Skip to main content

Refund an order

Overview

Refund a sale made in 2Checkout via the issueRefund API method. Depending on your business needs, you can refund only one sale item, the entire order amount, or a partial amount from the total order.

Requirements

The payment for the refundable order needs to be collected.

You cannot issue a refund for an amount higher than the total order amount.

Parameters

Parameters Type/Description
RefNo

String / Required

The order reference number of the sale for which the refund is issued. Example: '721924012'.

Amount

Double / Required

Refundable amount. Required as a supplementary check for partial refunds. Example: '26.00'.

Comment

String / Optional

Comments are displayed to customers in the refund confirmation they receive. Example: 'Let us know if you are satisfied with the refund process'. 

Reason

String / Required

In case you have custom refund reasons defined on your account, send one of the reasons. If not, send one of the platform defined reasons. Read more about 2Checkout refund reasons.

Example: 'Unwanted auto-renewal'.

Items

Array / Required only for partial refunds

In case you issue a partial refund, send the array with the information below.

  ProductCode 

String / Required

Send the product code belonging to the products to be refunded. The product code is available at product level, in the Information tab.

  Quantity

Integer / Required

Quantity to be refunded. Send only positive values.

  Amount

Double / Required

Total amount of the refunded line item, not the unit amount.

 

 

Convert a trial

Overview

Use the convertTrial method to convert a trial to a paid subscription. In the eventuality of a conversion failure, you can use convertTrial again for the same trial subscription only after you let 24 hours pass since the initial attempt. The 2Checkout system attempts to automatically convert trials before they expire to full subscriptions, unless you made an attempt that failed less than 24 hours before the scheduled expiration deadline.

In case the trial conversion fails due to a transaction issue, the 2Checkout system sends unfinished payment follow-up emails to customers, provided that you set up lead management 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.

SubscriptionReference

Required (string)

 

Unique, system-generated subscription identifier of the trial that you convert to a paid subscription. The unique identifier from the 2Checkout system:

  • Must belong to an active trial subscription with the recurring billing system (auto-renewal) enabled.
  • The initial order placed to access the trial subscription must be finalized (status Finished).

Note: This method does not work for cancelled and/or expired trial subscriptions.

 

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

ExtendSubscriptionFromPaymentDate

Optional (boolean)

 

true = Set the moment of the conversion as the start date of the full subscription. 

Example: A 7 day trial purchased on October 29 for a monthly subscription converted on October 30 with $ExtendSubscriptionFromPaymentDate = true; features the following Billing cycle expiration: Nov 30, 2013 and 2Checkout scraps the initial trial expiration date November 5.

 

false = Set initial trial expiration deadline as the fhe full subscription start date. 

Example: A 10 day trial purchased on October 29 for a monthly subscription converted on October 30 with $ExtendSubscriptionFromPaymentDate = false; features the following Billing cycle expiration: December 9, with the first month period of the subscription added to the trial lifetime stretching until November 8.

 

Can be NULL. If not sent, the default value is false.

Response

Boolean

true or false depending on whether the changes were successful or not.

Request


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

function hmac($key, $data)
{
    $b = 64; // byte length for md5
    if (strlen($key) > $b) {
        $key = pack("H*", md5($key));
    }
    
    $key    = str_pad($key, $b, chr(0x00));
    $ipad   = str_pad('', $b, chr(0x36));
    $opad   = str_pad('', $b, chr(0x5c));
    $k_ipad = $key ^ $ipad;
    $k_opad = $key ^ $opad;
    return md5($k_opad . pack("H*", md5($k_ipad . $data)));
}
$merchantCode = "YOUR_MERCHANT_CODE";// your account's merchant code available in the 'System settings' area of the cPanel: https://secure.2checkout.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.2checkout.com/cpanel/account_settings.php
$now          = gmdate('Y-m-d H:i:s'); //date_default_timezone_set('UTC')
$string = strlen($merchantCode) . $merchantCode . strlen($now) . $now;
$hash   = hmac($key, $string);
try {
    $sessionID = $client->login($merchantCode, $now, $hash);
}
catch (SoapFault $e) {
    echo "Authentication: " . $e->getMessage();
    exit;
}
$SubscriptionReference = '30E47F8699';
$ExtendSubscriptionFromPaymentDate = true; //false can also be used if you want the subscription start date to be the moment when the trial was set to initially expire.
try {
    $convertedTrial = $client->convertTrial($sessionID, $SubscriptionReference, $ExtendSubscriptionFromPaymentDate);
}
catch (SoapFault $e) {
    echo "convertedTrial: " . $e->getMessage();
    exit;
}
var_dump("convertedTrial", $convertedTrial);

 

Subscription renewal links

Overview

You can build and control manual subscription renewal links to offer directly to your customers.

Availability 

All 2Checkout accounts. 

Requirements

Custom renewals links can be created for active and past-due subscriptions (excluding trials and non-recurring/lifetime subscriptions).

Requirements 

Custom on-remand renewals buy-links: need to be generated manually, and they work for active and past-due subscriptions (excluding trials and non-recurring/lifetime subscriptions).

Subscriptions can be renewed on demand up to 4 years ahead of their expiration deadline. Contact 2Checkout directly if you wish to customize this limitation.

Scenarios covered 

  1. Renew Subscription A belonging to Product A (source product) keeping it under Product A (target product).
  2. Renew Subscription A belonging to Product A (source product) and moving/upgrading the customer to Product B (target product).

Workflow 

Use this feature to enable your customers to renew their active and past-due subscriptions on-demand, bypassing the upcoming renewal operation scheduled in the 2Checkout system.

Custom on-demand subscription renewals are performed:

  1. Using the price you specify, or by calculating the renewal costs based on the pricing options of the target product, or the custom renewal price for upcoming billing cycles, if set. The costs of all future renewals will be calculated based on the pricing options of the product with which the subscription is associated.
  2. From the moment when the items were scheduled to renew/expire. For example, let's assume that Subscription A (a monthly subscription), scheduled to expire June 30th, 2013, is renewed through the use of an on-demand link with a period of 10 days on June 22nd. Subscription A's lifetime will be prolonged with 10 days starting with June 30th, and the renewal/expiration deadline moved to July 10th. Moving forward, Subscription A will be renewed a month after the July 10threnewal, per its monthly renewal cycle.
  3. By overriding the subscription billing cycle settings. However, following the custom on-demand renewal, the subscription will be governed by the renewal settings and pricing configuration of the product it's associated with.

