Skip to main content

Place orders with catalog products

Overview

Use this object to create new orders and collect payments from shoppers using catalog products defined in your Merchant Control Panel.

For orders that require physical delivery, if no shipping methods are provided, 2Checkout will add to the cart your account's default shipping configuration.

You can find a list of common errors that may arise when using the placeOrder call via API 6.0 here.

Supported payment methods/flows

Requirements

For credit card orders placed using API 6.0, you need to pass through additional parameters that support the 3D Secure flow. 3D Secure works by redirecting customers to pages provided by their banks, where they need to enter additional security tokens or passwords to trigger the completion of the charge. By using 3D Secure, you get additional protection from liability for fraudulent card payments, with customers having to go through an extra layer of authentication. Send the following parameters in the placeOrder call:

Parameters Description
Vendor3DSReturnURL Required (string)
  URL address to which customers are redirected after the 3DS details get validated by the bank and the order is successfully authorized.
Vendor3DSCancelURL Required (string)
  URL address to which customers are redirected if the 3DS details were not validated or the order could not be authorized.
WSOrder Optional (string)
  The WSOrder parameter is used to control the website URL displayed in the email messages shoppers receive after they place an order. By default, 2Checkout reports the URL set as Homepage in the Account information area. Adding WSOrder to the buy-links for your products will cause the optional website address set by using the parameter to override and replace the Homepage URL in the email notifications sent to customers. The behavior is similar to the WS_ORDER parameter supported on checkout/cart pages and described here.

Parameters

 
Parameters Type/Description
Currency String / Optional
  The currency ISO code for the payment - ISO 4217. Example: “usd.”
Country String / Optional
  Shopper country. ISO 3166 two-letter code. Example: “us.”
Language String / Optional
  ISO 639-1 two-letter code. Language used for the purchase process. Example: “en.”
ExternalReference String / Optional
  Set external reference identifiers for orders. Enables you to replicate the functionality of the REF parameter included in Buy Links. Maximum 100 characters. If there is a need for longer references, you can apply an md5 hash for any string value, resulting in a 32 characters string. You can verify the hash after the order notification, on the client-side.
Source String / Optional
 

The link source for the sales. Enables you to replicate the functionality of the SRC (separate link identifier) parameter when included in Buy Links. Use the SRC parameter to track sale sources.

 

Maximum length 255 characters.

CustomerReference Integer / Optional
  Set an external customer ID, attached to the customer.
Affiliate Object/Optional
                   AffiliateCode String/Required
  The affiliate unique code (as returned by the affiliates API methods).
                   AffiliateSource String/Optional
  The affiliate source.
Items Array of object / Required
  Details below. 
  OrderItem Object
    Details below. 
    Code String / Mandatory
      Unique product identifier your control. Max length 256 characters. Only for catalog products.
    Quantity Integer / Optional
      Number of units
    PriceOptions Array of strings / Optional
      Array of price option codes.
    SKU String / Optional
      SKU identifier.
    Price Object - Can be NULL. If Price Type is set to 'CUSTOM', dynamic pricing can be added to the order via the Amount parameter.
    CrossSell Object – Can be NULL
      Details below. 
      ParentCode String 
        The product code of the master product you set to trigger the campaign.
      CampaignCode String 
        Unique, system-generated identifier for cross-sell campaigns.
    Trial Object – Can be NULL
      Details below. 
      Period Integer 
        The length of the trial subscription lifetime in days.
      Price Double / Optional
        Total trial price in the payment currency before 2Checkout deducts any taxes, discounts, etc.
    AdditionalFields Array of objects – Can be NULL
      AdditionalFieldSet Object – Can be NULL
        Code String
          The alpha-numeric characters, underscores and dashes that are set as the field identifier.
        Value String
          Selected field value.
    SubscriptionStartDate String
     

Specify the date time stamp when the subscription becomes active. Format 2016-07-02 22:22:22 (YYYY-MM-DD HH:mm:ss). Available for JSON-RPC and REST.

Send empty or NULL to activate subscriptions on the same date when customers purchase them.

You can exclude HH:mm:ss when sending the date and include only YYYY-MM-DD. In this case, 2Checkout uses 00:00:01. Default time zone GMT+02:00.

    SubscriptionCustomSettings Object/Optional
      To use this, the ExtraInformation object with AssistedSale property set to "true" is required.
   

CycleAmountType

String/Required
      Billing cycle unit NET/GROSS.
   

CycleUnit

String/Required
      DAY/MONTH. Can be NULL.
   

CycleAmount

Float/Required
      Billing cycle (renewal) price.
   

CycleLength

Integer/Required
      Billing cycle length. Can be NULL.
   

ContractLength

Integer/Optional
      Contract period length (expressed in the specified CycleUnit; must be multiple of CycleLength). Can be NULL.
   

MerchantDealAutoRenewal

Boolean/Optional
      Merchant deal auto-renewal flag.
   

ClientDealAutoRenewal

Boolean/Optional
      Client deal auto-renewal flag.
BillingDetails Object / Required
  Details below. 
  FirstName String/Required
    Shopper name.
  LastName String/Required
    Shopper surname.
  CountryCode String/Required
    Shopper country. ISO 3166 two-letter code.
  State String/Optional – Required for US, Canada, Brazil, Turkey, India and Romania
    The state in the shopper's country. Mandatory when you set the Billing Country to US, Canada, Brazil, Turkey, India and Romania. Use case insensitive utf8 strings for the full name, or just the two-letter code.
  City String/Required
    Shopper city.
  Address1 String/Required
    Shopper address.
  Address2 String / Optional
    Shopper address.
  Zip String/Required
    ZIP/ Postal code.
  Email String/Required
    Shopper email address.
  Phone String / Optional
    Shopper phone number. Mandatory when you set Brazil as the Billing Country. Can be NULL.
  Company String / Optional
    Company name. Can be null for end users. When present, you also need to provide the FiscalCode.
  FiscalCode String / Optional– Required for Brazil
   

• For companies, it needs to be the VAT ID. 2Checkout will validate the value provided and throw an error if the VAT ID is invalid/incorrect when calling setPaymentDetails. When present, you also need to provide the Company name.

• Mandatory when you set Brazil as the Billing Country. For Brazilian customers it represents the Fiscal Code (CPF/CNPJ).

Mandatory when you set India as the Billing Country, and purchase is made by a Company.

• Can be NULL for end users.

  TaxExemptionId String / Optional
    Tax Exempt Certification id used to deduct taxes for US orders.
Example: 1b80eecc349v
DeliveryDetails Object / Required
  Details below. 
    FirstName String / Required
      Shopper name from the delivery details.
    LastName String / Required
      Shopper surname from the delivery details.
    CountryCode String / Required
      Shopper country. ISO 3166 two-letter code from the delivery details.
    State String/Optional – Required for US, Canada, Brazil, Turkey, India and Romania
      The state in the shopper's country. Mandatory when you set the Billing Country to US, Canada, Brazil, Turkey, India and Romania. Use case insensitive utf8 strings for the full name, or just the two-letter code.
    City String / Optional
      Shopper city from the delivery details.
    Address1 String / Optional
      Shopper address from the delivery details.
    Address2 String / Optional
      Shopper address from the delivery details.
    Zip String / Optional
      ZIP/ Postal code from the delivery details.
    Email String / Optional
      Shopper email address from the delivery details.
    Phone String / Optional
      Shopper phone number from the delivery details. Mandatory when you set Brazil as the Billing Country. Can be NULL.
    Company String / Optional
      Company name from the delivery details. Can be null for end users. When present, you also need to provide the FiscalCode.
DeliveryInformation

Object / Optional

For products that require physical delivery, use this object to send the shipping method.

    ShippingMethod

Object

Details below

      Code String
  System-generated identified for your shipping method configuration
PaymentDetails Object / Required
  Adapt this object to the desired payment method.
  Type Required (string)
   

