Skip to main content

Automatic renewal reminder

Overview

Use the variables in the list below to customize the Automatic renewal reminder shopper email according to your needs. Check the 'Mandatory' column to see the variables that are required in your customized version of the e-mail.

Variable name Description Test value Mandatory
ALLOW_MYACCOUNT_PROMO Include or exclude myAccount information in the email body 0 No
AUTO_RENEWAL Indicates whether or not the shopper has enabled automatic renewal on the subscription 1 No
AUTO_RENEWAL_DAYS_LEFT Indicates the number of days left until date of first attempt for automatic renewal 0 No
AVANGATE_LOGO 2Checkout logo URL https://secure.2checkout.com/images/e...endor_logo.png Yes
AVANGATE_RESELLER_ROLE This is mandatory content you need to keep in your emails, given 2Checkout acts as Reseller/Merchant of Record for online purchases on your website. 2Checkout acts as an authorized reseller of #Merchant commercial name online products and services. Yes
AVANGATE_WEBSITE 2Checkout website http://www.2checkout.com Yes
BASE_URL Merchant's full host https://secure.2checkout.com/ No
BUSINESS_COMPANY 2Checkout company name 2Checkout No
BUSINESS_HOTLINE 2Checkout support phone 0 No
BUSINESS_HOTLINEUS 2Checkout US hotline number 0 No
BUSINESS_SUPEMAIL 2Checkout support email address support@2checkout.com No
BUY_NOW_LINK Short version of renewal buy link (prefilled with shopper information) https://secure.2checkout.com/order/ch..._ID=xxxxxxxxxx No
BUY_NOW_LINK_RAW Renewal link prefilled with shopper information (long version) 0 No
CARD_DETAILS 0 0 No
CARD_DETAILS.EXPIRATION_DATE 0 42692 No
CARD_DETAILS.LAST_DIGITS 0 41111 No
CARD_DETAILS.TYPE 0 Visa No
CARD_EXPIRED Indicates whether the payment card associated to the subscription will expire during the current billing cycle 0 No
COMMERCIALNAME Merchant's commercial name Software Company Name No
COUNTRY Shopper's country used on the billing information USA No
COUPON_DISCOUNT Indicates the value of the discount (either the percentage of the fixed amount) 40 No
COUPON_DISCOUNT_CURRENCY Indicates the 3-letter code for the currency in which the discount was set 0 No
COUPON_DISCOUNT_TYPE Indicates whether the discount is PERCENT or FIXED PERCENT No
CURRENCY Order billing currency USD No
DISPLAY_MY_ACCOUNT_INFO Include or exclude myAccount information in the email body 1 No
EMAIL Shopper email address used on the delivery information. If no delivery information is available. the billing information is used. example@customer-email.com No
ENCRYPTED_MERCHANT_CODE Encrypted merchant code 0 No
EXPIRATIONDATE Subscription expiration date 41962 No
EXPIRED Indicates whether the subscription is active or past due/expired. Possible values: TRUE (for active subscriptions), FALSE (for past due/expired subscriptions). 0 No
EXTERNAL_CUSTOMER_REFERENCE Unique customer identifier assigned to each customer by a vendor's system. This identifier allows the vendor support team to quickly retrieve customer details, transaction history, and account information. Alphanumeric string No
FIRSTNAME Shopper's first name used on the billing information John No
FIRST_NAME_BILLING Shopper's first name used on the billing information John No
HOTLINE_NUMBERS 0 0 No
IS_IMPORTED_SUBSCRIPTION Indicates whether the subscription has been imported into the 2Checkout system. 0 No
IS_SUBSCRIPTION_EXPIRED Indicates whether the subscription is active  0 No
LASTNAME Shopper's last name used on the billing information Doe No
LAST_NAME_BILLING Shopper's last name used on the billing information Doe No
LICENCECODE Subscription reference number 0 No
MERCHANT_COMMERCIAL_NAME Merchant's commercial name Some company No
MERCHANT_SUPPORT_EMAIL Merchant support email address support@some-company.com No
MERCHANT_SUPPORT_PHONE Merchant support phone number 788112233 No
MYACCOUNT_URL URL for myAccount. To the BASE_URL we add /myaccount/ https://secure.2checkout.com/myaccoun...m&k=xxxxxxxxxx No
MYACCOUNT_URL_UPDATE_CC URL for updating credit card information in myAccount 0 No
MY_ACCOUNT_LOGIN_EMAIL Email address used by shopper to login/signup to myAccount client@shopper.com No
MY_ACCOUNT_LOGIN_URL 2Checkout myAccount login/sign-up URL https://secure.2checkout.com/myaccoun...m&k=xxxxxxxxxx Yes
MY_ACCOUNT_URL URL for myAccount. To the BASE_URL we add /myaccount/ https://secure.2checkout.com/myaccoun...m&k=xxxxxxxxxx No
MY_ACCOUNT_URL_UPDATE_CC URL for updating credit card information in myAccount https://secure.2checkout.com/myaccoun...m&k=xxxxxxxxxx No
NUMBER_OF_DAYS_UNTIL_EXPIRATION Number of days left until subscription expiration 0 No
OLD_PRODUCT_NAME Name of the old product (that will be renewed to a different version as per settings in your Control Panel) Old product name No
OLD_PRODUCT_GROUP_CODE The Product Group Code of the product currently on the subscription   No
OLD_PRODUCT_GROUP_NAME The Product Group Name of the product currently on the subscription   No
ORDER_DATE Order placement date 40544 No
ORDER_DATE_STANDARD_FORMAT Standard format used for the order placement date 42292 No
ORDER_NUMBER Indicates the reference number of the initial order that generated the licence 9xxxxx No
ORIGINAL_ORDER_REFERENCE_NUMBER Indicates the reference number of the initial order that generated the licence 9xxxxx No
PRODUCTID Product ID number 0 No
PRODUCT_EXTRA 0 0 No
PRODUCT_NAME The name of the renewal product Software Product Name No
PRODUCT_NAME_OLD Name of the old product (that will be renewed to a different version as per settings in your Control Panel) Software Product Name Old No
RENEWAL_BUY_NOW_LINK Short version of renewal buy link (prefilled with shopper information) https://secure.2checkout.com/order/ch..._ID=xxxxxxxxxx No
RENEWAL_COUPON Shows the coupon code of the discount (if the product has a renewal promotion assigned) 1 No
RENEWAL_INTERVAL Indicates the length of a billing cycle in number of days/months (as defined for the renewed product) 6 No
RENEWAL_INTERVAL_METRIC Indicates whether the renewal interval is defined in months or days 0 No
RENEWAL_PRICE The next renewal price of the renewal product 19.99 No
RENEWAL_PRODUCT_GROUP_CODE The Product Group Code of the product that the subscription will be renewing.   No
RENEWAL_PRODUCT_GROUP_NAME The Product Group Name of the product that the subscription will be renewing to   No
RENEWAL_PRODUCT_NAME The name of the renewal product Renewal product name Yes
RENEWAL_PRODUCT_RENEWAL_PRICE The next renewal price of the renewal product 19.99 Yes
RENEWAL_PRODUCT_RENEWAL_PRICE_OLD The catalog next renewal price (before discount) 30.99 No
RENEWAL_PROMOTION_DATA 0 0 No
RENEWAL_PROMOTION_DATA.Currency Currency of the renewal promotion USD No
RENEWAL_PROMOTION_DATA.Discount Discount value applied to renewals 30 No
RENEWAL_PROMOTION_DATA.DiscountType Type of renewal discount (percentage or fixed) PERCENT No
RETRYLINK Payment retry link 0 No
RETRY_LINK Payment retry link 0 No
SHOPPER_COMPANY_BILLING Shopper's company name used on the billing information User company No
SHOPPER_EMAIL_ADDRESS_BILLING Shopper's email address used on the billing information client@shopper.com No
STARTDATE Indicates the date when the subscription was purchased 40544 No
SUBSCRIPTION_EXPIRATION_DATE Indicates the date when the subscription expires 42292 Yes
TECHEMAIL Merchant support email address support@software-company-website.com No
TECHPHONE Merchant support phone number 888-xxx-xxxx No
UNSUBSCRIBE_LINK Shopper unsubscribe link 0 No
UPLOADLINK File upload link 0 No
UPLOAD_LINK File upload link 0 No
USER_EMAIL Email address used by shopper to login/signup to myAccount 0 No
WILL_CARD_EXPIRE_THIS_BILLING_CYCLE Indicates whether the payment card associated with the subscription will expire during the current billing cycle 0 No