Early renewals

In addition to standard manual renewal links, you can also create more complex early renewal links, controlling price, renewal and expiration deadlines as well as subscription lifecycles. 

Create a custom renewal link

To build custom renewal links you need the following two elements:

  1. The main renewal link: https://secure.2Checkout.com/renewal/?
  2. The unique subscription reference from the 2Checkout system: LICENSE=1A22223BC4.
The simplest renewal link you can build is https://secure.2checkout.com/renewal/?LICENSE=1A22223BC4.

Tailor your renewal offer by controlling the renewal quantity and price. 

Parameters

When building custom on-demand renewal links, please make sure that the position of the parameters is the same when creating the link as well as when generating the HASH. For convenience, consider using them in this order: LICENSE, PRODS, OPTIONS, PRICES[Currency], PERIOD, and PHASH.

Parameter Required Description

LICENSE

Required

Unique 2Checkout subscription reference. This identifier is used to trigger the renewal process for a specific subscription.

PRODS

Required

The unique numeric (int) product ID from the 2Checkout system. Custom on-demand subscription renewals work for a single product at a time. As such, custom renewal links can contain only a single product identifier.

The product ID can be:

 

1. Identifier of the product (the source and the target product are the same) to which the subscription is already associated with. For example, Subscription A belonging to Product A can be renewed while preserving the connection to Product A. Following the on-demand renewal, Subscription A will continue to renew per the Product A's renewal settings and pricing configuration options.

 

2. Identifier of a different product (the target product) than the one associated with the subscription (the source product). For example,Subscription A belonging to Product A can be renewed while the customer is upgraded to Product B. Following the on-demand renewal,Subscription A will continue to renew per the Product B's renewal settings and pricing configuration options.

 

In the Control Panel, click to edit a product, and select the Information tab. The Product ID of the item you're editing is available at the top of the General area under Information. Note: Product IDs are different than Product Codes, also available in this area, but which you control.

 

Effect: permanent. 2Checkout associates the subscription with the target product following the custom on-demand renewal.

Note: PRODS override settings related to renewal with a different product.

OPTIONS

Optional

Preselected pricing options for the target renewal product. The values used are the pricing options codes (the codes are set for each option individually). When a list of pricing options codes is used the values should be separated by commas. For example: OPTIONS=5usr,2year. Pricing options codes are case sensitive. 

 

For scale pricing options, the parameters need to be built using the options code and the specific scale value. For example, for a Users scale from 1 to 10 and 11 to 50 with the code users, the parameter is OPTIONS=users=35 if you want customers to the pay the costs for 35 users.

 

The 2Checkout system uses the options to calculate the renewal costs that customers pay, unless you specify them using the PRICES parameter.

 

If missing, the 2Checkout system uses the default pricing options of the product with which the subscription is associated.

 

2Checkout uses required pricing options to calculate renewal costs whether they're included in the custom link or not. At the same time, options that are not associated with the product are ignored.

 

Effect: permanent. 2Checkout associates the pricing options with the subscription following the custom on-demand renewal and will be used by the system to calculate the costs that customers will pay for future renewals.

PRICES[Currency]

Optional

Use this parameter to set the custom price for the subscription renewal in the default currency, as well as in all the transactional currencies active for your account. Multiple PRICES[Currency] parameters can be set to control renewal costs in various currencies: PRICES[Currency1]=[FLOAT]&PRICES[Currency2]=[ FLOAT]&PRICES[Currency3]=[ FLOAT]

When sent, the price takes precedence and overrides the renewal costs calculated by the 2Checkout system based on the pricing options (OPTIONS) included in the custom on-demand link.

 

If missing, 2Checkout calculates the price based on the default product settings and pricing options.

 

For example, let's assume that only 3 transactional currencies are active for your account, USD, EUR and GBP. You can price the renewal of a subscription as such:

PRICES[USD]=99.99&PRICES[EUR]=88.99&PRICES[GBP]=80.99. This example can be expanded to cover all transactional currencies active for your account.

 

Customers see the prices defined per the currency they use when accessing the shopping cart during the ordering process. Considering the example above, shoppers in the US will pay $99.99 for their subscription renewal, while those in the UK will pay 80.99 GBP, even if the same link is used for both.

 

If the price is not defined for a specific billing currency, the renewal costs calculated will be converted from the pricing defined for the product's default currency.

 

Effect: one-time only. Following the custom on-demand renewal, the 2Checkout system calculates the costs paid by customers for future renewals, based on the pricing options saved for this subscription and the product it's associated with.

 

Note: When sent, the PRICES value, overrides all product-side pricing settings, including custom renewal prices and the usage of original order prices for renewals.

 

Note: If missing for a subscription for which you defined a custom renewal price for one or more upcoming billing cycles, the costs paid by the users will reflect the custom renewal price and will not be calculated using product pricing options.

QTY Optional

The product quantity of the renewal order. Example: QTY=5.

The value set overrides the quantity from the order that generates the renewal. The quantity value only impacts the price per unit, but has no impact on the final renewal price.

Include this parameter in the PHASH signature.

PERIOD

Optional

The interval of time in days that will be added to the subscription lifetime starting with the current renewal/expiration deadline. Cannot be larger than three (3) years.

 

If missing, the subscription renewal takes into account the entire billing cycle interval of the product with which the subscription is associated.

 

Effect: one-time only. Following the custom on-demand renewal, the subscription will be renewed based on the billing cycle settings of the product it's associated with.

LANG Optional

Selected language for order processing interface and payment receipt and fulfillment emails. By default, if the parameter is missing, the ordering process language is the same as the one used to buy the subscription.

 

Check here the list of languages available.

IGNORE_CUSTOM_PRICE Optional

The parameter applies the initial base price of the subscription, ignoring any custom price that you may have set. If you include this parameter in the link, you need to generate the PHASH again.

 

Possible values: 1.

PHASH

Required

Required HMAC_MD5 signature in order to prevent the request from being exploited. Read the examples below to understand how to build the PHASH.

Effect: one-time only. Valid only for the link it's generated for.

Note: If you include the IGNORE_CUSTOM_PRICE parameter in the link, you need to generate a new PHASH.

Use cases

Renew the subscription with a specific price, quantity and period of time

For this example, let's assume that we need a custom on-demand renewal link for Subscription A (monthly subscription expiring on June 30th, 2013 with the reference ABC1D2E345) associated with Product A with the ID 1234567.