The payment method:

  • CC (credit/debit card - including local Brazilian cards).
  • ENCRYPTED_PAYMENT_DATA (client-side encryption)
  • PAYPAL
  • PAYPAL_EXPRESS
  • DIRECT_EBANKING 
  • TEST (for test orders).
  • PREVIOUS_ORDER(place new orders using the reference of a previous order).
  • EXISTING_PAYMENT_DATA  (use a card one of your customers already used to purchase from your account).
  • WIRE – the placeOrder response includes Wire payment details.
  • CHECK – the placeOrder response includes Check payment details.
  • WE_CHAT_PAY (for WeChat payments).
  • IDEAL (for iDEAL payments).
  • PURCHASEORDER - use for orders with POs.
  • FREE – for 0 value orders for which you’re not requiring customers to provide payment details.
  • ALIPAY
  • UNIONPAY
  • TRUSTLY (for Trustly payments)
  • EES_TOKEN_PAYMENT (2Pay.js)
  • APPLE PAY
  • BOLETO
  • GOOGLE PAY
  • Echeck/ACH
  • Stored Credit
  Currency Required (string)
    The currency ISO code for the payment - ISO 4217. Example: “usd.”
  PaymentMethod Optional (object)
   

Object structure and parameters differ according to payment method selected and API method (placing orders (POST) vs. retrieving order data (GET)).

 

NULL for 0 value orders for which you’re not requiring customers to enter payment details.

                                             RecurringEnabled Optional (boolean)
 
 

true – shopper checks the auto-renewal checkbox and 2Checkout charges subscription renewals using a recurring billing process.

false – shopper doesn’t check the auto-renewal checkbox.

      CardPayment Optional (object)
        Details below. 
        CardNumber Required (string)
          The credit/debit card number.
        CardType Required (string)
          visa, visaelectron, mastercard, maestro, amex, discover, dankort, cartebleue, jcb, hipercard, elo
        ExpirationYear Required (string)
          The year in which the card expires.
        ExpirationMonth Required (string)
          The month in which the card expires.
        HolderName Required (string)
          Card holder name.
        CCID Required (string)
          Credit Card Identification - an extra ID printed on the card, usually a 3-4 digit number, the CVC2/CVV2.
        Vendor3DSReturnURL Required (string)
          URL address to which customers are redirected after the 3DS details get validated by the bank and the order is successfully authorized.
        Vendor3DSCancelURL Required (string)
          URL address to which customers are redirected if the 3DS details were not validated or the order could not be authorized.
        HolderNameTime Optional (float)
         

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

Can be NULL, but not a negative number.

        CardNumberTime Optional (float)
         

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

Can be NULL, but not a negative number.

        InstallmentsNumber  Optional (Int)
          Number of installments. Available only when customers un Brazil pay with Visa or MasterCard using Brazilian Real as the order currency. Use 1 or exclude the parameter for full payments. 
      PayPalExpress Optional (object)
        Details below. 
        Email Optional (string)
          Email address customers use for their PayPal account.
        ReturnURL Optional (string)
          The PayPal Express Checkout redirect URL returned by calling the getPayPalExpressCheckoutRedirectURL method. The return URL is the page on your website to which PayPal redirects yourbuyer's browser after the buyer logs into PayPal and approves the payment. Typically, this is a secure page (https://...) on your site.
        CancelURL Optional (string)
          The cancel URL is the page on your website to which PayPal redirects your buyer's browser if the buyer does not approve the payment. Typically, this is the secure page (https://...) on your site from which you redirected the buyer to PayPal.
      PreviousOrder Optional (Object)
          Details below. 
        RefNo Optional (string)
         

Order reference a previous purchase which reached the Approved/Complete status. You can use order for which customers paid with credit/debit cards or with PayPal. The status of order should be AUTHRECEIVED or COMPLETE.

 

Check the validity of references with the isValidOrderReference method.

 

The 2Checkout system blocks you from using references for fraudulent or potentially fraudulent orders.

      PurchaseOrderPaymentDetails Optional (Object)
        Details below. 
        InternalPONumber Optional (string)
          Identifier that business customers use internally in their organization to track and manage Purchase Orders (PO). Can be NULL.
        AutoApprove Optional (boolean)
         

TRUE - requires activation of the PO AutoApprove package (If the package is inactive 2Checkout returns an error). Please contact 2Checkout. When AutoApprove is TRUE, 2Checkout no longer requires that business customers upload a PO document. As such, PO orders are automatically approved for your account, without a PO doc. 2Checkout sets the PURCHASE_PENDING status for auto-approved PO orders.

FALSE - Default. Send this if the PO AUtoApprove package is not available for your account. 2Checkout uses the same flow as cart purchases with Purchase Orders for business customers placing orders with POs via API. This means that customers receive the same emails as if they made the purchase using the cart and need to update the PO document, which is reviewed by 2Checkout and that you need to approve. 2Checkout sets the AVAITING_UPLOAD status for POs andUnfinished for their orders.

 

Can be NULL.

      WE_CHAT_PAY Optional (string)
        Details below
        ReturnURL Optional (string)
          The return URL is the page to which your customers are redirected after their successful payment.
        CancelURL Optional (string)
          The cancel URL is the page to which your customers are redirected after their failed payment attempt.
      IDEAL Optional (string)
        Details below
        ReturnURL Optional (string)
          The return URL is the page to which your customers are redirected after their successful payment.
        CancelURL Optional (string)
          The cancel URL is the page to which your customers are redirected after their failed payment attempt.
        BankCode Required (string)
          String contains the SWIFT code of the bank, the plus sign "+", and the first 3 characters from the bank name. E.q.: in the case of Rabobank, code parameter is "RABONL2U+RAB".
      EXISTING_PAYMENT_DATA Optional (Object)
        By using EXISTING_PAYMENT_DAT you no longer require shoppers to enter any payment details.
        TransientToken Optional (string)
          Returned as a part of the process of retrieving customer information by SSOToken.
      TRUSTLY  Optional (string)
        Details below.
        ReturnURL Optional (string)
       

 
The return URL is the page to which your customers are redirected after their successful payment. 
      DIRECT_DEBIT_ACH Optional (object)
          Details below.
        AccountHolderName Optional (string)
          Full name of the account holder.
        BankRoutingNumber Optional (string)
          Bank Routing number consisting of up to 17 digits.
        AccountNumber Optional (string)
          Account number with fixed 9 digit length.
        AccountType Optional (string)
          Possible values are "S" for SAVINGS accounts or "C" for CHECKING accounts.
  CustomerIP Optional (string)
    Shopper IP.
Promotions Optional (Array of strings)
  Array of promotion codes.
AdditionalFields Object / Optional
  Details below. 
  Code Optional (string)
    The alpha-numeric characters, underscores, and dashes are set as the field identifier.
  Text Optional (string)
    Field text visible to shoppers in the cart.
  Value Optional (string)
    Selected field value.
LocalTime Optional (string)
 

Local shopper time in the following format: Y-m-d H:i:s.

This parameter can impact the fraud score of an order when it's missing, NULL, or incorrectly formatted.

GiftDetails Optional (object)
  Contains contact details for the recipient of gift purchase.
  FirstName Optional (string)
    First name of the gift recipient.
  LastName Optional (string)
    Last name of the gift recipient.
  Email Optional (string)
    Email of the gift recipient. 2Checkout uses this email for the delivery/fulfillment process.
  GiftNote Optional (string)
    Custom text shoppers provide a message to the gift recipient.

Request example (with Credit Card)

<?php

declare(strict_types=1);

class Configuration
{
    public const MERCHANT_CODE = '';
    public const MERCHANT_KEY = '';
    public const URL = 'http://api.2checkout.com/soap/6.0';
    public const ACTION = 'placeOrder';
    public const ADDITIONAL_OPTIONS = null;
    //array or JSON
    public const PAYLOAD = <<<JSON
{
    "Currency": "USD",
    "Country": "US",
    "CustomerIP": "91.220.121.21",
    "Source": "testAPI.com",
    "WSOrder": "http://www.myurlfortest.com",
    "ExternalReference": null,
    "BillingDetails": {
        "Address1": "Test Address",
        "City": "London",
        "CountryCode": "US",
        "Email": "customer@2Checkout.com",
        "FirstName": "Customer",
        "LastName": "2Checkout",
        "Phone": "556133127400",
        "State": "DF",
        "Zip": "70403-900"
    },
    "PaymentDetails": {
        "Type": "CC",
        "Currency": "USD",
        "CustomerIP": "91.220.121.21",
        "PaymentMethod": {
            "CCID": "123",
            "CardNumber": "4111111111111111",
            "CardNumberTime": "12",
            "CardType": "Visa",
            "ExpirationMonth": "12",
            "ExpirationYear": "2023",
            "HolderName": "John Doe",
            "HolderNameTime": "12",
            "RecurringEnabled": true,
            "Vendor3DSReturnURL": "www.test.com",
            "Vendor3DSCancelURL": "www.test.com"
        }
    },
    "Items": [
        {
            "Code": "testprod",
            "Quantity": "1"
        }
    ]
}
JSON;
}

