Skip to main content

Set a redirect URL for default checkout flows

Overview

2Checkout supports the seamless transition of shoppers to a web page of your choosing following order completion. Shopper redirect will only happen after the order is placed successfully.

Availability

All 2Checkout accounts. 

Analytics tracking

2Checkout bypasses the Thank You page (finish.php) completely and no longer displays it to shoppers. If you use analytics code in finish.php be aware that it will no longer collect data.

AfterSale Messages

Please note that setting up a Redirect URL and effectively redirecting shoppers to a different webpage after they place an order cancels any AfterSale Messages that you might have set up. 2Checkout displays AfterSale Messages in the Thank You page, at the end of the purchase process, but the Redirect URL causes the process to bypass the Thank You page and sends shoppers directly to the web page of your choosing.

Instant Delivery in finish.php

By redirecting shoppers to a different webpage after they place an order effectively cancels Instant delivery (in the Thank you page).

Instant delivery takes place in the Thank you page, at the end of the purchase process, but Redirect URL causes the process to bypass the Thank You page altogether, and sends shoppers directly to the web page of your choosing.

Shopper redirects

2Checkout always redirects shoppers:

  • If they use an instantaneous payment method (including when they purchase paid trials).
  • When payment is not required (order value is 0).

2Checkout does not redirect shoppers when they:

  • Use an offline payment method such as bank/wire transfer.
  • When they order free trials.

Configure the Redirect URL

To configure the Redirect URL, make your way to the Setup area of the Control Panel.

  1. Click Generate Links under Setup, and select the Default flows tab. Alternatively, you can also hit the Get buy links for this product link under the Information tab, just to the right of the Product ID, when editing a product.
  2. Scroll down to the Advanced Options section and locate the Redirect URL field from the Additional options area. Enter the URL for the destination to which shoppers will be redirected once they finalize payments for orders they place through the 2Checkout system.
  3. Once you have entered all the desired details, scroll down to the bottom of the page and click the Generate link button. The Buy Link created will contain a &BACK_REF parameter just as in the example below. The URL following the &BACK_REF parameter is the same as the one entered under the Redirect URL field. 

    https://secure.2checkout.com/order/checkout.php?PRODS=1234567&BACK_REF=http%3A//www.YourCustomRedirectURL.com

    While you can use the Control Panel to ease the introduction of the Redirect URL into Buy Links for your products, you can also enter it manually. Just introduce &BACK_REF= http%3A//www.YourCustomRedirectURL.com into the Buy Link and replace YourCustomRedirectURL with the actual name of the custom web page where shoppers will be redirected.

Optional

In order to increase security and avoid BACK_REF tampering from 3rd party entities (security breaches), we added the possibility to include the parameter SECURE_CART
In order to obtain a more secure and hashed URL, the SECURE_CART parameter must be used and set to value ‘1’ ( SECURE_CART=1) along with the hashed value of the BACK_REF parameter, according to this documentation.
The new URL might look like:

