Skip to main content

Generate a trial link

Overview

You can attract new customers or increase your conversion rates by offering a free or extra charge trial for one of your products. Once the trial period expires, customers are automatically charged with the full value of the product, unless they choose to cancel.

Availability

Available to all 2Checkout accounts.

Generate a trial link

  1. Access the trial link generation options in the Checkout Links area, under Dashboard → Setup → Generate Links. Alternatively, you can navigate to this page through the View Edit product section of the Merchant Control Panel, select the product you want to generate the trial subscription for, go to the Information tab, and click on Get trial links.
  2. Click the Trial link radio button.

set free trial_1.png

3. Select the product for which you're creating the trial. 

set free trial_2.png

4. Choose the duration of the trial. Minimum 7 days. Default: 30 days. 

5. Configure the trial price. 0 by default, but you have the option of charging shoppers for the trials. To further modify pricing, you can use Additional pricing options. Input pricing options codes separated by commas. 2Checkout uses pricing options to calculate the costs of the automatic trial conversion.

set free trial_3.png

6. Scroll down to the bottom of the page and generate the link.

set free trial_4.png

7. Place the URL on call-to-actions on your store that offer access to trials.

CUSTOMIZE THE TRIAL 

  1. Trial period - Minimum 7 days. 
  2. Trial price - 2Checkout uses the custom prices and ignores the per-product pricing configuration. 
  3. Additional pricing options - Input pricing options codes separated by a comma. 2Checkout calculates the costs of the trial conversion based on the pricing options.
  4. Advanced options - In the advanced options screen, you can specify the default language and billing currency for the checkout process.
    • Default language - AUTO preselected. Choose a specific language for the ordering interface.
    • Billing currency - AUTO preselected. Choose a specific currency for the ordering process. 
  5. Additional options
    • Scroll down to the Additional options area, to choose the Order template displayed to your shoppers.
    • Enter a specific link source for the sales, and have the separate link identifier (SRC) to track every sale point generator (e.g. homepage, product page, etc.)
    • Provided that you defined a coupon code for the product you're generating the trial subscription for, insert it in the coupon code field. The appropriate discount is deducted from the full product price (and displayed in the shopping cart and/or checkout page).
    • Select a different hashing algorithm from the one preselected from Hashing algorithm subsection

SimpleProduct Object Structure

Parameters

Parameter Type/Descriptio
ProductId Int
  Unique Avangate Product ID.
ProductCode String
  Unique Product Code.
ProductName String
  Product Name
ProductType String
  Possible values: REGULAR or BUNDLE
ProductVersion String
  Product version. Can be NULL.
ProductImage String
  URLs to the product image uploaded into the Avangate platform. Can be NULL.
Price Double
  Product price calculated using the configuration of pricing options from the pricing list.
Currency String
  The ISO code of the currency set for the partner - ISO 4217.
PriceType String
  Possible values NET or GROSS.

 

Create fix discount

Overview

Use setPromotionDiscount via JSON-RPC API 4.0 to set a fixed promotion discount.

Parameters

Parameter Type/Description

sessionID

Required (string)

 

Output of the Login method.

promotionCode

Required (string)

 

The code corresponding to the promotion that you want to set the discount for.

promotionDiscount

Required(Object)

 

Type

Required (String)

 

 

Discount type:

  • PERCENT, use in combination with Value
  • FIXED, use in combination with Values and DefaultCurrency

 

Value / Values

Required (Int / Array of objects)

 

 

  • Value = Int, determines the discount percentage from 0 to 100
  • Values = Array of Value objects

 

 

Value

Required (Object)

 

 

 

Currency

Required (String)

 

 

 

 

Discount currency ISO code (ISO 4217).

 

 

 

Amount

Required (Int)

 

 

 

 

Discount amount in corresponding currency.

 

DefaultCurrency

Required (String)

 

 

Default discount currency ISO code (ISO 4217).

Response

Parameter Type/Description
promotionDiscount Object

Request

<?php