class Client
{
    public function call(
        string $url = Configuration::URL,
               $payload = Configuration::PAYLOAD,
        string $action = Configuration::ACTION
    ): ?object
    {
        if (is_array($payload)) {
            $payload = json_encode($payload);
        }
        if (!empty($payload)) {
            // SoapClient works with objects(StdClass)
            $payload = json_decode($payload);
        }

        $soapClient = $this->getClient($url);
        $sessionId = $this->getSession($soapClient);

        $args = array_filter([$sessionId, $payload]);

        return $soapClient->$action(...$args);
    }

    public function getClient(string $url): SoapClient
    {
        return new SoapClient(
            $url . '?wsdl',
            [
                'location' => $url,
                'cache_wsdl' => WSDL_CACHE_NONE,
            ]
        );
    }

    public function getSession(SoapClient $client)
    {
        $date = gmdate('Y-m-d H:i:s');
        $merchantCode = Configuration::MERCHANT_CODE;
        $key = Configuration::MERCHANT_KEY;
        $string = strlen($merchantCode) . $merchantCode . strlen($date) . $date;
        $hash = hash_hmac('md5', $string, $key);
        // $client->__setCookie('XDEBUG_SESSION', 'PHPSTORM');
        return $client->login($merchantCode, $date, $hash);
    }
}

try {
    $client = new Client();
    var_dump($client->call());
} catch (Exception $ex) {
    var_dump($ex);
}

 

Create promotion

Overview

Use the addPromotion method to create a new promotion.

Parameters 

Parameter Type/Description
sessionID Required (string)
  Output of the Login method.
Promotion Required (object)
  Promotion object that you want to create.

Response

Parameters Type/Description
Promotion

Object

Contains promotion configuration.

Request

<?php

require ('PATH_TO_AUTH');

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

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

$discountObj = new stdClass;
$discountObj->Type = 'PERCENT';
$discountObj->Value = 30;
$promotionObject->Discount = $discountObj;
$promotionObject->Products = [$productsObj1, $productsObj2, $productsObj3];
//$promotionObject->Translations = [$translation1, $translation2];

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

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

Update promotion

Overview

Use the updatePromotion method to alter the details of an existing promotion.

Parameters

Parameter Type/Description
sessionID Required (string)
  Output of the Login method.
Promotion Required (object)
  Promotion object that you want to update.

Response

Parameter Type/Description
Promotion Updated promotion object.

Request

<?php
require ('PATH_TO_AUTH'); 

// Retrieve promotion details

$promotionCode = 'PROMOTION_CODE'; // code of the promotion that you want to update

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

// Keep the promotion you want to update in $existingPromotion
$existingPromotion = callRPC((Object)$jsonRpcRequest, $host);
// Set the fields to update 
$existingPromotion->Description = 'Updated description';

// Update the promotion
$jsonRpcRequest = array (
'jsonrpc' => '2.0',
'id' => $i++,
'method' => 'updatePromotion',
'params' => array($sessionID, $existingPromotion)
);
var_dump (callRPC((Object)$jsonRpcRequest, $host));

Create proposal

Overview

Use the createProposal method via SOAP API 6.0 to add/create a new quote.

Request Parameters

Parameters Type Required/Optional Description
proposal Object Required  
proposalContent Object Required  
lineItems Object Required  
sessionId String Required Unique 2Checkout session ID code.

Request sample

<?php

require ('PATH_TO_AUTH');

$proposal = new stdClass();
$proposal->Type = "acquisition";
$proposal->BillTo = new stdClass();
$proposal->BillTo->Company = "Billing company";
$proposal->Content = new stdClass();
$proposal->Content->Language = "EN";
$proposal->Content->Currency = "USD";
$proposal->Content->LineItems =  array();
$lineItem = new stdClass();
$lineItem->ProductName = "My Product Name";
$lineItem->ProductCode = "5DCB30C6B0";
$lineItem->Quantity = 1;
$lineItem->Price = 54.2;
$lineItem->DiscountedPrice = 50;
$lineItem->PriceType = "net";
$lineItem->ContractPeriod = 0;
$proposal->Content->LineItems[0] = $lineItem;
$proposal->tac = new stdClass();
$proposal->tac->content = "Lorem ipsum.";
$proposal->SellTo = new stdClass();
$proposal->SellTo->Company = "End user company";

try {
    $results = $soapClient->createProposal($sessionID, $proposal);
    echo "New proposal created: </br>", 
    var_dump($results);
}
catch (SoapFault $e) {
    echo "Could not create proposal: " . $e->getMessage();
    exit;
}

Request sample with prorationDate

<?php

        require ('PATH_TO_AUTH');

        $proposal = new stdClass();
        $proposal->Type = "amendment";
        $proposal->BillTo = new stdClass();
        $proposal->BillTo->Company = "Billing company";
        $proposal->Content = new stdClass();
        $proposal->Content->Language = "EN";
        $proposal->Content->Currency = "USD";
        $proposal->Content->Tersm = 10;
        $proposal->Content->LineItems =  array();
        $lineItem = new stdClass();
        $lineItem->ProductName = "My Product Name";
        $lineItem->ProductCode = "5DCB30C6B0";
        $lineItem->Quantity = 1;
        $lineItem->Price = 54.2;
        $lineItem->DiscountedPrice = 50;
        $lineItem->PriceType = "net";
        $lineItem->ProrationDate = "2020-11-14T15:28:56+00:00";
        $lineItem->ContractPeriod = 0;
        $lineItem->subscriptionReference ="1234567890";
        $proposal->Content->LineItems[0] = $lineItem;
        $proposal->tac = new stdClass();
        $proposal->tac->content = "Lorem ipsum.";
        $proposal->SellTo = new stdClass();
        $proposal->SellTo->Company = "End user company";

        try {
            $results = $soapClient->createProposal($sessionID, $proposal);
            echo "New proposal created: </br>",
            var_dump($results);
        }
        catch (SoapFault $e) {
            echo "Could not create proposal: " . $e->getMessage();
            exit;
        }

Request sample with vatCode

    <?php

        require ('PATH_TO_AUTH');

        $proposal = new stdClass();
        $proposal->Type = "acquisition";
        $proposal->BillTo = new stdClass();
        $proposal->BillTo->Company = "Billing company";
        $proposal->Content = new stdClass();
        $proposal->Content->Language = "EN";
        $proposal->Content->Currency = "USD";
        $proposal->Content->LineItems =  array();
        $lineItem = new stdClass();
        $lineItem->ProductName = "My Product Name";
        $lineItem->ProductCode = "5DCB30C6B0";
        $lineItem->Quantity = 1;
        $lineItem->Price = 54.2;
        $lineItem->DiscountedPrice = 50;
        $lineItem->PriceType = "net";
        $lineItem->ContractPeriod = 0;
        $proposal->Content->LineItems[0] = $lineItem;
        $proposal->tac = new stdClass();
        $proposal->tac->content = "Lorem ipsum.";
        $proposal->SellTo = new stdClass();
        $proposal->SellTo->Company = "End user company";
        $proposal->SellTo->VatCode = "854234564";

        try {
            $results = $soapClient->createProposal($sessionID, $proposal);
            echo "New proposal created: </br>", 
            var_dump($results);
        }
        catch (SoapFault $e) {
            echo "Could not create proposal: " . $e->getMessage();
            exit;
        }

Request sample with TaxExemptionId

