Skip to main content

Revenue Recovery Tools

Overview

2Checkout provides recurring-revenue-based businesses with a comprehensive suite of revenue recovery tools, as well as the expertise and guidance to tailor and fine-tune your strategy to achieve industry-high revenue loss prevention and revenue recapture rates. Use the Revenue Recovery Tools to fight involuntary churn and increase your long-term revenues by up to 20%.

Revenue Recovery Tools are a unique set of features of the 2Checkout platform that are used for recovering and collecting transactional revenues lost due to poor authorization rates and include, without limiting, the following :

 

Basic 

2Recover Add-on

Account Updater external

Yes

Yes

Multiple retry logic

2

up to 4 (in addition to the 2 included in Basic)

Pre-expiration billing Yes Yes

2Checkout Updater

No

Yes

Dunning management 

No

Yes

Dispute prevention service

No

Yes

Advanced Authorization  Report

Basic Advanced

Availability

  • Basic revenue recovery tools are available by default for all types of plans (2Sell, 2Subscribe, 2Monetize).
  • 2Recover add-on is available on demand for all types of plans (2Sell, 2Subscribe, 2Monetize).

Basic Revenue Recovery Tools

Basic revenue recovery tools are available for all accounts (2Sell, 2Subscribe, 2Monetize).

Account Updater

Account Updater is a key customer retention tool designed to support seamless updates of credit/debit card account information. 

What is Account Updater Service

Account Updater is a generic term for programs such as Visa's Account Updater or MasterCard Automatic Billing Updater that are offered by the credit card networks to automatically update subscription customer card data when cardholder information changes or goes out of date.

How Does an Account Updater Service Work

This service records changes to credit card account numbers and expiration dates due to mergers, portfolio flips (e.g., Visa to MasterCard), re-issued cards (from loss or security breach) account closures, and product upgrades.

Companies that participate in updater programs have several ways to check the information in their subscriber database: automated nightly updates that check any card you have processed in the past six months, requests for information on specific cards that have been declined and requests for information on a set of cards due for their next billing installment.

Basic Retry Logic

Basic Retry Logic involves the first two (2) renewal authorizations 2Checkout makes to recover expired subscriptions for which the renewal process failed.

2Recover Add-on 

The 2Recover add-on is available on-demand as part of the 2Recover add-on. Contact 2Checkout directly for more information. 2Recover add-on includes the basic revenue recovery tools plus: 

  • 2Checkout Updater
  • Advanced Retry Logic
  • Hard Declines Notifications
  • Advanced Authorization Report (new acquisition, auto-renewal, manual renewal) 

2Checkout Updater

2Checkout Updater is a key customer retention tool designed to support seamless updates of credit/debit card account information. 

Advanced retry logic

Advanced Retry Logic involves multiple renewal authorizations 2Checkout makes beyond those of Basic Retry Logic.

Hard Declines Notifications

Read more about hard decline notifications here.

Advanced Authorization  Report 

The advanced authorization report section in your Merchant Control Panel includes dedicated sections for each of the extra features in the 2Recover add-on, as well as the ability to display the report for new acquisitions and manual renewals. 

Self-service

Requirements

1. To request the activation of the 2Recover add-on, your account must meet the following criteria:

  • Less than 1% chargeback rate over the last 3 months
  • Have at least 10 active auto-renewing subscriptions
  • Use a 2Sell, 2Subscribe, 2Monetize 2Checkout account

2. If your account meets the requirements above, you can click on Activate Advanced Options in your Merchant Control Panel.

3. Next, you'll be prompted with a message informing you that we will activate the module for your account in 48 hours.

4. As soon as we activate the module, you will receive an email notifying you about the activation.

2Recover Add-on Fees and Revenue

2Recover Add-on Incurred Fees

Commission (net amount, does not include taxes) for the recurring payments 2Checkout recovered when renewing subscriptions using the 2Recover add-on. 2Checkout does not charge fees for basic recovery tools. To calculate the recovered revenue fee, generate the report using the Attempt date selector.

2Checkout keeps the 2Recover add-on fees even in the eventuality of chargebacks or refunds.

Total Earnings from the 2Recover Add-on

Total recurring charges successfully recovered using the 2Recover add-on, reported according to authorization dates, when the 2Checkout system collects funds from your customers.

Invoice for 2recover add-on fees

2Checkout issues an invoice for the advanced recovery fees at the end of each month.

Subscription import

Overview

Add/import subscriptions in the Avangate system. Include card data with your subscription import only if you contacted 2Checkout to enable this functionality for your account. Otherwise, the import process results in a failure. Contact 2Checkout or your account manager directly for more details.