function callRPC($Request, $host, $Debug = true) {
    $curl = curl_init($host);
    curl_setopt($curl, CURLOPT_POST, 1);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($curl, CURLOPT_VERBOSE, true);
    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.1/';

$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

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

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

// Promotion code assigned to the promotion you want to update
$promotionCode = '';

$promotionDiscount = new stdClass;
$promotionDiscount->Type = 'FIXED';
$promotionDiscount->DefaultCurrency = 'USD';

// Define the first discount object for a specific currency
$discount1 = new stdClass;
$discount1->Currency = 'USD';
$discount1->Amount = 22;

// Define the second discount object for a specific currency
$discount2 = new stdClass;
$discount2->Currency = 'EUR';
$discount2->Amount = 50;

$promotionDiscount->Values = [$discount1, $discount2];

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

Recurring billing charges

Overview

2Checkout calculates recurring charges for your subscription plans based on your pricing setups. You have the option to change recurring charges and modify the costs incurred by subscribers when renewing their subscriptions. 

Availability

All 2Checkout accounts. 

Requirements 

Create at least a product/subscription plan before defining pricing. 

Type 

  • Net: without taxes - 2Checkout applies extra taxes to the default price, such as Tax/VAT for US/EU orders during the ordering process. 
  • Gross: with taxes included - 2Checkout takes the taxes out of the costs paid by shoppers, without modifying the price during the ordering process. 

Currency 

When defining product prices you can:

  1. Configure the price only for the default currency - 2Checkout converts amounts in the cart based on the currency selected by/for shoppers. Currency rates are available here: https://secure.2checkout.com/content/...p?CURRENCY=USD

    This is an XML schema with the corresponding values for the other currencies compared to the one supplied in the CURRENCY query parameter.

  2. Specify prices in all currencies available for your account - 2Checkout serves shoppers the prices for all the currencies you set up without converting the amounts.

Setup

Navigate to the Pricing tab of a product/subscription plan and edit the desired pricing configuration. 

  • For products with dynamic pricing (with base price), look for the Renewal Price area.
  • For products with static pricing (without base price), look for the Renewal tab in the Prices area.

Options

There are three options to control recurring charges: 

Set renewal prices to equal the initial purchase prices (eStore only)

Use this setting when you want subscribers to continue paying the same amount for recurring charges that they paid initially when they first acquired your product. 

Create new renewal base prices

Set up prices in the default currency or for all the currencies available for your account. 2Checkout calculates recurring charges based on the renewal-based price modified by the costs defined for any extra options you configure with the exception of volume discounts.

Modify the renewal costs with discounts

Set up a renewal discount and assign it to impact manual or auto-recurring charges. 

Change recurring costs at the subscription level

Access this option by editing subscriptions. 

  1. Click the link on the price information for the Current billing amount in the Subscription info area. 
  2. Click edit.
  3. Enter a new billing amount. 
  4. Set it to impact:
  • All future billing cycles
  • Only a specific number of upcoming billing cycles

Custom recurring charges at the subscription level cause the 2Checkout system to completely ignore any sort of changes you make to product charges, including ro recurring/renewal costs. 

Retrieve subscription payment information

Overview

Use the getSubscriptionPaymentInformation method to retrieve information related to the payment made 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)
  The reference of the subscription you want to retrieve payment information for.

Response

Parameters Type/Description

Type

String

 

Payment method type.

Currency

String

 

ISO code of the order currency.

PaymentMethod

Object

 

FirstDigits

String

 

 

First 4 digits of the card used on the order.

 

LastDigits

String

 

 

Last 4 digits of the card used on the order.

 

CardType

String

 

 

Type of card used on the order.

  ExpirationMonth String
    Card expiration month.
  ExpirationYear String
    Card expiration year.
  CardUpdated Boolean
    The card updated by our internal account updater.
  Authorize3DSUrl String
    URL address to which customers are redirected after the 3DS details get validated by the bank and the order is successfully authorized.

Response sample

{
    "Type": "CC",
    "Currency": "USD",
    "PaymentMethod": {
        "FirstDigits": "4111",
        "LastDigits": "1111",
        "ExpirationMonth": null,
        "ExpirationYear": null,
        "CardUpdated": false,
        "Authorize3DSUrl": null,
        "CardType": "Visa"
    }
}

 

Request

<?php
require ('PATH_TO_AUTH');

$subscriptionReference = "Subscription_Code";

try {
    $paymentInformation = $client->getSubscriptionPaymentInformation($sessionID, $subscriptionReference);
} catch (SoapFault $e) {
    echo  $e->getMessage();
}
var_dump($paymentInformation);

Retrieve subscription payment information

Overview

Use the getSubscriptionPaymentInformation method to retrieve information related to the payment made for 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)
  The reference of the subscription you want to retrieve payment information for.

Response

Parameters Type/Description

Type

String

 

Payment method type.

Currency

String

 

ISO code of the order currency.

PaymentMethod

Object

 

FirstDigits

String

 

 

First 4 digits of the card used on the order.

 

LastDigits

String

 

 

Last 4 digits of the card used on the order.

 