API 5.0

Before you start using the 2Checkout API, check your PCI DSS compliance status. Find out more details about what PCI compliance means and what you should do to be PCI compliant here.  

 

Subscription history

Overview

Retrieve information about a subscription.

Parameters

Parameters Type/Description

ReferenceNo

String

 

Unique, system-generated order reference number.

Type

String

 

Purchase type:

  • SALE
  • RENEWAL
  • UPGRADE

SubscriptionReference

String

 

Unique, system-generated subscription reference.

StartDate

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

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.

Lifetime

Boolean

 

Possible values:

  • True – the subscription is evergreen

False – the subscription has a recurring billing cycle less than or equal to three years.

SKU

String

 

Stock keeping unit you defined.

DeliveryInfo

Object

 

Object with information about the delivery made to the customer - structure described below

PartnerCode

String

 

Possible values:

  • Empty = ecommerce order
  • Partner Code

 

Instant Payment Notification (IPN)

Overview

Use webhooks to be notified automatically and in real-time about events in your 2Checkout account.

 

Availability

IPN notifications are available to all 2Checkout account types.

What is IPN?

Instant Payment Notification (IPN) works as a message service generating automatic order/transaction notifications for your 2Checkout account. Use the notifications to process order data into your own management systems by synchronizing it with 2Checkout account events.

