Skip to main content

Pricing

Overview

Update subscription plan/product pricing using the Price Options Group and the Pricing Configuration objects. 

Price options group

Use this object to add/create and edit/update price options for your account.

Parameters

PriceOptionsGroup

Array of objects

Name

String

 

Price option group name.

 

Use this parameter when adding a new price options group.

 

To edit the name of a price option group use the Name parameter under the Translations object.

Description

String

 

Pricing option group description.

Translations

Array of objects

 

Details below.

Code

String

 

Unique code that the 2Checkout system generates or set for each pricing options group.

Type

String

 

The type of the pricing options group. Possible values:

· RADIO

· CHECKBOX

· INTERVAL

· COMBO

Options

Array of objects

 

Details below.

Required

boolean

 

True if you made the pricing option group mandatory.

 

Options

Object

Name

String

 

Pricing option child name.

Description

String

 

Pricing option child description.

Translations

Array of objects

 

Details below.

Code

String

 

The code you set or that the 2Checkout system generated for each pricing option child inside a pricing options group parent.

ScaleMin

Int

 

The minimum value of a scale interval set for each pricing option child inside a pricing options group parent of the type INTERVAL.

ScaleMax

Int

 

The maximum value of a scale interval set for each pricing option child inside a pricing options group parent of the type INTERVAL.

SubscriptionImpact

Object

 

Details below.

PriceImpact

Object

 

Details below.

Default

Boolean

 

TRUE for preselected options.

Missing for options that are not preselected.

 

SubscriptionImpact

Object

Months

String

 

The value in months the 2Checkout system adds or subtracts from the initial billing cycle of a subscription.

Impact

String

 

Possible values:

  • ADD
  • SUBTRACT
  • LIFETIME

 

PriceImpact

Object

ImpactOn

String

 

Possible values:

  • BASE corresponding to impact on base price
  • GLOBAL for impact on calculated sum.

Impact

String

 

Impact on price per unit:

  • ADD
  • SUBTRACT

Percent

String

 

The value of the percentage out of the price per product unit, when you use PERCENT for Method.

Method

String

 

Possible values:

· PERCENT

· FIXED

Amounts

Array of objects.

 

Details below.

 

Amount

Object

Currency

String

 

Currency ISO code - ISO 4217.

Amount

String

 

The amount defined for each specific currency active for your account, when you use FIXED for Method.

 

Translations

Object

Name

String

 

Localized product pricing options group name under PriceOptionGroup.

Localized pricing option child name under Options.

Description

String

 

Localized product pricing options group description under PriceOptionGroup.

Localized pricing option child description under Options.

Language

String

 

ISO language code. (ISO 639-1 two-letter code).

Price option group

Use this object to search for, retrieve information on price option groups (including those assigned to specific products) for your account.

Parameters

PriceOptionGroup

Array of objects

 

Name

String

 

Price option group name.

 

Use this parameter when adding a new price options group.

 

To edit the name of a price option group use the Name parameter under the Translations object.

Description

String

 

Pricing option group description.

Translations

Array of objects

 

Details below.

Code

String

 

Unique code that the 2Checkout system generates or set for each pricing options group.

Type

String

 

The type of pricing options group. Possible values:

  • RADIO
  • CHECKBOX
  • INTERVAL
  • COMBO

Options

Array of PriceOption objects

 

Details below.

 

PriceOption

Object

Code

String

 

The code you set or that the 2Checkout system generated for each pricing option child inside a pricing options group parent.

ScaleMin

Int

 

The minimum value of a scale interval set for each pricing option child inside a pricing options group parent of the type INTERVAL.

ScaleMax

Int

 

The maximum value of a scale interval set for each pricing option child inside a pricing options group parent of the type INTERVAL.

SubscriptionImpact

SubscriptionLifetimeImpact object

 

Details below.

PriceImpact

Object

 

Details below.

Default

Boolean

 

TRUE for preselected options.

Missing for options that are not preselected.

