Skip to main content

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. Avangate 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

 

BasicPrice

Object

Currency

String

 

The currency ISO code used for shipping costs - ISO 4217.

Amount

Float

 

Basic price.

 

Quantities

Object

MinQuantity

String

 

The minimum quantity of volume discounts. Default is 1.

MaxQuantity

String

 

The maximum quantity of volume discounts. Default is 99999.

 

PriceOptionsAssigned

Object

Code

String

 

Price option identifier.

Options

Array of strings

 

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

Response

bool(true)

Request

<?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)) {
//        var_dump($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.0/';
 
$merchantCode = "YOURCODE12345";//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(gmdate('Y-m-d H:i:s')) . gmdate('Y-m-d H:i:s');
$hash = hash_hmac('md5', $string, $key);
 
$i = 1; // counter for api calls
 
// Call the login method for authentication
 
$jsonRpcRequest = new stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method = 'login';
$jsonRpcRequest->params = array($merchantCode, gmdate('Y-m-d H:i:s'), $hash);
$jsonRpcRequest->id = $i++;
 
$sessionID = callRPC($jsonRpcRequest, $host);
 
 
/**
 * ProductCode = 'PDOWNFILE'
 * Default currency: EUR
 *
 * Dynamic pricing configuration
 *
 * Send two prices, including the required one for the default currency
 * The method will append the prices for the sent entries, without removing the previous values
 *
 * If the quantities intervals were not defined then they will be set.
 * If the quantities overlap with existing defined intervals, an Exception will be thrown.
 */
 
 
// make call
$Prices = array();
 
$Price = new stdClass(); // BasicPrice object
$Price->Amount = 140;
$Price->Currency = 'USD';
$Prices[] = $Price;
 
$Price = new stdClass(); // BasicPrice object
$Price->Amount = 80;
$Price->Currency = 'EUR';
$Prices[] = $Price;
 
$Quantities = new stdClass(); // QuantityInterval object
$Quantities->MinQuantity = 1;
$Quantities->MaxQuantity = 10;
 
$PriceOptions = array();
 
$PricingConfigurationCode = '5553603382';
$type = 'regular';
 
$jsonRpcRequest = array (
                                                                                                                                                                                                                                                                    'jsonrpc' => '2.0',
                                                                                                                                                                                                                                                                    'id' => $i++,
                                                                                                                                                                                                                                                                    'method' => 'savePrices',
                                                                                                                                                                                                                                                                    'params' => array($sessionID, $Prices, $Quantities, $PriceOptions, $PricingConfigurationCode, $type)
);
 
$response = callRPC((Object)$jsonRpcRequest, $host);
var_dump ($response);
 
// will output:
// bool(true)
 
 
/**
 * ProductCode = 'PDOWNFILE'
 * Default currency: EUR
 *
 * Flat pricing configuration
 * Has the VOLTAGE pricing option group assigned and marked as required.
 * If prices are sent WITHOUT setting the pricing option group and options will set the price but without setting values for the options prices.
 */
 
// Call the login method for authentication
$string = strlen($merchantCode) . $merchantCode . strlen(gmdate('Y-m-d H:i:s')) . gmdate('Y-m-d H:i:s');
$hash = hash_hmac('md5', $string, $key);
 
$i = 1; // counter for api calls
$jsonRpcRequest = new stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method = 'login';
$jsonRpcRequest->params = array($merchantCode, gmdate('Y-m-d H:i:s'), $hash);
$jsonRpcRequest->id = $i++;
$sessionID = callRPC($jsonRpcRequest, $host);
 
// make call
$Prices = array();
 
$Price = new stdClass(); // BasicPrice object
$Price->Amount = 80;
$Price->Currency = 'EUR';
$Prices[] = $Price;
 
// if PricingOption group is not required, will set price for combination of QuantityInterval - no-pricing-option-value.
$PriceOptions = array();
 
// if PricingOption group is required, then send options by assigning a PriceOptionsAssigned object (group code and options)
// $optionAssigned = new stdClass(); // PriceOptionsAssigned
// $optionAssigned->Code = 'VOLTAGE';
// $optionAssigned->Options = array('220V'); // radio option group
// $PriceOptions = array($optionAssigned);
 
$Quantities = new stdClass(); // QuantityInterval object
$Quantities->MinQuantity = 1;
$Quantities->MaxQuantity = 99999; // default maximum value
 
$PricingConfigurationCode = '54AA62CA31'; // flat pricing configuration
$type = 'regular';
 
$jsonRpcRequest = array (
                                                                                                                                                                                                                                                                    'jsonrpc' => '2.0',
                                                                                                                                                                                                                                                                    'id' => $i++,
                                                                                                                                                                                                                                                                    'method' => 'savePrices',
                                                                                                                                                                                                                                                                    'params' => array($sessionID, $Prices, $Quantities, $PriceOptions, $PricingConfigurationCode, $type)
);
 
$response = callRPC((Object)$jsonRpcRequest, $host);
var_dump ($response);
 
 
 
/**
 * ProductCode = 'PDOWNFILE'
 * Default currency: EUR
 *
 * Flat pricing configuration
 * Has the COLOR and scalenotmandatory pricing option group assigned and marked as required.
 */
// Call the login method for authentication
$string = strlen($merchantCode) . $merchantCode . strlen(gmdate('Y-m-d H:i:s')) . gmdate('Y-m-d H:i:s');
$hash = hash_hmac('md5', $string, $key);
 
$i = 1; // counter for api calls
$jsonRpcRequest = new stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method = 'login';
$jsonRpcRequest->params = array($merchantCode, gmdate('Y-m-d H:i:s'), $hash);
$jsonRpcRequest->id = $i++;
$sessionID = callRPC($jsonRpcRequest, $host);
 
// make call
$Prices = array();
 
$Price = new stdClass(); // BasicPrice object
$Price->Amount = 10;
$Price->Currency = 'EUR';
$Prices[] = $Price;
 
$optionAssigned = new stdClass(); // PriceOptionsAssigned
$optionAssigned->Code = 'COLOR'; // checkbox pricing option group, multiple values are allowed
$optionAssigned->Options = array('cyan', 'magenta');
$PriceOptions = array($optionAssigned);
 
$optionAssigned = new stdClass(); // PriceOptionsAssigned
$optionAssigned->Code = 'scalenotmandatory'; // interval pricing option group
$optionAssigned->Options = array('scalenotmandatory-1-5');
$PriceOptions = array($optionAssigned);
 
$Quantities = new stdClass(); // QuantityInterval object
$Quantities->MinQuantity = 1;
$Quantities->MaxQuantity = 99999; // default maximum value
 
$PriceOptions = array();
 
$PricingConfigurationCode = '54AA62CA31'; // flat pricing configuration
$type = 'regular';
 
$jsonRpcRequest = array (
                                                                                                                                                                                                                                                                    'jsonrpc' => '2.0',
                                                                                                                                                                                                                                                                    'id' => $i++,
                                                                                                                                                                                                                                                                    'method' => 'savePrices',
                                                                                                                                                                                                                                                                    'params' => array($sessionID, $Prices, $Quantities, $PriceOptions, $PricingConfigurationCode, $type)
);
 
$response = callRPC((Object)$jsonRpcRequest, $host);
var_dump ($response);
?>

Follow-up emails for cart abandons and free trials

Overview

Convert more leads into buyers by sending customized follow-up email messages for unfinished payments, shopping cart abandons, and free trial downloads. The 2Checkout lead management system is extremely simple to use and effective, enabling you to boost conversion rates and increase revenue.

The 2Checkout lead management capabilities are designed to:

  • Track leads and collect lead information.
  • Send smart follow-ups (follow-up settings are fully customizable, including the when/ what/ and where; you also have the option of localizing follow-ups in different languages, as supported by your account).
  • Monitor, measure the evolution and optimize lead management campaigns.
  • Take advantage of data mobility to export leads and introduce the information in your own database.
  • Include retry payment links into unfinished payments follow-up emails based on the origin (custom shopping cart, API or ConvertPlus) of the order.

Availability

Lead management is available for unfinished payments, shopping cart abandons, and free trial downloads by default for all 2Checkout accounts, and, currently, only for catalog products.

Lead sources

The 2Checkout system is designed to harvest leads from multiple sources, supporting scenarios such as:

Unfinished payments

Placed orders for which the payment process was not finished - reasons can vary: expired cards, insufficient funds, authorization declined, etc.

Shopping cart abandons

Shopping cart abandonment is a common issue and happens for various reasons: comparison shopping, lack of money, undecided shoppers, pricing research before trial & buy. A surprising number of shoppers return within a few days to continue shopping, and it's up to you to ease their conversion into paying customers.

Free trial downloads

You can use leads from free trial downloads and turn them into buyers. This source generates leads only if your download links point to the 2Checkout "downloads trials" system, with the system requesting shopper email addresses.

What to do with your leads

Follow-up emails are a very effective method for converting shopping cart abandons and unfinished payments into sales. The same goes for free trial downloads, without payment details.

The 2Checkout system supports:

  • collecting lead information;
  • setting up notification emails;
  • configuring notification type (basic/promotion with discount);
  • accessing the leads database;
  • creating and exporting reports.

Set up a follow-up campaign

To start using the follow-up for cart abandons feature, log in to your Merchant Control Panel and navigate to Marketing tools -> Lead management to set up and manage data collection and follow-up campaigns.

The Order Recovery section offers settings designed to configure and manage order recovery follow-up emails for:

  • Unfinished payments - by default, the 2Checkout system sends a simple follow-up email, two hours after the order was placed. You can edit and set your own follow-up rules, such as the number of messages, follow-up type, time intervals, etc.
  • Shopping cart abandons - you need to set your own follow-up rules to communicate with shoppers that abandon the cart, including the number of emails and type (Basic, Promotional), time intervals, etc.
  • Free trials - enable lead collection via the Free trial downloads area. Configure the data to be harvested and manage follow-ups for this lead source.

Accelerate shopper interactions through follow-up messages

The latest update to the 2Checkout lead management system is focused on accelerating shopper interactions through follow-up messages. In scenarios in which transaction failures block placed orders from being finalized, shoppers will be contacted immediately and guided through the necessary steps to complete their purchase successfully.

The first follow-up email for an unfinished payment can reach the customer in as little as one hour since the order was placed. Reducing the wait time for the 2Checkout lead management system to come into effect ensures increased efficiency of the follow-up messages and contributes to boosting conversion rates.

Shoppers using credit and debit cards and PayPal will receive a follow-up email after 60 minutes from the moment when the order was placed. In the case of abandoned shopping carts, the 2Checkout system can send the first follow-up email as soon as 20 minutes (you can configure the interval up to 90 days) after the purchase process was interrupted, provided that the shopper's first name, last name and email address were introduced.

The recommended email sequence includes 3 notifications for cart abandonment and unfinished payments, as follows:
•    Email 1: within one hour (no discount offer yet)
•    Email 2: twenty-four hours (can include a discount offer for cart abandonment emails)
•    Email 3: seventy-two hours (can include a discount offer for both cart abandonment and unfinished payments emails)

For unfinished payments merchants can set only basic follow ups, and not promotional follow-ups that also include a discount.

This email sequence is recommended for online payment methods (credit card, Paypal). It's important to keep in mind that these 3 emails should have different subject lines, content, and graphics. Also, if you're using links with the short form on the main shopping cart, the lead management emails should use the same form for links.

Unfinished payments

Guidance for unfinished payment follow-up emails is available here.

Shopping cart abandons

Follow-up availability per cart type

Type Default  ConvertPlus InLine
New acquisition
Manual renewal/ upgrade
By default, if you're using the default cart, the abandoned cart follow-up will be sent for new acquisition, manual renewal and upgrade flows. If you wish to only send these for the new acquisition flow, please enable the Only for new acquisitions (supported only in the Default flow) checkbox.

Follow-up messages are sent when shoppers go through the stages of the purchase process but abandon the cart before of actually placing the order.

  • Shopper data is collected by default by 2Checkout during the ordering process.
  • Up to 5 notification emails can be sent.
  • Flexible notification type (basic/ promotion)
No follow-up campaigns are created by default by the 2Checkout system for abandoned carts.
  1. Click on the Edit button. Order recovery unfinished payment
  2. Enable order recovery follow-up.
  3. Set the time interval starting with 20 minutes. You can set the interval as high as 90 days.
  4. Select the type of follow-up from the options available:
    • Basic follow-up: message includes a link to the abandoned shopping cart; several follow-ups can be sent.
    • Promotional follow-up: message includes a link to the abandoned shopping cart with an additional promotion applied automatically; several follow-ups can be sent. You'll need to select one of the active promotions that you defined in the Promotions area of the Control Panel.
    • A total of 5 follow-up emails can be configured. Once added, existing follow-up emails can be removed at any time, but they cannot be edited. You'll be able to view and customize the follow-up emails from the Email template manager section.

Shopping cart abandons

Shopping cart abandonment is a common issue and happens for various reasons: comparison shopping, lack of money, undecided shoppers, pricing research before trial & buy. A surprising number of shoppers return within a few days to continue shopping, and it's up to you to ease their conversion into paying customers. Here is an easy way to adopt the abandoned cart follow-up configuration:

Type When Why?
Basic follow-up 1 hour

Speed is of the essence. Short attention span plagues online shoppers, so the sooner the lead management system can generate and send a follow-up message the better. As a rule of thumb, the first follow-up should reach potential customers within one hour to be as efficient as it can.

Make it easy for customers to return to the shopping cart without having to go back through the purchase process.

Basic follow-up 1 day
Promotional follow-up 3 days

A little incentivizing goes a long way. Offer discounts to make it very hard for an already interested customer to say no.

For ConvertPlus and InLine cart initiated orders, promotions supported are product level promotions (regular and special price promotions) managed directly in the Promotions area.

Buy-links included in the email will take users to a shopping cart containing the products added to the cart. Links to abandoned shopping carts also include any additional fields information contained in the initial shopping cart. Prices are calculated according to the pricing configurations of the products in cart at the time when the link is accessed. Promotions are taken into account only if they're still active and impacting the products in the cart. On the fly pricing is ignored in the default flows initiated orders, however, it is supported for ConvertPlus and InLine orders.

Follow-up emails for Legacy cart, ConvertPlus and InLine cart abandons are available for new purchase flows and include support for:

  • Product types:
    • Catalog products with/ without selected pricing options, catalog products with on the fly pricing, dynamic products (Note: Dynamic products are only supported on ConvertPlus).
    • Digital and/or physical products.
  • All Legacy cart and ConvertPlus themes, including Inline cart
  • Lead information collected and maintained:
    • Billing details.
    • Shipping details and selected shipping methods.
    • Regular and special price promotions applied in the cart.
    • Custom parameters included in the checkout process.
    • Order and product references: order external reference, customer reference, customer external reference, item external reference).
    • Additional product and order fields sent in the checkout process or inputted by the shopper in the checkout form.