https://secure.2checkout.com/order/checkout.php?PRODS=1234567&BACK_REF=http%3A//www.YourCustomRedirectURL.com &SECURE_CART=1&PHASH=0d5e3ecfe95fd6560e117d1f18b7e7ea
  • The  2Checkout platform will perform this action by default for links generated in the Merchant Control Panel and will generate the PHASH value for you.
  • Parameter BACK_REF should be used in clear (raw, not coded) in the PHASH calculation (ex: &BACK_REF=http://www.YourCustomRedirectURL.com/), but should be encoded when adding it to the URL (ex: &BACK_REF=http%3A%2F%2Fwww.YourCustomRedirectURL.com%2F).
  • Parameter SECURE_CART should not be taken into consideration when calculating the PHASH.

Validate 2Checkout redirects

2Checkout generates the ctrl parameter automatically and adds it to Buy Links when you use BACK_REF.

ctrl is an HMAC (keyed-hash message authentication code) MD5/SHA code enabling you to validate that the redirect was generated by 2Checkout. The code is generated using the length of the characters of the redirect URL, concatenated with the redirect URL. 

Example

Buy-link
https://secure.2checkout.com/order/checkout.php?PRODS=1234567&BACK_REF=…
STRING for HMAC_MD5/HMAC_SHA calculation

36http://www.YourCustomRedirectURL.com

129 represents the length of the sequence of parameters.

Secret key for this example
_SECRET_KEY_
Resulting ctrl parameter value*
3ffdce1661e12b0ab33ef28b1bbc8bb5 (MD5)
4cf27f60551b698e44e4b15267beeac9a6995fb583cf398175c4fe211ae6254e (SHA2)
1b70515c126b4942394e4208f22c0402e48525dc2498542b22a52b3a6161f49f (SHA3)
   The hashing algorithm (MD5/ SHA2/ SHA3) will be determined based on an internal system configuration.

Update product

Overview

Use the updateProduct method to update the configuration of a subscription plan/product you already configured 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.

Product

Required (object)

 

Use this object to configure your subscription plans/products.

 

You can update/edit all parameters, except the following:

  • 2CheckoutID
  • ProductType

Exceptions

When updating a subscription plan/product, you also update its PricingConfigurations. However, you cannot modify:

  • The pricing configuration CODE.
  • The PricingSchema from DYNAMIC to FLAT or vice versa.  

Request

<?php

require ('PATH_TO_AUTH');

$ProductCode = 'NewProdCodeAPI12345';

try {
$myProduct = $client->getProductByCode($sessionID, $ProductCode);
}

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

$myProduct->ProductName = 'Edited_From_API_Again';

var_dump ($myProduct);

try {
    $NewSubscriptionPlan = $client->updateProduct($sessionID, $myProduct);
}

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

var_dump("UpdatedProductInfo", $NewSubscriptionPlan);

?>

Response

bool(true)

 

Enable/Disable product

Overview

Use the setProductStatus method to enable/disable products 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.

productCode

Required (string)

 

Use this object to configure your subscription plan/products.

 

You can set all Product parameters except 2CheckoutID. The 2Checkout system sets the unique product ID. The 2CheckoutID is not editable.

Status

Required (Boolean)

 

True or False, depending on whether you want to enable or disable a subscription plan/product.

Request

<?php

require ('PATH_TO_AUTH');

$ProductCode = "YourProductCode";

try {
    $ProductStatus = $client->setProductStatus($sessionID, $ProductCode, true); // TRUE to enable a product - FALSE to disable a product
}

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

var_dump("ProductStatus", $ProductStatus);

?>

 

Response

bool(true)

 

Retrieve a shipping fee configuration

Overview

Use the getShippingFee method to extract information about a specific shipping fee configuration you defined 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.

shippingCode

Required (string)

 

Shipping fee configuration code.

Response

Parameters Type/Description

ShippingFees

Array of objects

Request

<?php
require ('PATH_TO_AUTH');

$shippingCode= "YOUR_SHIPPING_CODE";

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

?>

Retrieve active promotions in cart

Overview

Use this method to list all promotions applied to products added to cart.

Requirements

Parameters

Parameter Type/Description
sessionID Required (String)
  Session identifier, output of the Login method. An exception is thrown if the values are incorrect.

Response

Parameter Type/Description

Promotion

Array of objects

 

Details below

 

Name

String

 

 

Promotion name

 

Description

String

 

 

Promotion description

 

StartDate

String

 

 

Promotion start date. NULL for promotions that start immediately after they're created.

 

EndDate

String

 

 

Ending date. The date when you set the promotion to end. Is NULL for promotions that you want active indefinitely.

 

MaximumOrdersNumber

Int

 

 

When the maximum number of orders is reached the promotion stops. NULL if you want the promotion to apply to an unlimited number of orders.

 

MaximumQuantity

Int

 

 

Discount only applies to a specific number of products, smaller than the maximum defined quantity. 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

 

 

Selecting the instant discount option auto-applies the discount for ALL the selected products for all shoppers, without the need to enter the discount coupon.

 

Coupon

String

 

 

Promotion coupon/voucher.

 

DiscountLabel

String

 

 

Set discounts as percentage from the product price or as a fixed amount in the chosen currency.

Request

<?php

require('PATH_TO_AUTH'); // Authentication example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/02Authentication
require('PATH_TO_setPartner'); // setPartner example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/06Reference/Partner/00Set_partner

try {
    $Promotions= $client->getPromotions ($sessionID);
} catch (SoapFault $e) {
    Echo "AllDiscounts: " . $e->getMessage();
    exit;
}
var_dump ("AllDiscounts", $Promotions);

Errors

Error Description

EMPTY_CART

The shopping cart is empty

NO_PROMOTIONS

There are no promotions applied to current shopping cart

 

Add 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. 2Checkout throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

AdditionalField

Object

 

Additional field object.

Response

bool(true)

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));