Name

String

 

Pricing option child name.

Description

String

 

Pricing option child description.

Translations

Array of objects

 

Details below.

 

SubscriptionLifetimeImpact

Object

Months

String

 

The value in months the 2Checkout system adds or subtracts from the initial billing cycle of a subscription.

Impact

String

 

Possible values:

  • ADD
  • SUBTRACT
  • LIFETIME

 

PriceImpact

Object

ImpactOn

String

 

Possible values:

  • BASE corresponding to impact on base price
  • GLOBAL for impact on calculated sum.

Impact

String

 

Impact on price per unit:

  • ADD
  • SUBTRACT

Percent

String

 

The value of the percentage out of the price per product unit, when you use PERCENT for Method.

Method

String

 

Possible values:

· PERCENT

· FIXED

Amounts

Array of objects.

 

Details below.

 

Amount

Object

Currency

String

 

Currency ISO code - ISO 4217.

Amount

String

 

The amount defined for each specific currency active for your account, when you use FIXED for Method.

 

Translations

Object

Name

String

 

Localized product pricing options group name under PriceOptionGroup.

Localized pricing option child name under Options.

Description

String

 

Localized product pricing options group description under PriceOptionGroup.

Localized pricing option child description under Options.

Language

String

 

ISO language code. (ISO 639-1 two-letter code).

Pricing configuration

Use this object to add/create and update/edit pricing configurations for your account. You can assign one or multiple price option groups to pricing configurations.

You identify a pricing configuration using its unique identifier: Code

Parameters

PricingConfiguration

Object

Name

String

 

Pricing configuration name.

Code

String

 

System-generated identifier. Read-only.

Default

Boolean

 

True for the default pricing configuration

BillingCountries

Array of strings

 

ISO codes of the countries assigned to the pricing configuration.

Empty unless specific countries are assigned to a pricing configuration.

PricingSchema

String

 

DYNAMIC – With a base price

FLAT – Without a base price

PriceType

String

 

Possible values:

• NET

• GROSS

DefaultCurrency

String

 

The ISO code of the default currency for the pricing configuration

Prices

Object

 

Details below.

PriceOptions

Array of objects

 

Details below.

 

Prices

Object

Regular

Array of objects

 

Details below.

Renewal

Array of objects

 

Details below.

 

Regular

Object

Amount

Int

 

The price of the product. Use -1 to delete it.

Currency

String

 

ISO code of the currency for the product price.

MinQuantity

Int

 

The minimum quantity of volume discounts. Default is 1.

MaxQuantity

Int

 

The maximum quantity of volume discounts. Default is 99999.

OptionCodes

Array of objects

 

Details below.

 

Renewal

Object

Amount

Int

 

The price of the product. Use -1 to delete it.

Currency

String

 

ISO code of the currency for the product price.

MinQuantity

Int

 

The minimum quantity of volume discounts. Default is 1.

MaxQuantity

Int

 

The maximum quantity of volume discounts. Default is 99999.

OptionCodes

Array of objects

 

Details below.

 

PriceOptions

Object

Code

String

 

System generated pricing options group code (you can also configure it) that the 2Checkout system uses to calculate product prices for pricing configurations without a base price.

Options

StringArray

 

The pricing options group option code you configured that the 2Checkout system uses to calculate product prices for pricing configurations without a base price.

 

Retrieve product group

Overview

Use the getProductGroup method to extract information about a specific product group you created for your account.

Parameters

Parameters Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect. The sessionID expires in 10 minutes.

groupCode Required (string)
  Unique, system-generated identifier assigned to product groups. 

Response

Parameters Type/Description

ProductGroup

Array of objects

Request

<?php

require ('PATH_TO_AUTH');

$groupCode = 'YOUR_GROUP_CODE';

try {
    $MyProductGroup = $client->getProductGroup($sessionID, $groupCode);
}

catch (SoapFault $e) {
    echo "My Product Group: " . $e->getMessage();
    exit;
}

