Payment Methods
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
Amount
2 letters country code
3 letters currency code
Fiscal code. Required for Brasil or if CardBin or EesToken is not provided
Card number. Required if Fiscal code or EesToken is not provided
Ees token. Required if Fiscal code or CardBin is not provided
application/jsonExample: application/jsonPossible values: Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"OK
ERROR
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"
}
}code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"application/jsonName of the cardholder
John DoeCredit card number
4111111111111111CVV number
123Card expiration date, format MM/YY
12/28Represents the scope of the created token. It is the client's responsability to manage this
orderingExample: subscriptionPossible values: Create token response
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"
}Create token response
{
"Results": {
"Token": "c2ba2590-3641-4a06-9eaf-5fba50c8eef0"
}
}Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"application/jsonPossible values: 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.
OK
Invalid data
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": []
}
}Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"application/jsonPossible values: 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.
OK
Invalid data
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
}application/jsonExample: application/jsonPossible values: Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"OK
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}"
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"
}
]Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"application/jsonPossible values: Shopper country. ISO 3166 two-letter code. Example: “us.”
The currency ISO code for the payment - ISO 4217. Example: “usd.”
Shopper IP.
ISO 639-1 two-letter code. The language used for the purchase process. Example: “en.”
OK
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"
}
}OK
http://api.2checkout.com/6.0/scripts/paypalexpress/request?avng8apitoken=a211b606e9a622022Checkout 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.
Reference number for approved/paid orders.
1234567application/jsonExample: application/jsonPossible values: Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"OK
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}"
OK
trueReturns 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.
The 2Checkout internal customer ID (AVANGATE_CUSTOMER_ID). At least one of CustomerReference or ExternalCustomerReference must be provided.
12345The external customer ID set by the merchant (EXTERNAL_CUSTOMER_ID). At least one of CustomerReference or ExternalCustomerReference must be provided.
EXT-CUST-001Page number for pagination. Default value is 1.
1Example: 1Number of results per page. Default value is 100. Maximum value is 1000.
100Example: 100application/jsonExample: application/jsonPossible values: Authentication header
code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"OK
Bad request - validation error or missing required parameters
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?