Add order/product additional fields
Overview
Use the addAdditionalField method to create new additional fields 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. |
Object |
|
|
Additional field object. |
Request
<?php
require ('PATH_TO_AUTH');
$AdditionalField = new stdClass();
$AdditionalField->Label = 'Do you agree with the new newsletter policy 2015?';
$AdditionalField->Type = 'LISTBOX';
$AdditionalField->Code = 'NewsletterPolicy1234576';
$AdditionalField->ApplyTo = 'ORDER';
$AdditionalField->Values = array();
$AdditionalField->Values[0] = 'YES';
$AdditionalField->Values[1] = 'NO';
$AdditionalField->ValidationRule = null;
$AdditionalField->Translations = array();
$AdditionalField->Translations[0] = new stdClass();
$AdditionalField->Translations[0]->Label = "Êtes-vous d'accord avec la politique de la newsletter?";
$AdditionalField->Translations[0]->Values = array();
$AdditionalField->Translations[0]->Values[0] = 'Oui';
$AdditionalField->Translations[0]->Values[1] = 'Non';
$AdditionalField->Translations[0]->Language = 'fr';
$AdditionalField->Translations[1] = new stdClass();
$AdditionalField->Translations[1]->Label = 'Haben Sie mit dem Newsletter Politik zu?';
$AdditionalField->Translations[1]->Values = array();
$AdditionalField->Translations[1]->Values[0] = 'Ja';
$AdditionalField->Translations[1]->Values[1] = 'Nein';
$AdditionalField->Translations[1]->Language = 'de';
$jsonRpcRequest = array(
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'addAdditionalField',
'params' => array(
$sessionID,
$AdditionalField
)
);
var_dump(callRPC((Object) $jsonRpcRequest, $host));
?>
Response
bool(true)
Next renewal price
Overview
Use the methods below to set or retrieve information related to the next renewal price to be charged on a customer's subscription.
Assign values for the additional order fields
Overview
Use this method to assign values to the additional fields for orders.
Use case
- Add an HTML link or button on your page like the one below.
- Create a JavaScript click handler to execute the Inline Client desired methods.
- Set your currency using the TwoCoInlineCart.cart.setCurrency('USD') method.
- Use the TwoCoInlineCart.cart.setAdditionalFields(additionalFields) method to set the order additional fields values.
- The additionalFields argument should contain a list of objects with the code of the field and its value.
- Use the TwoCoInlineCart.products.add({code, quantity}) method to prepare your products.
- Use the TwoCoInlineCart.cart.checkout() method to show the cart on your page.
Sample request
HTML
<a href="#" class="btn btn-success" id="buy-button">Buy now!</a>
JavaScript
window.document.getElementById('buy-button').addEventListener('click', function() {
TwoCoInlineCart.cart.setCurrency('USD');
TwoCoInlineCart.cart.setAdditionalFields([
// textbox type example
{
code : 'TextInIPNCustom123',
value : 'Some text value'
},
// listbox type example
{
code : 'SourceOrder',
value : 'The WWW'
},
// hidden type example
{
code : 'cart2cotestorderhidden',
value : 'Some text for the hidden field'
},
// checkbox type example
{
code : 'cart2cotestordercheckbox',
value : true
}
]);
TwoCoInlineCart.products.add({
code: '2CO3MONTHS',
quantity: 1
});
TwoCoInlineCart.cart.checkout();
});
Demo
After defining the additional fields for your orders using the above method, your cart should look like this:
Set next renewal price
Overview
Charge customers custom prices for the renewal of subscriptions, moving away from the recurring pricing configuration at product level. Use the setCustomRenewalPrice method to set custom renewal prices for subscriptions and control the number of recurring billing cycles the price impact subscribers.
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. |
SubscriptionReference |
Required (string) |
Unique, system-generated subscription identifier. |
|
Price |
Required (double) |
|
The custom renewal price you want to charge. |
Currency |
Required (string) |
|
Currency in which prices are expressed. The currency ISO code used for the payment is ISO 4217. The default currency is the same as in the previous payment made by the customer. |
Cycles |
Required (int) |
|
Number of recurring billing cycles for which 2Checkout charges customers the custom price rather, ignoring product–level recurring pricing configurations. (The renewal cycles number must be a positive integer. Default value 1). |
ReasonText |
Optional (string) |
|
Save details at the subscription-level about the custom costs. |
Request
<?php
require ('PATH_TO_AUTH');
$subscriptionReference = 'YOUR_REFERENCE';
$Price = 25;
$Currency = 'gbp';
$Cycles = 7;
$ReasonText = null;
$jsonRpcRequest = array (
'method' => 'setCustomRenewalPrice',
'params' => array($sessionID, $subscriptionReference, $Price, $Currency, $Cycles, $ReasonText),
'id' => $i++,
'jsonrpc' => '2.0');
var_dump (callRPC((Object)$jsonRpcRequest, $host, true));
Response
Parameters | Type/Description |
---|---|
Boolean |
true or false depending on whether or not the operation succeeded. |
Retrieve cross-sell campaign by code
Overview
Use the getCrossSellCampaign method to extract information about the cross-sell campaign identified by the provided campaign code.
Request parameters
Parameters | Type | Required/Optional | Description |
---|---|---|---|
sessionID |
String | Required |
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. |
CampaignCode |
String | Required | The campaign code. |
Request sample
<?php
declare(strict_types=1);
// Start clear CLI
echo chr(27).chr(91).'H'.chr(27).chr(91).'J';
// End clear CLI
$executionStartTime = microtime(true);
$apiVersion = '6.0';
$apiHost = "http://api.avangate.local";
$host = $apiHost."/soap/" . $apiVersion . "/";
$client = new SoapClient(
$host."?wsdl",
[
'location' => $host,
'trace' => 1,
'cache_wsdl' => WSDL_CACHE_NONE
]
);
$client->__setCookie('XDEBUG_SESSION', 'PHPSTORM');
// Please be aware to consider valid data
$merchantCode = 'your_merchant_code';
$key = 'your_merchant_key';
// Generate hash for login
$date = gmdate('Y-m-d H:i:s');
$string = strlen($merchantCode) . $merchantCode . strlen($date) . $date;
$hash = hash_hmac('md5', $string, $key);
try {
$sessionID = $client->login($merchantCode, $date, $hash);
} catch (SoapFault $e) {
echo $e->getMessage();
}
var_dump("Generated sessionID: ". $sessionID);
echo "\n\r";
$crossSellCampaignCode = '2Xrl83J0k+qOr3W1ceTwZnHHr30=';
try {
$result = $client->getCrossSellCampaign($sessionID, $crossSellCampaignCode);
echo "\n\rGET CROSS SELL CAMPAIGNS: \n\r";
print_r(json_encode($result, JSON_PRETTY_PRINT));
} catch (SoapFault $e) {
echo $e->getMessage();
}
$executionEndTime = microtime(true);
// The duration will be displayed in seconds and milliseconds.
$seconds = round($executionEndTime - $executionStartTime, 2);
// Print it out
echo "\n\rThis script took $seconds to execute.\n\r";
Response
Parameters | Type/Description |
---|---|
CrossSellCampaign |
Object |
Place an order with installments
Overview
Use the placeOrder method to create an order and collect the payment.
Supported payment methods
Credit/Debit cards: Visa and MasterCard local Brazilian cards.
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. |
Required (Object) |
|
|
Object designed to collect all data necessary for an order, including billing, product/subscription plan, and payment details. |
Requirements
- Payment methods: Visa, MasterCard or AMEX
- Country: Brazil
- Currency BRL
- Specified number of installments under the PaymentMethod object. (Minimum installment threshold is 5 BRL.)
- Phone number
- Fiscal code (CPF/CNPJ)
-
Mandatory billing information must include:
- Transaction: non-recurring
- Installments are available only for:
- Brazilian customers
- Local Visa, MasterCard and AMEX cards
- Non-recurring transactions
<?php
function callRPC($Request, $hostUrl, $Debug = true) {
$curl = curl_init($hostUrl);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($curl, CURLOPT_SSLVERSION, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Accept: application/json'));
$RequestString = json_encode($Request);
curl_setopt($curl, CURLOPT_POSTFIELDS, $RequestString);
if ($Debug) {
$RequestString;
}
$ResponseString = curl_exec($curl);
if ($Debug) {
$ResponseString;
}
if (!empty($ResponseString)) {
$Response = json_decode($ResponseString);
if (isset($Response->result)) {
return $Response->result;
}
if (!is_null($Response->error)) {
var_dump($Request->method, $Response->error);
}
} else {
return null;
}
}
$host = 'https://api.avangate.com/rpc/3.1/';
$merchantCode = "MERCHANT_CODE";// your account's merchant code available in the 'System settings' area of the cPanel: https://secure.avangate.com/cpanel/account_settings.php
$key = "SECRET_KEY";// your account's secret key available in the 'System settings' area of the cPanel: https://secure.avangate.com/cpanel/account_settings.php
$string = strlen($merchantCode) . $merchantCode . strlen(date('Y-m-d H:i:s')) . date('Y-m-d H:i:s');
$hash = hash_hmac('md5', $string, $key);
$i = 1; // counter for api calls
// call login
$jsonRpcRequest = new stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method = 'login';
$jsonRpcRequest->params = array($merchantCode, date('Y-m-d H:i:s'), $hash);
$jsonRpcRequest->id = $i++;
$sessionID = callRPC($jsonRpcRequest, $host);
$Order = new stdClass();
$Order->RefNo = NULL;
$Order->Currency = 'brl';
$Order->Country = 'BR';
$Order->Language = 'en';
$Order->CustomerIP = '91.220.121.21';
$Order->ExternalReference = NULL;
$Order->Source = NULL;
$Order->Affiliate = new stdClass();
$Order->Affiliate->AffiliateCode = 'Partner123'
$Order->Affiliate->AffiliateSource = 'MobilePlatform'
$Order->CustomerReference = NULL;
$Order->Items = array();
$Order->Items[0] = new stdClass();
$Order->Items[0]->Code = 'my_subscription_1';
$Order->Items[0]->Quantity = 1;
$Order->Items[0]->PriceOptions = NULL;
$Order->Items[0]->SKU = NULL;
$Order->Items[0]->Price = NULL;
$Order->Items[0]->CrossSell = NULL;
$Order->Items[0]->Trial = false;
$Order->Items[0]->AdditionalFields = NULL;
$Order->Items[0]->Promotion = NULL;
$Order->BillingDetails = new stdClass();
$Order->BillingDetails->FirstName = 'FirstName';
$Order->BillingDetails->LastName = 'LastName';
$Order->BillingDetails->CountryCode = 'BR';
$Order->BillingDetails->State = 'DF';
$Order->BillingDetails->City = 'LA';
$Order->BillingDetails->Address1 = 'Address example';
$Order->BillingDetails->Address2 = NULL;
$Order->BillingDetails->Zip = '70403-900';
$Order->BillingDetails->Email = 'customer@email.com';
$Order->BillingDetails->Phone = "556133127400";
$Order->BillingDetails->FiscalCode = "056.027.963-98";
$Order->BillingDetails->Company = NULL;
$Order->DeliveryDetails = NULL;
$Order->PaymentDetails = new stdClass ();
$Order->PaymentDetails->Type = 'CC';
$Order->PaymentDetails->Currency = 'brl';
$Order->PaymentDetails->PaymentMethod = new stdClass ();
$Order->PaymentDetails->CustomerIP = '10.10.10.10';
$Order->PaymentDetails->PaymentMethod->RecurringEnabled = true;
$Order->PaymentDetails->PaymentMethod->CardNumber = "4111111111111111";
$Order->PaymentDetails->PaymentMethod->CardType = 'visa';
$Order->PaymentDetails->PaymentMethod->ExpirationYear = '2019';
$Order->PaymentDetails->PaymentMethod->ExpirationMonth = '12';
$Order->PaymentDetails->PaymentMethod->HolderName = 'John';
$Order->PaymentDetails->PaymentMethod->CCID = '123';
$Order->Promotions = NULL;
$Order->AdditionalFields = NULL;
$Order->LocalTime = NULL;
$Order->GiftDetails = NULL;
$jsonRpcRequest = array (
'method' => 'getInstallments',
'params' => array($sessionID, $Order),
'id' => $i++,
'jsonrpc' => '2.0'
);
echo '<BR>';
echo 'The content of the current session:';
echo '<BR>';
$installments = callRPC((Object)$jsonRpcRequest, $host, true);
var_dump ($installments);
$Order = new stdClass();
$Order->RefNo = NULL;
$Order->Currency = 'brl';
$Order->Country = 'BR';
$Order->Language = 'en';
$Order->CustomerIP = '91.220.121.21';
$Order->ExternalReference = NULL;
$Order->Source = NULL;
$Order->Affiliate = new stdClass();
$Order->Affiliate->AffiliateCode = 'Partner123'
$Order->Affiliate->AffiliateSource = 'MobilePlatform'
$Order->CustomerReference = NULL;
$Order->Items = array();
$Order->Items[0] = new stdClass();
$Order->Items[0]->Code = 'my_subscription_1';
$Order->Items[0]->Quantity = 1;
$Order->Items[0]->PriceOptions = NULL;
$Order->Items[0]->SKU = NULL;
$Order->Items[0]->Price = NULL;
$Order->Items[0]->CrossSell = NULL;
$Order->Items[0]->Trial = false;
$Order->Items[0]->AdditionalFields = NULL;
$Order->Items[0]->Promotion = NULL;
$Order->BillingDetails = new stdClass();
$Order->BillingDetails->FirstName = 'FirstName';
$Order->BillingDetails->LastName = 'LastName';
$Order->BillingDetails->CountryCode = 'BR';
$Order->BillingDetails->State = 'DF';
$Order->BillingDetails->City = 'LA';
$Order->BillingDetails->Address1 = 'Address example';
$Order->BillingDetails->Address2 = NULL;
$Order->BillingDetails->Zip = '70403-900';
$Order->BillingDetails->Email = 'customer@email.com';
$Order->BillingDetails->Phone = "556133127400";
$Order->BillingDetails->FiscalCode = "056.027.963-98";
$Order->BillingDetails->Company = NULL;
$Order->DeliveryDetails = NULL;
$Order->PaymentDetails = new stdClass ();
$Order->PaymentDetails->Type = 'CC';
$Order->PaymentDetails->Currency = 'brl';
$Order->PaymentDetails->PaymentMethod = new stdClass ();
$Order->PaymentDetails->CustomerIP = '10.10.10.10';
$Order->PaymentDetails->PaymentMethod->RecurringEnabled = true;
$Order->PaymentDetails->PaymentMethod->CardNumber = "4111111111111111";
$Order->PaymentDetails->PaymentMethod->InstallmentsNumber = 2;
$Order->PaymentDetails->PaymentMethod->CardType = 'visa';
$Order->PaymentDetails->PaymentMethod->ExpirationYear = '2019';
$Order->PaymentDetails->PaymentMethod->ExpirationMonth = '12';
$Order->PaymentDetails->PaymentMethod->HolderName = 'John';
$Order->PaymentDetails->PaymentMethod->CCID = '123';
$Order->Promotions = NULL;
$Order->AdditionalFields = NULL;
$Order->LocalTime = NULL;
$Order->GiftDetails = NULL;
$jsonRpcRequest = array (
'method' => 'placeOrder',
'params' => array($sessionID, $Order),
'id' => $i++,
'jsonrpc' => '2.0'
);
echo '<BR>';
echo 'The content of the current session:';
echo '<BR>';
var_dump (callRPC((Object)$jsonRpcRequest, $host, true));
Promotions
Overview
Use the Promotion object to create / update and update information on discounts/promotions you set up for your account.
Parameters
Parameters | Type/Description | |||||||
---|---|---|---|---|---|---|---|---|
Promotion |
Object |
|||||||
|
Name |
String / Required |
||||||
|
|
Promotion name |
||||||
|
Description |
String / Optional |
||||||
|
|
Promotion description |
||||||
|
StartDate |
String / Optional | ||||||
|
|
Starting date. The date when you set the promotion to start. Is NULL for promotions that start immediately after they're created. Format: Y-m-d |
||||||
|
EndDate |
String / Optional | ||||||
|
|
Ending date. The date when you set the promotion to end. Is NULL for promotions that you want active indefinitely. Format: Y-m-d |
||||||
|
MaximumOrdersNumber |
Integer / Optional | ||||||
|
|
2Checkout stops offering the discount when the promotion reaches the maximum number of orders. Can be NULL if you want the promotion to apply to an unlimited number of orders. |
||||||
|
MaximumQuantity |
Integer / Optional | ||||||
|
|
Discount only applies to a specific number of product, smaller than the maximum quantity you defined. Can be NULL if you want the promotion to apply to an unlimited number units. Any extra quantity added to the cart will be sold at full price. |
||||||
|
InstantDiscount |
Boolean / Optional | ||||||
|
|
Selecting the instant discount option will auto-apply the discount for ALL the selected products for all shoppers, without the need to enter the discount coupon. |
||||||
Coupon |
Object / Required |
|||||||
|
Type |
String | ||||||
|
|
|
||||||
|
Code/Codes |
Array of strings | ||||||
|
|
Varies according to type. Send:
|
||||||
Enabled |
Bolean / Optional |
|||||||
|
Possible values:
|
|||||||
ChannelType |
String / Required |
|||||||
|
Possible values:
|
|||||||
Type |
String / Required |
|||||||
|
REGULAR |
|||||||
Discount |
Object / Required |
|||||||
|
Type |
String |
||||||
|
|
Discount type:
|
||||||
|
Value / Values |
Array of objects |
||||||
|
|
|
||||||
|
|
Value |
Object |
|||||
|
|
Currency |
String |
|||||
|
|
|
|
ISO currency code |
||||
|
|
Amount |
Integer |
|||||
|
|
|
|
Discount amount in corresponding currency. |
||||
|
DefaultCurrency |
String | ||||||
|
|
ISO code |
||||||
Products |
Object/ Optional | |||||||
|
Code |
Integer/ Optional | ||||||
|
|
Unique product code that you control. |
||||||
|
PricingConfigurationCode |
String / Optional | ||||||
|
|
Unique system generated pricing configuration code. |
||||||
|
PricingOptionCodes |
Array of strings / Optional |
||||||
|
|
Array of pricing option codes controlled by you. |
||||||
PriceThreshold |
Object / Optional |
|||||||
|
Limits discount use only when total order value (taxes included) exceeds the threshold you configure. |
|||||||
|
Amount |
Decimal / Optional |
||||||
|
|
The minimum threshold you defined for the default currency. |
||||||
|
Currency |
String / Optional |
||||||
|
|
Currency code available for the default currency of custom threshold settings. |
||||||
Translations |
Array of objects / Optional |
|||||||
|
PromotionTranslation |
Object / Optional |
||||||
|
|
Name |
String / Optional |
|||||
|
|
|
Localized name corresponding to translated language. Name: Le product Language: FR |
|||||
|
|
Language |
String / Optional |
|||||
|
|
|
Language for localization. | |||||
Sources |
StringArray / Optional |
|||||||
|
Array of strings defining the sale source through the SRC parameter. |
|||||||
PublishToAffiliatesNetwork |
Integer / Optional |
|||||||
|
1 - make promotion available in the Affiliates Network 0 - keep promotion unavailable for the Affiliates Network |
|||||||
ApplyRecurring |
String / Required |
|||||||
|
Choose whether to apply the discount to renewal orders. Possible values:
|
|||||||
RecurringChargesNumber |
Integer / Optional |
|||||||
|
If ApplyRecurring is set to CUSTOM, you can offer discounts for a number of recurring billing charges beyond the initial purchase. |
How to set a regular promotion in your Merchant Control Panel
Watch this tutorial to see how to set a regular promotion right from your Merchant Control Panel.
Product
Overview
This object is returned directly or within a successful response from the following API requests:
Retrieve products by ID Retrieve products by code Search products
Product object
Parameters | Type/Description | |
---|---|---|
AvangateId |
String |
|
|
Unique, system-generated 2Checkout product ID. Read-only. |
|
ProductCode |
String |
|
|
The product code that you can define for each of your offerings. Needs to be unique. |
|
ExternalReference | String | |
External reference that you control when defining the product. | ||
ProductType |
String |
|
|
REGULAR or BUNDLE |
|
ProductName |
String |
|
|
The name of the product |
|
ProductVersion |
String |
|
|
The product version number |
|
PurchaseMultipleUnits | Boolean | |
Possible values:
The default value is TRUE. |
||
Tangible | Boolean | |
Possible values:
|
||
Boolean | ||
TangibleDetails | Object | |
Only for physical products. Contains information related to product's physical setup. | ||
UnitDetails | Array of objects | |
Details on tangible setup. | ||
Type | String | |
Product physical configuration type. Example: "WEIGHT". | ||
Amount | String | |
Product's tangible weight. Example: "5". | ||
Fee | Array of objects | |
Details on handling fees associated with a tangible product. | ||
Currency | String | |
Currency of the handling fee. Example: "USD" | ||
Amount | String | |
Handling fee amount defined on the tangible product. Example: "5". | ||
ProductGroup | Object | |
Product group information. | ||
Name | String | |
Product group name | ||
Code | String | |
Product group code generated when you create the group | ||
TemplateName | String | |
Default cart template used when generating buy links for products from this group. | ||
Description | String | |
Product group description. | ||
ShippingClass |
Object |
|
|
Existing shipping class object with the structure detailed below. |
|
|
Name |
String |
|
|
The name of the shipping class |
|
Amount |
Decimal |
|
|
The shipping costs |
|
Currency |
String |
|
|
The currency ISO code used for shipping costs - ISO 4217. |
|
ApplyTo |
String |
|
|
Possible values: • PRODUCT • ORDER |
|
Type |
Possible values: • FIXED • PERCENT |
GiftOption |
Boolean |
|
|
True or false depending on whether the product can be gifted or not. |
|
ShortDescription |
String |
|
|
Product's short description. |
|
LongDescription |
String |
|
|
Product's long description. |
|
SystemRequirements |
String |
|
|
System requirements |
|
ProductCategory |
String |
|
|
Product category |
|
Platforms |
Array of Platform objects |
|
|
Array of objects detailing the platforms supported by the application. Details below. |
|
|
PlatformName |
String |
|
|
The label of the platform per the product configuration. |
|
Category |
String |
|
|
Platform category per product configuration. |
ProductImages |
Array of Image objects |
|
|
Image object. Details below. Read-only. |
|
|
Default |
Boolean |
|
|
True or False depending on whether you set the image stored at the address in the URL parameter as default or not. |
|
URL |
String |
|
|
The location of the image on the 2Checkout system. |
TrialUrl |
String (anyURI) |
|
|
The URL from where shoppers can download trial software. |
|
TrialDescription |
String |
|
|
Descriptive text entered for trials. |
|
Enabled |
Boolean |
|
|
True/false depending on whether the products are active or disabled. When empty, 2Checkout marks the product as disabled. |
|
AdditionalFields |
Array of AdditionalFieldAssigned objects |
|
|
Array of existing additional fields assigned to products. Details below. |
|
|
Label |
String |
|
|
The name of the additional field assigned to a product. |
|
Code |
String |
|
|
The code of the additional field assigned to a product. |
|
Enabled |
Boolean |
|
|
True or false depending on whether the assigned product field is enabled or not. |
|
Required |
Boolean |
|
|
True or false depending on whether the assigned product field is required or not. |
|
URLParameter |
String |
|
|
The value of the system generated URL parameter for the product field that can be used in Buy Links. |
Translations |
Array of ProductTranslation objects |
|
|
Details below. |
|
|
LongDescription |
String |
|
|
The translated long description in the language corresponding to the Translation object. |
|
TrialUrl |
String |
|
|
The trial URL for users speaking the language corresponding to the Translation object. |
|
TrialDescription |
String |
|
|
|
|
SystemRequirements |
String |
|
|
Localized system requirements. |
|
Name |
String |
|
|
Localized product name. |
|
Description |
String |
|
|
Localized product short description. |
|
Language |
String |
|
|
ISO 639-1 two-letter code. |
PricingConfigurations |
Array of PricingConfiguration objects |
|
|
Details below. 2Checkout creates pricing configurations during the process when you add a product. |
|
|
Name |
String |
|
|
Pricing configuration name |
|
Code |
String |
|
|
System-generated identifier. |
|
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. |
|
Regular |
Array of objects |
|
|
Details below. |
|
Amount |
Int |
|
|
The price of the product. |
|
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. |
|
Code |
String |
|
|
Price option identifier. |
|
Options |
Array of strings |
|
|
The pricing options group option code you configured that the 2Checkout system uses to calculate product prices for pricing configurations without a base price. |
|
Renewal |
Array of objects |
|
|
Details below. |
|
Amount |
Int |
|
|
The price of the product. |
|
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 PriceOptionCode objects |
|
|
Details below. |
|
Code |
String |
|
|
Price option identifier. |
|
Options |
Array of strings |
|
|
The pricing options group option code you configured that the 2Checkout system uses to calculate product prices for pricing configurations without a base price. |
|
PriceOptions |
Array of AssignedPriceOptionGroup objects |
|
|
Details below. |
|
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. |
|
Required |
Boolean |
|
|
True or False depending on whether you want to make it mandatory for shoppers to select the price option during the puyrchase process. |
BundleProducts |
Array of BundleProductCode objects |
|
|
Details below. |
|
|
ProductId |
String |
|
|
Unique, system-generated product ID. |
|
ProductCode |
String |
|
|
Editable product code that you control. |
Fulfillment |
String |
|
|
BY_AVANGATE NO_DELIVERY – The 2Checkout system finalizes orders immediately after it receives payment confirmation. BY_VENDOR – you are responsible for delivering/fulfilling orders |
|
Prices |
Array of Price objects |
|
|
Use this object only when Pricing Configurations are not available for your account. Details below. |
|
|
Amount |
Int |
|
|
The price of the product. |
|
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. |
|
Code |
String |
|
|
Price option identifier. |
|
Options |
Array of strings |
|
|
The pricing options group option code you configured that the 2Checkout system uses to calculate product prices for pricing configurations without a base price. |
GeneratesSubscription |
Boolean |
|
|
TRUE or FALSE depending on whether you set the product to generate subscriptions or not.
NULL for bundles for which you set the following subscription management option: “Use the subscription settings of each product in the bundle” |
|
SubscriptionInformation |
ProductSubscriptionInformation Object |
|
|
Details below. NULL for bundles which you set to use the renewal settings of child products and not of the parent bundle. |
|
|
DeprecatedProducts |
Array |
|
|
Deprecated products. |
|
BundleRenewalManagement |
String |
|
|
Possible values:
Can be NULL. |
|
BillingCycle |
String |
|
|
The number of subscription billing cycle units (months or days). Possible values:
Days
Months
|
|
BillingCycleUnits |
String |
|
|
The units of the billing cycle:
|
|
IsOneTimeFee |
Boolean |
|
|
True or False depending on whether the subscription is evergreen or not. |
|
ContractPeriod |
Object |
|
|
Details below. |
|
Period |
Int |
|
|
The contract period in months or days. -1 for unlimited contracts. |
|
PeriodUnits |
String |
|
|
The contract period units days | months |
|
IsUnlimited |
Boolean |
|
|
This flag is true if the contract is for an unlimited period |
|
Action |
String |
|
|
The action performed after the subscription expires. Possible values CANCEL | RESTART |
|
EmailsDuringContract Boolean |
|
|
|
True or False depending on whether you suppress renewal notification emails throughout the duration of the contract or not. |
|
UsageBilling |
Int |
|
|
The usage billing interval must be smaller than or equal to the grace period.
Interval of time within the grace period, when the 2Checkout system attempts to automatically charge customers for recurring costs and additional metered usage fees (in arrears). 2Checkout renews subscriptions only after subscribers make all outstanding payments per the renewal settings (from the expiration or the renewal date). If automatic renewal and usage charges fail, subscriptions can be manually renewed only by the end of the grace period, after which they expire.
Can be NULL. |
|
GracePeriod |
Object |
|
Type |
String |
|
|
CUSTOM – you configured grace period setting at product level. GLOBAL – global grace period settings apply. |
|
Period |
String |
|
|
Number of days set for the grace period. |
|
PeriodUnits |
String |
|
|
D - Days. |
|
IsUnlimited |
Boolean |
|
|
TRUE or FALSE depending on whether you set the grace period to unlimited or not. |
|
RenewalEmails |
Object |
|
|
Details below. Can be NULL. Available only in Product API 2.5 and later. |
|
Type |
String |
|
|
GLOBAL - Send emails according to the global renewal notification settings. CUSTOM – per product renewal notification settings |
|
Settings |
Object (can be NULL) |
|
|
Details below. |
|
ManualRenewal |
Object (can be NULL) |
|
|
Details below. |
|
Before30Days |
Boolean |
|
|
True or False. |
|
Before15Days |
Boolean |
|
|
True or False. |
|
Before7Days |
Boolean |
|
|
True or False. |
|
Before1Day |
Boolean |
|
|
True or False. |
|
OnExpirationDate |
Boolean |
|
|
True or False. |
|
After5Days |
Boolean |
|
|
True or False. |
|
After15Days |
Boolean |
|
|
True or False. |
|
AutomaticRenewal |
Object (can be NULL) |
|
|
Details below. |
|
Before30Days |
Boolean |
|
|
True or False. |
|
Before15Days |
Boolean |
|
|
True or False. |
|
Before7Days |
Boolean |
|
|
True or False. |
|
Before1Day |
Boolean |
|
|
True or False. |
|
OnExpirationDate |
Boolean |
|
|
True or False. |
|
After5Days |
Boolean |
|
|
True or False. |
|
After15Days |
Boolean |
|
|
True or False. |
FulfillmentInformation |
Object |
|
|
Details below. Can be NULL. Available only in Product API 2.5 and later. |
|
|
IsStartAfterFulfillment |
Boolean |
|
|
True or False. Depending on whether you want the subscription lifetime to start afther the completion of the fulfillment process or not. |
|
IsElectronicCode |
Boolean |
|
|
True or False. Depending on whether you configure the delivery of keys/codes for the product or not. |
|
IsDownloadLink |
Boolean |
|
|
True or False. Depending on whether you configure the delivery of a product file or not. |
|
IsBackupMedia |
Boolean |
|
|
True or False. Depending on whether you configure the delivery of backup media or not. |
|
IsDownloadInsuranceService |
Boolean |
|
|
True or False. Depending on whether you enable the Download Insurance Service or not, for a product for which you configure a product file. |
|
IsInstantDeliveryThankYouPage |
Boolean |
|
|
True or False. Depending on whether you enable instant delivery in the Thank You page or not. |
|
IsDisplayInPartnersCPanel |
Boolean |
|
|
True or False. Depending on whether you share access to the product file with your channel partners or not. |
ReturnMethod | Object | |
Information on the customer redirect method after a successful purchase. | ||
Type | String | |
Possible values:
|
||
URL | String | |
Website to which customers are redirected after a successful purchase. Example: "http://mySuccessURL.com" | ||
|
CodeList |
Object (can be NULL) |
|
|
Details below. |
|
Code |
String |
|
|
The unique code list identifier. |
|
Name |
String |
|
|
Name of the code list. |
|
Type |
String |
|
|
Code list type:
|
|
BackupMedia |
Object (can be NULL) |
|
|
Details below. |
|
Code |
String |
|
|
The unique backup media identifier. |
|
Name |
String |
|
|
Name of the backup CD/DVD. |
|
Type |
String |
|
|
Media type: CD |
|
ProductFile |
Object (can be NULL) |
|
|
Details below. |
|
Code |
String |
|
|
Unique product file identifier. |
|
Name |
String |
|
|
Display name. |
|
File |
String |
|
|
Name of the product file. |
|
Version |
String |
|
|
File version. |
|
Size |
String |
|
|
File size. |
|
Type |
String |
|
|
File type. |
|
LastUpdate |
String |
|
|
YYYY-MM-DD HH-MM-SS. Date time stamp when you last updated the file. |
|
AdditionalInformationByEmail |
String (can be NULL) |
|
|
The text you set up in the Additional fulfillment information - by email area. |
|
AdditionalInformationEmailTranslations |
Object (can be NULL) |
|
|
Array of localized Additional fulfillment information - by email texts. |
|
AdditionalThankYouPage |
String (can be NULL) |
|
|
The text you set up in the Additional fulfillment information - "Thank you" page area. |
|
AdditionalThankYouPageTranslations |
Array (can be NULL) |
|
|
Array of localized Additional fulfillment information - "Thank you" page texts. |