var_dump("My Product Group", $MyProductGroup);


?>

Assign a PricingOption Group

Overview

Use the assignPricingConfigurationOptionGroup method to assign a PricingOption Group to a PricingConfiguration.

Parameters

Parameters Type/Description

Parameters

Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

PricingConfigurationCode

Required (string)

 

Unique, system-generated pricing configuration identifier.  

PriceOptionsGroupAssigned

Required (Object)

 

Details below.

 

Parameters Type/Description

PriceOptionsGroupAssigned

Object

Code

Required (string)

 

PricingOption Group identifier.

Required

Required (Object)

 

True or false depending on whether the pricing options group is required during the purchase process or not.

Response

bool(true)

Request

<?php

require ('PATH_TO_AUTH');

$PricingConfigurationCode = 'YOUR_CODE';
$PriceOptionsGroupAssigned = new stdClass();
$PriceOptionsGroupAssigned->Code = 'USERSUSERS';
$PriceOptionsGroupAssigned->Required = TRUE;

$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'assignPricingConfigurationOptionGroup',
'params' => array($sessionID, $PricingConfigurationCode, $PriceOptionsGroupAssigned)
);
var_dump (callRPC((Object)$jsonRpcRequest, $host));

?>

Retrieve SKU code by details

Overview

Use the getSKUCodeByDetails method to retrieve an SKU based on its included details.

Parameters

Parameters Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect. The sessionID expires in 10 minutes.

 skuDetailsObject

Object

 

Details below

 

PricingConfigurationCode

Required (string)

 

 

Unique identifier of the pricing configuration.

 

Currency

Optional (string)

 

 

ISO currency code.

 

PurchaseType

Optional (string)

 

 

Purchase type identifier. Possible values:

  • NEW_PRODUCT
  • RENEWAL
  • UPGRADE

 

PriceOptions

Optional (stringArray)

 

 

Array of price options names.

 

Quantity

Optional (int)

 

 

Numeric identifier of product quantity.

Response

{SKUCode} // eg: SKU-EUR-1-10-N-A

Request

<?php
require ('PATH_TO_AUTH');

$skuDetailsObject = new \stdClass();
$skuDetailsObject->PricingConfigurationCode = 'YOUR_CODE';
$skuDetailsObject->Currency = 'USD';
$skuDetailsObject->PurchaseType = 'NEW_PRODUCT';
$skuDetailsObject->PriceOptions = ['A'];
$skuDetailsObject->Quantity = 1;

$jsonRpcRequest = new stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method = 'getSKUCodeByDetails';
$jsonRpcRequest->params = array($sessionID, $skuDetailsObject);
$jsonRpcRequest->id = $i++;

$getSkuCodeByDetails = callRPC($jsonRpcRequest, $host);
var_dump($getSkuCodeByDetails);

Coupons

Overview

Use this section to handle coupons that are part of your promotions.

You can add, update or remove coupons that are configured on your promotional campaigns.

 

Update pricing configuration

Overview

Use the updatePricingConfiguration method to update/edit an existing pricing configuration.

Parameters

Parameters Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

PricingConfiguration

Required (object)

 

Use this object to update/edit an existing pricing configuration for your account.

ProductCode

Required (string)

 

The unique product code that you control not the system-generated product identifier.

You cannot modify:

  • The pricing configuration CODE.
  • The PricingSchema from DYNAMIC to FLAT or vice versa.
  • The intervals of an existing pricing configuration (MinQuantity and MaxQuantity). 

Response

bool(true)

Request

<?php

require ('PATH_TO_AUTH');

$ProductCode = 'YOUR_PRODUCT_CODE';

$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'getPricingConfigurations',
'params' => array($sessionID, $ProductCode)
);

$existingPricingConfig = callRPC((Object)$jsonRpcRequest, $host);
var_dump ($existingPricingConfig );
die;
$existingPricingConfig[1]->Prices->Regular[0]->Currency = 'USD';
$existingPricingConfig[1]->Prices->Regular[0]->Amount = 99;
$newPriceConfig = $existingPricingConfig[1];