Webhook asynchronicity

2Checkout’s webhooks (IPN and LCN) operate asynchronously.

How can I use IPN?

Use IPN to automate back-end functions, including but not limited to:

  • Creating end-user accounts
  • Providing access to acquired services
  • Fulfilling purchases
  • Tracking orders and customers
  • Engaging customers

How does IPN work?

  1. Create one or multiple IPN listener pages on your website. 2Checkout sends IPNs to publicly accessible servers.
  2. Configure the IPN settings of your 2Checkout account to point to the URLs of your default/preferred listener pages. Our system performs a GET request against the URL you fill in and expects an HTTP 200 code as a response. Make sure that your URL can be queried via a GET request from our webserver  IPs.
  3. Set up multiple URLs if you require more listener pages, such as in testing scenarios in which you don’t want to use your default IPN listener. 
  4. 2Checkout sends order notifications to the endpoints you defined when shoppers acquire products/services from your online store. 2Checkout packages the payment information and sends it using secure (HTTPS) POST, according to your IPN settings.
  5. 2Checkout sends the IPN parameters according to your setup from IPN Settings. To include additional information in the notifications, enable new parameters in the IPN settings page. Learn more about IPN parameters here.
  6. 2Checkout uses an HMAC_SHA signature to validate the HTTPS POST. Calculate the signature using data sent and your 2Checkout account’s secret key, following the instructions included in this article.
  7. Your custom IPN listener scripts consume the notifications and process the info received.
  8. Configure your IPN listeners to output a read receipt confirmation on the listener page after receiving a valid IPN message. Guidance on how to generate the confirmation can be found here.
  9. In the absence of a confirmation from one of your IPN listeners, 2Checkout continues to send notifications to that endpoint, according to the failure retry process, until you provide a valid response.
  10. In the eventuality that 2Checkout fails to send IPNs or doesn’t receive a confirmation from your IPN listener, it displays an error in your Control Panel, on the Dashboard.