Free trial downloads

Unlike order recovery for unfinished payments and shopping cart abandons, you also have the possibility to configure the lead collecting settings for Free Trial Downloads.

  1. Click Trial Lead Collection settings.
  2. Select the products for which you want leads to be collected from the users who want to download the trial version. Items listed in the Lead collecting settings area, need to feature a trial link.
  3. Click to edit your product, select the navigation tab, scroll down and enter the trial URL in the Download trial version (http:// or ftp://) field. Only products for which a link was introduced in the Download trial version (http:// or ftp://) field will also be listed under the Lead collecting settings items area.
  4. You can make it mandatory for customers to provide the following data ahead of downloading the trial: email address (required by default), first name, last name, address, city, zip or postal code, country, and company name.
  5. If you use additional fields in the shopping cart, you can also make some of them mandatory for trial downloads.

With the Trial Lead collecting settings out of the way, you can move to the next stage:

  1. Click Edit follow-up settings.
  2. Enable order recovery follow-up.
  3. Set the time interval from 1 to 255 days.
  4. Select the type of follow-up from the options available:
    • Basic follow-up: message includes a link to the abandoned shopping cart; several follow-ups can be sent.
    • Promotional follow-up: message includes a link to the abandoned shopping cart with an additional promotion applied automatically; several follow-ups can be sent. You'll need to select one of the active promotions that you defined in the Promotions area of the Control Panel.
Free trials with payment details and paid trials are not impacted by the 2Checkout lead management system messages, since the platform will send out Trial automatic purchase notifications instead of follow-up emails.

A total of 5 follow-up emails can be configured. Once added, existing follow-up emails can be removed at any time, but they cannot be edited. You'll be able to view and customize the follow-up emails from the Email template manager section.

No follow-up campaigns are created by default by the 2Checkout system for free trial downloads.

Leads Database

The Leads database section helps you manage lead information:

  • view your leads
  • export leads
  • add data to your own database
  • email reports to your partners, etc.

Use the Search functionality to find leads from any Source, but you can also narrow down the query only to:

  • Shopping cart abandons
  • Free trial downloads

By using the Type filter, you can choose to focus your reports on:

  • New (New leads)
  • Used (Leads already used)
  • Used -> Success (Converted leads)
  • Follow-ups not stopped (Follow-ups that generated successful conversions)
  • Stopped from follow-ups (Follow-ups that didn't generate conversions)

For a more granular view, you can search for leads by selecting specific:

  • Dates (statistics are available starting with the day prior to the moment when the report is generated)
  • Emails
  • Languages
  • Countries
  • Products

Via the Export pop-up menu reports can be saved locally as CSV (comma separated values) or Excel files. The Export leads menu also allows you to mark items as used.

Generate a leads report

To create a new report of generated leads, follow these steps:

  1. Log in to your Merchant Control Panel.
  2. Navigate to Marketing ToolsLead management.
  3. On the Lead management page, click on the Leads database tab.
  4. Choose the filter you want to apply to your query and click Search.
    Leads export manager
  5. You can then choose to export your reports in CSV file formats by clicking the Export button.

Exported reports show the latest 20.000 leads from the selected interval. To export more than 20.000 leads, generate multiple reports on shorter time intervals.

Measure results with Follow-up Reports

The follow-up report allows you to:

  • Access details on the volume of follow-up emails that have been sent per each lead source type.
  • Gain insight into the success rate of follow-up messages.
  • Get an overview of the revenue generated from follow-ups.

The follow-up reports are extremely flexible: you can filter by language, country, product, so you can see exactly which follow-up campaigns work best and improve conversion rates.

Custom follow-up emails

Access the follow-up emails that the 2Checkout system sends out according to your configured lead management campaigns in the Email template manager area of the Merchant Control Panel, under Marketing tools.

The follow-up messages can be customized through the addition of text. Contact 2Checkout directly if would like to use follow-up email personalization.

FAQ

  • What will the follow-up email buy-link contain? 
    In the follow-up email, a ConvertPlus or InLine cart link will be provided for the shopper to finalize the initiated order.
  • Does this cost me extra?
    No. There is no fee associated with the activation or the use of Lead management cart abandons functionality.
  • Will the ConvertPlus cart share the same look and feel as the current cart I am using? 
    ConvertPlus and InLine cart will also save the customizations applied in the initiated order.
  • What are the unsupported use cases in ConvertPlus cart follow-up reminders?
    In the current implementation orders initiated via connector/third-party integration and order initiated for manual renewals are not supported.
  • Are the cart abandon buy-links secured?
    Yes, leads are signed using the merchant Secret Word and the signature generation and validation functionality implemented in ConvertPlus. This does not require any effort on your side and it is a process performed and managed by the system.
  • What will the reminder email contain for an order initiated via the InLine cart?
    The reminder email will contain a buy-link that will open an InLine cart in the browser.

Create partner invoice

Overview

Generate a partner invoice for one or more orders, based on their unique reference numbers.

Requirements

You can include only confirmed/approved orders in partner invoices. To include multiple orders in the same partner invoice they must share the same currency.

Parameters

Parameters Type/Description
sessionID Required (String)
  Session identifier, output of the Login method. An exception is thrown if the values are incorrect.
Sales Required (Array of strings)
  Array with the reference number of the orders you want included on the same partner invoice.

Response

Parameters Type/Description

Proforma

Object

 

A partner invoice object with the structure detailed below.

 

Number

String

 

 

Unique partner invoice identifier

 

CreateDate

String

 

 

Partner invoice creation date

 

DueDate

String

 

 

The date before which the partner needs to pay the invoice.

 

Status

String

 

 

Partner invoice status. Possible values:

  • Unpaid
  • Overdue
  • Paid
  • Canceled

 

Currency

String

 

 

Partner invoice currency ISO code

 

Total

String

 

 

Total costs of all orders included in the partner invoice

 

PaymentMethod

String

 

 

Payment method used to pay for the partner invoice. NULL if the invoice was not paid.

 

Orders

String / Array

 

 

Order references array of strings. A partner invoice only groups approved orders with the same currency.

 

BusinessModel

String

 

 

The business model governing the relationship between you and the partner company. Possible values:

  • RESELLER: payments made to Avangate as a master reseller
  • SERVICE_PROVIDER: direct payments to your accounts via wire transfer

 

ProformaPDF

String

 

 

Partner invoice PDF download link. Valid for 1 hour.

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

$sales = array(
'ORDER_REFERENCE_1',
'ORDER_REFERENCE_2'
);

try {
    $NewProforma= $client->createProforma($sessionID, $sales);
} catch (SoapFault $e) {
    echo "NewP: " . $e->getMessage();
    exit;
}
var_dump ("NewP ", $NewProforma);

Errors

Error Description

INVALID_ORDER

You must provide an array with orders

INVALID_PARTNER

No partner was set.

INVALID_PARTNER

This partner does not have rights to create a partner invoice.

INVALID_ORDER

We cannot create partner invoices for some of your orders.

INVALID_ORDER

Some of your orders already have a partner invoice invoice.

INVALID_ORDER

The order is not approved. We cannot create a partner invoice.

INVALID_ORDER

Your orders must all have the same currency. They now have:

Error handling for issueRefund

Overview

Learn how to tackle the common errors that may arise when issuing refunds via 2Checkout API.

Common error codes 

Error code Description

ORDER_REF missing or format incorrect 

The order reference number was not provided, or has an invalid format. Check the order reference provided.

ORDER_AMOUNT missing or format incorrect 

Refundable amount was not provided, or it has an invalid format. Check the order amount provided.

Order already canceled 

Order is already canceled.

Invalid ORDER_REF 

The order reference number is not correct. Check the order reference provided.

Invalid ORDER_AMOUNT 

The refundable amount is invalid. Check the order amount provided.

PRODUCTS_CODES missing or format incorrect 

Products codes were not provided, or have an invalid format. Check the product codes provided.

PRODUCTS_QTY missing or format incorrect 

Product quantity was not provided, or has an invalid format. Check the product quantity provided.

Invalid PRODUCTS_QTY 

The product quantity is not correct. Check the product quantity provided.

You have already placed a Total refund for this order. 

Order has been already refunded in total. Check again the current refund status of the order.

You already have a pending refund request. 

The order already has a pending refund request. Before issuing a new refund, the current request needs to be settled.

The maximum refundable amount for this order has been exceeded. 

The refundable amount cannot exceed the order amount. Check the refundable amount.

You cannot place a refund request due to the order's current status. 

The order needs to be in FINISHED status, before being refunded. Check the current order status.

You cannot place a refund request due to the order's payment details. 

The current customer payment details do not allow refund requests. Contact 2Checkout for additional details.

The allowed period to request a new refund for this order has expired. 

You are not able to issue a refund for this order at this moment. Contact 2Checkout for additional details.

Multiple refunds are not supported by this order's payment type. 

The payment method on this order does not allow multiple refunds.

Refunding not supported for this Cross Vendor Sale order. 

The order type does not allow refunds. Contact 2Checkout for additional details.

Order total is negative. 

The order total is negative. Send only positive order amounts.

You cannot place a refund request due to the order's approval status. 

The order cannot be refunded due to its approval status. Contact 2Checkout for additional details.

Multiple refunds are not supported by this order's terminal. 

The order cannot be refunded to due to its payment method terminal. Contact 2Checkout for additional details.

Partial reverse is not supported. 

Partial refunds are only supported for orders with “COMPLETE” status code. Contact 2Checkout for additional details.

Invalid product type. Refunds are available only for the following product types: REGULAR / BUNDLE / MEDIA / DOWNLOAD_INSURANCE, but not for DISCOUNT / SHIPPING. 

The product item cannot be refunded. Contact 2Checkout for additional details.

You cannot request a refund because a chargeback dispute was open for the order. 

You cannot issue a refund for orders that have a chargeback dispute open. 

Invalid REFUND_REASON

The refund reasons provided is not valid. In case you have custom refund reasons created, send one of their names as values. 

Set an external reference

Overview

Use the setExternalRef method in conjunction with setSubscriptionUpgrade.

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.

externalRef

Required (string)

 

External reference you control.

Response

Parameters Type/Description

Boolean

true or false depending on whether or not the operation succeeded.

Request

<?php

require ('PATH_TO_AUTH');

$externalReference = 'YOUR_EXTERNAL_REFERENCE';

try {
    $extRef = $client->setExternalRef($sessionID, $externalReference);
}
catch (SoapFault $e) {
    echo "extRef: " . $e->getMessage();
    exit;
}
var_dump("extRef", $extRef);

Upgrade a subscription

Overview

Retrieve information about the upgrade options for a specific subscription.

Parameters Type/Description

ProductInfo

Object

               

Details below.

 

ProductId

Int

 

 

Unique, system-generated product identifier belonging to the upgrade product.

 

ProductCode

String

 

 

Unique product identifier that you control belonging to the upgrade product.

 

ProductName

String

 

 

Product name

 

ProductVersion

String

 

 

The product version number that you control.

 

ProductEnabled

Boolean

 

 

Possible values:

0 – You disabled this product.

1 – You enabled this product.

 

ProductType

String

 

 

REGULAR or BUNDLE

 

Currency

String

 

 

The currency for prices. The currency ISO code used for the payment - ISO 4217.

 

DefaultCurrency

String

 

 

The product's default currency which is set in the Control Panel. The currency ISO code to be used for the payment - ISO 4217.

 

Price

Double

 

 

Product price. Can be null for flat pricing schemes. You need to call getPrice with Quantity, Currency and Price Options parameters to get a valid price.

 

GiftOption

String

 

 

True or false depending on whether the product can be gifted or not.

 

IdGroup

Int

 

 

Product Group ID number.

 

GroupName

String

 

 

The name of the Product Group.

 

ShortDescription

String

 

 

The product's short description.

 

ProductImage

String

 

 

URLs to the product images uploaded into the Avangate platform.

 

Languages

Array of strings

 

 

Array of ISO language codes for the product - ISO 639-1.

 

PriceIntervals

Array of objects

 

 

Pricing intervals.

 

PriceType

String

 

 

NET or GROSS

 

PriceSchema

String

 

 

FLAT or DYNAMIC

Quantity

Int

 

Number of units available for the upgrade order.

PriceOptions

Array of objects

 

Details below.

 

Id

String

 

 

Pricing options ID.

 

Name

String

 

 

Pricing options group name.

 

Description

String

 

 

The description of the Pricing options group

 

Required

Boolean

 

 

True or False depending on whether you set the Pricing options group asrequired or not.

 

Type

String

 

 

Pricing options group type:

  • COMBO
  • CHECKBOX
  • RADIO

INTERVAL

 

Options

Array of objects

 

 

Details below.

 

 

Name

String

 

 

 

The name of the option inside the Pricing options group

 

 

Value

String

 

 

 

The code of the option inside the Pricing options group

 

 

Default

Boolean

 

 

 

True or false.

 

 

Description

String

 

 

 

The description of the option inside the Pricing options group.

 

 

MinValue

Int

 

 

 

Start value of a scale interval.

 

 

MaxValue

Int

 

 

 

End value of a scale interval.

 

Pricing localization capabilities

Overview

2Checkout's pricing configuration capabilities enable you to tailor the price details of your products/subscription plans to specific markets or geographic regions. The price, currency, and pricing options set per product can easily adapt to each market, providing a powerful tool to support your localization/globalization strategy.

Example:

A product costs $30 for US-based shoppers and 25 Euro for those in Germany. The 2Checkout system's localization capabilities make it possible for shoppers located in the United States to see the $30 price when adding the product to cart, with the US as the preselected billing country. Similarly, shoppers in Germany will get the 25 Euro localized price, when their country is preselected according to geolocation detection. The flexibility of the 2Checkout system also enables localized prices to be swapped for one another when shoppers manually select the billing country.

Availability

2Checkout Enterprise Edition accounts. 

Requirements

Pricing localization capabilities require the following:

  1. Pricing Configurations enabled for your account.
  2. Enable geolocation by IP address. 2Checkout uses real-time geo-location to determine shopper locale. Geo-location is enabled by default and should be active to ensure that localized pricing will work for your products.
  3. To localize costs you first need to configure a new pricing configuration for a subscription plan/product on top of the Default.

Default pricing configuration

Each product features a Default pricing configuration designed to cover all available billing countries (it includes all markets as long as they aren't covered by any localized pricing strategies). 2Checkout defaults to this pricing configuration when IP geolocation is disabled.

2Checkout recommends you use pricing localization in tandem with IP geolocation. Without geo-location 2Checkout does not pre-select the billing country when shoppers first land in the shopping cart, and they will see the costs configured under the Default pricing configuration. 

Limitations

  1. You cannot localize the Default pricing configuration. 
  2. All new pricing configurations you add on top of the default are disabled by default until you edit the country details (assign at least one country to a pricing configuration to enable it for the shoppers in that specific market).
  3. Marking a new, custom, localized pricing configuration as Default disables the default pricing configuration previously in use (detail reflected by the Not active for eStore status).
  4. Transforming a custom, localized pricing configuration into the Default pricing configuration expands its country coverage worldwide, removing all its personalized localization settings.

Setup

  1. Click the Add countries link in the eStore billing countries column of a pricing configuration to start adding markets/regions: Europe, the Middle East, and Africa, Asia-Pacific, Latin America, Rest of the World, and North America.
  2. Select countries and assign them to the pricing configuration one by one or in bulk. Press and hold the Ctrl key to multi-select items. Once you added the countries for a local pricing configuration.
  3. Click Save to save localization details of the pricing configuration and to activate it. When you assign all countries in a geographical region to a pricing configuration, 2Checkout displays the name of that region displayed under the eStore billing countries column. 2Checkout displays a maximum of five assigned standalone markets under the eStore billing countries column, for multi-market localized pricing configurations.

How do localized pricing configurations work?

Localized pricing configurations override the default pricing configuration when 2Checkout detects the shopper country. If the 2Checkout system can't determine the country of a shopper, the shopping cart display prices in accordance with the Default pricing configuration. However, if the shopper selects a country for which you defined a localized pricing configuration, the price details adapt accordingly.

Shoppers from countries not covered by any of their localized pricing configurations also see the price details of the default pricing configuration.

You can associate a specific country ONLY with a single localized pricing configuration at any given time. Re-assigning a country to another localized pricing configuration removes the market automatically from the localized pricing configuration it was part of.

While going through the stages of the purchase process, shoppers will be presented with the price set for the billing country selected in the cart (can be pre-selected, but users can also choose it manually). Per-product pricing details displayed to shoppers change if the billing country is modified to a different market governed by other pricing details. Shoppers will get this warning message in the cart: "The product options have been changed due to availability settings in the selected country."

Non-localized pricing configurations are also active, but not for eStore, as they can be used to supply price lists to your partners.

Localized pricing configuration options

You can create multiple pricing configurations for the same product, be as similar to one another or as different as you prefer. The following parameters can be completely different for multiple pricing configurations applied to the same product.

  1. Pricing configuration type (with a base price, without base price, net, gross)
  2. Price
  3. Default currency
  4. Pricing options
  5. Renewal discounts
  6. Volume discounts

As a result, they can control not only the actual price in accordance to specific geographic regions and countries but also pricing strategies.

Pricing localization and product SKUs

You have the option of configuring stock-keeping units (SKUs) each pricing configuration in the 2Checkout platform, and associate unique SKUs in accordance with the currencies, volume discounts (if any), purchase type and pricing options (if any) settings impacting products when localizing their pricing configurations. 

Upselling and Cross-selling

Localized pricing settings impact their upselling and cross-selling marketing campaigns.

upselling

When configuring upselling campaigns, you'll need to factor in localized pricing strategies for the primary and recommended products. There are four scenarios you need to consider, related to the type of upselling campaigns available.

Scenario 1

Primary product with NO pricing options in Default pricing configuration

Recommended product with NO pricing options in Default pricing configuration. 

2Checkout always triggers upselling campaigns regardless of the pricing options in additional localized pricing configurations. If pricing options are defined for specific localized pricing configurations, they'll also be available to shoppers in eligible markets.
Scenario 2

Primary product with NO pricing options in Default pricing configuration

Recommended product WITH pricing options in Default pricing configuration. For the Recommended product, you can select either:

  • Any pricing options combination (all pricing options are editable).
  • Specific pricing options (only if they were defined for the Default pricing configuration created for the product).

2Checkout always triggers upselling campaigns regardless of the pricing options in additional localized pricing configurations. When added to cart, Recommended products:

  • Have their pricing options locked (those selected when creating the campaign), if they're associated with localized pricing configurations assigned to the countries where shoppers are located and match those of the Default pricing configuration.
  • Feature editable pricing options if they're associated with pricing configurations governing the countries where shoppers are located but do not match those of the Default pricing configuration.
Scenario 3

Primary product WITH pricing options in Default pricing configuration

Recommended product with NO pricing options in Default pricing configuration. For the Primary product, you can select either:

  • Any pricing options combination - the campaign will always start (all pricing options will be editable)
  • Specific pricing options (only if they were defined for the Default pricing configuration created for the product) - the campaign will start only when the primary product with specific pricing options is added to the cart.

If pricing options are defined for specific localized pricing configurations, they'll also be available to shoppers in eligible markets.

Scenario 4

Primary product WITH pricing options in Default pricing configuration

Recommended product WITH pricing options in Default pricing configuration. For the Primary product, you can select either:

  • Any pricing options combination - the campaign will always start (all pricing options will be editable);
  • Specific pricing options (only if they were defined for the Default pricing configuration created for the product) - the campaign will start only when the primary product with specific pricing options is added to the cart.

Recommended products :

  • Have their pricing options locked (those selected when creating the campaign), if they're associated with localized pricing configurations assigned to the countries where shoppers are located and matching those of the Default pricing configuration.
  • Feature editable pricing options if they're associated with pricing configurations governing the countries where shoppers are located but not matching those of the Default pricing configuration.

As a rule of thumb, consider the default pricing configuration of your offerings as the central element of upselling campaigns when pricing options are also involved. In scenarios in which the Primary product of an upselling campaign has pricing options set up for the default pricing configuration, they'll also be available when configuring the upselling recommendation. Pricing options will not be displayed in the Upselling recommendation area when editing a campaign if they're only defined for the localized pricing configurations of the Primary product, but not the default.

 

Similarly, the pricing options of the Recommended product will only be displayed in the Upselling recommendation area when editing a campaign only if they were enabled for the Default pricing configuration. If not featured under the Default pricing configuration but only for localized pricing configurations, the pricing options will not be available when configuring upselling campaigns.

Cross-selling

Cross-selling campaigns function regardless of the pricing configurations set up for their products. Shoppers located in a country governed by a localized pricing configuration will be able to select the pricing options associated to their locale for the main products and for the cross-selling items as well.

However, if the products are automatically added to cart, they're pricing options will be locked, and shoppers won't have the possibility of editing them (offerings will come with pre-selected pricing options, and the system will disregard the availability of alternatives, which will never be displayed in the cart).

Localized pricing for subscription renewals

When renewing a subscription, the 2Checkout system will correlate the renewal price with that of the initial purchase. Renewal prices can be defined as a part of the default and localized pricing configurations for products with base and without base price.

 

Essentially, subscriptions initially acquired by shoppers in a specific market governed by a localized pricing configuration, will be renewed in accordance to the same pricing configuration and billing country. Renewal prices will not vary in any way, even if shoppers change the billing country to a market assigned to a different pricing configuration than the one from which they made the initial acquisition.

Renewals made by using the 2Checkout API are impacted by the same limitation, namely, the price will not adapt when the billing country is changed, but will reflect the market in which shoppers were located when they initially purchased the subscription.

Upgrades

When upgrading a product, the 2Checkout system correlates the upgrade price with that of the initial purchase.

2Checkout does not change the localized pricing configuration and billing country when upgrading a subscription, reflecting the initial purchase. Upgrade costs do not vary, even if shoppers change the billing country to a market assigned to a different pricing configuration than the one from which they made the initial acquisition.

Upgrades made by using the 2Checkout API are impacted by the same limitation, namely, the price does adapt when the billing country is changed, but will instead reflect the market in which shoppers were located when they initially purchased the product.

New purchases, renewals and upgrades through API - localized pricing

The 2Checkout API supports localized pricing capabilities.

New purchases

The billing country set by using 2Checkout API causes the price details to be adapted accordingly if you localized the pricing configuration for that specific market.  If there's no match between the localized pricing configuration and the billing country, 2Checkout uses the default pricing configuration used instead.

Upgrades

Upgrades through the 2Checkout API take into account the billing country associated with the initial subscription for the pricing details of the target subscription of the upgrade process. 2Checkout uses the localized pricing configuration of the target subscription plan in accordance with the billing country of the initial subscription.

Note: If the upgrade subscription/product does not feature a pricing configuration localized on a specific market, then the system uses the item's Default pricing configuration.

Renewals

Subscription renewals through the 2Checkout API use the price options from the localized pricing configuration, but you control the price and the billing cycle following the renewal independently of the subscription plan configuration.

Next renewal price

Overview

Retrieve the costs of the next subscription renewal.

Attributes

Parameters Type/Description

NetPrice

Double

 

Price without taxes

NetCurrency

String

 

Currency for the price without taxes. The currency ISO code used for the payment - ISO 4217.

FinalPrice

Double

 

Price with taxes

FinalCurrency

String

 

Currency used for prices with taxes. The currency ISO code used for the payment - ISO 4217.

 

Renew a subscription

Overview

Renew a subscription in the Avangate system on-demand, controlling the number of days, price and currency of the extension. Use the renewSubscription method renew a subscription.

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.

SubscriptionReference

Required (string)

 

Unique, system-generated subscription identifier.

 

Avangate charges customers using the payment data attached to subscriptions. In the case of credit/debit cards, if customers update their payment information in myAccount or if you update these details on behalf of your subscribers, the Avangate system uses the latest card info provided to charge subscription renewals.

Days

Required (int)

 

The number of days the Avangate system extends the lifetime of the subscription.

Price

Required (double)

 

The price that Avangate charges the customer for the renewal. This is the Net price.

Currency

Required (string)

 

The currency associated to the renewal price - ISO 4217 code.

Response

Boolean

true or false depending on whether or not the operation succeeded.

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 = "YOUR_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 = "YOUR_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;
}
$subscriptionReference = '30E47F8699';
$Days = 4;
$Price = 50;
$Currency = 'eur';
try {
    $CustomPrice = $client->renewSubscription($sessionID, $subscriptionReference, $Days, $Price, $Currency);
}
catch (SoapFault $e) {
    echo "CustomPrice: " . $e->getMessage();
    exit;
}
var_dump("CustomPrice", $CustomPrice);

Hyperlinks for order, customer and subscription details pages

Overview

Get access to information on specific orders, customers and subscriptions by easily building links to the Order, Customer and Subscription details pages in the Control Panel.

Availability

This feature is available to all 2Checkout accounts.

Requirements

The Control Panel user accounts accessing information on orders, customers and subscriptions require the following role privileges:

  • eStore order search
  • Customers
  • Subscription Management

To edit user roles, go to Account settings -> Manage user access and click View roles. Edit the user role accordingly and click Save role.

Link parameters

Two parameters are key to building specific links. Both parameters are case sensitive.

  • refno - used to build links to the Order details and Subscriptions details pages.
  • avangateid - used to build links to the Customer details pages.

Order details page

Orders have unique identifiers associated by default. Use these identifiers combined with the refno parameter to build Order details page links.

Example

A link to the Order details page of an order with the 1234567 reference number:

https://secure.2checkout.com/cpanel/order_info.php?refno=1234567

Note: Order reference identifiers are integer values.

Refund orders

Refund orders share the same 2Checkout identifier as the original order. When building links for Refund order details page, you need to add the order status to the URL, together with the refno parameter. You can add the order status via the status parameter (case sensitive).

Example

https://secure.2checkout.com/cpanel/order_info.php?refno=1234567&status=refund

Subscription details page

Subscriptions also have unique identifiers associated by default. Use these identifiers combined with the refno parameter to build Subscription details page links.

Example

A link to the Subscription details page of a subscription with the 0A001B23C5 reference number:

https://secure.2checkout.com/cpanel/license_info.php?refno=0A001B23C5

Customer details page link

Customer accounts have unique 2Checkout identifiers. Use these identifiers together with the avangateid parameter to build links for Customer details pages.

Note: Use the internal, system-generated Avangate customer reference, and not the External customer reference which you control.

Example

A link to the Customer details page of a customer with the id 102407513:

https://secure.2checkout.com/cpanel/customer_details.php?avangateid=102407513

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