<?php

        require ('PATH_TO_AUTH');

        $proposal = new stdClass();
        $proposal->Type = "acquisition";
        $proposal->BillTo = new stdClass();
        $proposal->BillTo->Company = "Billing company";
        $proposal->Content = new stdClass();
        $proposal->Content->Language = "EN";
        $proposal->Content->Currency = "USD";
        $proposal->Content->LineItems =  array();
        $lineItem = new stdClass();
        $lineItem->ProductName = "My Product Name";
        $lineItem->ProductCode = "5DCB30C6B0";
        $lineItem->Quantity = 1;
        $lineItem->Price = 54.2;
        $lineItem->DiscountedPrice = 50;
        $lineItem->PriceType = "net";
        $lineItem->ContractPeriod = 0;
        $proposal->Content->LineItems[0] = $lineItem;
        $proposal->tac = new stdClass();
        $proposal->tac->content = "Lorem ipsum.";
        $proposal->SellTo = new stdClass();
        $proposal->SellTo->Company = "End user company";
        $proposal->SellTo->TaxExemptionId = "854234564";

        try {
            $results = $soapClient->createProposal($sessionID, $proposal);
            echo "New proposal created: </br>", 
            var_dump($results);
        }
        catch (SoapFault $e) {
            echo "Could not create proposal: " . $e->getMessage();
            exit;
        }    

Response

The createProposal call via SOAP API returns a Proposal object.

Two-factor authentication

Overview

Two-factor authentication is a method of computer access control that grants users access to their account after validating two criteria:

  • Knowledge - represented by a security aspect the user has knowledge of, such as the username and password.
  • Possession - represented by an item that only exists in the possession of that specific user, such as a smartphone, tablet, phone number, or email address.

Through two-factor authentication, users can access the 2Checkout Merchant Control Panel using their username, password, and a security token provided either by the Google Authenticator app or sent via email (associated with their Merchant Control Panel account).

For security reasons, master account users can enable two-factor authentication for their own accounts only via Google Authenticator

2Checkout allows you to manage user access to specific features by creating and assigning user roles. This extra layer of security enables you to restrict access to the Merchant Control Panel to specific users, based on unique tokens.

Availability

All 2Checkout accounts.

Requirements

  • Two-factor authentication through Google Authenticator requires a compatible mobile device running Android 2.3.3 or newer, or iOS 7.0 or newer.
  • Two-factor authentication via email requires the user to have access to his or her email account.

Google Authenticator for Android

You can download the Google Authenticator app for Android here or by accessing Google Play Store from your Android device.

Google Authenticator for iOS

You can download the Google Authenticator app for iOS here or by accessing the App Store from your iOS device.

Two-factor authentication types

2Checkout supports two types of two-factor authentication:

  • Two-factor authentication powered by Google Authenticator. Authentication codes are delivered through the Google Authenticator app for Android and iOS.
  • Two-factor authentication via emailParticular cases where users do not have access to their smartphones, such as environments that adhere to a "clean desk" policy, require authentication codes to be sent via email. In these situations, two-factor enrollment is done by the master account. Users enrolled by the master account cannot disable two-factor authentication on their own.

Two-factor authentication via Google Authenticator

Enable two-factor authentication

Follow the steps below to enable two-factor authentication for your account.

  1. Log in to the 2Checkout Merchant Control Panel.
  2. Navigate to the Settings cogwheel in the upper right corner.
  3. Click on My details.

2FA details.png

4. Go to the Two-factor authentication tab.

5. Scan the QR code using your smart device or enter the Authentication secret in the Google Authenticator app. The app will provide an authentication code.

6. Enter the authentication code in the dedicated field in the 2Checkout Merchant Control Panel.

7. Click Activate.

From this point on, every login attempt will require an authentication code provided by Google Authenticator.

Disable two-factor authentication

Follow the steps below to disable two-factor authentication.

  1. Login to the 2Checkout Control Panel.
  2. Navigate to the Settings cogwheel in the upper right corner.
  3. Click on My details.
  4. Go to the Two-factor authentication tab.
  5. Click Deactivate.

Two-factor authentication via email

Particular cases where users do not have access to their smartphones, such as environments that adhere to a "clean desk" policy, require authentication codes to be sent via email. In these situations, two-factor enrollment is done by the master account. Users enrolled by the master account cannot disable two-factor authentication on their own.

Follow the steps below to enable two-factor authentication via email.

  1. Login to the 2Checkout Merchant Control Panel with a master account.
  2. Navigate to the Settings cogwheel in the upper right corner.
  3. Click on User management.
  4. Identify the user you wish to enable two-factor authentication for and click Edit.
  5. Check the Two-factor authentication by email option.
  6. Click Save.

Once you enable two-factor authentication for a user, 2Checkout notifies them about the change and sends an authentication code to their email address each time a login attempt is detected.

Add promotion coupon

Request

<?php 

class Client
{
    protected static $merchantCode;
    protected static $loginDate;
    protected static $hash;
    protected static $baseUrl;
    protected static $callCount = 0;
    protected static $sessionId = '';

    protected static $client;

    public static function setCredentials($code, $key)
    {
        static::$merchantCode = $code;
        static::$loginDate = gmdate('Y-m-d H:i:s');
        static::$hash = hash_hmac('md5', strlen($code) . $code . strlen(static::$loginDate) . static::$loginDate, $key);
        static::$sessionId = static::login();
    }

    public static function setBaseUrl($url)
    {
        static::$baseUrl = $url;
    }

    public static function login()
    {
        $client = static::getClient();
        return $client->login(static::$merchantCode, static::$loginDate, static::$hash);
    }

    public static function __callStatic($name, $arguments = array())
    {
        $client = static::getClient();

        array_unshift($arguments, static::$sessionId);
        $response = call_user_func_array(array($client, $name), $arguments);

        return $response;
    }

    protected static function getClient()
    {
        $opts = array(
            'http'=> ['user_agent' => 'PHPSoapClient'],
            'ssl' => [
                'verify_peer' => false,
                'verify_peer_name' => false,
            ],
        );

        if (null === static::$client) {
            static::$client = new \SoapClient(static::$baseUrl . '?wsdl', [
                'location' => static::$baseUrl,
                'cache_wsdl' => WSDL_CACHE_NONE,
                'stream_context' => stream_context_create($opts),
            ]);
        }

        return static::$client;
    }
}

Client::setBaseUrl('https://api.avangate.com/soap/3.1/');
Client::setCredentials('YOUR_MERCHANT_CODE', 'YOUR_SECRET_KEY');
Client::login();

$promotionCode = 'YOUR_PROMOTION_CODE'; // code of the promotion that you want to update

// // Define single coupon object
// $promotionCoupon = new stdClass;
// $promotionCoupon->Type = 'SINGLE';
// $promotionCoupon->Code = 'YOUR_CODE_HERE';

// Define multiple coupon object
// $promotionCoupon = new stdClass;
// $promotionCoupon->Type = 'MULTIPLE';
// $promotionCoupon->Codes = ['YOUR_CODE_1', 'YOUR_CODE_2'];

$response = Client::addPromotionCoupon ($promotionCode,$promotionCoupon); // Add coupons to the existing promotion
var_dump($response);

Enable a subscription

Overview

Use the enableSubscription method to enable a subscription.

Parameters

Parameters Type/Description

sessionID

Required (string)

 

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

subscriptionReference

Required (string)

 

Unique, system-generated subscription identifier.

Response

Parameters Type/Description

Boolean

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

Request

<?php

require ('PATH_TO_AUTH');

$subscriptionReference = 'YOUR_SUBSCRIPTION_REFERENCE';

try {
    $enabledSubscription = $client->enableSubscription($sessionID, $SubscriptionReference);
}
catch (SoapFault $e) {
    echo "enabledSubscription: " . $e->getMessage();
    exit;
}
var_dump("enabledSubscription", $enabledSubscription);

Enable a subscription

Overview

Use the enableSubscription method to enable a subscription.

Parameters

Parameters Type/Description

sessionID

Required (string)

 

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

subscriptionReference

Required (string)

 

Unique, system-generated subscription identifier.

Response

Parameters Type/Description

Boolean

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

Request

<?php

require ('PATH_TO_AUTH');

$subscriptionReference = 'YOUR_SUBSCRIPTION_REFERENCE';

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

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

Update a subscription

Overview

Change specific details about a subscription. Use the updateSubscription method to change specific details about a subscription.

Parameters

Parameters Type/Description
sessionID Required (string)
  Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect.  The sessionID expires in 10 minutes.
Subscription Required (Object)
  You need to include the entire Subscription object keeping its structure unchanged (retrieve it using getSubscription) but you can update only specific parameters enumerated below.
  EndUser Object
    End user details.
  ExpirationDate String
   

Subscription expiration date - If you changed the time zone for the 2Checkout API by editing system settings under Account settings, then 2Checkout calculates the ExpirationDate according to your custom configuration. Note: The default 2Checkout API time zone is GMT+02:00.

