Update price options
Overview
Use the updatePriceOptionGroup method to update/edit an existing price options group you configured for your account.
- Price options intervals cannot overlap.
Parameters
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) |
|
|
Use this object to update/edit a new price option group for your account. |
You cannot update the
- Code of the price options group.
Response
bool(true)
Request
<?php
$host = "https://api.avangate.com";
$client = new SoapClient($host . "/soap/4.0/?wsdl", array(
'location' => $host . "/soap/4.0/",
"stream_context" => stream_context_create(array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false
)
))
));
function hmac($key, $data)
{
$b = 64; // byte length for md5
if (strlen($key) > $b) {
$key = pack("H*", md5($key));
}
$key = str_pad($key, $b, chr(0x00));
$ipad = str_pad('', $b, chr(0x36));
$opad = str_pad('', $b, chr(0x5c));
$k_ipad = $key ^ $ipad;
$k_opad = $key ^ $opad;
return md5($k_opad . pack("H*", md5($k_ipad . $data)));
}
$merchantCode = "YOURCODE123"; //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
$now = gmdate('Y-m-d H:i:s'); //date_default_timezone_set('UTC')
$string = strlen($merchantCode) . $merchantCode . strlen($now) . $now;
$hash = hmac($key, $string);
try {
$sessionID = $client->login($merchantCode, $now, $hash);
}
catch (SoapFault $e) {
echo "Authentication: " . $e->getMessage();
exit;
}
$SearchOptions = new stdClass();
$SearchOptions->Name = 'New Users from API';
$SearchOptions->Types = array(
'INTERVAL',
'RADIO',
'COMBO'
); //RADIO, CHECKBOX, INTERVAL, COMBO, INTERVAL
$SearchOptions->Limit = 10;
$SearchOptions->Page = 1;
try {
$existentPriceOptions = $client->searchPriceOptionGroups($sessionID, $SearchOptions);
}
catch (SoapFault $e) {
echo "existentPriceOptions: " . $e->getMessage();
exit;
}
var_dump("existentPriceOptionst", $existentPriceOptions);
$existentPriceOptions[0]->Translations[0]->Name = 'New Users from API_1';
$existentPriceOptions[0]->Translations[0]->Language = 'EN';
$existentPriceOptions[0]->Required = FALSE;
echo "\n";
var_dump($existentPriceOptions);
try {
$NewPriceOptionGroup = $client->updatePriceOptionGroup($sessionID, $existentPriceOptions[0]);
}
catch (SoapFault $e) {
echo "NewPriceOptionGroup: " . $e->getMessage();
exit;
}
var_dump("NewPriceOptionGroup", $NewPriceOptionGroup);
?>
Add leads for catalog products
Overview
The lead management functionality that exists for the ConvertPlus cart can be also integrated with a self-hosted cart.
Use the addLead method to create a lead when a customer abandons the cart before placing an order.
Request Parameters
Parameters | Required | Type/Description |
---|---|---|
Items | Required | Purchased products. |
BillingDetails | Required | Array of strings. Billing information for the order. |
DeliveryDetails | Required | Array of strings. Delivery information for the order. |
Request Example
<?php
require ('PATH_TO_AUTH');
$Lead = new stdClass();
$Lead->CartId = "CartIdValue";
$Lead->Currency = "EUR";
$Lead->Language = "EN";
$Lead->ExternalReference = "REST_API_2CHECKOUT";
$Lead->Source = "testAPI.com";
$Lead->CustomerReference = "asdf1";
$Lead->MachineId = "123asd";
$Lead->Items = [];
$Item = new stdClass();
$Item->Code = "04C26C50F8";
$Item->Quantity = 2;
$Item->IsDynamic = false;
$Item->Tangible = true;
$Item->PurchaseType = "PRODUCT";
$Item->PriceOptions = [];
$priceOption = new stdClass();
$priceOption->Name = "group name 1";
$priceOption->Required = false;
$option = new stdClass();
$option->Name = 'add25';
$option->Value = 'add25';
$option->Surcharge = 100;
$priceOption->Options[] = $option;
$Item->PriceOptions[] = $priceOption;
$recurringOptions = new stdClass();
$recurringOptions->CycleLength = 6;
$recurringOptions->CycleUnit = 'MONTH';
$recurringOptions->CycleAmount = 100;
$recurringOptions->ContractLength = 2;
$recurringOptions->ContractUnit = 'YEAR';
$Item->RecurringOptions = $recurringOptions;
$marketingCampaigns = new stdClass();
$marketingCampaigns->Type = 23;
$marketingCampaigns->ParentCode = "m";
$marketingCampaigns->CampaignCode = 23;
$Item->MarketingCampaigns = $marketingCampaigns;
$Item->Price = new stdClass();
$Item->Price->Amount = 20;
$Item->Price->Type = "CUSTOM";
$additionalFields = [];
$additionalField = new stdClass();
$additionalField->Code = "TestFieldOne";
$additionalField->Text = "test text";
$additionalField->Value = "test value";
$additionalFields[] = $additionalField;
$Item->AdditionalFields = $additionalFields;
$Item->SubscriptionStartDate = date("Y-m-d H:i:s");
$Lead->Items[] = $Item;
$billingDetails = new stdClass();
$billingDetails->FirstName = "Customer";
$billingDetails->LastName = "2Checkout";
$billingDetails->Phone = null;
$billingDetails->Company = null;
$billingDetails->FiscalCode = "32423423";
$billingDetails->Email = "customer@2checkout.com";
$billingDetails->Address1 = "Test Address";
$billingDetails->Address2 = null;
$billingDetails->City = "LA";
$billingDetails->Zip = "12345";
$billingDetails->CountryCode = "RO";
$billingDetails->State = "CA";
$Lead->BillingDetails = $billingDetails;
$Lead->DeliveryDetails = clone($billingDetails);
$Lead->DeliveryInformation = new stdClass();
$Lead->DeliveryInformation->ShippingMethod = new stdClass();
$Lead->DeliveryInformation->ShippingMethod->Code = "sdfsd";
$Lead->PaymentDetails = new stdClass();
$Lead->PaymentDetails->Type = "CC";
$Lead->PaymentDetails->Currency = "EUR";
$Lead->PaymentDetails->PaymentMethod = new stdClass();
$Lead->PaymentDetails->PaymentMethod->RecurringEnabled = false;
$Lead->PaymentDetails->PaymentMethod->CardPayment = new stdClass();
$Lead->PaymentDetails->PaymentMethod->CardPayment->InstallmentsNumber = 23;
$Lead->PaymentDetails->CustomerIP = "1.2.3.4";
$Lead->LocalTime = date("Y-m-d H:i:s");
try {
$leadData = $client->addLead($sessionID, $Lead);
} catch (SoapFault $e) {
echo "addLead: " . $e->getMessage();
exit;
}
var_dump("addLead", $leadData);
Response Example
class stdClass#18 (3) {
public $LeadCode =>
string(10) "60E6C4B574"
public $CreatedAt =>
string(19) "2019-11-05T16:39:36"
public $Errors =>
array(0) {
}
}
Save prices
Overview
Use the savePrices method to update product prices for a specific 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. |
Prices |
BasicPrice Object |
|
Details below. |
Quantities |
Object |
|
Details below. |
PriceOptions |
Required (PriceOptionsAssigned object) |
|
Details below. |
PricingConfigCode |
Required (string) |
|
System-generated unique pricing configuration code. Read-only. |
type |
Require (string) • REGULAR • RENEWAL |
Parameters | Type/Description |
---|---|
BasicPrice |
Object |
Currency |
String |
|
The currency ISO code used for shipping costs - ISO 4217. |
Amount |
Float |
|
Basic price. |
Parameters | Type/Description |
---|---|
Quantities |
Object |
MinQuantity |
String |
|
The minimum quantity of volume discounts. Default is 1. |
MaxQuantity |
String |
|
The maximum quantity of volume discounts. Default is 99999. |
Parameters | Type/Description |
---|---|
PriceOptionsAssigned |
Object |
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. |
Response
bool(true)
<?php
require ('PATH_TO_AUTH');
$Prices = array();
$Prices[0] = new stdClass();
$Prices[0]->Currency = 'USD';
$Prices[0]->Amount = 999.99;
$Prices[1] = new stdClass();
$Prices[1]->Currency = 'EUR';
$Prices[1]->Amount = 111.99;
$Quantities = new stdClass();
$Quantities->MinQuantity = 1;
$Quantities->MaxQuantity = 99999;
$PriceOptions = null;
/*
$PriceOptions = array();
$PriceOptions[0] = new stdClass();
$PriceOptions[0]->Code = '04WCPNHWQ5';
$PriceOptions[0]->Options = array();
$PriceOptions[0]->Options[0] = 'loqmhwcpwk';
$PriceOptions[0]->Options[1] = 'n7332ux312';
$PriceOptions[1] = new stdClass();
$PriceOptions[1]->Code = '4CU1OVAGAA';
$PriceOptions[1]->Options = array();
$PriceOptions[1]->Options[0] = 'dvk7hv62jg';
$PriceOptions[1]->Options[1] = 'uf1svzaxcd';
*/
$PricingConfig = new stdClass();
$PricingConfig->ProductCode = 'NewSubscriptionPlan_Code_12345';
$PricingConfig->Country = null;
$type = 'REGULAR';
try {
$NewPrice = $client->savePrices($sessionID, $Prices, $Quantities, $PriceOptions, $PricingConfig, $type);
}
catch (SoapFault $e) {
echo "NewPrice: " . $e->getMessage();
exit;
}
var_dump("NewPrice", $NewPrice);
?>
Retrieve all groups
Overview
Use the getProductGroups method to extract information about the product groups 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. |
Response
Parameters | Type/Description |
---|---|
Array of objects |
Request
<?php
require ('PATH_TO_AUTH');
try {
$ProductGroups = $client->getProductGroups($sessionID);
}
catch (SoapFault $e) {
echo "Product Groups: " . $e->getMessage();
exit;
}
var_dump("ProductGroups", $ProductGroups);
?>
Expose merchant information for 2CO shopping cart
Overview
Disclaimer: the following method is intended for internal purposes only.
Use the getMerchantInforamtion method for retrieving vendor information required by the 2CO shopping cart into a single call.
This API method is protected through a special authentication header that the 2CO cart should sent. Click here to learn more about the X - header authentication.
Requirements
Authenticate using the special authentication header.
Response
Info | Description |
---|---|
Company name | Merchant company name. |
Commercial name | Merchant commercial name. |
Demo flag | Y if the vendor status is Pending, else P if the vendor has the "test orders" package active, otherwise N. |
Forced currency code | 3-letter code. |
Shopping cart customization | Shows possible cart customizations. |
Payment methods | Merchant available payment options. |
Override line item limit | - |
Order auth time | Minutes into days (how long it takes for the order to become complete). |
3DS status | true if vendor has Use3DSecure = NO, false otherwise. |
Currencies | Merchant available currencies. |
Countries | Merchant available ordering countries. |
Languages | Merchant available ordering languages. |
Promotions |
Promotions defined on merchant account. |
Secret key | Merchant account secret key. |
Shipping methods | Shipping methods defined on merchant account. |
Request
<?php
function callRPC($Request, $hostUrl, $Debug = false) {
$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_HTTPPROXYTUNNEL, false);
curl_setopt($curl, CURLOPT_PROXY, '');
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Accept: application/json',
'X-Avangate-Authentication: type="private" ver="2" app="2co-shopping-cart" merchant="RDGM" date="2018-01-31T13:57:44+00:00" hash="0m3ULy6dZ2xUI8CFtU0ersCootdf6wz8Z1qxN28FdXI="'
));
curl_setopt($curl, CURLOPT_COOKIE, '');
$RequestString = json_encode($Request);
curl_setopt($curl, CURLOPT_POSTFIELDS, $RequestString);
if ($Debug) {
var_dump($RequestString);
}
$ResponseString = curl_exec($curl);
if ($Debug) {
var_dump($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;
}
return null;
}
$host = 'http://api.avangate.com/soap/5.0';
try {
$merchantInformation= $client->getMerchantInformation($sessionID);
}
catch (SoapFault $e) {
echo "MerchantInformation: " . $e->getMessage();
exit;
}
var_dump("merchantInformation", $merchantInformation);
Express Payments Checkout
Overview
Use the Express Payments Checkout flow to minimize billing data entry for your shoppers, depending on the selected payment method, enabling you to further streamline the available single page checkout flows. This flow is particularly optimized to facilitate high volumes of payments via PayPal.
2Checkout recommends that you test the compatibility of existing shopping cart templates with the 'Express payments checkout' flow to ensure smooth purchase experiences for customers.
Availability
The Express Payments Checkout is available for all account types on both business models (PSP & MoR).
Requirements
Use a currency parameter in the buy-link, preferably EUR or USD when pre-selecting PayPal as the payment method for the Express payments checkout, to ensure that the ordering process uses a PayPal supported currency.
If shoppers are geo-located in a market using a currency not supported by PayPal, the 2Checkout system automatically switches the currency to Euro (EUR), but only in scenarios in which PayPal is the pre-selected method for the Express payments checkout.
Express payments checkout flow
The Express payments checkout flow modifies the shopping cart design by positioning the payment methods selector area above the billing details section.
PayPal
In scenarios in which you use PayPal as the pre-selected payment method for the Express payments checkout flow, the cart displays a streamlined Billing Information area. Customers are only required to select the currency for the transaction that can be either EUR or USD.
Cards and other payment methods
By default, the payment methods list features four visible items. Users can click on the Select other methods link to access an extensive list of payment methods, initially hidden. Note: These are all payment methods activated for your account.
The order in which items are listed in this area is optimized by the 2Checkout system to reflect the popularity of payment methods in specific geographies worldwide. This causes the list to vary from market to market according to the location of shoppers.
Express payments checkout links query parameters
You can build buy-links for the Express payments checkout flow manually. Use the parameters described below either with your custom domain or with https://secure.2checkout.com/order/checkout.php:
Parameter | Description |
---|---|
NODATA = 1 |
Use in conjunction with PAY_TYPE=PAYPAL to trigger the Express payments checkout flow with PayPal which will circumvent 2Checkout checkout and redirect customers directly to PayPal. Expected behavior: Shoppers click on a Buy Link using the NODATA=1 andPAY_TYPE=PAYPAL parameters and are redirected to PayPal, rather than be taken to the 2Checkout shopping cart (checkout.php). |
PAY_TYPE=PAYPAL |
PayPal - pre-selected payment method for the order. It needs to be used in conjunction with the DESIGN_TYPE=1 parameter to trigger the Express payments checkout flow with PayPal. |
CURRENCY (optional |
Preselect the billing currency to be used in the transaction. |
CLEAN_CART (optional) |
Set this parameter to 1 to reset the cart contents or to ALL to reset the cart session. Use this parameter to remove products from the current cart session. Note: CLEAN_CART does remove production options or custom prices from the current cart session. |
DESIGN_TYPE (optional) |
Value = 1. When DESIGN_TYPE=1 is used in Buy Links the parameter changes the layout of the shopping cart template interface, positioning the payment methods selector in a more prominent position, above the billing details area. |
Value = 2. When DESIGN_TYPE=2 is used in Buy Links customers are redirected to their PayPal account, where they log in and confirm the payment. After payment confirmation, they are redirected to the shopping cart to confirm the billing and delivery data and enter their VAT ID. |
Here's an example of such a link:
https://secure.2checkout.com/order/checkout.php?PRODS=1234567&QTY=1&COUPON=4066_100&CLEAN_CART=ALL
Generate an Express payments checkout flow link
- Navigate to Generate links under Setup.
- Select the Express payments checkout flow option in the list of purchase flows available under the Link options area.
- Select one or more products and configure advanced options, if needed.
- Scroll down to the bottom of the page and click on the Generate link button.
- The 2Checkout system builds a link such as the following:
https://secure.2checkout.com/order/checkout.php?PRODS=1234567&DESIGN_TYPE=1
FAQs:
1. Are free orders supported?
For free orders (with zero value) 2Checkout authorizes a minimum charge, for example, $1 when USD is the currency used for PayPal account validation purposes. 2Checkout subsequently returns the money to the shopper.
2. Can CARD=1 and CARD=2 parameters be used with the Express Payments Flow?
The Express payments flow supports both CARD=1 and CARD=2 parameters.
Place upgrade partner orders
Overview
Purchase upgrades in addition to new licenses and subscription renewals. The 2Checkout platform enables you to offer partners upgrades to:
- A different subscription/product;
- A newer version of the current subscription/product;
- A distinct licensing option of the same subscription/product.
Requirements
- It's mandatory to associate upgrades to the same price list as the original products (subscriptions/licenses), and to assign them to partners to provide access. Products that are not part of price lists assigned to partners will not be available as upgrade options.
- Upgrades are only available for active subscriptions/licenses. As long as expired licenses/subscriptions are still in their grace period (featuring the Past due status), upgrading them is a valid option.
- When defining the product which will act as the upgrade make sure to also generate a subscription under the Renewal tab. Products can only be upgraded to offerings for which a subscription was generated, when ordering on behalf of your partners. If the upgrade is not a subscription, select none as the Renewal interval. This creates a lifetime license.
Place partner upgrade orders
- Go to Orders & customers -> Place partner order.
- Select the partner for which you're ordering upgrades, either by typing the name in the Select partner box, or by using the drop down menu available. Alternatively, provided that you already placed orders on behalf of your partners, a list of Last used partners will be available in this area, and clicking on a name will automatically select it.
- Select Upgrade to move to the next stage.
- Search for subscriptions/licenses you want to upgrade. The results returned for the search include only active, upgradable subscriptions/licenses previously purchased by the selected partner. Expired or disabled subscriptions/licenses, as well as those for which you haven't defined an upgrade, will not be listed here. Upgrades need to be ordered individually, one at a time, unlike prolonging subscriptions, where you can bulk renew a number of selected items. The reason for this is the fact that each product subscription/license can have different upgrade options, requiring you to customize each item individually. However, once you add an upgrade to cart, you can continue doing so for more subscriptions/products. You'll be able to add to cart and order as many upgrades as you wish, but you have to do it one by one. The quantity/number of units of the upgrade is locked and cannot be modified, unlike additional options you configured.
- Editing functionality for upgrade orders involves options such as adding more upgrades, remove added items one by one or all at once, and communicate with your partner through comments. You can even edit the specific details of a subscription/license already added to cart, if you would like to modify the options selected initially, for example.
- Step 4: Add extra margin/discount options to decrease the cost of an upgrade for your partner. Extra margins and discounts are entirely optional and completely under your control.
- Discount - Apply a discount to the product(s) value in this order. The discount is deducted from the total price of the products before partner margin is applied.
- Extra margin - Offer an extra margin to your partner only for this order. The extra margin is deducted from the total price of the products after discount and partner margin are applied.
- Place the order. Hit the Place order button to place an upgrade order once all the details are final.
- Order confirmation. Orders placed by you on behalf of your partners are confirmed automatically, regardless of the order confirmation settings of the partner account.
- Attach end user information. For upgrades, the 2Checkout system is designed to copy the end user information attached to the original subscription/license. However, when such data is not available, you'll need to provide it for the order to move to the delivery/fulfillment stage (if they are required according to the Partner commercial settings). 2Checkout needs at least the email address of partners/shoppers to deliver keys for orders that require end user information.
- Attach reseller information. Reseller information is also copied automatically from the original subscription/licenses as a part of the upgrade process. Similarly, when such data is not available, you'll need to provide it for the order to move to the delivery/fulfillment stage, if the reseller information is required according to that partner's commercial settings.
- Pay partner invoices. Partner invoices can be generated manually or automatically, depending on your partner account settings. If the order is placed without any available credit, or your partners do not enjoy a credit limit - they will first need to pay the partner invoice that gets generated automatically when the order is confirmed, and only then will the process advance to the delivery/fulfillment stage. To manually issue a partner invoice, go to Partner invoices under Orders & customers.
- Click the item in the list of available orders on the left hand side of the page to add them to the partner invoice you're generating, and click Preview.
- Click Save to create the partner partner invoice. On the next screen you'll have the option to notify your partner of the newly generated partner invoice or to cancel it if necessary.
- Delivery/fulfillment: When delivery/fulfillment is handled by 2Checkout, not required or has been confirmed by you, the system will give green light to deliveries immediately for order that are paid in full or placed within available credit. Fulfillment for partner orders guidance is available here.
Error messages
UPGRADE_PRICELIST_UNAVAILABLE |
Upgrade is not available for this license because the product is no longer available in the initial price list. Please revise the price settings for this product. |
UPGRADE_TO_PRODUCT_NOT_IN_LIST |
Upgrade is not available for this license because the upgrade options set for this product are not part of the initial purchase price list. Please revise the price settings for this product. |
UPGRADE_LICENCE_DISABLED |
License is disabled. |
UPGRADE_TO_PRODUCTS_NO_RENEWAL | Upgrade is not available because subscriptions are not being generated for any of the upgrade options. |
Electronic delivery and payment receipt
Use the variables in the list below to customize the Electronic delivery and payment receipt shopper email according to your needs. Check the 'Mandatory' column to see the variables that are required in your customized version of the e-mail.
Variable name | Description | Test value | Mandatory |
---|---|---|---|
ADDITIONAL_PRODUCT_INFO | Additional product-level fulfillment information set in the Avangate Control Panel | Additional delivery information for this product. | No |
ADDRESS1 | First section of the billing address | [123, Main Street] | No |
ADDRESS1_D | First section of the delivery address | [123, Main Street] | No |
ADDRESS2 | Second section of the billing address | 0 | No |
ADDRESS2_D | Second section of the delivery address | 0 | No |
ALLOW_MYACCOUNT_PROMO | Include or exclude myAccount information in the email body | 1 | No |
APPROVAL | Issuer (bank) payment idetifier | 0 | No |
ATTACHMENT | Indicates whether or not you configured the product keys to be sent as an email attachment. Possible values: TRUE if the email contains an attachment FALSE if the email doesn't contain an attachment |
0 | No |
AVANGATE_COMPANY_NAME | Avangate company name | Avangate | No |
AVANGATE_LOGO | Avangate logo URL | https://secure.avangate.com/images/e...endor_logo.png | Yes |
AVANGATE_WEBSITE | Avangate website | http://www.avangate.com | Yes |
AVANGATE_ON_BANK_STATEMENT_GENERIC | This is mandatory content you need to keep in your emails, given Avangate acts as Reseller / Merchant of Record for online purchases on your website. | The charge on your bank statement will appear as Avangate. | Yes |
AVS_MATCH | Gateway AVS | 0 | No |
BANK_STATEMENT | Account statement descriptor | 0 | No |
BANK_STATEMENT_DESCRIPTOR | Account statement descriptor | 0 | No |
BASE_URL | Merchant's full host | https://secure.avangate.com | No |
BUSINESS_COMPANY | Avangate company name | Avangate | No |
BUSINESS_HOTLINE | Avangate support phone | +31 88 0000008 | No |
BUSINESS_HOTLINEUS | Avangate US hotline number | +1 (650) 963-5701 / (888) 247-1614 | No |
BUSINESS_SUPEMAIL | Avangate support email address | support@avangate.com | No |
BUSINESS_WEBSITE | Avangate website | http://www.avangate.com | No |
CARD_LAST_DIGITS | Last 4 digits of the card used to perform the payment | 1234 | No |
CBANKACCOUNT | Shopper's bank account used on the billing information | 0 | No |
CBANKNAME | Shopper's bank name used on the billing information | 0 | No |
CITY | Shopper's city used on the billing information | Anytown | No |
CITY_D | Shopper's city used on the delivery information | Anytown | No |
CODES | Product keys to be delivered to the shopper. Each item of the array has two values: key and description | 0 | No |
CODES[index1].description | Product key description. | Key description | No |
CODES[index1].key | Product key. | 123-ABC-1key-example | No |
COMMERCIALNAME | Merchant's commercial name | [Software Company Name] | No |
COMPANY | Shopper's company name used on the billing information | [Customer company] | No |
COMPANY_D | Shopper company name used on the delivery information. If no delivery information is available. no company name is displayed. | [Customer company] | No |
COUNTRY | Shopper's country used on the billing information | [U.S.A] | No |
COUNTRY_D | Shopper's country used on the delivery information | [U.S.A] | No |
CURRENCY | Order billing currency | USD | Yes |
CURRENCY_ORIGINAL | Original order currency (applicable to refunds) | 0 | No |
CUSTOMEREMAIL | Shopper's email address used on the billing information | example@customer-email.com | No |
CVV2_MATCH | Gateway CVV2 check response | 0 | No |
DISPLAY_MY_ACCOUNT_INFO | Include or exclude myAccount information in the email body | 1 | No |
DOWNLOAD_INSURANCE |
Indicates whether or not the purchase includes Download Insurance Service. Possible values
|
0 | No |
DOWNLOAD_LINK_DELIVERY | Indicates whether or not a download link is available. Possible values: TRUE FALSE |
1 | No |
Shopper email address used on the delivery information. If no delivery information is available. the billing information is used. | example@customer-email.com | No | |
ENCRYPTED_MERCHANT_CODE | Encrypted merchant code | 0 | No |
FIRSTNAME | Shopper's first name used on the billing information | [John | |
FIRSTNAME_D | Shopper's first name used on the delivery information | [John | No |
FIRST_NAME_BILLING | Shopper's first name used on the billing information | John | Yes |
FIRST_NAME_DELIVERY | Shopper's first name used on the delivery information | John | No |
FISCALCODE | Shopper's fiscal code used on the billing information | 0 | No |
GATEWAY_ERROR_CODE | Gateway error code | GW_PROCESSING_ERROR See the full list of Possible Values |
No |
GATEWAY_ERROR_MESSAGE | Reason why the transaction failed. (e.g. Invalid card, insufficient funds) | Error processing the card transaction. The card account has not been debited. Card data is invalid or incomplete. | No |
GENERALTOTAL | Total order price | 135.2 | No |
GLOBALDISCOUNT | Order total discount | 8.33 | No |
HAS_RENEWAL_PRODUCTS | Flag that indicates whether at least one product has renewal settings | 0 | No |
HAVEPAYMENTRCPT | Signals that the mail includes a payment receipt | 1 | No |
INT_REF | Global Collect internal reference | 0 | No |
IS_RENEWAL | Flag that indicates whether at least one product has renewal settings | 0 | No |
LANGUAGE | Order language (abbreviated) selected by shopper | en | No |
LASTNAME | Shopper's last name used on the billing information | Doe] | No |
LASTNAME_D | Shopper's last name used on the delivery information | Doe] | No |
LAST_NAME_BILLING | Shopper's last name used on the billing information | Doe | Yes |
LAST_NAME_DELIVERY | Shopper's last name used on the delivery information | Doe | No |
LICENSE_TYPE | Type of subscription generated by the purchase product | 0 | No |
MERCHANT_COMMERCIAL_NAME | Merchant's commercial name | Software Company Name | No |
MERCHANT_SUPPORT_EMAIL | Merchant support email address | support@software-company-website.com | No |
MERCHANT_SUPPORT_PHONE | Merchant support phone number | 888-xxx-xxxx | |
MOREINFO | Additional product-level fulfillment information set in the Avangate Control Panel | [Additional delivery information for this product.] | No |
MORE_EMAIL_INFO | 0 | 0 | No |
MY_ACCOUNT_LOGIN_EMAIL | Email address used by shopper to login/signup to myAccount | example@customer-email.com | No |
MY_ACCOUNT_LOGIN_URL | Avangate myAccount login/sign-up URL | secure.sofware-company-website.com/myaccount/?lang=en | Yes |
NAMES_OF_PRODUCTS | Names of all products in the order, comma separated | 0 | No |
ORDERDATE | Order placement date | [2016-07-12] | No |
ORDER_AMOUNT | Total order price | 135.2 | Yes |
ORDER_AMOUNT_ORIGINAL | Original order value (applicable to refunds) | 0 | No |
ORDER_DATE | Order placement date | 42563 | Yes |
ORDER_DATE_STANDARD_FORMAT | Standard format used for the order placement date | 0 | No |
ORDER_FLOW | Purchase flow used to place the order | 0 | No |
ORDER_REFERENCE_NUMBER | Order reference number | 9xxxxxx | Yes |
ORDER_STATUS | Order status | 0 | No |
ORDER_WEBSITE | Website where the shopper placed the order | http://www.software-company-website.com | Yes |
PAYMENT_METHOD | English name for the payment method used | Visa/MasterCard/Eurocard | Yes |
PAYMENT_TYPE_INFO | English payment method name. Includes last four card digits (if applicable). | 0 | No |
PAYTYPESTR | English name for the payment method used | [Visa/MasterCard/Eurocard] | No |
PHONE | Shopper's phone number used on the billing information | 0 | No |
PHONE_D | Shopper's phone number used on the delivery information | [555-555-555] | No |
PRODUCTID | Product ID number | 0 | No |
PRODUCTNAME | Product name | [Test product name] | Yes |
PRODUCTQTY | Purchased product quantity | 0 | No |
PRODUCTS[index1].DISCOUNT | Product discount value per product line | 0 | No |
PRODUCTS[index1].ID | Product ID number | 1001 | No |
PRODUCTS[index1].INFO | Additional product information defined by merchant when generating buy links | Product info 1 | No |
PRODUCTS[index1].IS_TRIAL | Indicates whether this is a trial product | 1 | No |
PRODUCTS[index1].LICENSE_TYPE | Type of purchased subscription | TRIAL | No |
PRODUCTS[index1].PCODE | Product code. | [P_CODE_1] | No |
PRODUCTS[index1].PID | Product ID number | 1001 | No |
PRODUCTS[index1].PNAME | Product name | [Test product name 1] | No |
PRODUCTS[index1].PRICE | Product unit price | 100 | No |
PRODUCTS[index1].PRODUCTNAME | 0 | No | |
PRODUCTS[index1].PRODUCT_OPTIONS[index2].OptionText | Ignore internal var. | 0 | No |
PRODUCTS[index1].PROMONAME | Name of the promotion applied to the product | 0 | No |
PRODUCTS[index1].QUANTITY | Purchased product quantity | 1 | No |
PRODUCTS[index1].SHORT_DESCRIPTION | Short product description | 0 | No |
PRODUCTS[index1].TOTAL | Total gross price per product line (before applying discounts) | 120 | No |
PRODUCTS[index1].TOTAL_PRICE | Total net price per product line (before applying discounts) | 100 | No |
PRODUCTS[index1].TRIAL_PERIOD | Product trial period. | 7 | No |
PRODUCTS[index1].UNIT_PRICE | Product unit price | 100 | No |
PRODUCTS[index1].VAT | VAT/Sales tax value per product line | 20 | No |
PRODUCTS_DATA[index1].IdProduct | Product ID number | 0 | No |
PRODUCTS_DATA[index1].PRODUCT_SHORT_DESCRIPTION | Short product description | 0 | No |
PRODUCTS_NO | Number of products in cart | 0 | No |
PRODUCT_DATA[index1].CODES[index2].description | 0 | No | |
PRODUCT_DATA[index1].CODES[index2].key | 0 | No | |
PRODUCT_DATA[index1].DOWNLOAD_LINK | # | No | |
PRODUCT_DATA[index1].HAS_CODES_ATTACHED | 0 | No | |
PRODUCT_DATA[index1].HAS_DOWNLOAD_LINK | 1 | No | |
PRODUCT_DATA[index1].MORE_EMAIL_INFO | Additional product information | No | |
PRODUCT_DATA[index1].NAME | Test product name 1 | No | |
PRODUCT_DATA[index1].PRODUCT_OPTIONS | 0 | No | |
PRODUCT_DATA[index1].PRODUCT_OPTIONS[index2].OptionText | 0 | No | |
REFNO | Order reference number | [9xxxxxx] | No |
REGISTRATIONNUMBER | Shopper's registration number used on the billing information | 0 | No |
RETRYLINK | Payment retry link | 0 | No |
RETRY_LINK | Payment retry link | 0 | No |
SELLERWEBSITE | Website where the shopper placed the order | http://www.software-company-website.com | No |
SHIPPING | Shipping fee amount | 0 | No |
SHIPPING_FEE | Shipping fee amount | 0 | No |
SHOPPER_ADDRESS_1_BILLING | First section of the billing address | 123, Main Street | No |
SHOPPER_ADDRESS_1_DELIVERY | First section of the delivery address | 123, Main Street | No |
SHOPPER_ADDRESS_2_BILLING | Second section of the billing address | 0 | No |
SHOPPER_ADDRESS_2_DELIVERY | Second section of the delivery address | 0 | No |
SHOPPER_CITY_BILLING | Shopper's city used on the billing information | Anytown | No |
SHOPPER_CITY_DELIVERY | Shopper's city used on the delivery information | Anytown | No |
SHOPPER_COMPANY_BILLING | Shopper's company name used on the billing information | Customer company | No |
SHOPPER_COMPANY_DELIVERY | Shopper company name used on the delivery information. If no delivery information is available. no company name is displayed. | Customer company | No |
SHOPPER_COUNTRY_BILLING | Shopper's country used on the billing information | U.S.A. | No |
SHOPPER_COUNTRY_DELIVERY | Shopper's country used on the delivery information | U.S.A. | No |
SHOPPER_EMAIL_ADDRESS_DELIVERY | Shopper email address used on the delivery information. If no delivery information is available. the billing information is used. | example@customer-email.com | No |
SHOPPER_STATE_BILLING | Shopper's state used on the billing information | Anystate | No |
SHOPPER_STATE_DELIVERY | Shopper's state used on the delivery information | Anystate | No |
SHOPPER_ZIP_CODE_BILLING | Shopper's ZIP code used on the billing information | 12345 | No |
SHOPPER_ZIP_CODE_DELIVERY | Shopper's ZIP code used on the delivery information | 12345 | No |
STATE | Shopper's state used on the billing information | Anystate] | No |
STATE_D | Shopper's state used on the delivery information | Anystate] | No |
SUBTOTAL | The order amount without vat and shipping | 112.67 | No |
TECHEMAIL | Merchant support email address | support@software-company-website.com | No |
TECHPHONE | Merchant support phone number | [888-xxx-xxxx] | No |
TOTALEQUIV | The order amount converted to all the merchant's currencies | 0 | No |
TOTAL_DISCOUNT | Total order discount | 8.33 | No |
TOTAL_VAT | Total order VAT | 12 | No |
UPLOADLINK | File upload link | 0 | No |
UPLOAD_LINK | File upload link | 0 | No |
USER_EMAIL | Email address used by shopper to login/signup to myAccount | example@customer-email.com | No |
USER_TOKEN | Shopper token for Avangate myAccount access | xxxxxxxxxxxx | No |
VALIDATION_CODE | Global Collect validation code | 0 | No |
WEBSITE | Website where the shopper placed the order | http://www.software-company-website.com | No |
ZIPCODE | Shopper's ZIP code used on the billing information | 12345 | No |
ZIPCODE_D | Shopper's ZIP code used on the delivery information | [12345 | No |
API Requests
Overview
Perform easy account management via API Requests. The 2Checkout API portfolio contains extended capabilities that can help you automate processes as creating products or promotions, placing orders (both with catalog and dynamic product information), issuing refunds, retrieving the shipping price for an order, handling subscriptions, and many others.