For the complete documentation index, see llms.txt. This page is also available as Markdown.

Payment Methods

Retrieve installment settings used to place orders with installments

get

Retrieve information about the number of installments available for a specific selection of products or services.

Once the installment information is retrieved, it can be used in the POST call on the order resource to place an order with a installments

Query parameters
AmountnumberRequired

Amount

CountrystringRequired

2 letters country code

CurrencystringRequired

3 letters currency code

FiscalCodestringOptional

Fiscal code. Required for Brasil or if CardBin or EesToken is not provided

CardBinstringOptional

Card number. Required if Fiscal code or EesToken is not provided

EesTokenstringOptional

Ees token. Required if Fiscal code or CardBin is not provided

Header parameters
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Responses
200

OK

application/json
get/orders/0/installments/
GET /rest/6.0/orders/0/installments/?Amount=1&Country=text&Currency=text HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
{
  "0": {
    "Amount": "384.45",
    "Currency": "BRL",
    "Number": "1"
  },
  "1": {
    "Amount": "192.23",
    "Currency": "BRL",
    "Number": "2"
  },
  "2": {
    "Amount": "128.15",
    "Currency": "BRL",
    "Number": "3"
  },
  "3": {
    "Amount": "96.11",
    "Currency": "BRL",
    "Number": "4"
  },
  "4": {
    "Amount": "76.89",
    "Currency": "BRL",
    "Number": "5"
  },
  "5": {
    "Amount": "64.08",
    "Currency": "BRL",
    "Number": "6"
  }
}

Create an EES token for placing orders using 2pay.js

post
Header parameters
X-Avangate-AuthenticationstringRequiredExample: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
AcceptstringRequiredExample: application/json
Body
NamestringOptional

Name of the cardholder

Example: John Doe
CreditCardstringRequired

Credit card number

Example: 4111111111111111
CvvstringRequired

CVV number

Example: 123
ExpirationDatestringRequired

Card expiration date, format MM/YY

Example: 12/28
Scopestring · enumOptional

Represents the scope of the created token. It is the client's responsability to manage this

Default: orderingExample: subscriptionPossible values:
Responses
200

Create token response

application/json
post/tokens/
POST /rest/6.0/tokens/ HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
Content-Type: application/json
Content-Length: 111

{
  "Name": "John Doe",
  "CreditCard": "4111111111111111",
  "Cvv": "123",
  "ExpirationDate": "12/28",
  "Scope": "subscription"
}
200

Create token response

{
  "Results": {
    "Token": "c2ba2590-3641-4a06-9eaf-5fba50c8eef0"
  }
}

Initiate an ApplePay session

post
Header parameters
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Acceptstring · enumRequiredExample: application/jsonPossible values:
Body
validationURLstringOptional

Create an endpoint on your server to call to initiate an Apple Pay session. In order for a valid Apple Pay session to be created, an API call to the 2Checkout API needs to be sent, with the validationURL set to the ApplePay payment service.

Responses
200

OK

application/json
post/payments/startapplepaysession/
POST /rest/6.0/payments/startapplepaysession/ HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
Content-Type: application/json
Content-Length: 84

{
  "validationURL": "https://apple-pay-gateway.apple.com/paymentservices/startSession"
}
{
  "ApplePaySessionData": {
    "response": "APPLEPAY_DATA",
    "errors": []
  }
}

Decrypt the ApplePay data

post
Header parameters
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Acceptstring · enumRequiredExample: application/jsonPossible values:
Body
ApplePayDatastringOptional

Once the token is received from the frontend component, it has to be sent to the decryptApplePayData endpoint in the 2Checkout API. This will return a data response from Apple Pay that needs to be used in the placeOrder call.

Responses
200

OK

application/json
ApplePayDataTokenstringOptional
BillingDetailsobjectOptional
DeliveryDetailsobjectOptional
StatusbooleanOptional
post/payments/decryptApplePayData/
POST /rest/6.0/payments/decryptApplePayData/ HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
Content-Type: application/json
Content-Length: 83

{
  "ApplePayData": "543a07601ed9f8b8ee226e9630a24e2a91da8fdb08e6786fa02bf628f395bb91"
}
{
  "ApplePayDataToken": "APPLEPAY_DATA_TOKEN",
  "BillingDetails": {},
  "DeliveryDetails": {},
  "Status": true
}

Retrieve the list of banks that support iDEAL

get
Header parameters
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Responses
200

OK

application/json
get/paymentmethods/IDEAL/issuerbanks/
GET /rest/6.0/paymentmethods/IDEAL/issuerbanks/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
200

OK