Set up the default IPN URL

  1. Log into your 2Checkout account.
  2. Navigate to Dashboard → Integrations → Webhooks and API.
  3. Click on the IPN Settings tab.
  4. Click on the Edit button to edit an existing URL corresponding to your default IPN listener or click on the Add URL button to add a URL corresponding to your default IPN listener in the IPN URL field.

       All merchants are strongly advised to migrate to SHA2/SHA3. We will stop supporting the MD5 algorithm in our platform on the 15th of August, 2024. For more details check the Migration guide documentation.
  5. Check the Allow concurrent requests (faster notifications) option. If checked, 2Checkout sends multiple notifications concurrently to your IPN URL. Note: This may cause concurrency problems, but will greatly improve the notification time.
  6. Save your settings.
  7. 2Checkout checks the validity of the URLs in terms of access to ensure that notifications reach your IPN listener without any issues.

Set up multiple IPN URLs

You can set up multiple endpoints for your IPN notifications, for scenarios in which you have multiple Internal Systems that require to receive this information. You can set up eight (8) URLs for your notifications.

Navigate to IPN settings under Integrations → Webhooks and API, in your Merchant Control Panel Dashboard. Select the IPN Settings tab and click on the Add IPN URL button to create an additional URL configuration for your notifications.

To find out more about the NOTIFICATION_URL functionality, read more here.

Debug IPN

To view or debug IPN notifications during the integration phase, place TEST orders.

Alternatively, search for specific orders in the "Orders & Reports" area. When you access the order details page you get the option to resend notifications. You can also see how many IPN notifications have been sent so far for an order. Opt to reissue the IPN for debugging and 2Checkout re-generates and re-sends the IPN, but also displays a copy of the content sent in the control panel.

Secure your IPN script

For security reasons, 2Checkout recommends that you restrict access to the IPN script.

 

Product group

Overview

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

                                           Retrieve product group                                                  Retrieve product groups

Product group object

Parameters Type/Description

Name

Required (string)

 

The name of the product group.

Code Optional (string)
  Unique, system-generated identifier assigned to product groups. 

TemplateName

Optional (string)

 

Leave empty to assign the Default Template to the product.

 

Or use the name of an active shopping cart template.

Description

Optional (string)

 

The description of the product group.

 

Extract invoices

Overview

Use the getInvoices method to extract shopper invoices from the 2Checkout system based on unique order references. The method returns the binary code for invoices in the PDF file format, Base64 encoded (Base64 is used to represent binary data in the ASCII string format).

getInvoices works for COMPLETE orders for which an invoice was already issued. For refunded orders, getInvoices provides two shopper invoices, one for the original order and the second for the refund, reflecting the repayment made.

In the case of cross-selling orders which contain products from different merchants, getInvoice enables you to re-send only the invoices for your own offerings.

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.

reference

Required (string)

 

Unique, system generated reference for orders.

Response

Parameters Type/Description

InvoicesData

Array of objects

 

 

Details below.

 

Sale

String

 

 

Base64 encoded PDF file containing an invoice for a Complete order.

 

Cancellation

String

 

 

Base64 encoded PDF file containing a cancellation invoice.

 

Refunds

Array of string

 

 

Base64 encoded PDF files containing invoices for Refunds.

Request

<?php

require ('PATH_TO_AUTH');

$reference = 'ORDER_REFERENCE';

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

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

 

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.

 

Update a lead

Overview

Use the updateLead method to update an existing lead and change all current values with new data.

Request Parameters

Parameters Required Type/Description
Currency Required Order currency.
Items Required Purchased products.
BillingDetails Required Array of strings. Billing information for the order.
DeliveryDetails Required Array of strings. Delivery information for the order.

Request Example

<?php

require ('PATH_TO_AUTH');

$Lead = new stdClass();