Attributes

Parameters Type/Description

ExternalSubscriptionReference

Required (string)

 

Unique identifier for your subscription. Mandatory when importing subscription data.

StartDate

Required (string)

 

Subscription start date(YYYY-MM-DD) - StartDate is mandatory when importing subscription data. If you changed the time zone for the Avangate API by editing system settings under Account settings, then the StartDate you provide must be in accordance with your custom configuration.

ExpirationDate

Required (string)

 

Subscription expiration date(YYYY-MM-DD) - ExpirationDate is mandatory when importing subscription data. If you changed the time zone for the Avangate API by editing system settings under Account settings, then the ExpirationDate you provide must be in accordance with your custom configuration.

Product

Required (object)

 

The product for which Avangate generated the subscription. Details below.

 

ProductCode

String

 

 

Unique product identifier that you control.

 

ProductId

Int

 

 

Unique, system-generated product identifier.

 

ProductName

String

 

 

Product name.

 

ProductQuantity

Int

 

 

Ordered number of units.

 

ProductVersion

String

 

 

Product version.

 

PriceOptionCodes

Array

 

 

The product options codes the customer selected when acquiring the subscription. Pricing options codes are case sensitive.

EndUser

Required (object)

 

The end user of the subscription. Details below.

 

Person

Object

    Details below. 

 

 

FirstName

String

 

 

 

End user's first name

 

 

LastName

String

 

 

 

End user's last name

 

 

CountryCode

String

 

 

 

End user country code [ISO3166-1 Alpha 2].

 

 

State

String

 

 

 

End user state.

 

 

City

String

 

 

 

End user city.

 

 

Address1

String

 

 

 

End user first address line.

 

 

Address2

String

 

 

 

End user second address line.

 

 

Zip

String

 

 

 

End user zip code.

 

 

Email

String

 

 

 

End user email address.

 

 

Phone

String

 

 

 

End user phone number.

 

 

Company

String

 

 

 

Company name.

 

Fax

String

 

 

End user fax.

 

Language

String

 

 

Language [ISO639-2] the Avangate system uses for communications.

DeliveryInfo

Optional (object)

 

The object contains information about the delivery/fulfillment made to the customer.

 

Description

String

 

 

Delivery description.

 

Codes

Array of objects

    Details below. 

 

 

Code

String

 

 

 

Delivered activation key/code.

 

 

Description

String

 

 

 

Code description for dynamic lists from your key generator. 

 

 

ExtraInfo

Object

 

 

 

Info set by your key generator for dynamic lists only.

 

 

 

CodeExtraInfo

Object

 

 

 

Type

String

 

 

 

Label

String

 

 

 

Value

String

 

 

File

Array of objects

      Details below. 

 

 

 

Content

String

 

 

 

 

Content of the file (base64 encoded).

 

 

 

ContentLength

Int

 

 

 

 

File size.

 

 

 

Filename

String

 

 

 

 

The name of the delivered file.

 

 

 

FileType

String

 

 

 

 

The type of the delivered file.

PartnerCode

Optional (string)

 

  • Empty: for ecommerce orders
  • Partner Code (mandatory)

ExternalCustomerReference

Optional (string)

 

Customer identifier you control.

SubscriptionValue

Optional (double)

 

Subscription value. The total costs incurred by the customer through the lifecycle of the subscription before you imported the item into the Avangate system.

When you send this parameter you must accompany it by ValueCurrency.

SubscriptionValueCurrency

Optional (string)

 

Mandatory when you also send the Value parameter. The currency associated to the subscription value.

AdditionalInfo

Optional (string)

 

Extra information that you can attach to a subscription, such as the source of the initial purchase.

NextRenewalPrice

Optional (double)

 

The future costs that subscribers would incur when their subscriptions are renewed. When provided, you must accompany it by NextRenewalPriceCurrency and CustomPriceBillingCyclesLeft.

NextRenewalPriceCurrency

Optional (string)

 

Mandatory when you send CustomPriceBillingCyclesLeft. The currency associated with the subscription next renewal price value.

CustomPriceBillingCyclesLeft

Optional (string)

 

Mandatory when you send NextRenewalPrice. Avangate applies the next renewal price to the number of billing cycles you define.

Test Optional (integer)
  Available only for eStore subscriptions. Use 1 to import a test subscription. Exclude the parameter or set the value to 0 to import regular subscriptions. Test subscriptions enable you to try out flows like manual and auto renewal, and upgrade.

CardPayment

Optional (object)

 