[
  {
    "Code": "ABNANL2A+ABN",
    "Name": "ABN AMRO"
  },
  {
    "Code": "RABONL2U+RAB",
    "Name": "Rabobank"
  },
  {
    "Code": "INGBNL2A+ING",
    "Name": "ING"
  },
  {
    "Code": "SNSBNL2A+SNS",
    "Name": "SNS Bank"
  },
  {
    "Code": "ASNBNL21+ASN",
    "Name": "ASN BANK"
  },
  {
    "Code": "KNABNL2H+KNA",
    "Name": "Knab"
  },
  {
    "Code": "RBRBNL21+REG",
    "Name": "SNS Regio Bank"
  },
  {
    "Code": "TRIONL2U+TRI",
    "Name": "Triodos bank"
  },
  {
    "Code": "FVLBNL22+VAN",
    "Name": "Van Lanschot"
  },
  {
    "Code": "BUNQNL2A+BUN",
    "Name": "Bunq"
  }
]

Retrieve PayPal Express redirect URL

put
Header parameters
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Acceptstring · enumRequiredExample: application/jsonPossible values:
Body
CountrystringOptional

Shopper country. ISO 3166 two-letter code. Example: “us.”

CurrencystringOptional

The currency ISO code for the payment - ISO 4217. Example: “usd.”

CustomerIPstringOptional

Shopper IP.

LanguagestringOptional

ISO 639-1 two-letter code. The language used for the purchase process. Example: “en.”

Responses
200

OK

application/json
put/paymentmethods/PAYPAL_EXPRESS/redirecturl/
PUT /rest/6.0/paymentmethods/PAYPAL_EXPRESS/redirecturl/ HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
Content-Type: application/json
Content-Length: 270

{
  "Country": "us",
  "Currency": "usd",
  "CustomerIP": "91.220.121.21",
  "Items": [
    {
      "Code": "my_subscription_1",
      "Quantity": "1"
    }
  ],
  "Language": "en",
  "PaymentDetails": {
    "Currency": "USD",
    "PaymentMethod": {
      "Email": "customer@email.com",
      "ReturnURL": "www.yoursite.com"
    },
    "Type": "PAYPAL_EXPRESS"
  }
}
200

OK

http://api.2checkout.com/6.0/scripts/paypalexpress/request?avng8apitoken=a211b606e9a62202

Validate previous order as payment reference

get

2Checkout supports 1-click purchases for returning customers who paid for their previous orders with credit card, Paypal or iDeal.

Once a order reference has been validated, it can be used in the POST call on an order to place an order with a previous order reference.

Path parameters
OrderReferencestringRequired

Reference number for approved/paid orders.

Example: 1234567
Header parameters
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Responses
200

OK

application/json
get/paymentmethods/PREVIOUS_ORDER/refno/{OrderReference}/
GET /rest/6.0/paymentmethods/PREVIOUS_ORDER/refno/{OrderReference}/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
200

OK

true

Retrieve UniTokens list

get

Returns a paginated list of UniTokens associated with a customer. At least one of CustomerReference or ExternalCustomerReference must be provided. If both are provided, they must belong to the same customer record. Requires the UNITOKEN feature to be enabled for the account.

UniTokens are created and updated automatically. When an order is placed and authorized with a card that matches an existing UniToken for the same customer (same first 4 and last 4 card digits), that UniToken is updated with the new order reference instead of a new one being created. See the POST /orders/ (place order) documentation for details.

Query parameters
CustomerReferencestringOptional

The 2Checkout internal customer ID (AVANGATE_CUSTOMER_ID). At least one of CustomerReference or ExternalCustomerReference must be provided.

Example: 12345
ExternalCustomerReferencestringOptional

The external customer ID set by the merchant (EXTERNAL_CUSTOMER_ID). At least one of CustomerReference or ExternalCustomerReference must be provided.

Example: EXT-CUST-001
Pageinteger · min: 1Optional

Page number for pagination. Default value is 1.

Default: 1Example: 1
Limitinteger · min: 1 · max: 1000Optional

Number of results per page. Default value is 100. Maximum value is 1000.

Default: 100Example: 100
Header parameters
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Responses
200

OK

application/json
get/unitokens/
GET /rest/6.0/unitokens/ HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
{
  "UniTokens": [
    {
      "UniToken": "550e8400-e29b-41d4-a716-446655440000",
      "PaymentType": "CC",
      "CardBrand": "VISA",
      "CardFirst4Digits": "4111",
      "CardLast4Digits": "1111"
    }
  ],
  "Pagination": {
    "Page": 1,
    "Limit": 100,
    "Count": 1
  }
}

Last updated

Was this helpful?