You cannot set an expiration date from the past.

  ActivationDate String
   

Subscription activation date - If you changed the time zone for the 2Checkout API by editing system settings under Account settings, then 2Checkout calculates the ActivationDate according to your custom configuration. Note: The default 2Checkout API time zone is GMT+02:00.

This field is optional. If provided, it cannot be set lower than the subscription start date (creation/purchase date) and it can be changed only while the subscription is in pending activation status.

  SubscriptionEnabled Boolean
    Possible values: TRUE/FALSE
  RecurringEnabled Boolean
    Possible values: TRUE/FALSE
  ExternalCustomerReference String
   

Unique customer alphanumeric (string) identifiers that you control. Use this to 

move a subscription from under a customer to another customer entity. 2Checkout moves subscription under the customer for which you provide the External customer reference during the subscription update process. View example.

  ProductId Int
   

System-generated unique product ID. Needs to be the ID of an existing product in the 2Checkout system created under your account.

The product ID governs the product to which the subscription is associated with.

Product types must match Regular - Regular or Bundle - Bundle.

IDs must identify products with the renewal system enabled (max billing cycle 36 months).

  ProductName String
    The name of the product for identifier used under ProductID.
  ProductQuantity Int
    Ordered quantity.
  PriceOptionCodes Array
   

Array of product options codes. Pricing options codes are case sensitive.

To impact the renewal price, the PriceOptionsCodes need to belong to price options of pricing configurations used for the product with which the subscription is associated.

ChurnReasons Array
 

This payload can be sent only when the Subscription object (from above) will have RecurringEnabled set as TRUE. Possible values for this field are:
CHURN_REASON_NOT_SATISFIED_PRODUCT

CHURN_REASON_ENABLED_BY_MISTAKE

CHURN_REASON_PREFER_MANUAL

CHURN_REASON_ALREADY_RENEWED

CHURN_REASON_DONT_NEED

CHURN_REASON_WANT_PAUSE

CHURN_REASON_COVID

CHURN_REASON_HIGH_PRICE

CHURN_REASON_NOT_SATISFIED_SUPPORT

CHURN_REASON_EXTRAORDINARY

CHURN_REASON_OTHER

ChurnReasonOther String
  This field should have a value only if the ChurnReasons has the CHURN_REASON_EXTRAORDINARY or CHURN_REASON_OTHER values

 

All other parameters of the Subscription object are non-editable.

The 2Checkout system uses the updated subscription information for:

  • Manual and automatic renewals
  • Upgrades
  • Trial conversions

Response

Parameters Type/Description
Boolean true or false depending on whether the changes were successful or not.

Request

<?php

require ('PATH_TO_AUTH');

$subscriptionReferenceTest = 'YOUR_SUBSCRIPTION_REFERENCE';

try{
    $retrievedSubscription = $client->getSubscription($sessionID, $subscriptionReferenceTest);
}

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

var_dump ($updatedSubscription);


$retrievedSubscription->RecurringEnabled = false;
$retrievedSubscription->SubscriptionEnabled = false;
$retrievedSubscription->ExpirationDate = '2026-12-12';

$churnReasons = ['CHURN_REASON_OTHER'];
$churnReasonOther = 'I refuse to continue the subscription';

try {
    $updatedSubscription = $client->updateSubscription($sessionID, $retrievedSubscription);
}
catch (SoapFault $e) {
    echo "updatedSubscription: " . $e->getMessage();
    exit;
}
var_dump("updatedSubscription", $updatedSubscription);

?>

 

Error handling for API 6.0

Overview

Learn how to tackle the common errors that may arise when using the placeOrder call via 2Checkout API.

Error codes for Order Object

Item: Product

Error code Description
ORDER_PRODUCTS_EMPTY No products have been provided.
ORDER_PRODUCT_RENEWAL_SUBSCRIPTION_REFERENCE_EMPTY Subscription reference cannot be empty.
ORDER_PRODUCT_RENEWAL_SUBSCRIPTION_REFERENCE_INVALID Subscription reference is invalid.
ORDER_PRODUCT_RENEWAL_SUBSCRIPTION_REFERENCE_NOT_FOUND Subscription reference is invalid.
ORDER_PRODUCT_RENEWAL_PERIOD_INVALID The renewal period is invalid.
ORDER_PRODUCTS_RENEWAL_NOT_ALLOWED Renewal is not allowed with multiple products.
ORDER_PRODUCT_CODE_INVALID Invalid product code.
PRODUCT_ERROR Invalid product id.
ORDER_PRODUCT_CODE_INVALID Requested product [%s] was not found.
ORDER_PRODUCT_PRICE_STRUCTURE_INVALID The price structure is not valid.
ORDER_PRODUCT_PRICE_AMOUNT_INVALID The price amount is not valid.
ORDER_PRODUCT_PRICE_TYPE_INVALID The price type is not valid
ORDER_PRODUCT_PRICE_TYPE_BASE_INVALID The price amount does not need to be set on the base price flow.
ORDER_PRODUCT_PRICE_TYPE_DEFAULT_INVALID The price amount does not need to be set on the default price flow.
ORDER_PRODUCT_PRICE_TYPE_CUSTOM_INVALID The price amount is mandatory to be set on the custom price flow.
ORDER_PRODUCT_INVALID Internal product validation error.
ORDER_PRODUCT_NAME_INVALID Name is mandatory when you set IsDynamic to TRUE.
ORDER_ITEMS_INVALID Invalid items. You cannot mix dynamic and catalog products.
ORDER_PRODUCT_IS_DYNAMIC_INVALID Invalid IsDynamic value. Use: TRUE or FALSE.
ORDER_PRODUCT_PURCHASE_TYPE_INVALID Invalid product purchase type. Accepted values: PRODUCT, SHIPPING, COUPON and TAX.
ORDER_PRODUCT_TANGIBLE_INVALID Invalid Tangible value. Use: TRUE or FALSE.
ORDER_ITEMS_QUANTITY_INVALID Item quantity must be between 1 and 99999.

 Item: Trial

Error code Description
INVALID_PRODUCT Invalid product ID.
PRODUCT_ALREADY_IN_CART Product already in cart.
INVALID_TRIAL_PERIOD The trial period needs to be greater than 0 days.
INVALID_TRIAL_PRODUCT Invalid trial product.

Item: Cross-sell

Error code Description
INVALID_CROSS_SELL_PRODUCT Invalid cross-sell product ID/Invalid cross-sell parent product code/Invalid cross-sell parent product ID/Invalid cross-sell products for a specified campaign.
PRODUCT_ALREADY_IN_CART Product already in cart.
PRODUCT_NOT_IN_CART The cross-sell master product is not already in the cart.
INVALID_CROSS_SELL_CAMPAIGN Invalid cross-sell campaign.
ORDER_ITEMS_CROSS_SELL_PARENT_DISABLED Parent product form cross-sell campaign is disabled.
ORDER_ITEMS_CROSS_SELL_CHILD_DISABLED Child product form cross-sell campaign is disabled.
ITEM_CROSS_SELL_INVALID CrossSell field is invalid.
ITEM_CROSS_SELL_PARENT_CODE_INVALID CrossSell parent code is invalid.
ITEM_CROSS_SELL_CAMPAIGN_CODE_INVALID CrossSell campaign code is invalid.
ITEM_CROSS_SELL_AUTOADDED_INVALID CrossSell 'AutoAdded' field is invalid.

Item: Price_options

Error code Description
INVALID_OPTIONS Your pricing has error: %s.
ORDER_ITEMS_PRICE_OPTIONS_NAME_EMPTY Item price options name is empty.
ORDER_ITEMS_PRICE_OPTIONS_OPTION_NAME_EMPTY Item price options option name is empty.
ORDER_ITEMS_PRICE_OPTIONS_OPTION_VALUE_EMPTY Item price options option value is empty.
ORDER_ITEMS_PRICE_OPTIONS_NAME_INVALID Invalid item price options name.
ORDER_ITEMS_PRICE_OPTIONS_INVALID Invalid item price options.
ORDER_ITEMS_PRICE_OPTIONS_OPTION_NAME_INVALID Invalid item price options option name.
ORDER_ITEMS_PRICE_OPTIONS_OPTION_VALUE_INVALID Invalid item price options option value.
ORDER_ITEMS_PRICE_OPTIONS_OPTION_SURCHARGE_INVALID Invalid item price options option surcharge.