?>

 

Use Credit cards

Overview

Use the placeOrder method to create an order using products defined in your Control Panel and collect the payment using credit card based payment methods.

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.
Order Required (Object)
  Object designed to collect all data necessary for an order, including billing, product/subscription plan and payment details.

Response

Parameters Type/Description
Order information Object
  Object containing order information.

Request

<?php

require ('PATH_TO_AUTH');

$Order = new stdClass();
$Order->Currency = 'usd';
$Order->Country = 'US';
$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]->SubscriptionStartDate = NULL; //If empty or null, subscriptions become active when purchase is made.

$Order->BillingDetails = new stdClass();
$Order->BillingDetails->FirstName = 'First';
$Order->BillingDetails->LastName = 'Last';
$Order->BillingDetails->CountryCode = 'us';
$Order->BillingDetails->State = 'California';
$Order->BillingDetails->City = 'LA';
$Order->BillingDetails->Address1 = 'Address example';
$Order->BillingDetails->Address2 = NULL;
$Order->BillingDetails->Zip = '90210';
$Order->BillingDetails->Email = 'email@address.com';
$Order->BillingDetails->Phone = NULL;
$Order->BillingDetails->Company = NULL;
$Order->DeliveryDetails = NULL;

$Order->PaymentDetails = new stdClass ();
$Order->PaymentDetails->Type = 'CC';
$Order->PaymentDetails->Currency = 'usd';
$Order->PaymentDetails->PaymentMethod = new stdClass ();
$Order->PaymentDetails->CustomerIP = '10.10.10.10';
$Order->PaymentDetails->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->CCID = '123';
$Order->PaymentDetails->PaymentMethod->HolderName = 'John';
$Order->PaymentDetails->PaymentMethod->CardNumberTime = 83.21; // can be null - high value in seconds is a red flag for fraud attempts.
$Order->PaymentDetails->PaymentMethod->HolderNameTime = 13.35; // can be null - high value in seconds is a red flag for fraud attempts.
$Order->PaymentDetails->PaymentMethod->Vendor3DSReturnURL = "http://www.success.ro";
$Order->PaymentDetails->PaymentMethod->Vendor3DSCancelURL = "http://www.error.ro"; 


try {
    $newOrder = $client->placeOrder($sessionID, $Order);
}
catch (SoapFault $e) {
    echo "newOrder: " . $e->getMessage();
    exit;
}

var_dump("newOrder", $Order);

Enable recurring billing

Overview

Use the enableRecurringBilling method to switch on the automatic renewal system for a subscription that's manually renewable. 

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.

Response

Parameters Type/Description

Boolean

true or false depending on whether the changes were successful or not.

Request

<?php

require ('PATH_TO_AUTH');

$subscriptionReference = 'YOUR_SUBSCRIPTION_REFERENCE';

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

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

Set up redirect URLs for ConvertPlus ordering flow

Overview

Redirect your customers together with the sale parameters to a page or script after a successful sale on the ConvertPlus cart. You can specify the redirect URL at the account, product, and buy-link level.

Specifying an approved URL at the account level will direct all buyers to the same URL after a successful ConvertPlus checkout.

 

Recommended resources

Requirements

Available only for merchants that have ConvertPlus cart enabled on their account. Contact us for ConvertPlus activation.

Applicable only to online payment methods (ex: Credit cards and PayPal).

To learn how to set a redirect URL on 2Checkout default ordering flows, read this article.

Return methods

2Checkout provides three methods in which the buyer and sale parameters can be returned to your approved URL.