Include payment (credit/debit card) information that Avangate uses for recurring billing to renew imported subscriptions. Importing subscriptions with payment data is available only to eligible Avangate accounts. Contact Avangate directly for additional details.

Card payment

Add credit/debit card details when importing subscriptions. 2Checkout uses payment information in the recurring billing process. 

For imports of test subscriptions, use the credit card information from this article.

Parameters Type/Description

CardPayment

Object

CardNumber

Required (string)

 

The credit/debit card number.

CardType

Required (string)

 

VISA, VISAELECTRON, MASTERCARD, MAESTRO, AMEX, DISCOVER, DANKORT, CARTEBLEUE, JCB.

ExpirationYear

Required (string)

 

The year in which the card expires.

ExpirationMonth

Required (string)

 

The month in which the card expires.

HolderName

Required (string)

 

Card holder name.

CCID

Required (string)

 

Credit Card Identification - an extra ID printed on the card, usually a 3-4 digit number, the CVC2/CVV2.

HolderNameTime

Required (int)

 

The interval of time in seconds in which shoppers enter their name in the HolderName field. An abnormally short interval is usually a red flag for fraud attempts.

AutoRenewal

Optional (bool)

 

True or false, depending on whether the customer or you enabled or disabled subscription auto-renewals.

CardNumberTime

Optional (int)

 

The interval of time in seconds in which shopper enter their card number in the CardNumber field. An abnormally short interval is usually a red flag for fraud attempts.

Can be NULL, but not a negative number.

 

Unassign a product group

Response

bool(true)

Request

<?php

$host   = "https://api.avangate.com";
$client = new SoapClient($host . "/soap/4.0/?wsdl", array(
    'location' => $host . "/soap/4.0/",
    "stream_context" => stream_context_create(array(
        'ssl' => array(
            'verify_peer' => false,
            'verify_peer_name' => false
        )
    ))
));


function hmac($key, $data)
{
    $b = 64; // byte length for md5
    if (strlen($key) > $b) {
        $key = pack("H*", md5($key));
    }
    
    $key    = str_pad($key, $b, chr(0x00));
    $ipad   = str_pad('', $b, chr(0x36));
    $opad   = str_pad('', $b, chr(0x5c));
    $k_ipad = $key ^ $ipad;
    $k_opad = $key ^ $opad;
    return md5($k_opad . pack("H*", md5($k_ipad . $data)));
}

$merchantCode = "YOURCODE123"; //your account's merchant code available in the 'System settings' area of the cPanel: https://secure.avangate.com/cpanel/account_settings.php
$key          = "SECRET_KEY"; //your account's secret key available in the 'System settings' area of the cPanel: https://secure.avangate.com/cpanel/account_settings.php
$now          = gmdate('Y-m-d H:i:s'); //date_default_timezone_set('UTC')

$string = strlen($merchantCode) . $merchantCode . strlen($now) . $now;
$hash   = hmac($key, $string);

try {
    $sessionID = $client->login($merchantCode, $now, $hash);
}

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

$ProductCode = 'AAA4643116';
$Code = "Code_12345AB";
try {
    $AssignedProductGroup = $client->unassignProductGroup($sessionID, $ProductCode, $Code);
}

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

var_dump("AssignedProductGroup", $AssignedProductGroup);

?>

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

 

Parameters Type/Description

BasicPrice

Object

Currency

String

 

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

Amount

Float

 

Basic price.

 

Parameters Type/Description

Quantities

Object

MinQuantity

String

 

The minimum quantity of volume discounts. Default is 1.

MaxQuantity

String

 

The maximum quantity of volume discounts. Default is 99999.

 

Parameters Type/Description

PriceOptionsAssigned

Object

Code

String

 

Price option identifier.

Options

Array of strings

 

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

Response

bool(true)
<?php
require ('PATH_TO_AUTH');