Item: Price

Error code Description
PRICE_ERROR The price needs to be a decimal value.
PRODUCT_ERROR You need to add the product to the order before setting the price./Invalid product id.
CURRENCY_ERROR No currency is set for the current session.
ORDER_ITEMS_RECURRING_OPTIONS_CYCLE_UNIT_INVALID Invalid item recurring option cycle unit. Accepted values: DAY, WEEK, MONTH, YEAR.
ORDER_ITEMS_RECURRING_OPTIONS_CYCLE_LENGTH_INVALID Invalid item recurring option cycle length. Use integers.
ORDER_ITEMS_RECURRING_OPTIONS_CONTRACT_UNIT_INVALID Invalid item recurring option contract unit. Accepted values: DAY, WEEK, MONTH, YEAR, FOREVER.
ORDER_ITEMS_RECURRING_OPTIONS_CONTRACT_LENGTH_INVALID Invalid item recurring option contract length. Use integers.
ORDER_ITEMS_RECURRING_OPTIONS_CYCLE_AMOUNT_INVALID Item recurring option cycle amount must be zero or a positive value (INT or FLOAT).
ORDER_PRODUCT_PRICE_AMOUNT_TYPE_INVALID The price amount type is not valid.

Item: Refund

Error code Description
ORDER_REFUND_ORDER_REF_MISSING ORDER_REF missing or format incorrect.
ORDER_REFUND_ORDER_AMOUNT_MISSING ORDER_AMOUNT missing or format incorrect.
ERROR_CANCELLING_ORDER Error canceling order.
ORDER_ALREADY_CANCELED Order already canceled.
UNKNOWN_ERROR Unknown error.
ORDER_REFUND_INVALID_ORDER_REF Invalid ORDER_REF.
ORDER_REFUND_INVALID_ORDER_AMOUNT Invalid ORDER_AMOUNT.
ORDER_REFUND_LINE_ITEM_REFERENCE_MISSING ORDER_REFUND_LINE_ITEM_REFERENCE missing or format incorrect.
ORDER_REFUND_PRODUCTS_QTY_MISSING PRODUCTS_QTY missing or format incorrect.
ORDER_REFUND_INVALID_PRODUCTS_QTY Invalid PRODUCTS_QTY.
ORDER_REFUND_AMOUNT_MISSING AMOUNT missing or format incorrect.
ORDER_REFUND_AMOUNT_INVALID Invalid AMOUNT.
ORDER_REFUND_ALREADY_PLACED_TOTAL_REFUND You have already placed a Total refund for this order.
ORDER_REFUND_ALREADY_PLACED You have already placed a refund for this order.
ORDER_REFUND_ALREADY_HAVE_PENDING_REFUND_REQUEST You already have a pending refund request.
ORDER_REFUND_AMOUNT_EXCEEDED_MAXIMUM_REFUNDABLE_AMOUNT The maximum refundable amount for this order has been exceeded.
ORDER_REFUND_FAILED_DUE_TO_ORDER_CURRENT_STATUS You cannot place a refund request due to the order's current status.
ORDER_REFUND_FAILED_DUE_TO_PAYMENT_DETAILS You cannot place a refund request due to the order's payment details.
ORDER_REFUND_FAILED_DUE_TO_PERIOD_TO_REQUEST_REFUND_HAS_EXPIRED The allowed period to request a new refund for this order has expired.
ORDER_REFUND_MULTIPLE_NOT_SUPPORTED_BY_PAYMENT_TYPE Multiple refunds are not supported by this order's payment type.
ORDER_REFUND_NOT_SUPPORTED_FOR_CROSS_VENDOR_SALE Refunding not supported for this Cross Vendor Sale order.
ORDER_REFUND_TOTAL_NEGATIVE Order total is negative.
ORDER_REFUND_AMOUNT_NEGATIVE Order amount is negative.
ORDER_REFUND_ITEM_AMOUNT_NEGATIVE Order item amount is negative.
ORDER_REFUND_FAILED_DUE_TO_ORDER_APPROVAL_STATUS You cannot place a refund request due to the order's approval status.
ORDER_REFUND_MULTIPLE_REFUNDS_NOT_SUPPORTED Multiple refunds are not supported by this order's terminal.
ORDER_REFUND_PARTIAL_REVERSE_NOT_SUPPORTED Partial reverse is not supported.
ORDER_REFUND_INVALID_PRODUCT_TYPE Invalid product type. Refunds are available only for the following product types: REGULAR / BUNDLE / MEDIA / DOWNLOAD_INSURANCE / SHIPPING, but not for DISCOUNT.
ORDER_REFUND_FAILED_DUE_TO_OPEN_CHARGEBACK_DISPUTE You cannot request a refund because a chargeback dispute was open for the order.
ORDER_REFUND_INVALID_REASON Invalid REFUND_REASON.
ORDER_REFUND_LINE_ITEM_REFERENCES_NOT_FOUND ORDER_REFUND_LINE_ITEM_REFERENCES is incorrect or not part of Order.
ORDER_REFUND_FEATURE_MISSING You are not allowed to request refund.

Item: Mark_Shipped

Error code Description
ORDER_MARK_SHIPPED_ALREADY_MARKED_SHIPPED Sale already marked shipped.
ORDER_MARK_SHIPPED_NOT_SHIPPABLE Item not shippable.
ORDER_MARK_SHIPPED_STATUS_INVALID Order Status is not Payment Authorized.
ORDER_MARK_SHIPPED_AUTH_EXPIRED Payment authorization has expired. Reauthorize payment before marking shipped.
ORDER_MARK_SHIPPED_TOO_SOON Please wait 24 hours before trying to reauthorize again.
ORDER_MARK_SHIPPED_REAUTH_FAILED Failed to reauthorize payment.
ORDER_MARK_SHIPPED_INTERNAL_ERROR_REAUTH Failed to mark shipped but reauthorization succeeded.
ORDER_MARK_SHIPPED_INTERNAL_ERROR Failed to mark shipped.

Item: Shipping_Price

Error code Description
COUPON_CODES_INVALID The coupon codes format is invalid.
BILLING_DETAILS_COUNTRY_INVALID The billing country code is invalid.
DELIVERY_DETAILS_COUNTRY_INVALID The delivery country code is invalid.
PARAMETERS_INVALID The country code [%s] does not have a currency that is in your account's transactional currencies.
ITEMS_INVALID The shipping price can only be calculated for physical products.

Item: Billing_Details

Error code Description
ORDER_BILLING_DETAILS_COUNTRY_DYNAMIC_NOT_ALLOWED Functionality not available for your account.
ORDER_BILLING_DETAILS_EMPTY Billing details can not be used for delivery as they are empty.
ORDER_BILLING_EMAIL_EMPTY Email cannot be empty.
ORDER_BILLING_EMAIL_EMAIL_INVALID Email is not valid.
ORDER_BILLING_FIRST_NAME_EMPTY The First Name cannot be empty.
ORDER_BILLING_LAST_NAME_EMPTY The Last Name cannot be empty.
ORDER_BILLING_ADDRESS1_EMPTY The Address 1 cannot be empty.
ORDER_BILLING_CITY_EMPTY The City cannot be empty.
ORDER_BILLING_ZIP_EMPTY The Zip cannot be empty.
ORDER_BILLING_STATE_EMPTY The State cannot be empty.
ORDER_BILLING_DETAILS_COUNTRY_EMPTY The Country cannot be empty.
ORDER_BILLING_DETAILS_COUNTRY_INVALID The Country is not supported by the vendor.
ORDER_BILLING_DETAILS_STATE_EMPTY The State cannot be empty.
ORDER_BILLING_DETAILS_STATE_INVALID The State is not valid.
ORDER_BILLING_DETAILS_PHONE_EMPTY The Phone cannot be empty.
ORDER_BILLING_DETAILS_CPF_CNPJ_EMPTY The CPF/CPNJ cannot be empty.
ORDER_BILLING_DETAILS_CPF_CNPJ_INVALID The CPF/CNPJ is invalid.
ORDER_BILLING_DETAILS_COMPANY_EMPTY The Company cannot be empty.
ORDER_BILLING_DETAILS_GSTIN_EMPTY The GSTIN number cannot be empty.
ORDER_BILLING_DETAILS_GSTIN_INVALID The GSTIN number is invalid.
ORDER_BILLING_DETAILS_FISCAL_CODE_EMPTY The Fiscal Code cannot be empty.
ORDER_BILLING_DETAILS_TAX_OFFICE_EMPTY The Tax office cannot be empty.
ORDER_BILLING_DETAILS_TAX_OFFICE_INVALID The Tax office is not valid.
ORDER_BILLING_DETAILS_FISCAL_CODE_INVALID The Fiscal Code is not valid.
ORDER_BILLING_DETAILS_INVALID No billing details have been provided.
ORDER_BILLING_DETAILS_EMAIL_EMPTY The billing email cannot be empty.
ORDER_BILLING_DETAILS_PHONE_INVALID The Phone is invalid (10/11 digits expected).
ORDER_BILLING_DETAILS_TAX_OFFICE_INVALID TaxOffice length exceeds 50 characters.