You may send the buyer to our order processed page which displays a Click Here to Finalize your Order button to redirect the buyer, you may bypass the order processed page using a header redirect or you can immediately display your approved URL to the buyer while they remain on our server. You can set your return method and Approved URL at different levels of granularity:

  • Set the return method and Approved URL at order level (apply to individual sales) from the Generate Links area, after enabling the Enable return after sale checkbox.
  • Set the return method and Approved URL at product level (apply to all successful sales of this product) from the Fulfillment area of the product page, after enabling the Enable return after sale checkbox.
  • Set the return method and Approved URL at account level (apply to all successful orders, irrespective of the product ordered) from your 2Checkout Merchant Control Panel by navigating to Dashboard → Integrations → Webhooks & API → Redirect URL, and select the Enable return after sale checkbox.

Links IN thank you page

The shopper is sent to the Thank You Page, which will display a link that will act as a redirect to the Approved URL.

With the return method set to Link in Thank You Page, the shopper will be taken to the Thank You Page after completing a successful purchase. This page will feature a redirect link. When clicked, the shopper (and collected sale parameters if the case) is directed to the provided Approved URL via GET.

HEADER REDIRECT

Set the return method to Header Redirect to have the Approved URL immediately displayed to the shoppers, while they still remain on our server.

The shopper will be immediately redirected to your Approved URL. Using this method, the sale parameters will be returned along with the shopper (in case of product/order URL).

DIRECT RETURN

Note to user NOTE:  Direct return is available only to clients upgraded from previous 2Checkout Admin Area.

With the return method set to Direct Return, sale parameters will be posted automatically to the approved URL while fetched by our server and displayed to the buyer. When using this return method, the Approved URL will be masked to the customer, while the experience provided would be that of a 2Checkout domain.

This method can be used with redirects as long as each page outputs more than 255 characters of content to the browser. If Direct Return encounters a page that redirects without outputting content the process will fail and the customer will be sent to our standard Order Processed page. This generally occurs with a header redirect from your Approved URL when that URL outputs less than 255 characters of content to the browser.

Approved URL priority

Depending on the cPanel URL settings and the return methods you have in place, the priority of the approved URL will be the following:

  • Priority I: Order level – with corresponding Approved URL set at order level. 
  • Priority II: Product level – with corresponding return method, has priority if there is no order level return URL and there is only one product with product level Approved URL set.
  • Priority III: Account level – with corresponding return method set at vendor account level is applied in any of the following situations:
    • There are more than one products in the cart that have approved URLs set, and there is no order level approved URL.
    • None of the products have approved URL set and there is no order level URL set.

 

Order session content

Overview

The object below is returned directly or within a successful response from the following API requests:

Retrieve session content                              Retrieve contents with prefill                                         Retrieve VAT or sales tax

Session contents object

Parameters                                                                                                       Type/Description

Errors

 

Array of strings

 

 

Payment gateway processing errors.

Items

Array of objects

    Details below. 

 

ProductDetails

Object

      Details below. 

 

 

Name

String

 

 

 

Product name.

    ShortDescription String
      Product short description.
    Tangible Boolean
     

Possible values:

  • TRUE - for physical products
  • FALSE - for digital products
    IsDynamic Boolean
     

Possible values:

  • TRUE - for dynamic products
  • FALSE - for catalog products

 

 

ExtraInfo

String

 

 

 

The text entered in the Additional information field when generating Buy links, or via the INFO[PRODUCT_ID] parameter used in Buy links.

 

 

RenewalStatus

Boolean

 

 

 

  • TRUE for orders renewing subscriptions.
  • FALSE for all other orders: new purchases, upgrades.

 

 

Subscriptions

Object

        Details below. 

 

 

 

SubscriptionReference

String

 

 

 

 

Unique, system-generated subscription identifier.

 

 

 

PurchaseDate

String

 

 

 

 

The date time stamp when shoppers acquired their subscriptions corresponding to the moment when the 2Checkout system marks the purchase as finished. Format (YYYY-MM-DD HH:mm:ss). Default GMT+02:00.

 

e.g. 2015-08-11 15:18:52

 

 

 