$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'updatePricingConfiguration',
'params' => array($sessionID, $newPriceConfig, $ProductCode) //Use product ID and not product code for API versions smaller than 2.5
);

var_dump (callRPC((Object)$jsonRpcRequest, $host));

?>

API Responses

Overview

This section contains the objects returned as API responses, based on your requests to retrieve information on orders, products, subscriptions, promotions, and others.

 

 

2Checkout supported languages

Overview

2Checkout has localized the ordering interface, the ConvertPlus and InLine carts, the shopper emails, and the myAccount interface in 33 languages.  

Localizations

English label Native label 2Checkout code ConvertPlus supported
Arabic العربية  ar YES
Brazilian Portuguese Português do Brasil  pt-br YES
Bulgarian български език  bg YES
Chinese Mandarin Traditional 繁体中文 zy YES
Chinese Simplified(Cantonese) 中文 zh YES
Croatian Hrvatski jezik hr YES
Czech Česky cs YES
Danish Dansk da YES
Dutch Dutch nl YES
English English en YES
Finnish Suomi fi YES
French Français fr YES
German Deutsch de YES
Greek Ελληνικά el YES
Hebrew עִבְרִית he YES
Hindi  हिन्दी hi YES
Hungarian Magyar hu YES
Italian Italiano it YES
Japanese 日本語 ja YES
Korean 한국어 ko YES
Norwegian Norsk no YES
Persian فارسی fa YES
Polish Polski pl YES
Portuguese Português pt YES
Romanian Română ro YES
Russian Русский ru YES
Serbian Србија sr YES
Slovak Slovenčina sk YES
Slovenian Slovène sl YES
Spanish Español es YES
Swedish Svenska sv YES
Thai ไทย th YES
Turkish Türkçe tr YES

Set partner

Overview

Set the partner for the current shopping cart session. It's mandatory to set the partner for the current cart session to use all Channel Manager methods with the exception of logingetPartnerByCode, getPartnerSingleSignOn and searchPartners.

Parameters

Parameter Type/Description
sessionID Required (string)
  Session identifier, output of the Login method. An exception will be thrown if the values are incorrect.
partnerCode Required (string)
  Unique identifier that you need to specify when creating a partner in the Control Panel. You can find it under the General Information area when editing partner details.

Response

Parameter Type/Description
Result Boolean
  True or false

Request

<?php

require ('PATH_TO_AUTH'); // Authentication example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/JSON-RPC/02Authentication 

$partnerCode = 'YOUR_PARTNER_CODE';

$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'setPartner',
'params' => array($sessionID, $partnerCode)
);

var_dump (callRPC((Object)$jsonRpcRequest, $host));

Errors

Error Description

INVALID_PARTNER

Partner code is mandatory.

INVALID_PARTNER

Provided partner code is not associated with an active partner account in the Avangate system.

 

Retrieve an order field

Overview

Use the getAdditionalOrderField method to extract information about a specific additional field you set up for your account.

Parameters

Parameters Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. Avangate throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

fieldCode

Required (string)

 

Field identifier. Alpha-numeric chars, underscores and dashes.

Request

<?php
 
require ('PATH_TO_AUTH');

$fieldCode = 'YOUR_FIELD_CODE';
 
$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'getAdditionalOrderField',
'params' => array($sessionID, $fieldCode)
);
var_dump (callRPC((Object)$jsonRpcRequest, $host));
 ?>

Response

Parameters Type/Description

AdditionalField

Array of objects

Need help?

Do you have a question? If you didn’t find the answer you are looking for in our documentation, you can contact our Support teams for more information. If you have a technical issue or question, please contact us. We are happy to help.

Not yet a Verifone customer?

We’ll help you choose the right payment solution for your business, wherever you want to sell, in-person or online. Our team of experts will happily discuss your needs.

Verifone logo