Product A is offered to customers in two versions:

  • 1 user (code: 1user) - $99.99; (the customer using Subscription A opted for this particular pricing option).
  • 2 users (code: 2users) - $149.99.

You're looking to prolong the subscription lifetime with 30 days, and charge the customer $50, for a quantity of 5. We'll use some of the parameters listed above:

LICENSE=ABC1D2E345

PRODS=1234567

OPTIONS=1user

PRICES[USD]=50

QTY=5

PERIOD=30

https://secure.2checkout.com/renewal/?LICENSE=ABC1D2E345&PRODS=1234567&OPTIONS=1user&PRICES[USD]=50&QTY=5&PERIOD=30

You will need to build the PHASH for the link above.

1. Using the parameters above, you get the following sequence:

LICENSE=ABC1D2E345&PRODS=1234567&OPTIONS=1user&PRICES[USD]=50&QTY=5&PERIOD=30

2. Next, you need to prefix (prepend) the length of the character sequence to calculate the hash, namely 77. The resulting BASE STRING is: 

77LICENSE=ABC1D2E345&PRODS=1234567&OPTIONS=1user&PRICES[USD]=50&QTY=5&PERIOD=30

3. For the purpose of this example, let's assume that your secret key is SECRET_KEY.

4. Use the secret key and the base string to calculate the HMAC-MD5 HASH. The result should be: 3f3b3dc0a9ceda2fb1daad4d5eec0b04 (valid exclusively for this example).

5. Build your complete link:

https://secure.2checkout.com/renewal/?LICENSE=ABC1D2E345&PRODS=1234567&OPTIONS=1user&PRICES[USD]=50&QTY=5PERIOD=30&PHASH=3f3b3dc0a9ceda2fb1daad4d5eec0b04

Renew a subscription with a specific price, quantity and period of time, changing the product associated with the subscription

For this example, let's assume that we need a custom on-demand renewal link for Subscription A (monthly subscription expiring on June 30th, 2013 with the reference ABC1D2E345) associated with Product A with the ID 1234567. In the renewal process, the customer will also be upgraded from Product A to Product B (ID 1122334).

Product A is offered to customers in two versions:

  • 1 user (code: 1user - default, required option) - $99.99; (the customer using Subscription A opted for this particular pricing option).
  • 2 users (code: 2users) - $149.99.

Product B is offered to customers in a single version:

  • 1 user (code: 1userPB - default, required option) - $199.99;

You're looking to prolong the subscription lifetime by 60 days, and charge the customer $160. We'll use some of the parameters listed above:

  • LICENSE=ABC1D2E345
  • PRODS=1122334
  • OPTIONS=1userPB
  • PRICES[USD]=160
  • QTY=5
  • PERIOD=60
https://secure.2checkout.com/renewal/?LICENSE=ABC1D2E345&PRODS=1122334&OPTIONS=1userPB&PRICES[USD]=160&QTY=5&PERIOD=60

You need to build the PHASH for the link above.

1. Using the parameters above, you get the following sequence: 

LICENSE=ABC1D2E345&PRODS=1122334&OPTIONS=1userPB&PRICES[USD]=160&QTY=5&PERIOD=60

2. Next, you need to prefix (prepend) the length of the character sequence to calculate the hash, namely 80. The resulting BASE STRING is:

80LICENSE=ABC1D2E345&PRODS=1122334&OPTIONS=1userPB&PRICES[USD]=160&QTY=5&PERIOD=60

3. For the purpose of this demo, let's assume that your secret key is SECRET_KEY.

4. Use the secret key and the base string to calculate the HMAC-MD5 HASH. The result should be: 0e06b3dfce123db20dae02a3fccfd3dd (valid exclusively for this example).

5. Build your complete link:

https://secure.2checkout.com/renewal/?LICENSE=ABC1D2E345&PRODS=1122334&OPTIONS=1userPB&PRICES[USD]=160&PERIOD=60&QTY=5&PHASH=0e06b3dfce123db20dae02a3fccfd3dd

Convert a trial on-demand

2Checkout converts all trials with payment information automatically, unless customers opt-out. You can use the 2Checkout API to convert trials on demand.

Control the ordering experience for early renewals

You can control some aspects of the ordering experience for customers using early renewal links, by appending the following parameters to the created buy-link. The parameters listed below are not included in the PHASH calculation and can be added to links without recalculating the mandatory HMAC_MD5 signature.

Parameter Required/Optional Description

DESIGN_TYPE

Optional

Value = 1. When DESIGN_TYPE=1 is used in Buy Links the parameter changes the layout of the shopping cart template interface, positioning the payment methods selector in a more prominent position, above the billing details area. 

LAYOUT_TYPE

Optional

LAYOUT_TYPE enables you to control which version of the shopping cart is served to shoppers. Possible values:

CLASSIC - the desktop variant of the shopping cart (using LAYOUT_TYPE=CLASSIC will always display the desktop version of the cart even to mobile device users);

MOBILE - 2Checkout mobile cart (using LAYOUT_TYPE=MOBILE will always display the mobile version of the shopping cart, even to users of desktop browsers).

REF

Optional

External order reference (string). You can add a string identifier to every Buy Link created (less than 100 characters), and that will be saved with the order, in addition to the system-generated 2Checkout order reference. If there is a need for longer references, an md5 hash can be applied for any string value, resulting in a 32 characters string. This hash can be verified after the order notification, on the client-side. External references are visible when accessing the order details page for your orders.

SRC

Optional

To identify the source of your sales (which links are performing better), a separate link identifier can be assigned to each link. For instance, if there are two buy links on your website, one in the product page and another one on the download page, you can track the source page by entering the following parameters: 
SRC=prodpage for the product page or SRC=dldpage for the link on the download page 
(dldpage and prodpage are example strings only, you can use any combination).

COUPON

Optional

Promotion coupon code to be applied in the order. You can send multiple values separated by a comma (in case you need several coupons to be applied in the same order). 
For example: [...]&COUPON=voucher1,voucher2[...]

CARD

Optional

Possible values:

1 - use this parameter with value 1 in order to display the credit card details form on the selected landing page. Shoppers will place orders from the Review page.

2 - when this value is used, it not only allows the credit card details form to be displayed on the selected landing page but also enables shoppers to place orders immediately after entering their payment data, excluding the Review page.