SubscriptionStartDate

String

 

 

 

 

 

Example: 2015-09-29 17:57:59

 

 

 

ExpirationDate

String

 

 

 

 

The date time stamp of upcoming renewal/expiration for subscriptions not taking into account grace period settings.

 

Format (YYYY-MM-DD HH:mm:ss). Default GMT+02:00.

 

e.g. 2015-09-11 15:18:52

 

 

 

Lifetime

Boolean

 

 

 

 

  • TRUE – For non-recurring, evergreen subscriptions.
  • FALSE– For recurring subscriptions with a specific billing cycle from 7 days to 36 months.

 

 

 

Trial

Boolean

 

 

 

 

  • TRUE – For trial subscriptions.
  • FALSE– For non-trial, recurring subscriptions with a specific billing cycle from 7 days to 36 months.

 

 

 

Enabled

Boolean

 

 

 

 

  • TRUE – For active and past due subscriptions.
  • FALSE– For expired and cancelled subscriptions.

 

 

 

RecurringEnabled

Boolean

 

 

 

 

  • TRUE - customers opted for subscriptions to renew automatically when they expire.
  • FALSE- customers did not choose to renew the subscription automatically.

                    

PriceOptions

Array of strings

 

 

Product price options.

 

Price

Object

 

 

This object returns the price per unit at order line level.

 

In the case of trials, the object returns the costs for the trial to full subscription conversion.

 

 

UnitNetPrice

Float

 

 

 

The value per product unit, excluding sales tax/VAT expressed in the payment currency.

 

 

UnitGrossPrice

Float

 

 

 

Total value per product unit, including sales tax/VAT expressed in the payment currency. UnitGrossPrice does not reflect any discounts.

 

 

UnitVAT

Int
 

 

 

Sales tax/VAT per product unit expressed in the payment currency.

 

 

UnitDiscount

Int

 

 

 

Value of the discount per product unit expressed in the payment currency.

 

 

UnitNetDiscountedPrice

Float

 

 

 

The value per product unit, expressed in the payment currency, excluding sales tax/VAT, from which 2Checkout deducts the unit discount.

 

 

UnitGrossDiscountedPrice

Float

 

 

 

Total costs shoppers incur per product unit, expressed in the payment currency. This value includes sales tax/VAT, 2Checkout and affiliate commissions, but 2Checkout deducts the value of any discounts.

 

 

UnitAffiliateCommission

Int

 

 

 

Value of the affiliate commission per product unit calculated expressed in the payment currency.

 

2Checkout deducts discounts from the costs incurred by shoppers before calculating affiliate commissions.

 

2Checkout does not take into account shipping costs when calculating affiliate commissions.

 

NULL when 2Checkout does not apply an affiliate commission.

    VATPercent Int
      Percentage of VAT charged on the order.
    HandlingFeeNetPrice Int
      Handling fee applied to your net price configuration. 
    HandlingFeeGrossPrice Int
      Handling fee applied to your gross price configuration.

 

 

Currency

Optional (string)

 

 

 

The currency ISO code for the payment - ISO 4217. Example: usd.

 

 

NetPrice

Optional (double)

 

 

 

The value per order line, excluding sales tax/VAT expressed in the payment currency.

 

 

GrossPrice

Optional (double)

 

 

 

Total value per order line, including sales tax/VAT expressed in the payment currency. UnitGrossPrice does not reflect any discounts.

 

 

NetDiscountedPrice

Optional (double)

 

 

 

The NetPrice value per order line, excluding sales tax/VAT, from which 2Checkout deducts discounts. NetDiscountedPrice is expressed in the payment currency.

 

 

GrossDiscountedPrice

Optional (double)

 

 

 

Total costs shoppers incur per order line, expressed in the payment currency. This value includes sales tax/VAT, 2Checkout and affiliate commissions, but 2Checkout deducts the value of any discounts.

 