$Lead->CartId = "CartIdValue";
$Lead->Currency = "EUR";
$Lead->Language = "BG";
$Lead->ExternalReference = "REST_API_3CHECKOUT";
$Lead->Source = "testAPI.com";
$Lead->CustomerReference = "asdf1";
$Lead->MachineId = "123asd";

$Lead->Items = [];

$Item = new stdClass();
$Item->Code = "04C26C50F8";
$Item->Quantity = 2;
$Item->IsDynamic = false;
$Item->Tangible = true;
$Item->PurchaseType = "PRODUCT";
$Item->PriceOptions = [];

$priceOption = new stdClass();
$priceOption->Name = "group name 1";
$priceOption->Required = false;
$option = new stdClass();
$option->Name = 'add25';
$option->Value = 'add25';
$option->Surcharge = 100;
$priceOption->Options[] = $option;

$Item->PriceOptions[] = $priceOption;

$recurringOptions = new stdClass();
$recurringOptions->CycleLength = 6;
$recurringOptions->CycleUnit = 'MONTH';
$recurringOptions->CycleAmount = 100;
$recurringOptions->ContractLength = 2;
$recurringOptions->ContractUnit = 'YEAR';
$Item->RecurringOptions = $recurringOptions;

$marketingCampaigns = new stdClass();
$marketingCampaigns->Type = 23;
$marketingCampaigns->ParentCode = "m";
$marketingCampaigns->CampaignCode = 23;
$Item->MarketingCampaigns = $marketingCampaigns;

$Item->Price = new stdClass();
$Item->Price->Amount = 20;
$Item->Price->Type = "CUSTOM";

$additionalFields = [];

$additionalField = new stdClass();
$additionalField->Code = "TestFieldOne";
$additionalField->Text = "test text";
$additionalField->Value = "test value";
$additionalFields[] = $additionalField;
$Item->AdditionalFields = $additionalFields;

$Item->SubscriptionStartDate = date("Y-m-d H:i:s");

$Lead->Items[] = $Item;

$billingDetails = new stdClass();
$billingDetails->FirstName = "Customer";
$billingDetails->LastName = "2Checkout";
$billingDetails->Phone = null;
$billingDetails->Company = null;
$billingDetails->FiscalCode = "32423423";
$billingDetails->Email = "customer@2checkout.com";
$billingDetails->Address1 = "Test Address";
$billingDetails->Address2 = null;
$billingDetails->City = "LA";
$billingDetails->Zip = "12345";
$billingDetails->CountryCode = "RO";
$billingDetails->State = "CA";

$Lead->BillingDetails = $billingDetails;
$Lead->DeliveryDetails = clone($billingDetails);

$Lead->DeliveryInformation = new stdClass();
$Lead->DeliveryInformation->ShippingMethod = new stdClass();
$Lead->DeliveryInformation->ShippingMethod->Code = "sdfsd";

$Lead->PaymentDetails = new stdClass();
$Lead->PaymentDetails->Type = "CC";
$Lead->PaymentDetails->Currency = "EUR";
$Lead->PaymentDetails->PaymentMethod = new stdClass();
$Lead->PaymentDetails->PaymentMethod->RecurringEnabled = false;
$Lead->PaymentDetails->PaymentMethod->CardPayment = new stdClass();
$Lead->PaymentDetails->PaymentMethod->CardPayment->InstallmentsNumber = 23;
$Lead->PaymentDetails->CustomerIP = "1.2.3.4";

$Lead->LocalTime = date("Y-m-d H:i:s");

$jsonRpcRequest = array (
    'method' => 'updateLead',
    'params' => array($sessionID, $Lead, '60E6C4B574'),
    'id' => $i++,
    'jsonrpc' => '2.0'
);

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

Response Example

class stdClass#18 (4) {
  public $LeadCode =>
  string(10) "60E6C4B574"
  public $CreatedAt =>
  string(19) "2019-11-05T16:39:36"
  public $UpdatedAt =>
  string(19) "2019-11-05T16:48:31"
  public $Errors =>
  array(0) {
  }
}

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