ORDERSTYLE

Optional

Allows you to set the corresponding template, overriding the default template assigned to the product group. Each template defined in the Interface Templates area of the Control Panel has a unique identifier associated which is visible in the browser address bar when previewing the shopping cart.

AUTO_PREFILL=1

Optional

Include AUTO_PREFILL=1 in buy links for shopping carts.

When the AUTO PREFILL feature is active and AUTO_PREFILL=1 is used in buy links, the ZIP code and country pair become the only required aspects of the billing address.

Address, City, and State details are calculated automatically by the 2Checkout system. The address can miss altogether.

Note: Using the AUTO_PREFILL=1 parameter without the feature being enabled for your account will result in shoppers following the classic purchase flow, where all billing address data is mandatory. 

Domain use

  • secure.2checkout.com domain. If your account is using the 2Checkout's secure.2checkout.com domain, then this is what you need to include in your custom on-demand renewal links served to your customers, namely 
https://secure.2checkout.com/renewal/?
  • Custom domains such as store.YourDomain.com. If your account is using a custom domain such as store.YourDomain.com, then this is what you need to include in your custom on-demand renewal links served to your customers, namely 
https://store.YourDomain.com/renewal/?

 

Use iDEAL

Overview

Place an order with catalog products defined in your Control Panel and collect the payment using iDEAL.

Requirements

Shoppers in the Netherlands can purchase using iDEAL. The billing country and the order country code have to be NL.

Supported currencies

  • EUR

Accepted on other payment flows 

One-click (1-click) purchase for iDeal is available in API 6.0.

Workflow

  1. Use the getIdealIssuerBanks method for retrieving information on the 2Checkout list of banks that support iDEAL payments. More details about this method here.
  2. Shoppers select iDEAL as payment option in the interface you provide them, and select their bank from the list.
  3. Create the order object. Use IDEAL as the type of the PaymentDetails object, and include ReturnURL and CancelURL. The BankCode parameter should be added based on the bank selected by the customer, from the array obtained after calling method getIdealIssuerBanks.
  4. Use the placeOrder method to send the data to 2Checkout.
  5. Once you place the order, 2Checkout logs it into the system. At this point in time, the status of the order is PENDING.
  6. 2Checkout returns an Order object as the output of the placeOrder method. 
  7. Use the PaymentMethod object to create a redirect URL for the shoppers, concatenating the values of the Href and avng8apitoken parameters. Here's an example of the redirect URL:
    https://api.2checkout.com/4.0/scripts/ideal/authorize/?avng8apitoken=f56373d92ed6b153
    
  8. Customers are directed to the iDEAL payment page, where they have to confirm their payment details before finishing the ordering process.
  9. Shoppers are redirected to the RedirectURL from the Order information object. In case the payment fails, shoppers are redirected to the CancelURL. 

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.

Order

Required (Object)

 

Object designed to collect all data necessary for an order, including billing, product/subscription plan and payment details.

To place an order with iDEAL, use IDEAL as the type of the PaymentDetails object and provide the following parameters as part of the PaymentMethod object:

  • ReturnURL - URL to which customers are redirected after a successful payment.
  • CancelURL - URL to which customers are redirected after a failed payment attempt.
  • BankCode - information retrieved based on the bank selected by the customer, from the array obtained after calling getIdealIssuerBanks method.