Example:

  • UnitNetPrice: 99
  • UnitGrossPrice: 120.39
  • UnitVAT: 21.39
  • UnitDiscount: 9.9
  • UnitNetDiscountedPrice: 89.1
  • UnitGrossDiscountedPrice: 110.49
  • UnitAffiliateCommission: 22.28
  • Currency: "usd"
  • NetPrice: 198
  • GrossPrice: 240.77
  • NetDiscountedPrice: 178.2
  • GrossDiscountedPrice: 220.97
  • Discount: 19.8
  • VAT: 42.77
  • AffiliateCommission: 44.56

 

 

Discount

Optional (double)

 

 

 

Value of the discounts per order line expressed in the payment currency.

 

 

VAT

Optional (double)

 

 

 

Value of sales tax/VAT per order line expressed in the payment currency.

 

 

AffiliateCommission

Optional (double)

 

 

 

Value of the affiliate commission per order line, calculated from the NetDiscountedPrice expressed in the payment currency. Or NULL. 2Checkout does not take into account shipping costs when calculating affiliate commissions.

  LineItemReference String
    System-generated item reference.
  PurchaseType String
   

Possible values:

  • PRODUCT
  • SHIPPING
  • TAX
  • COUPON
  ExternalReference String
    External order reference that you control.

 

Code

String

 

 

Unique product identifier your control. Max length 256 characters.

 

Quantity

Int

 

 

Number of units

 

SKU

String

 

 

SKU identifier.

 

CrossSell

Object

      Details below. 

 

 

ParentCode

String

 

 

 

The product code of the master product you set to trigger the campaign.

 

 

CampaignCode

String

 

 

 

Unique, system-generated identifier for cross-sell campaigns.

 

Trial

Object

      Details below. 

 

 

Period

Int

 

 

 

The length of the trial subscription lifetime in days.

 

 

GrossPrice

Float

 

 

 

Total trial price in the payment currency before 2Checkout deducts any taxes, discounts, etc.

 

 

VAT

Float

 

 

 

The total value of taxes for the trial in the payment currency, before 2Checkout deducts any discounts.

 

 

NetPrice

Float

 

 

 

Total trial price in the payment currency, not including taxes, before 2Checkout deducts any discounts.

 

AdditionalFields

Array of objects

      Details below. 

 

 

Code

String

 

 

 

The alpha-numeric characters, underscores and dashes that are set as the field identifier.

 

 

Text

String

 

 

 

Field text visible to shoppers in the cart.

 

 

Value

String

 

 

 

Selected field value.

 

Promotion

Object

      Details below. 

 

 

Name

String

 

 

 

Promotion name.

 

 

Description

String

 

 

 

Promotion description.

 

 

StartDate

String

 

 

 

The date when you set the promotion to start. NULL for promotions that start immediately after you create them.

 

 

EndDate

String

 

 

 

The date when you set the promotion to end. NULL for promotions you want active indefinitely.

 

 

MaximumOrdersNumber

Int

 

 

 

2Checkout only applies the promotion to a maximum number of orders you define.

 

Can be NULL if you want the promotion to apply to an unlimited number of orders.

 

 

MaximumQuantity

Int

 

 

 

Discount only applies to a maximum number of units purchased through a single order, smaller than the quantity you defined. Shoppers purchase any extra units at full price. Can be NULL if you want the promotion to apply to an unlimited number units.

 

 

InstantDiscount

Boolean

 

 

 

The instant discount option auto-applies the discount for ALL selected products, without the need for shoppers to enter a discount coupon.

 

 

Coupon

String

 

 

 

Promotion coupon/voucher.

 

 

DiscountLabel

String

 

 

 

Discounts can be set as a percentage from the product price or as a fixed amount in the chosen currency.

 

 

Enabled

String

 

 

 

true or false, depending on whether a promotion is active or disabled. 

 

 

Type

String

 

 

 

  • REGULAR – product/cart line level discounts.
  • ORDER – quantity discounts.
  • GLOBAL – order-level discounts.

Promotions

Array of objects

    Details below. 

 

Name

String

 

 

Promotion name.

 

Description

String

 

 

Promotion description.

 

StartDate

String

 

 

The date when you set the promotion to start. NULL for promotions that start immediately after you create them.

 

EndDate

String

 

 

The date when you set the promotion to end. NULL for promotions you want active indefinitely.

 

MaximumOrdersNumber

Int

 

 

