Follow-up auto email
Overview
If you are leveraging 2Checkout lead management tools (set your campaigns here), our system automatically sends out the Follow-Up Auto email as part of the overall strategy to increase subscriber retention and the conversion rate of recurring charges. This notification makes it easy for subscribers to still renew their subscription in the case of scheduled recurring charges fail.
As of August 31, 2016, you can use a redesigned template complete with fresh content (sample below). The new template has replaced the previous Follow-Up Auto carts email, but any customization you have in place, either in terms of styling or content, continues to be available.
Availability
The lead management set of tools is available for Standard and Enterprise accounts. If you are running on our Growth offer and would like to receive access, please send us an email and we will discuss next steps.
What is the purpose of this email?
2Checkout performs dunning management for unfinished payments (declined) for auto-recurring charge attempts. Messages include links redirecting to a shopping cart where shoppers can manually purchase subscription renewals, but also links to their myAccount. The email covers failed transactions involving credit/debit cards, PayPal, direct debit, and recurring charges for subscriptions acquired through iDeal.
Email content
The email includes:
- Link to the shopping cart for the manual subscription renewal.
- Link to shopper myAccount.
- Order, product, and subscription details.
Preview and test the email sample
Navigate to the Email template manager section to:
- Preview and test current templates for emails sent to your shoppers
- Customize the header and the footer sections by creating custom templates you can assign to your emails
Access the Follow-Up Auto email under the Follow-Up section.
Why don't I see the new template for this email?
The redesigned template for the Follow-Up Auto email has automatically replaced default templates.
If your preview of Follow-Up Auto email does not show the new template, you are most probably using a customized version that includes content and/or styling your company requested at a certain point in time.
You can compare the above sample to your current template and send us an email if you decide the new one suits your business needs better. We will work with you on the switch.
Add products
Overview
Use addPromotionProducts to add products to an existing promotion.
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 add products to. |
|
promotionProducts |
Required (object) |
|
|
Code |
Required (string) |
|
|
System generated product code. |
|
pricingConfigurationCode |
Optional (string) |
|
|
System generated pricing configuration code. |
|
pricingOptionCodes |
Optional (array of strings) |
|
|
Pricing option codes that you control. |
Response
Parameter | Type/Description |
---|---|
PromotionProducts | Object |
Request
<?php
require ('PATH_TO_AUTH');
// Define a product to add to the promotion
$newProduct1 = new stdClass;
$newProduct1->Code = '';
$newProduct1->PricingConfigurationCode = '';
$newProduct1->PricingOptionCodes = ['',''];
// Define another product to add to the promotion
$newProduct2 = new stdClass;
$newProduct2->Code = '';
$newProduct2->PricingOptionCodes = [''];
$productPromotion = [$newProduct1, $newProduct2];
try {
$updatedPromotion = $client->addPromotionProducts($promotionCode, $productPromotion);
}
catch (SoapFault $e) {
echo "UpdatedPromotion: " . $e->getMessage();
exit;
}
var_dump("UpdatedPromotion", $updatedPromotion);
Add usage
Overview
Use the addSubscriptionUsage method in SOAP API 6.0 to add multiple usages at the same time.
Request Parameters
Parameters | Type | Required | Description |
---|---|---|---|
merchantCode | String | Required | The system-generated merchant ID. |
sessionID | String | Required | Unique 2Checkout session ID code. |
SubscriptionReference | String | Required | Unique 2Checkout subscription reference code. |
hash | String | Required | The MD5 hmac key for the request. |
OptionCode | String | Required | Unique 2Checkout option code. |
UsageStart | Datetime | Required | Date when the usage starts. Format "YYYY-MM-DD". The timezone used is the one on the server. |
UsageEnd | Datetime | Required | Date when the usage ends. Format "YYYY-MM-DD". The timezone used is the one on the server. |
Units | Number | Required | Number of usage units consumed by user. |
Description | String | Optional | It can be used to store a short merchant comment of the usage being uploaded. This can be anything, from the source of usage (mobile, web, etc.), to why changes occurred, etc. Example: Subscription usage for September. |
Request Sample
<?php
require ('PATH_TO_AUTH'); // authentication call
$SubscriptionReference = "B7D8E72224";
try {
$subscriptionUsageRequest = new stdClass();
$subscriptionUsageRequest->OptionCode = "scale";
$subscriptionUsageRequest->UsageStart = "2025-03-02 10:00:10";
$subscriptionUsageRequest->UsageEnd = "2025-04-01 10:00:10";
$subscriptionUsageRequest->Units = 404;
$response = $client->addSubscriptionUsage(
$sessionID,
$SubscriptionReference,
[$subscriptionUsageRequest]
);
var_dump($response);
} catch (SoapFault $ex) {
$faultname = (isset($ex->faultname)) ? " $faultname" : '';
echo "[$ex->faultcode]$faultname: $ex->faultstring" . PHP_EOL;
}
exit;
Response
The successful addSubscriptionUsage call via SOAP APIv6 returns the Usage object.
array(1) {
[0] =>
class stdClass#3 (9) {
public $usageReference =>
string(12) "120011112191"
public $subscriptionReference =>
string(10) "67F3AD6A32"
public $optionCode =>
string(6) "USG_MN"
public $usageStart =>
string(19) "2020-07-06 12:00:00"
public $usageEnd =>
string(19) "2020-07-07 12:00:00"
public $units =>
int(30)
public $description =>
string(0) ""
public $renewalOrderReference =>
string(0) ""
}
}
Error handling
Error message description | Error code | Error message |
---|---|---|
LICENCECODE is not a valid licence code for the merchant | INPUT_ERROR | Usage was not added as the license code provided is invalid. |
OPTIONCODE is invalid for the Merchant and Licence or is not a usage-based option code | INPUT_ERROR | Usage was not added as the option code provided is invalid. |
Provided usage entries overlap within themselves or with existing usage entries | INPUT_ERROR | Usage was not added as the usage interval provided overlaps with an existing usage interval for the same LICENCECODE and OPTIONCODE combination. |
Provided date formats are unsupported |
INPUT_ERROR | Usage start format unsupported. Please use YYYY-MM-DD HH:MM:SS. |
Usage end format unsupported. Please use YYYY-MM-DD HH:MM:SS. | ||
One or more mandatory parameters are missing or do not have the required format |
INPUT_ERROR | Usage was not added as one or more of the mandatory parameters are missing. |
Usage was not added as one or more of the parameters do not match the required format. | ||
Units not allowed. | ||
Provided usages' start date is prior to the subscription start date or end date is after the subscription expiration date. | INPUT_ERROR | Usage interval out of bounds. |
Unexpected error happens | INTERNAL_ERROR | <unexpected_error> |
Search products
Overview
Use the searchProducts method to extract information about the subscription plan/products you configured for your account.
Pagination
Use pagination to decrease the request loading time, while better handling the returning responses.
Pagination works on all the search methods existing on 2Checkout API 6.0. The default pagination behavior is to display page 1 with 10 results. The maximum number of items displayed on a single page is 200.
To use pagination, include the Pagination object inside the search method call, using the parameters below:
Parameters | Type/Description | |
---|---|---|
Pagination | Object | |
Details below. | ||
Page | Int | |
Set the number of pages that should be returned. | ||
Limit | Int | |
Set a limit for the number of results that should be returned. |
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. |
||
SearchOptions |
Object |
||
Name |
Optional (string) |
||
|
Product name. Can be NULL. |
||
|
Codes |
Optional (StringArray) |
|
|
Array of product codes. |
||
Types |
Optional (StringArray) |
||
|
Array of the values representing the type of products. Possible values:
Leave empty to have all product types returned to the search. Can be NULL. If NULL, 2Checkout returns both regular and bundle products. |
||
Enabled |
Optional (boolean) |
||
|
True or false. Can be NULL. |
||
GroupName |
Optional (string) |
||
|
The name of the group that the product is associated with. Can be NULL. |
||
Pagination | Object | ||
Limit |
Optional (integer) |
||
|
Number of results (products) displayed per page. Default value is 10. Can be NULL. |
||
Page |
Optional (integer) |
||
|
A specific page of search results. Default value is 1. Can be NULL. |
||
|
OrderBy |
Object |
|
|
Defines the order of the returned results. |
||
|
Field |
Optional (string) |
|
|
The name of the field to order the results by. Allowed values: 'ProductStatus', 'ProductName', 'ProductCode', 'UpdateDatetime', 'AvangateId'. Can be NULL. |
||
|
Direction |
Optional (string) |
|
|
Sort results ascending or descending. Allowed values:
Can be NULL (defaults to desc).
|
Request Example
<?php
require ('PATH_TO_AUTH');
$SearchOptions = new stdClass();
$SearchOptions->Name = '2Checkout Subscription'; //Product name
$SearchOptions->Types = array ('REGULAR', 'BUNDLE'); //product type (standalone), regular or bundle
$SearchOptions->Enabled = True;
//$SearchOptions->GroupName = '';
$SearchOptions->Pagination = new stdClass();
$SearchOptions->Pagination->Page = 1;
$SearchOptions->Pagination->Limit = 10;
try {
$ProdSearch = $client->searchProducts($sessionID, $SearchOptions);
}
catch (SoapFault $e) {
echo "Query: " . $e->getMessage();
exit;
}
var_dump("Query", $ProdSearch);
?>
Response Parameters
Parameter | Type/Description |
---|---|
Object |
Legal customization requirements
Overview
2Checkout is the Merchant of Record for orders performed and payments processed using our platform. From a legal standpoint, this means we are responsible for the information provided to your shoppers via the emails sent, on your behalf, through our platform.
Consequently, there are several mandatory requirements to account for when customizing your emails. These requirements depend on the type of emails sent. 2Checkout emails generally fall into two categories:
- Transactional emails. According to CAN-SPAM rules, these emails facilitate an already agreed-upon transaction or update the customer about ongoing transactions. They usually contain order, payment, or customer-specific information.
- Marketing (commercial content) emails. According to CAN-SPAM rules, these emails advertise or promote commercial products or services.
Check the documentation available here to see the emails in each category.
Email requirements
Do not remove mandatory information when you customize the content of your emails.
Transactional email requirements
- Always include the reference to 2Checkout acting as Merchant of Record in Transactional emails (optional for Marketing emails). The structure we recommend using is the one in our default templates: “2Checkout acts as an authorized reseller of <Your Company Name> online products and services.” Localized versions are available for all default templates.
- Show 2Checkout support information in all Transactional emails. This includes the access link to the shopper myAccount along with the email address needed to log in. Keep in mind that we are the ones offering order and payment support, so make sure you provide shoppers with access to all support channels. This weighs a lot in turning them into loyal, long-term customers.
- Display merchant (your company) support information in all Transactional emails. This includes support email and phone numbers. This is critical to your shoppers when they need additional product/subscription information, troubleshooting services, or access modifications.
Marketing email requirements
- Include an unsubscribe option in all Marketing emails. Make it as clear, explicit, and simple to use as possible. We recommend keeping/including an unsubscribe link at the bottom of your message. You can use the UNSUBSCRIBE_LINK variable that takes the shopper to an unsubscribe page.
- Gmail and Yahoo updated their requirements for bulk senders making it mandatory to have one-click unsubscribe option in the header. This means that all emails with the exception of order confirmation, payment receipts, electronic delivery, access links and others will have an unsubscribe option in the header.
- The current unsubscribe mechanism ensures that the unsubscribe scope is limited to either a specific sale, lead or subscription. Take for example the case where you have configured 5 manual renewal reminders. The shopper receives the first manual renewal reminder and clicks on the “unsubscribe” link. The shopper will no longer receive any manual renewal reminders for that subscription renewal, but he would still be eligible to get the same type of reminder for other subscription(s) and even for the next renewal of the same subscription.
- The below platform emails will have the one-click unsubscribe option in the header:
- Abandoned cart (lead management)
- Affiliate newsletter
- Free trial download expiration
- Manual renewal reminder
- Recurring payment failed (Direct Debit)
- Recurring payment failed (dunning notification)
- Recurring payment failed (instant payment methods)
- Unfinished payment (Direct Debit)
- Unfinished payment (lead management)
- Unfinished payment (Purchase order)
Shared requirements
- Always display the 2Checkout logo in either the header or the footer of the email. Make sure it is visible and distinctive against other elements. You can use the 2CHECKOUT_LOGO variable that shows the image at optimal dimensions.
- The subject line of your emails needs to be reflective of the content they communicate. Choose a relevant subject line to ensure your shoppers will continue opening emails sent on your behalf and keep these emails out of the spam folder.
- The content of your emails should always be related to the event triggering the email. For instance, build the Payment receipt email to include information on purchased products or subscriptions, quantities, unit prices, taxes, discounts, and total price, billing, and delivery information. Abandoned cart notifications should include a link to the abandoned cart, that the shopper can use to finalize the order.
Orders with installments
Overview
Avangate supports local Brazilian Visa, MasterCard and AMEX credit / debit cards limited to national purchases in the local currency BRL (Brazilian Real).
Requirements
- Installments are available only for:
- Brazilian customers
- Local Visa, MasterCard or AMEX cards
- Non-recurring transactions
- Minimum installment threshold is 5 BRL. Maximum number of installments is 6.
- Mandatory information for payments also includes shopper phone number and Fiscal Code (CPF/CNPJ).
Do local BR cards with / without installments require an addendum to my contract?
Yes. Please contact Avangate for activation.
How does it work?
- Create the Order object.
- Validate the number of installments available based on total order value.
- Place the order specifying the number of installments.
Funds collection for installment payments
2Checkout pays you in full, regardless of the number of installments (this is covered directly by the banks).
Overview
Introduction
Use JSON/RPC to invoke methods of version 3.0 of the Avangate API. JavaScript Object Notation remote procedure call protocol is a lightweight data-interchange format.
Workflow
- Use the following URL: https://api.avangate.com/rpc/3.0/
- Authenticate using the login method and create a session (connection).
- Throughout the lifetime of the session (max 10 minutes) you can invoke all Avangate API methods. To invoke methods you need to send a request to Avangate. Read more on the request object below.
- The Avangate system provides responses for all requests. Read more on the response object below.
Request
Invoke remote methods by sending requests to Avangate. Request contain single objects serialized using JSON. Read request properties below.
{
"jsonrpc": 2.0,
"id": < intidentifier >,
"method": "<methodName>",
"params": [ < parametersarray > ]
}
Request object
jsonrpc |
required (String) |
|
The version of the JSON-RPC protocol. Needs to be 2.0. |
id |
required (Int) |
|
A mandatory identifier you control used to identify the request and the response. Use only integers. |
method |
required (String) |
|
The name of the method invoked. Case sensitive. |
params |
optional (Object) |
|
An object containing the parameters valid for invoking the method used. Parameters structure:
|
Response
When the method invocation completes, Avangate replies with a response. The response is a single object serialized using JSON. There are two types of response, with the properties detailed below.
Valid
{
"id": < intidentifier > ,
"jsonrpc": 2.0,
"response": { < return object > }
}
jsonrpc |
required (String) |
|
The version of the JSON-RPC protocol. Needs to be 2.0. |
id |
required (Int) |
|
A mandatory identifier you control used to identify the request and the response. Use only integers. |
response |
required on success only (Object) |
|
Provided on success (Avangate does not provide it if there is an error invoking the method). Actual value depends on the method invoked. |
Invalid
{
"id": < intidentifier >,
"jsonrpc":2.0,
"error":{
"code": < interrorcode >,
"message":"<error message>"
}
}
jsonrpc |
required (String) |
|
The version of the JSON-RPC protocol. Needs to be 2.0. |
id |
required (Int) |
|
A mandatory identifier you control used to identify the request and the response. Use only integers. |
error |
required on error only (Object) |
|
|
Custom Price Change
Overview
2Checkout automatically sends out the custom price change email to provide shoppers with information about a change in their subscription price. It notifies shoppers that the subscription price has been changed by the service provider.
The custom price change email template is available for customization in the Merchant Control Panel.
Availability
All 2Checkout accounts.
What is the purpose of this email?
2Checkout sends the custom price change email for all shoppers with active subscriptions.
Email content
The email provides detailed information on the content of the subscription and billing cycle:
- Subscription details.
- Billing cycle and new billing cycle information.
- Billing amount details.
Sample
Email Body
Dear [% $LAST_NAME %] [% $FIRST_NAME %],
Please be informed that the next billing amount for your subscription to [% $PRODUCT_NAME %] has been changed by a representative of [%$COMMERCIALNAME%]:
New billing amount: [% $NEW_PRICE.amount %] [% $NEW_PRICE.currency %]
[%if $NEXT_BILLING_DATE %]Next billing date: [% $NEXT_BILLING_DATE %]
[%/if%]
Previous billing amount: [% $OLD_PRICE.amount %] [% $OLD_PRICE.currency %]
Price validity: [%if $NEXT_CIRCLES == false%]all future subscription renewals.
[%else%]the next [% $NEXT_CIRCLES %] subscription renewal(s) from now on, after which the previous billing amount will be charged.
[%/if%]
To manage your subscription, please access your [% $PAYMENT_PARTNER %] myAccount at:
[% $MYACCOUNT_URL %]
For further information regarding this price update, please contact [% $SELLER_COMPANY %][%if $SUPPORT_EMAIL%] at: [% $SUPPORT_EMAIL %][%/if%]
[%if $SUPPORT_WEB%]
Sample Image
Order session contents
Overview
Retrieve the current cart session content, and learn insights about your customers actions in cart.
You can obtain the VAT or sales TAX based on current cart items, prefill the customer information based on the subscription reference, or get the price applied in cart by using the API method from below.