See code sample for more details. 

    Response

    Parameter Type/Description

    Order information

    Object

      Object containing order information.

    Request

    <?php
    
    require ('PATH_TO_AUTH');
    
    $Order = new stdClass();
    $Order->RefNo = NULL;
    $Order->Currency = 'EUR';
    $Order->Country = 'NL';
    $Order->Language = 'en';
    $Order->CustomerIP = '91.220.121.21';
    $Order->ExternalReference = NULL;
    $Order->Source = NULL;
    $Order->Affiliate = new stdClass();
    $Order->Affiliate->AffiliateCode = 'Partner123'
    $Order->Affiliate->AffiliateSource = 'MobilePlatform'
    $Order->CustomerReference = NULL;
    
    $Order->Items = array();
    $Order->Items[0] = new stdClass();
    $Order->Items[0]->Code = 'my_subscription_1';
    $Order->Items[0]->Quantity = 1;
    $Order->Items[0]->PriceOptions = NULL;
    $Order->Items[0]->SKU = NULL;
    $Order->Items[0]->Price = NULL;
    $Order->Items[0]->CrossSell = NULL;
    $Order->Items[0]->Trial = false;
    $Order->Items[0]->AdditionalFields = NULL;
    $Order->Items[0]->SubscriptionStartDate = NULL; //If empty or null, subscriptions become active when purchase is made.
    $Order->BillingDetails = new stdClass();
    $Order->BillingDetails->FirstName = 'Test Cosmin API';
    $Order->BillingDetails->LastName = 'Cosmin API';
    $Order->BillingDetails->CountryCode = 'NL';
    $Order->BillingDetails->State = 'California';
    $Order->BillingDetails->City = 'LA';
    $Order->BillingDetails->Address1 = 'Address example';
    $Order->BillingDetails->Address2 = NULL;
    $Order->BillingDetails->Zip = '90210';
    $Order->BillingDetails->Email = 'cosmin.deftu@2checkout.com';
    $Order->BillingDetails->Phone = NULL;
    $Order->BillingDetails->Company = NULL;
    $Order->DeliveryDetails = NULL;
    
    $Order->PaymentDetails = new stdClass ();
    $Order->PaymentDetails->Type = 'IDEAL';
    $Order->PaymentDetails->Currency = 'EUR';
    $Order->PaymentDetails->PaymentMethod = new stdClass ();
    $Order->PaymentDetails->CustomerIP = '91.220.121.21';
    $Order->PaymentDetails->PaymentMethod->ReturnURL = 'http://yourreturnurl.com';
    $Order->PaymentDetails->PaymentMethod->CancelURL= 'http://yourcancelurl.com';
    $Order->PaymentDetails->PaymentMethod->BankCode='RABONL2U+RAB'; // value retrieved based on the bank selected by the customer, from the array obtained after calling method getIdealIssuerBanks.
    
    try {
       $newOrder = $client->placeOrder($sessionID, $Order);
    }
    catch (SoapFault $e) {
        echo "newOrder: " . $e->getMessage();
        exit;
    }
    
    $idealredirect= $newOrder->PaymentDetails->PaymentMethod->Authorize->Href."/?avng8apitoken=".$newOrder->PaymentDetails->PaymentMethod->Authorize->Params->avng8apitoken;
    
    header('Location:' . $idealredirect);
    ?>
    

    Retrieve check payment details

    Overview

    Retrieve the check payment details that customers must use or have used to pay for an order.

    Requirements

    Parameters

    Parameter Type/Description
    sessionID Required (String)
      Session identifier string, output of the Login method. An exception is thrown if the values are incorrect.
    refNo Required (String)
      Order reference number of an order that was marked with CHECK as payment method.

    Response

    Parameter Type/Description

    CheckPaymentDetails

    Object

     

    Details below

     

    Beneficiary

    String

     

     

    Payment beneficiary name. Can be NULL.

     

    CheckPostalAddress

    String

     

     

    Beneficiary address. Can be NULL.

     

    CheckAccountHolderName

    String

     

     

    Beneficiary account holder name. Can be NULL.

     

    Country

    String

     

     

    Beneficiary country. Can be NULL.

     

    Amount

    Double

     

     

    Total order costs. Can be NULL.

     

    Currency

    String

     

     

    Order currency ISO code – ISO 4217. Can be NULL.

    Request

    <?php
    
    require('PATH_TO_AUTH'); // Authentication example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/02Authentication
    require('PATH_TO_setPartner'); // setPartner example: https://knowledgecenter.avangate.com/Integration/Channel_Manager_API/SOAP/06Reference/Partner/00Set_partner
    
    $proformaNumber = 'YOUR_PROFORMA_NUMBER';
    
    try {
        $Proforma= $client->setProforma ($sessionID, $proformaNumber);
    } catch (SoapFault $e) {
        echo "ProformaOutput: " . $e->getMessage();
        exit;
    }
    var_dump ("ProformaOutput", $Proforma);
    
    
    $paymentDetails = new stdClass();
    $paymentDetails->Type = 'CHECK';
    $paymentDetails->Curency = 'YOUR_CURRENCY';
    $paymentDetails->CustomerIP = 'CUSTOMER_IP';
    
    try {
        $PaymentDetailsSet= $client->setPaymentDetails($sessionID, $paymentDetails);
    } catch (SoapFault $e) {
        Echo "Payment: " . $e->getMessage();
        exit;
    }
    var_dump ("Payment", $PaymentDetailsSet);
    
    try {
        $ProformaPay= $client->payProforma($sessionID);
    } catch (SoapFault $e) {
        Echo "ProformaPaid: " . $e->getMessage();
        exit;
    }
    var_dump ("ProformaPaid ", $ProformaPay);
    
    $refNo = 'YOUR_ORDER_REFNO'
    
    try {
        $client->getCheckPaymentDetails ($sessionID, $refNo);
    } catch (SoapFault $e) {
        echo "Error: " . $e->getMessage();
    }
    

    Errors

    Error Description

    INVALID_PARTNER

    No partner is set.

    PAYMENT_PROFORMA

    You have to set a partner invoice first.

    PAYMENT_NOT_SUPPORTED

    The current partner invoice is not set as payable through check.

    Add a subscription plan/product

     

    Use the addProduct method to create subscription plans/products for your Avangate account. 

    Parameters

    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.

    Product

    Required (object)

     

    Use this object to configure your subscription plans/products.

     

    You can set all Product parameters except AvangateID. The Avangate system sets the unique product ID. The AvangateID is not editable.

    Mandatory parameters

     

    ProductName
    ProductCode
    PricingConfigurations
    

    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;
    }
    
    $Product                 = new stdClass();
    $Product->AvangateId     = null;
    $Product->ProductCode    = 'API_Imported_1234567899';
    $Product->ProductType    = 'REGULAR';
    $Product->ProductName    = 'API_Subscription Imported New';
    $Product->ProductVersion = '1.0';
    $Product->GroupName      = 'General';
    
    //Shipping classes
    
    /* $Product->ShippingClass = new stdClass();
    $Product->ShippingClass->Name = '2o9rlujkvg';
    $Product->ShippingClass->Amount = 89.40;
    $Product->ShippingClass->Currency = 'GBP';
    $Product->ShippingClass->ApplyTo = 'ct29dr3fj4';
    $Product->ShippingClass->Type = 'bii521vp6k'; */
    
    $Product->GiftOption                 = false;
    $Product->ShortDescription           = 'Placeat cumque necessitatibus est minus praesentium ut non quibusdam. Molestias provident tempore eligendi mollitia quia.';
    $Product->LongDescription            = 'Corrupti inventore vitae nesciunt ab. Nemo cum non maiores. Non repudiandae est iste voluptatibus.';
    $Product->SystemRequirements         = null;
    $Product->ProductCategory            = null;
    $Product->Platforms                  = array();
    $Product->Platforms[0]               = new stdClass();
    $Product->Platforms[0]->PlatformName = null;
    $Product->Platforms[0]->Category     = null;
    $Product->Platforms[1]               = new stdClass();
    $Product->Platforms[1]->PlatformName = null;
    $Product->Platforms[1]->Category     = null;
    $Product->ProductImages              = array();
    $Product->ProductImages[0]           = new stdClass();
    $Product->ProductImages[0]->URL      = null;
    $Product->ProductImages[0]->Default  = false;
    $Product->ProductImages[1]           = new stdClass();
    $Product->ProductImages[1]->URL      = null;
    $Product->ProductImages[1]->Default  = true;
    $Product->TrialUrl                   = null;
    $Product->TrialDescription           = null;
    $Product->Enabled                    = True;
    
    //Product additional fields
    
    /* $Product->AdditionalFields = array();
    $Product->AdditionalFields[0] = new stdClass();
    $Product->AdditionalFields[0]->Label = 'i44wak1dzp';
    $Product->AdditionalFields[0]->Code = 'ITYAK0OEWJ';
    $Product->AdditionalFields[0]->Enabled = false;
    $Product->AdditionalFields[0]->Required = false;
    $Product->AdditionalFields[0]->URLParameter = 'id1ktigl6d';
    $Product->AdditionalFields[1] = new stdClass();
    $Product->AdditionalFields[1]->Label = 'aig699lmo1';
    $Product->AdditionalFields[1]->Code = 'V28TP07PQN';
    $Product->AdditionalFields[1]->Enabled = false;
    $Product->AdditionalFields[1]->Required = true;
    $Product->AdditionalFields[1]->URLParameter = '8to9p6y54j'; */
    
    //Product localization
    
    /* $Product->Translations = array();
    $Product->Translations[0] = new stdClass();
    $Product->Translations[0]->Name = 'zsg7wtg4e5';
    $Product->Translations[0]->Description = 'Voluptate iure ut quam omnis impedit. Deserunt facere id dolores doloribus quis. Minima nostrum ut possimus incidunt vel est sint. Odit tempora omnis iste nesciunt commodi accusantium placeat.';
    $Product->Translations[0]->Language = 'pt';
    $Product->Translations[0]->LongDescription = 'Pariatur molestiae sit dignissimos modi. Aut modi libero numquam repudiandae. Doloribus explicabo delectus fugiat amet. Excepturi quo consequatur sint adipisci.';
    $Product->Translations[0]->SystemRequirements = 'c16tvyg88c';
    $Product->Translations[0]->TrialUrl = 'UNCAUGHT TYPE: anyURI';
    $Product->Translations[0]->TrialDescription = 'Voluptas rem sit ut voluptas molestias quidem ut. Maiores facilis tempora voluptates. Consequuntur illum recusandae hic magni iste.';
    $Product->Translations[1] = new stdClass();
    $Product->Translations[1]->Name = 'cv2sx15aby';
    $Product->Translations[1]->Description = 'Ut distinctio asperiores et a placeat voluptatem et. Et eveniet temporibus aut vel. Nemo occaecati praesentium dolor fugiat rerum assumenda expedita.';
    $Product->Translations[1]->Language = 'fr';
    $Product->Translations[1]->LongDescription = 'Et ut nostrum molestiae voluptates soluta. Molestiae cum in ut qui. Voluptatem voluptates vero odit quia corporis. In impedit eligendi sed expedita nihil temporibus nobis.';
    $Product->Translations[1]->SystemRequirements = 'cfv2amk25j';
    $Product->Translations[1]->TrialUrl = 'UNCAUGHT TYPE: anyURI';
    $Product->Translations[1]->TrialDescription = 'Voluptatem ut possimus consequatur iste. Recusandae id quia sed quibusdam aut debitis. Cupiditate harum architecto quod quia.'; */
    
    
    $Product->PricingConfigurations                                     = array();
    $Product->PricingConfigurations[0]                                  = new stdClass();
    $Product->PricingConfigurations[0]->Default                         = false;
    $Product->PricingConfigurations[0]->Code                            = null;
    $Product->PricingConfigurations[0]->Name                            = 'API Pricing Configuration Test';
    $Product->PricingConfigurations[0]->BillingCountries                = array();
    $Product->PricingConfigurations[0]->PricingSchema                   = 'DYNAMIC';
    $Product->PricingConfigurations[0]->PriceType                       = 'NET';
    $Product->PricingConfigurations[0]->DefaultCurrency                 = 'USD';
    $Product->PricingConfigurations[0]->Prices                          = new stdClass();
    $Product->PricingConfigurations[0]->Prices->Regular                 = array();
    $Product->PricingConfigurations[0]->Prices->Regular[0]              = new stdClass();
    $Product->PricingConfigurations[0]->Prices->Regular[0]->Amount      = 100;
    $Product->PricingConfigurations[0]->Prices->Regular[0]->Currency    = 'USD';
    $Product->PricingConfigurations[0]->Prices->Regular[0]->MinQuantity = 1;
    $Product->PricingConfigurations[0]->Prices->Regular[0]->MaxQuantity = 10;
    $Product->PricingConfigurations[0]->Prices->Regular[0]->OptionCodes = array();
    $Product->PricingConfigurations[0]->Prices->Regular[1]              = new stdClass();
    $Product->PricingConfigurations[0]->Prices->Regular[1]->Amount      = 200;
    $Product->PricingConfigurations[0]->Prices->Regular[1]->Currency    = 'USD';
    $Product->PricingConfigurations[0]->Prices->Regular[1]->MinQuantity = 11;
    $Product->PricingConfigurations[0]->Prices->Regular[1]->MaxQuantity = 100;
    $Product->PricingConfigurations[0]->Prices->Regular[1]->OptionCodes = array();
    $Product->PricingConfigurations[0]->Prices->Renewal                 = array();
    $Product->PricingConfigurations[0]->Prices->Renewal[0]              = new stdClass();
    $Product->PricingConfigurations[0]->Prices->Renewal[0]->Amount      = 50;
    $Product->PricingConfigurations[0]->Prices->Renewal[0]->Currency    = 'USD';
    $Product->PricingConfigurations[0]->Prices->Renewal[0]->MinQuantity = 1;
    $Product->PricingConfigurations[0]->Prices->Renewal[0]->MaxQuantity = 10;
    $Product->PricingConfigurations[0]->Prices->Renewal[0]->OptionCodes = array();
    $Product->PricingConfigurations[0]->Prices->Renewal[1]              = new stdClass();
    $Product->PricingConfigurations[0]->Prices->Renewal[1]->Amount      = 60;
    $Product->PricingConfigurations[0]->Prices->Renewal[1]->Currency    = 'USD';
    $Product->PricingConfigurations[0]->Prices->Renewal[1]->MinQuantity = 11;
    $Product->PricingConfigurations[0]->Prices->Renewal[1]->MaxQuantity = 100;
    $Product->PricingConfigurations[0]->Prices->Renewal[1]->OptionCodes = array();
    $Product->PricingConfigurations[0]->PriceOptions                    = array();
    
    /* $Product->BundleProducts = array();
    $Product->BundleProducts[0] = new stdClass();
    $Product->BundleProducts[0]->ProductCode = '540Q45PQBN';
    $Product->BundleProducts[0]->ProductId = 48439;
    $Product->BundleProducts[1] = new stdClass();
    $Product->BundleProducts[1]->ProductCode = 'PA3JDB5SZ2';
    $Product->BundleProducts[1]->ProductId = 46439;
    */
    $Product->Fulfillment = 'NO_DELIVERY';
    $Product->Prices      = array();
    
    $Product->GeneratesSubscription                            = True;
    $Product->SubscriptionInformation                          = new stdClass();
    $Product->SubscriptionInformation->DeprecatedProducts      = array();
    $Product->SubscriptionInformation->BundleRenewalManagement = null;
    $Product->SubscriptionInformation->BillingCycle            = 1;
    $Product->SubscriptionInformation->BillingCycleUnits       = 'M';
    $Product->SubscriptionInformation->IsOneTimeFee            = false;
    
    $Product->SubscriptionInformation->ContractPeriod                       = new stdClass();
    $Product->SubscriptionInformation->ContractPeriod->Period               = -1;
    $Product->SubscriptionInformation->ContractPeriod->PeriodUnits          = 'days';
    $Product->SubscriptionInformation->ContractPeriod->IsUnlimited          = TRUE;
    $Product->SubscriptionInformation->ContractPeriod->Action               = 'RESTART';
    $Product->SubscriptionInformation->ContractPeriod->EmailsDuringContract = 'altenwerth.elise@gmail.com';
    
    //$Product->SubscriptionInformation->UsageBilling = 77;
    
    $Product->SubscriptionInformation->GracePeriod              = new stdClass();
    $Product->SubscriptionInformation->GracePeriod->Type        = 'GLOBAL';
    $Product->SubscriptionInformation->GracePeriod->Period      = 14;
    $Product->SubscriptionInformation->GracePeriod->PeriodUnits = 'D';
    $Product->SubscriptionInformation->GracePeriod->IsUnlimited = false;
    
    $Product->SubscriptionInformation->RenewalEmails                                               = new stdClass();
    $Product->SubscriptionInformation->RenewalEmails->Type                                         = 'CUSTOM';
    $Product->SubscriptionInformation->RenewalEmails->Settings                                     = new stdClass();
    $Product->SubscriptionInformation->RenewalEmails->Settings->ManualRenewal                      = new stdClass();
    $Product->SubscriptionInformation->RenewalEmails->Settings->ManualRenewal->Before30Days        = true;
    $Product->SubscriptionInformation->RenewalEmails->Settings->ManualRenewal->Before15Days        = true;
    $Product->SubscriptionInformation->RenewalEmails->Settings->ManualRenewal->Before7Days         = true;
    $Product->SubscriptionInformation->RenewalEmails->Settings->ManualRenewal->Before1Day          = false;
    $Product->SubscriptionInformation->RenewalEmails->Settings->ManualRenewal->OnExpirationDate    = true;
    $Product->SubscriptionInformation->RenewalEmails->Settings->ManualRenewal->After5Days          = false;
    $Product->SubscriptionInformation->RenewalEmails->Settings->ManualRenewal->After15Days         = false;
    $Product->SubscriptionInformation->RenewalEmails->Settings->AutomaticRenewal                   = new stdClass();
    $Product->SubscriptionInformation->RenewalEmails->Settings->AutomaticRenewal->Before30Days     = true;
    $Product->SubscriptionInformation->RenewalEmails->Settings->AutomaticRenewal->Before15Days     = false;
    $Product->SubscriptionInformation->RenewalEmails->Settings->AutomaticRenewal->Before7Days      = false;
    $Product->SubscriptionInformation->RenewalEmails->Settings->AutomaticRenewal->Before1Day       = false;
    $Product->SubscriptionInformation->RenewalEmails->Settings->AutomaticRenewal->OnExpirationDate = true;
    $Product->SubscriptionInformation->RenewalEmails->Settings->AutomaticRenewal->After5Days       = false;
    $Product->SubscriptionInformation->RenewalEmails->Settings->AutomaticRenewal->After15Days      = true;
    
    $Product->FulfillmentInformation                                = new stdClass();
    $Product->FulfillmentInformation->IsStartAfterFulfillment       = false;
    $Product->FulfillmentInformation->IsElectronicCode              = false;
    $Product->FulfillmentInformation->IsDownloadLink                = false;
    $Product->FulfillmentInformation->IsBackupMedia                 = false;
    $Product->FulfillmentInformation->IsDownloadInsuranceService    = false;
    $Product->FulfillmentInformation->IsInstantDeliveryThankYouPage = false;
    $Product->FulfillmentInformation->IsDisplayInPartnersCPanel     = false;
    
    /* $Product->FulfillmentInformation->CodeList = new stdClass();
    $Product->FulfillmentInformation->CodeList->Code = '5C6F821DA1';
    $Product->FulfillmentInformation->CodeList->Name = 'General delivery';
    $Product->FulfillmentInformation->CodeList->Type = 'STATIC';  */
    
    //$Product->FulfillmentInformation->BackupMedia = new stdClass();
    
    //$Product->FulfillmentInformation->ProductFile = new stdClass();
    
    /* $Product->FulfillmentInformation->AdditionalInformationByEmail = 'arlene03@hotmail.com';
    $Product->FulfillmentInformation->AdditionalInformationEmailTranslations = array();
    $Product->FulfillmentInformation->AdditionalInformationEmailTranslations[0] = new stdClass();
    $Product->FulfillmentInformation->AdditionalInformationEmailTranslations[0]->Name = 'kbaa1aj7po';
    $Product->FulfillmentInformation->AdditionalInformationEmailTranslations[0]->Description = 'Velit delectus sed amet sunt. Sunt deserunt quos recusandae consequuntur est. Velit aut optio error eius rerum. Nihil ipsam possimus ipsum dolores consequatur adipisci.';
    $Product->FulfillmentInformation->AdditionalInformationEmailTranslations[0]->Language = 'fr';
    $Product->FulfillmentInformation->AdditionalInformationEmailTranslations[1] = new stdClass();
    $Product->FulfillmentInformation->AdditionalInformationEmailTranslations[1]->Name = 'l4ocvz9wwa';
    $Product->FulfillmentInformation->AdditionalInformationEmailTranslations[1]->Description = 'Esse voluptatem delectus officiis eos quas asperiores. Quas non hic reiciendis enim. Consequatur similique recusandae laboriosam et autem.';
    $Product->FulfillmentInformation->AdditionalInformationEmailTranslations[1]->Language = 'pt';
    $Product->FulfillmentInformation->AdditionalThankYouPage = 'rvlhvkmxkp';
    $Product->FulfillmentInformation->AdditionalThankYouPageTranslations = array();
    $Product->FulfillmentInformation->AdditionalThankYouPageTranslations[0] = new stdClass();
    $Product->FulfillmentInformation->AdditionalThankYouPageTranslations[0]->Name = 'rl981w4nua';
    $Product->FulfillmentInformation->AdditionalThankYouPageTranslations[0]->Description = 'Qui explicabo molestiae dolorem consequuntur. Ullam maiores temporibus vitae. Totam eos et consequatur. Est sit minima animi nam ut aut.';
    $Product->FulfillmentInformation->AdditionalThankYouPageTranslations[0]->Language = 'en';
    $Product->FulfillmentInformation->AdditionalThankYouPageTranslations[1] = new stdClass();
    $Product->FulfillmentInformation->AdditionalThankYouPageTranslations[1]->Name = 'qye8hlwz3e';
    $Product->FulfillmentInformation->AdditionalThankYouPageTranslations[1]->Description = 'Id est rerum deserunt non et quia magnam. Minus aut nostrum dicta est officiis quia. Commodi nobis sit porro accusamus rerum quis. Fugit et asperiores eum.';
    $Product->FulfillmentInformation->AdditionalThankYouPageTranslations[1]->Language = 'fr';
    */
    
    
    try {
        $NewSubscriptionPlan = $client->addProduct($sessionID, $ProdbyCode);
    }
    
    catch (SoapFault $e) {
        echo "AddedProductInfo: " . $e->getMessage();
        exit;
    }
    var_dump("AddedProductInfo", $NewSubscriptionPlan);
    ?>
    

    Add additional fields

    Overview

    Use the addAdditionalField method to create new additional fields 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.

    AdditionalField

    Object

     

    Additional field object.

    Response

    bool(true)

    Request

    <?php
    
    require ('PATH_TO_AUTH');
    
    $AdditionalField                             = new stdClass();
    $AdditionalField->Label                      = 'Do you agree with the new newsletter policy 2015?';
    $AdditionalField->Type                       = 'LISTBOX';
    $AdditionalField->Code                       = 'NewsletterPolicy1234576';
    $AdditionalField->ApplyTo                    = 'ORDER';
    $AdditionalField->Values                     = array();
    $AdditionalField->Values[0]                  = 'YES';
    $AdditionalField->Values[1]                  = 'NO';
    $AdditionalField->ValidationRule             = null;
    $AdditionalField->Translations               = array();
    $AdditionalField->Translations[0]            = new stdClass();
    $AdditionalField->Translations[0]->Label     = "Êtes-vous d'accord avec la politique de la newsletter?";
    $AdditionalField->Translations[0]->Values    = array();
    $AdditionalField->Translations[0]->Values[0] = 'Oui';
    $AdditionalField->Translations[0]->Values[1] = 'Non';
    $AdditionalField->Translations[0]->Language  = 'fr';
    $AdditionalField->Translations[1]            = new stdClass();
    $AdditionalField->Translations[1]->Label     = 'Haben Sie mit dem Newsletter Politik zu?';
    $AdditionalField->Translations[1]->Values    = array();
    $AdditionalField->Translations[1]->Values[0] = 'Ja';
    $AdditionalField->Translations[1]->Values[1] = 'Nein';
    $AdditionalField->Translations[1]->Language  = 'de';
    
    try {
        $NewAdditionalField = $client->addAdditionalField($sessionID, $AdditionalField);
    }
    
    catch (SoapFault $e) {
        echo "NewAdditionalField: " . $e->getMessage();
        exit;
    }
    
    var_dump("NewAdditionalField", $NewAdditionalField);
    
    
    ?>
    

     

    Subscription history

    Overview

    Retrieve information about a subscription. Subscriptions can be retrieved starting with 5 minutes after their orders are generated in the 2Checkout system.

    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

     

    1099-K Form Requirements

    Overview

    The United States Government has enacted a law (Internal Revenue Code Section 6050W) which requires payment processors to send an IRS the 1099-K form annually, to all US sellers starting with 2011.

    The 1099-K form, Payment Card and Third Party Network Transactions is an IRS information return used to report certain payment transactions to improve voluntary tax compliance.

    Read the instructions below on how to update your 2Checkout account to meet these requirements. 

     

    Recommended resources

    Availability

    Form 1099-K applies to all US sellers.

    2Checkout requirements

    2Checkout will ask affected Sellers/Merchants to confirm and/or update their 2Checkout account by providing a tax ID number and the appropriate corresponding contact information.

    Your tax ID number is one of these:

    • Your Social Security Number (SSN)

    • Your Employer Identification Number (EIN)

    • Your Individual Tax Identification Number (ITIN)

    Please use the guidelines below to determine which tax ID number to provide.

    • Business Entities with an EIN

    Provide your company EIN and company name.

    • Sole Proprietors with an EIN

    Provide your company EIN and your own name.

    • Individual Sellers and Sole Proprietors without an EIN

    Provide your SSN or ITIN and your own name.

    2Checkout will also need affected Sellers/Merchants to confirm that their account name matches the tax ID number provided and to confirm their physical address so that if Form 1099-K is issued, we can report your information accurately to the IRS.

    Updating the 2Checkout account

    Follow these steps to update your 2Checkout account in order to meet the fiscal compliance requirements.

    1. Log in to your Merchant Control Panel account.

    2. Click the Settings tab.

    form1099Kcpanel.png

    3. In the Account Settings page, click on the Edit Details tab, under Account Information.

    form1099Kcpanel1.png

    4. On the Account Information page, edit the necessary details, and confirm your account information is correct.

    5. Click Update at the bottom of the page to save your new settings.

    6. Confirm that the Company Name listed is correct. If your company is incorporated, make sure that the company name listed on your 2Checkout Account is exactly as it is listed on your incorporation documents. If your Company name is incorrect on this page, send an email to supportplus@2checkout.com for assistance in updating this field.

    7. Confirm that the Business Office E-mail, Mailing Address, and Physical Address listed on the account are correct. Update if necessary. If the physical address listed on this page is incorrect, send an email to supportplus@2checkout.com for assistance in updating this field.

    FAQs

    1. How do I receive my 1099-K form?

    The platform will automatically generate the PDF for the 1099-K form for all merchants. You will receive an email notification that the file was generated and you will be able to download the file from your Merchant Control Panel, under Account information → Edit account information.
    Every year 2Checkout will generate a file for the IRS that will contain all your payments from the previous year.

    2. What if I don’t provide my Tax ID number?

    If 2Checkout is unable to verify your information because it is incorrect or incomplete, your account will be put in a Restricted status, so you will not be able to receive payouts. The restriction will end once you provide your tax ID number and corresponding contact information, and your information is verified by the IRS matching system.

    If you need additional information about this law you can read more details on the IRS website.

    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