2Checkout only applies the promotion to a maximum number of orders you define.

 

Can be NULL if you want the promotion to apply to an unlimited number of orders.

 

MaximumQuantity

Int

 

 

Discount only applies to a specific number of units purchased at once, smaller than the maximum quantity you defined. Shoppers purchase any extra units at full price. Can be NULL if you want the promotion to apply to an unlimited number units.

 

InstantDiscount

Boolean

 

 

The instant discount option auto-applies the discount for ALL selected products, without the need for shoppers to enter a discount coupon.

 

Coupon

String

 

 

Promotion coupon/voucher.

 

DiscountLabel

String

 

 

Discounts can be set as a percentage from the product price or as a fixed amount in the payment currency.

 

Enabled

String

 

 

true or false, depending on whether a promotion is active or disabled. 

 

Type

String

 

 

  • REGULAR – product/cart line level discounts.
  • ORDER – quantity discounts.
  • GLOBAL – order-level discounts.

AdditionalFields

Array of objects

    Details below. 

 

Code

String

 

 

The alpha-numeric characters, underscores and dashes that are set as the field identifier.

 

Text

String

 

 

Field text visible to shoppers in the cart.

 

Value

String

 

 

Selected field value.

BillingDetails

Object

Details below

  Person      

Object

Details below

    FirstName   String
  Customer first billing name.
    LastName   String
  Customer last billing name.
    CountryCode   String
  Two-letters code for customer billing country.
    State   String
  Customer billing state.
    City   String
  Customer billing city.
    Address1   String
  Customer billing address.
    Address2   String
  Customer additional address information.
    Zip   String
        Customer billing zip code.
    Email   String
        Customer billing email.
    Phone   String
        Customer billing phone.
    Company   String
        Customer billing company.
    FiscalCode   String
  Customer billing fiscal code.
DeliveryDetails

Object

Details below

  Person      

Object

Details below

    Phone   String
  Customer delivery phone number.
    FirstName   String
  Customer delivery first name.
    LastName   String
  Customer delivery last name.
    Company   String
  Customer delivery company.
    Email   String
  Customer delivery email.
    Address1   String
  Customer delivery address.
    Address2   String
  Customer additional delivery address.
    City   String
  Customer delivery city.
    Zip   String
  Customer delivery zip code.
    CountryCode   String
  Customer delivery country code.
    State   String
  Customer delivery state.
DeliveryInformation

Object

Details below

  ShippingMethod    

Object

Details below

    Code     String
          System-generated code assigned to the shipping method.
    TrackingURL   String
          Tracking URL assigned to the shipping method. 
    TrackingNumber   String
        Tracking Number provided to customers, used for obtaining more information about their package.
    Comment   String
  Additional information regarding the physical delivery of the product.

Currency

String

 

The currency ISO code for the payment - ISO 4217. Example: usd.

NetPrice

Float

 

Order value excluding sales tax/VAT expressed in the payment currency.

GrossPrice

Float

 

Total order value, including sales tax/VAT expressed in the payment currency. GrossPrice does not reflect any discounts.

NetDiscountedPrice

Float

 

The NetPrice order value excluding sales tax/VAT, from which 2Checkout deducts discounts. NetDiscountedPrice is expressed in the payment currency.

GrossDiscountedPrice

Float

 

Total costs shoppers incur, expressed in the payment currency. This value includes sales tax/VAT, 2Checkout and affiliate commissions, but 2Checkout deducts the value of any discounts.

 

For example:

  • Currency: "usd"
  • NetPrice: 396
  • GrossPrice: 486.29
  • NetDiscountedPrice: 376.2
  • GrossDiscountedPrice: 466.49
  • Discount: 19.8
  • VAT: 90.29
  • AffiliateCommission: 94.05

Discount

Float

 

Value of the discounts for an order expressed in the payment currency.

VAT

Float

 

Value of sales tax/VAT expressed in the payment currency.

AffiliateCommission

Float

 

Value of the affiliate commission for the order calculated from the NetDiscountedPrice expressed in the payment currency. Or NULL. 2Checkout does not take into account shipping costs when calculating affiliate commissions.

 

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