/**
 * 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);
?>

Extend a subscription

Overview

Extend the lifetime of a subscription in the 2Checkout system on-demand. Use the extendSubscription method to set a new expiration deadline for a subscription.

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.

days

Required (int)

 

2Checkout prolongs the lifetime of a subscription using the number of days you send, adding the interval on top of the expiration date.

 

Hint: Use a negative number to reduce the lifetime of a subscription.

 

Cannot be NULL.

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';
$days = 5;

try {
    $extendedSubscription = $client->extendSubscription($sessionID, $subscriptionReferenceTest, $days);
}
catch (SoapFault $e) {
    echo "extendedSubscription: " . $e->getMessage();
    exit;
}
var_dump("extendedSubscription", $extendedSubscription);

Shipping fees

Overview

Use this object via SOAP API 4.0 to retrieve information about shipping fees. 

Parameters

Parameter Type/Description

ShippingFee

Array of objects

Name

String

 

The name of the shipping fee configuration. 

Code String
  Unique, system-generated shipping fee identifier. 

Amount

String

 

The shipping costs

Currency

String

 

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

ApplyTo

String

 

Possible values:

• PRODUCT

• ORDER

Type

String

 

 

Possible values:

• FIXED

• PERCENT

 

 

Add special price promotion

Overview

Use the AddSpecialPricePromotion method to create a promotion with a special price.

Request parameters

Parameters Type Required Description
Promotion Object Required Contains details of the promotion.
PriceMatrix Array of Objects Required Only for this type of promotion. It is generated by getPriceMatrix and used to set promotion special prices.
Coupon Object Required Type of coupon applied to the promotion.

Request sample

<?php

require('PATH_TO_AUTH');

$promotionObject = new stdClass;
$promotionObject->Name = 'YOUR_PROMOTION_TITLE';
$promotionObject->Description = 'YOUR_PROMOTION_DESCRIPTION';
$promotionObject->DefaultCurrency = "EUR";
$promotionObject->StartDate = date('Y-m-d', strtotime('1 month ago'));
$promotionObject->EndDate = date('Y-m-d', strtotime('+1 month'));
$promotionObject->Type = 'SPECIAL_PRICE';
$promotionObject->Enabled = 1;
$promotionObject->MaximumOrdersNumber = 0;
$promotionObject->MaximumQuantity = 0;
$promotionObject->InstantDiscount = false;
$promotionObject->ApplyRecurring = 'NONE';
$promotionObject->RecurringChargesNumber = 3;
$promotionObject->InstantDiscount = 0;

$couponObject = new stdClass;
$couponObject->Type = 'SINGLE';
$couponObject->Code = 'single_code';
$promotionObject->Coupon = $couponObject;

$productsObj1 = new stdClass;
$productsObj1->Code = 'test';
$promotionObject->Products = [$productsObj1];


$priceMatrixDefinition1 = new stdClass;
$priceMatrixDefinition1->ProductCode = "test";
$priceMatrixDefinition1->PricingConfigurationCode = "738C6A2049";
$priceMatrixDefinition1->OptionHash = "708e43960c4edc42f14cf388bcb24bde";

$option1 = new stdClass;
$option1->GroupName = "Units";
$option1->OptionText = "1 - maximum";

$price1 = new stdClass;
$price1->Value = 10;
$price1->Currency = "USD";
$price2 = new stdClass;
$price2->Value = 15;
$price2->Currency = "EUR";

$priceMatrixDefinition1->Options = [$option1];
$priceMatrixDefinition1->Prices = [$price1, $price2];

$promotionObject->PriceMatrix = [$priceMatrixDefinition1];


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

$result = callRPC((object)$jsonRpcRequest, $host);
var_dump($result);

Response

{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "Code": "M99QQ7Q97A",
    "Name": "Promo percentage REST",
    "Description": "Promo description1",
    "StartDate": "2019-11-30",
    "EndDate": "2100-12-31",
    "MaximumOrdersNumber": -1,
    "MaximumQuantity": "1",
    "InstantDiscount": false,
    "Coupon": {
      "Type": "MULTIPLE",
      "Codes": [
        "code1",
        "code2"
      ]
    },
    "Enabled": true,
    "Type": "SPECIAL_PRICE",
    "Products": [
      {
        "Code": "test",
        "PricingOptionCodes": null,
        "PricingConfigurationCode": null
      }
    ],
    "Translations": [
      {
        "Name": "Promo percentage REST",
        "Language": "EN"
      }
    ],
    "Sources": [],
    "ApplyRecurring": "NONE",
    "RecurringChargesNumber": "0",
    "DefaultCurrency": "EUR",
    "PriceMatrix": [
      {
        "ProductCode": "test",
        "PricingConfigurationCode": "738C6A2049",
        "OptionHash": "708e43960c4edc42f14cf388bcb24bde",
        "Options": [
          {
            "GroupName": "Units",
            "OptionText": "1 - maximum"
          }
        ],
        "Prices": [
          {
            "Value": 31.15600000000014,
            "Currency": "CAD"
          },
          {
            "Value": 20,
            "Currency": "EUR"
          },
          {
            "Value": 40,
            "Currency": "USD"
          },
          {
            "Value": 1587.5251590697817,
            "Currency": "ARS"
          },
          {
            "Value": 18541.128586270122,
            "Currency": "CLP"
          },
          {
            "Value": 18.132399999999887,
            "Currency": "GBP"
          },
          {
            "Value": 2447.1999999999794,
            "Currency": "JPY"
          },
          {
            "Value": 499.51800000000384,
            "Currency": "MXN"
          },
          {
            "Value": 97.536,
            "Currency": "RON"
          },
          {
            "Value": 1846.0500000000052,
            "Currency": "RUB"
          },
          {
            "Value": 601.8285443739301,
            "Currency": "UAH"
          },
          {
            "Value": 384.3740000000019,
            "Currency": "ZAR"
          }
        ]
      }
    ]
  }
}

Retrieve partner information

Overview

Access partner details using the unique codes set to identify them.

Parameters

Parameters Type/Description
sessionID Required (string)
  Session identifier, output by the Login method. An exception will be thrown if the values are incorrect.
partnerCode Required (string)
  The unique partner code.

Response

Parameter Type/Description
Partner Object
  Partner information object.

Request

<?php

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

$partnerCode = 'YOUR_PARTNER_CODE'; // Partner code corresponding to the partner you want to get information for

try {
    $PartnerDetails= $client->getPartnerByCode($sessionID, $partnerCode);
} catch (SoapFault $e) {
    echo "Partner: " . $e->getMessage();
    exit;
}
var_dump ("Partner", $PartnerDetails);

?>

Errors

Error Description

INVALID_PARTNER

Partner code is mandatory.

INVALID_PARTNER

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

Cancel subscription pause

Overview

Use the cancelRenewalPause method to cancel a subscription's pause and change its status.

Request Parameters

Parameters Required Type/Description
merchantCode Required String. Unique merchant ID code that can be found in the Merchant Control Panel.
SubscriptionRef Required String. The system-generated reference code of the subscription.

Request Example

<?php
 
$host = 'https://api.2checkout.com/rpc/6.0/';
 
$merchantCode = "22322"; // MERCHANT CODE
$key = "q0^H5i?q3=)x9NP02W3q"; // MERCHANT SECRET KEY
 
$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 login
$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);
var_dump("session id:" . $sessionID);
 
// call api methods below
 
 
$SubscriptionRef = 'FA27DD5072';
 
$jsonRpcRequest = array (
    'jsonrpc' => '2.0',
    'method' => 'cancelRenewalPause',
    'params' => array($sessionID, $SubscriptionRef),
    'id' => $i++
);
var_dump ("cancelRenewalPause", callRPC((Object)$jsonRpcRequest, $host));
print ("If TRUE pause is canceled");
 
 
/* $jsonRpcRequest = array (
    'jsonrpc' => '2.0',
    'method' => 'getRenewalPause',
    'params' => array($sessionID, $SubscriptionRef),
    'id' => $i++
);
var_dump ("getRenewalPause", callRPC((Object)$jsonRpcRequest, $host));
*/
function callRPC($Request, $hostUrl, $Debug = false) {
    $curl = curl_init($hostUrl);
    curl_setopt( $curl, CURLOPT_POST, 1);
    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);
 
    curl_setopt( $curl, CURLOPT_COOKIE, "XDEBUG_SESSION=PHPSTORM");
 
    if (stristr($hostUrl, 'sandboxdev') || stristr($hostUrl, 'git-sb')) {
        curl_setopt( $curl, CURLOPT_PROXY, 'localhost:3128');
        //  curl_setopt( $curl, CURLOPT_PROXY, 'proxy.avangate.local:8080');
        //  curl_setopt( $curl, CURLOPT_PROXYUSERPWD, 'andrei.avramica:pw'); // for authenticated proxies
    }
 
    $ResponseString = curl_exec ($curl);
 
    if (!empty($ResponseString)) {
        $Response = json_decode ($ResponseString,false);
        if (isset($Response->error) && !is_null($Response->error)) {
            var_dump($Response->error) ;
            return null;
        }
 
        return $Response->result;
    } else {
        return null;
    }
}

Response Parameters

Parameters Type/Description
SubscriptionRef

Boolean

  • TRUE - if the call was successful and a pause was scheduled; 
  • FALSE - if the pause mechanism is not enabled for the merchant OR any of the eligibility conditions were not met OR pause is not enabled for the product OR the maximum pause duration for the product was exceeded. In this case, the system also throws the following message: "The subscription is not eligible for pause."
   

Response Example

{
    “StartDate”: “2020-02-19 22:20:30",
    “ResumeDate”: “2020-03-01 18:00:00",
    “PauseReason”: “vacation leave”
} 

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.

 

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