Item: Delivery

Error code Description
ORDER_DELIVERY_EMAIL_EMPTY The Email cannot be empty.
ORDER_DELIVERY_EMAIL_EMAIL_INVALID The Email is not valid.
ORDER_DELIVERY_FIRST_NAME_EMPTY The First Name cannot be empty.
ORDER_DELIVERY_LAST_NAME_EMPTY The Last Name cannot be empty.
ORDER_DELIVERY_ADDRESS1_EMPTY The Address 1 cannot be empty.
ORDER_DELIVERY_CITY_EMPTY The City cannot be empty.
ORDER_DELIVERY_ZIP_EMPTY The Zip cannot be empty.
ORDER_DELIVERY_STATE_EMPTY The State cannot be empty.
ORDER_DELIVERY_DETAILS_COUNTRY_INVALID The country code is not valid for the current vendor.

Item: Payment_Method

Error code Description

ORDER_PAYMENT_METHOD_EMPTY

No payment method has been provided.
ORDER_PAYMENT_METHOD_INVALID The payment method is not supported by your account.
ORDER_PAYMENT_METHOD_PREVIOUS_ORDER_REFNO_EMPTY The previous order reference number cannot be empty.
ORDER_PAYMENT_METHOD_RETRY_INVALID This payment method is not supported for retrying this order.
ORDER_PAYMENT_METHOD_RESTRICTED The payment method is restricted for product.
ORDER_PAYMENT_METHOD_COUNTRY_INVALID The payment method is not available in the selected country.
ORDER_PAYMENT_METHOD_CURRENCY_INVALID The payment currency is not supported for selected payment method.
ORDER_PAYMENT_METHOD_NOT_ALLOWED Card processing is restricted. Your integration does not meet the requirements for handling sensitive card data.
ORDER_PAYMENT_METHOD_PREVIOUS_ORDER_EMAIL_INVALID The billing email is different from the one of the reference order.
ORDER_PAYMENT_METHOD_CC_VENDOR_3DS_RETURN_URL_EMPTY The PaymentDetails.PaymentMethod.Vendor3DSReturnURL can not be empty.
ORDER_PAYMENT_METHOD_CC_VENDOR_3DS_RETURN_URL_INVALID The PaymentDetails.PaymentMethod.Vendor3DSReturnURL is not valid.
ORDER_PAYMENT_METHOD_CC_VENDOR_3DS_CANCEL_URL_EMPTY The PaymentDetails.PaymentMethod.Vendor3DSCancelURL can not be empty.
ORDER_PAYMENT_METHOD_CC_VENDOR_3DS_CANCEL_URL_INVALID The PaymentDetails.PaymentMethod.Vendor3DSCancelURL is not valid.
ORDER_PAYMENT_METHOD_PAYPAL_EXPRESS_PROCESS_ERROR An error occurred while trying to place the order.
ORDER_PAYMENT_METHOD_PAYPAL_EXPRESS_INTERNAL_ERROR An error from Paypal Express gateway.
ORDER_PAYMENT_METHOD_DIRECT_DEBIT_PROCESS_ERROR An error occurred while trying to place the order.
ORDER_PAYMENT_METHOD_DIRECT_DEBIT_INTERNAL_ERROR Generic error.
ORDER_PAYMENT_METHOD_IDEAL_PROCESS_ERROR An error occurred while trying to place the order.
ORDER_PAYMENT_METHOD_IDEAL_INTERNAL_ERROR Generic error.
ORDER_PAYMENT_METHOD_WE_CHAT_PAY_PROCESS_ERROR An error occurred while trying to place the order.
ORDER_PAYMENT_METHOD_WE_CHAT_PAY_INTERNAL_ERROR Generic error.
ORDER_PAYMENT_METHOD_DIRECT_DEBIT_SWIFT_EMPTY The swift code cannot be empty.
ORDER_PAYMENT_METHOD_DIRECT_DEBIT_IBAN_EMPTY The IBAN cannot be empty or exceed 28 characters./The FirstName cannot be empty or exceed 30 characters./The LastName cannot be empty or exceed 30 characters.
ORDER_PAYMENT_METHOD_IDEAL_BANK_CODE_EMPTY The bank code cannot be empty.
ORDER_PAYMENT_METHOD_INVALID The payment method [%s] is not supported.
ORDER_PAYMENT_METHOD_ORDER_REFERENCE_INVALID Order reference number is required for [%s] payment method./Order reference number is invalid for subscription reference [%s].
PAYMENT_ERROR You cannot place a trial order using [%s] payment method.
PAYMENT_ERROR You cannot place a trial order without a payment method.
ORDER_PAYMENT_METHOD_CARD_MONTH_INVALID The expiration month is invalid.
ORDER_PAYMENT_METHOD_CARD_YEAR_INVALID The expiration year is invalid.
ORDER_PAYMENT_METHOD_CARD_DATE_INVALID The card has expired.
ORDER_PAYMENT_METHOD_CARD_PROCESS_ERROR Couldn't complete the payment validation process: Error processing the credit card transaction. Please contact the issuer bank for more details, or enter another card.
ORDER_PAYMENT_METHOD_CARD_PROCESS_ERROR Couldn't complete the payment validation process: Error processing the credit card transaction. Insufficient funds. Please charge your card account or enter another card.
ORDER_PAYMENT_METHOD_CARD_PROCESS_ERROR Couldn't complete the payment validation process: Access denied in payment gateway! The transaction cannot be finalized at this time. Please try to finalize the transaction in a few minutes.
ORDER_PAYMENT_METHOD_CARD_PROCESS_ERROR Couldn't complete the payment validation process: Error processing the credit card transaction. Please enter another card or try to finalize the transaction in a few minutes.
ORDER_PAYMENT_METHOD_CARD_PROCESS_ERROR 'Couldn't complete the payment validation process: <div align="left">Error processing the credit card transaction. Your credit card was not charged.<br><br>Possible cause: <li>your card is not active for online transactions<li>you have entered invalid or incomplete credit card details<li>a temporary error occurred while processing the payment<br><br><font color="000000">Recommendations:<br>Please enter another card or try to finalize the transaction in a few minutes. If you still get an error, please contact the issuer bank for more details by calling the number on the back of your card.</font></div>
ORDER_PAYMENT_METHOD_CARD_PROCESS_ERROR Couldn't complete the payment validation process: Error processing the credit card transaction. Expired card. Please contact the issuer bank for more details, or enter another card.
ORDER_PAYMENT_METHOD_CARD_PROCESS_ERROR Couldn't complete the payment validation process: Error processing the credit card transaction. No such card. The transaction can be finalized only after entering a valid credit card.
ORDER_PAYMENT_METHOD_CARD_PROCESS_ERROR Couldn't complete the payment validation process: Error processing the credit card transaction. You have entered an invalid CVV2 or CVC2.
ORDER_CURRENCY_CODE_EMPTY The currency code cannot be empty.
ORDER_CURRENCY_INVALID The currency [%s] is not supported by the vendor.
PAYMENT_DECRYPTION_FAILED Invalid key identifier.
TEST_ORDER_NOT_ALLOWED Test orders are not available for your account.
ORDER_PAYMENT_METHOD_CCID_INVALID Invalid CVV2/CVC2 code.
ORDER_PAYMENT_METHOD_CARD_HOLDER_INVALID Invalid name.
ORDER_PAYMENT_METHOD_CARD_NUMBER_INVALID Your card type [%s] does not match the card number [%s].
ORDER_PAYMENT_METHOD_CARD_CURRENCY_INVALID The provided currency [%s] is not supported with this card type. Supported currencies: [%s].
ORDER_REF_MISMATCH The reference number does not belong to a valid order.
ORDER_FRAUD_ERROR The reference number identifies an order that is not yet cleared by fraud.
ORDER_STATUS_ERROR The reference number identifies an order with an incorrect status.
PAYMENT_ERROR The referenced order has an unsupported payment method.
ORDER_PAYMENT_METHOD_CARD_INVALID  Forbidden. You've reached the maximum allowed number of orders with the same credit card.
ORDER_PAYMENT_METHOD_CARD_INVALID Invalid card number entered.
ORDER_PAYMENT_METHOD_CARD_INVALID Visa usually has 16 or 13 digits, but you entered 14.
ORDER_PAYMENT_METHOD_CARD_INVALID Unknown error!
ORDER_PAYMENT_METHOD_CARD_INVALID We don't accept %s cards for online processing.
ORDER_PAYMENT_METHOD_CARD_INVALID Card number is missing %s digit(s).
ORDER_PAYMENT_METHOD_CARD_INVALID The month isn't a string.
ORDER_PAYMENT_METHOD_CARD_INVALID Month has invalid format.
ORDER_PAYMENT_METHOD_CARD_INVALID Invalid expiration date entered or the card has expired.
PAYMENT_ERROR AutoApprove feature is not available for your account.
PAYMENT_ERROR Net payment terms has to be a number of days between [%d] and [%d].
ORDER_PAYMENT_METHOD_DIRECT_DEBIT_IBANSWIFT_INCORRECT Invalid IBAN: [%s] or SWIFT CODE: [%s].
ORDER_PAYMENT_METHOD_DIRECT_DEBIT_IBAN_INVALID Invalid IBAN: [%s].
ORDER_PAYMENT_METHOD_DIRECT_DEBIT_SWIFT_INVALID Invalid SWIFT code: [%s].
ORDER_PAYMENT_METHOD_PAYPAL_RETURN_URL_EMPTY The return URL can not be empty.
ORDER_PAYMENT_METHOD_IDEAL_RETURN_URL_EMPTY The return URL can not be empty.
ORDER_PAYMENT_METHOD_WE_CHAT_PAY_RETURN_URL_EMPTY The return URL can not be empty.
ORDER_PAYMENT_METHOD_EXTERNAL_RETURN_URL_EMPTY The return URL can not be empty.
ORDER_PAYMENT_METHOD_PAYPAL_RETURN_URL_INVALID The return URL is not valid.
ORDER_PAYMENT_METHOD_IDEAL_RETURN_URL_INVALID The return URL is not valid.
ORDER_PAYMENT_METHOD_WE_CHAT_RETURN_URL_INVALID The return URL is not valid.
ORDER_PAYMENT_METHOD_EXTERNAL_RETURN_URL_INVALID The return URL is not valid.
ORDER_PAYMENT_METHOD_IDEAL_BANK_CODE_INVALID Invalid bank code [%s].
INVALID_PAYMENT_METHOD This payment method is not available for your account.
INVALID_CC_TOKEN Invalid token.
INVALID_EES_TOKEN The token is not valid. In order to proceed with the place order a valid token is required.
ORDER_PAYMENT_METHOD_APPLE_PAY_TOKEN_INVALID Invalid payment data: Invalid token.
ORDER_PAYMENT_METHOD_INVALID The payment method [%s] is not supported.
PAYMENT_ERROR Company name is mandatory for Purchase Order.