CardType

String

 

 

Type of card used on the order.

  ExpirationMonth String
    Card expiration month.
  ExpirationYear String
    Card expiration year.
  CardUpdated Boolean
    The card updated by our internal account updater.
  Authorize3DSUrl String
    URL address to which customers are redirected after the 3DS details get validated by the bank and the order is successfully authorized.

Response sample

{
    "Type": "CC",
    "Currency": "USD",
    "PaymentMethod": {
        "FirstDigits": "4111",
        "LastDigits": "1111",
        "ExpirationMonth": null,
        "ExpirationYear": null,
        "CardUpdated": false,
        "Authorize3DSUrl": null,
        "CardType": "Visa"
    }
}

 

Request

<?php
require ('PATH_TO_AUTH');

$subscriptionReference = "Subscription_Code";

$jsonRpcRequest = new stdClass();
$jsonRpcRequest->jsonrpc = '2.0';
$jsonRpcRequest->method = 'getSubscriptionPaymentInformation';
$jsonRpcRequest->params = array($sessionID, $subscriptionReference);
$jsonRpcRequest->id = $i++;

$paymentInformation = callRPC($jsonRpcRequest, $host);
var_dump($paymentInformation);

Assign a subscription to another customer

Overview

Use the setSubscriptionCustomer method. 2Checkout moves subscription under the customer for which you provide the 2Checkout customer reference or the External customer reference during the subscription update process.

json_diagram.png

Requirements

To move a subscription from a source customer to a target customer:

  • Use 2Checkout customer references or External customer references belonging to the target customer. 2Checkout re-assigns the subscription to the target customer. 
  • Customer references must be valid and associated to the target customer entity under which you move the subscription.
  • If you provide both the 2Checkout customer reference and External customer reference they need to belong to the same target customer entity.

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.

avangateCustomerReference

Required (int)

 

System-generated customer reference. Required unless you prefer to use ExternalCustomerReference.

externalCustomerReference

Optional (string)

 

External customer reference that you control. Optional when you use AvangateCustomerReference. If you include it, it needs to belong to the same customer as the AvangateCustomerReference.

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';
$customerReference = CUSTOMER_REFERENCE;

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

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

IPN POST failure recovery process

#

Action

No of attempts

Stage 1

2Checkout sends the first Instant Payment Notification (IPN) instantaneously for events per your account’s Notification Settings.

1

Stage 2

If the initial notification fails, the subsequent two (2) IPN messages are sent after the next five (5) minutes.

2

Stage 3

If the issue persists, and requests continue to result in failures, 2Checkout makes another four (4) retries, 15 minutes apart.

4

Stage 4

Following the four tries made in Stage 3, the 2Checkout system performs one-hour interval continuous requests for a maximum of two (2) days after it sent out the initial notification, until a valid response.

1/h

Retrieve all additional fields

Overview

Use the getAdditionalFields method to extract information about additional fields you set up for your account.

Parameters

Parameters Type/Description

sessionID

Required (string)

 

Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.

Response

Parameters Type/Description

AdditionalFields

Array of objects

Request

<?php

require ('PATH_TO_AUTH');

try {
    $AdditionalFields = $client->getAdditionalFields($sessionID);
}

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

var_dump("AdditionalFields", $AdditionalFields);

Assign to another customer

Overview

Use the setSubscriptionCustomer method. 2Checkout moves subscription under the customer for which you provide the 2Checkout customer reference or the External customer reference during the subscription update process.

json_diagram.png

Requirements

To move a subscription from a source customer to a target customer:

  • Use 2Checkout customer references or External customer references belonging to the target customer. 2Checkout re-assigns the subscription to the target customer. 
  • Customer references must be valid and associated to the target customer entity under which you move the subscription.
  • If you provide both the 2Checkout customer reference and External customer reference they need to belong to the same target customer entity.

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.

avangateCustomerReference

Required (int)

 

System-generated customer reference. Required unless you prefer to use ExternalCustomerReference.

externalCustomerReference

Optional (string)

 

External customer reference that you control. Optional when you use AvangateCustomerReference. If you include it, it needs to belong to the same customer as the AvangateCustomerReference.

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';
$customerReference = CUSTOMER_REFERENCE;

try {
    $newCustomerInfo = $client->setSubscriptionCustomer($sessionID, $subscriptionReference, $customerReference);
}
catch (SoapFault $e) {
    echo "newCustomerInfo: " . $e->getMessage();
    exit;
}
var_dump("newCustomerInfo", $newCustomerInfo);

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