Item: Payment_Details

Error code Description
ORDER_PAYMENT_DETAILS_INVALID No payment details have been provided/Free orders without payment details are not enabled for your account.

Item: Currency

Error code Description
ORDER_CURRENCY_CODE_EMPTY The currency code cannot be empty.
ORDER_CURRENCY_INVALID The currency [%s] is not supported by the vendor.

Item: Language

Error code Description
ORDER_LANGUAGE_EMPTY Language code cannot be empty.
ORDER_LANGUAGE_INVALID Language [%s] is not supported by current vendor settings.

Item: Affiliate

Error code Description
AFFILIATE_CODE_EMPTY The AffiliateCode parameter cannot be empty.
AFFILIATE_CODE_INVALID The AffiliateCode parameter is invalid.

Item: ExtraInformation

Error code Description
INVALID_RETRY_FAILED_PAYMENT_LINK The retry payment link is not a valid URL.
INVALID_RETRY_FAILED_PAYMENT_LINK The retry payment link has no parameter with placeholder [%s].

Item: Source

Error code Description
INVALID_SOURCE The provided source is empty.

Item: Gift_details

Error code Description
INVALID_GIFT_DETAILS Gift details require that FirstName, LastName, and Email be non-empty.
INVALID_GIFT_EMAIL The gift email [%s] is not valid.
PRODUCT_ERROR Cannot mark the order as a gift until there are products added to the cart.
PRODUCT_ERROR Cannot mark the order as a gift because there are products that are not available as gifts.

Item: Coupon

Error code Description
ORDER_COUPON_CODE_EMPTY The coupon code is empty.
ORDER_COUPON_CODE_INVALID The provided coupon [%s] is invalid.

Item: Promotion

Error code Description
ORDER_PRODUCT_PROMOTION_CODE_INVALID The provided promotion code [%s] is invalid.

Item: Additional_Field

Error code Description
ORDER_ADDITIONAL_FIELD_REQUIRED The order additional information field [%s] was not set, and it's marked as mandatory.

Item: Order_Product_Additional_Fields

Error code Description
ORDER_PRODUCT_ADDITIONAL_FIELD_REQUIRED Add the required product additional information fields [%s] for products [%s].
ORDER_PRODUCT_ADDITIONAL_FIELD_REQUIRED The product additional information field [%s] was not set for product [%s], and it\'s marked as mandatory

Item: SubscriptionCustomSettings

Error code Description
ORDER_ITEMS_SUBSCRIPTION_CUSTOM_SETTINGS_CYCLE_UNIT_INVALID Invalid item subscription custom settings cycle unit. Accepted values: DAY, MONTH.
ORDER_ITEMS_SUBSCRIPTION_CUSTOM_SETTINGS_CYCLE_LENGTH_INVALID Invalid item subscription custom settings cycle length. Use positive integers, or -1 when contract length is NULL.
ORDER_ITEMS_SUBSCRIPTION_CUSTOM_SETTINGS_CONTRACT_LENGTH_INVALID Invalid item subscription custom settings contract length. Use positive integers or NULL.
ORDER_ITEMS_SUBSCRIPTION_CUSTOM_SETTINGS_CONTRACT_LENGTH_FORBIDDEN Forbidden item subscription custom settings contract length. Use a value that is a multiple of the cycle length value.
ORDER_ITEMS_SUBSCRIPTION_CUSTOM_SETTINGS_CYCLE_AMOUNT_INVALID Item subscription custom settings cycle amount must be a positive value (INT or FLOAT).
ORDER_ITEMS_SUBSCRIPTION_CUSTOM_SETTINGS_CYCLE_AMOUNT_TYPE_INVALID Invalid item subscription custom settings cycle amount type. Accepted values: NET, GROSS.
ORDER_ITEMS_SUBSCRIPTION_CUSTOM_SETTINGS_CLIENT_DEAL_AUTO_RENEWAL_INVALID Invalid item subscription custom settings client deal auto-renewal.
ORDER_ITEMS_SUBSCRIPTION_CUSTOM_SETTINGS_MERCHANT_DEAL_AUTO_RENEWAL_INVALID Invalid item subscription custom settings merchant deal auto-renewal.

Other

Error code Description

ORDER_PHYSICAL_FEATURE_MISSING

You are not allowed to place orders with physical products.
ORDER_ERROR Couldn't process the order/Order reference is invalid.
GIFT_ORDER_NOT_ALLOWED Cannot place the order because order is marked as gift and product is not available as a gift.
TEST_ORDER_NOT_ALLOWED Test orders are not available for your account.
ORDER_CURRENCY_MISMATCH Order currency values must match.
ORDER_TOTAL_NEGATIVE Order total must be zero or a positive value.
ORDER_TEST_MODE_REQUIRED Test mode is required on test subscriptions.
BANNED_SHOPPER_IP The shopper is banned.
AUTHENTICATION_ERROR Authentication needed for this resource.

 

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