> For the complete documentation index, see [llms.txt](https://docs.2checkout.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.2checkout.com/api-reference/reference/payment-methods.md).

# Payment Methods

## Retrieve installment settings used to place orders with installments

> 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

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/orders/0/installments/":{"get":{"tags":["Payment methods"],"summary":"Retrieve installment settings used to place orders with installments","description":"Retrieve information about the number of installments available for a specific selection of products or services.\n\n\nOnce the installment information is retrieved, it can be used in the POST call on the order resource to place an order with a installments","parameters":[{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string","default":"application/json","enum":["application/json"]}},{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"schema":{"type":"number"},"in":"query","name":"Amount","description":"Amount","required":true},{"schema":{"type":"string"},"in":"query","name":"Country","description":"2 letters country code","required":true},{"schema":{"type":"string"},"in":"query","name":"Currency","description":"3 letters currency code","required":true},{"schema":{"type":"string"},"in":"query","name":"FiscalCode","description":"Fiscal code. Required for Brasil or if CardBin or EesToken is not provided"},{"schema":{"type":"string"},"in":"query","name":"CardBin","description":"Card number. Required if Fiscal code or EesToken is not provided"},{"schema":{"type":"string"},"in":"query","name":"EesToken","description":"Ees token.  Required if Fiscal code or CardBin is not provided"}],"responses":{"200":{"description":"OK","content":{"application/json":{}}},"500":{"description":"ERROR","content":{"application/json":{}}}}}}}}
```

## POST /tokens/

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

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/tokens/":{"post":{"tags":["Payment methods"],"summary":"Create an EES token for placing orders using 2pay.js","parameters":[{"name":"X-Avangate-Authentication","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEesToken"}}}},"responses":{"200":{"description":"Create token response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateEesTokenResponse"}}}}}}}},"components":{"schemas":{"CreateEesToken":{"type":"object","required":["CreditCard","Cvv","ExpirationDate"],"properties":{"Name":{"type":"string","description":"Name of the cardholder"},"CreditCard":{"type":"string","description":"Credit card number"},"Cvv":{"description":"CVV number","type":"string"},"ExpirationDate":{"description":"Card expiration date, format MM/YY","type":"string"},"Scope":{"type":"string","description":"Represents the scope of the created token. It is the client's responsability to manage this","default":"ordering","enum":["ordering","storage","subscription"]}}},"CreateEesTokenResponse":{"type":"object","required":["Results"],"properties":{"Results":{"type":"object","required":["Token"],"properties":{"Token":{"type":"string"}}}}}}}}
```

## POST /payments/startapplepaysession/

> Initiate an ApplePay session

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/payments/startapplepaysession/":{"post":{"tags":["Payment methods"],"summary":"Initiate an ApplePay session","parameters":[{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string","enum":["application/json"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body_24"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/applePaySession200"}}}},"400":{"description":"Invalid data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/applePaySession400"}}}}}}}},"components":{"schemas":{"body_24":{"type":"object","properties":{"validationURL":{"description":"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.","type":"string"}}},"applePaySession200":{"type":"object","properties":{"ApplePaySessionData":{"type":"object","properties":{"response":{"type":"string"},"errors":{"type":"array","items":{"type":"string"}}}}}},"applePaySession400":{"type":"object","properties":{"error_code":{"type":"string"},"message":{"type":"string"}}}}}}
```

## POST /payments/decryptApplePayData/

> Decrypt the ApplePay data

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/payments/decryptApplePayData/":{"post":{"tags":["Payment methods"],"summary":"Decrypt the ApplePay data","parameters":[{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string","enum":["application/json"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body_25"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/decryptApplePayData200"}}}},"400":{"description":"Invalid data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/decryptApplePayData400"}}}}}}}},"components":{"schemas":{"body_25":{"type":"object","properties":{"ApplePayData":{"description":"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.","type":"string"}}},"decryptApplePayData200":{"type":"object","properties":{"ApplePayDataToken":{"type":"string"},"BillingDetails":{"type":"object"},"DeliveryDetails":{"type":"object"},"Status":{"type":"boolean"}}},"decryptApplePayData400":{"type":"object","properties":{"error_code":{"type":"string"},"message":{"type":"string"}}}}}}
```

## GET /paymentmethods/IDEAL/issuerbanks/

> Retrieve the list of banks that support iDEAL

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/paymentmethods/IDEAL/issuerbanks/":{"get":{"tags":["Payment methods"],"summary":"Retrieve the list of banks that support iDEAL","parameters":[{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string","default":"application/json","enum":["application/json"]}},{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{}}}}}}}}
```

## PUT /paymentmethods/PAYPAL\_EXPRESS/redirecturl/

> Retrieve PayPal Express redirect URL

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/paymentmethods/PAYPAL_EXPRESS/redirecturl/":{"put":{"tags":["Payment methods"],"summary":"Retrieve PayPal Express redirect URL","parameters":[{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string","enum":["application/json"]}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/body_4"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{}}}}}}},"components":{"schemas":{"body_4":{"type":"object","properties":{"Country":{"description":"Shopper country. ISO 3166 two-letter code. Example: “us.”","type":"string"},"Currency":{"description":"The currency ISO code for the payment - ISO 4217. Example: “usd.”","type":"string"},"CustomerIP":{"description":"Shopper IP.","type":"string"},"Items":{"type":"array","items":{"$ref":"#/components/schemas/orders0_Items"}},"Language":{"description":"ISO 639-1 two-letter code. The language used for the purchase process. Example: “en.”","type":"string"},"PaymentDetails":{"$ref":"#/components/schemas/paymentmethodsPAYPAL_EXPRESSredirecturl_PaymentDetails"}}},"orders0_Items":{"type":"object","properties":{"Code":{"description":"Unique product identifier your control. Max length 256 characters. Only for catalog products.","type":"string"},"Quantity":{"description":"Number of units","type":"string"},"CrossSell":{"$ref":"#/components/schemas/orders0_CrossSellCampaign"},"SubscriptionCustomSetting":{"$ref":"#/components/schemas/Item_SubscriptionCustomSettings"}}},"orders0_CrossSellCampaign":{"required":["ParentCode","CampaignCode"],"type":"object","properties":{"ParentCode":{"description":"The product code of the master product you set to trigger the campaign.","type":"string"},"CampaignCode":{"description":"Unique, system-generated identifier for cross-sell campaigns.","type":"string"}}},"Item_SubscriptionCustomSettings":{"type":"object","required":["CycleUnit","CycleLength","CycleAmount","CycleAmountType"],"properties":{"CycleLength":{"description":"Billing cycle length. Can be NULL.","type":"integer","nullable":true,"minimum":1},"CycleUnit":{"description":"DAY/MONTH. Can be NULL.","type":"string","enum":["DAY","MONTH"],"nullable":true},"CycleAmount":{"description":"Billing cycle (renewal) price.","type":"number","format":"float","minimum":0,"exclusiveMinimum":true},"CycleAmountType":{"description":"Billing cycle unit NET/GROSS.","type":"string","enum":["NET","GROSS"]}}},"paymentmethodsPAYPAL_EXPRESSredirecturl_PaymentDetails":{"type":"object","properties":{"Currency":{"description":"The currency ISO code for the payment - ISO 4217. Example: “usd.”","type":"string"},"PaymentMethod":{"$ref":"#/components/schemas/paymentmethodsPAYPAL_EXPRESSredirecturl_PaymentDetails_PaymentMethod"},"Type":{"description":"\"The payment method:","type":"string"}}},"paymentmethodsPAYPAL_EXPRESSredirecturl_PaymentDetails_PaymentMethod":{"type":"object","properties":{"Email":{"description":"Email address customers use for their PayPal account.","type":"string"},"ReturnURL":{"description":"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.","type":"string"}}}}}}
```

## Validate previous order as payment reference

> 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.

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/paymentmethods/PREVIOUS_ORDER/refno/{OrderReference}/":{"get":{"tags":["Payment methods"],"summary":"Validate previous order as payment reference","description":"2Checkout supports 1-click purchases for returning customers who paid for their previous orders with credit card, Paypal or iDeal.\n\nOnce 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.","parameters":[{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string","default":"application/json","enum":["application/json"]}},{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"OrderReference","in":"path","description":"Reference number for approved/paid orders.","required":true,"style":"simple","explode":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{}}}}}}}}
```

## Retrieve UniTokens list

> 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.<br>

```json
{"openapi":"3.0.0","info":{"title":"API REST Documentation","version":"6.0-oas3"},"servers":[{"url":"https://api.2checkout.com/rest/6.0"}],"paths":{"/unitokens/":{"get":{"tags":["Payment methods"],"summary":"Retrieve UniTokens list","description":"Returns a paginated list of UniTokens associated with a customer.\nAt least one of `CustomerReference` or `ExternalCustomerReference` must be provided.\nIf both are provided, they must belong to the same customer record.\nRequires the UNITOKEN feature to be enabled for the account.\n\nUniTokens 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.\n","parameters":[{"name":"Accept","in":"header","required":true,"style":"simple","explode":false,"schema":{"type":"string","default":"application/json","enum":["application/json"]}},{"name":"X-Avangate-Authentication","in":"header","description":"Authentication header","required":true,"style":"simple","explode":false,"schema":{"type":"string"}},{"name":"CustomerReference","in":"query","description":"The 2Checkout internal customer ID (AVANGATE_CUSTOMER_ID). At least one of CustomerReference or ExternalCustomerReference must be provided.","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"ExternalCustomerReference","in":"query","description":"The external customer ID set by the merchant (EXTERNAL_CUSTOMER_ID). At least one of CustomerReference or ExternalCustomerReference must be provided.","required":false,"style":"form","explode":true,"schema":{"type":"string"}},{"name":"Page","in":"query","description":"Page number for pagination. Default value is 1.","required":false,"style":"form","explode":true,"schema":{"type":"integer","minimum":1,"default":1}},{"name":"Limit","in":"query","description":"Number of results per page. Default value is 100. Maximum value is 1000.","required":false,"style":"form","explode":true,"schema":{"type":"integer","minimum":1,"maximum":1000,"default":100}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"UniTokens":{"type":"array","description":"List of UniToken records for the customer.","items":{"type":"object","properties":{"UniToken":{"type":"string","description":"The UUID identifying this token."},"PaymentType":{"type":"string","description":"The payment method used for the order (e.g. CC, GOOGLEPAY, PAYPAL)."},"CardBrand":{"type":"string","nullable":true,"description":"The card brand. Null for non-card payment methods."},"CardFirst4Digits":{"type":"string","nullable":true,"description":"The first 4 digits of the card. Null for non-card payment methods."},"CardLast4Digits":{"type":"string","nullable":true,"description":"The last 4 digits of the card. Null for non-card payment methods."}}}},"Pagination":{"type":"object","properties":{"Page":{"type":"integer","description":"Current page number."},"Limit":{"type":"integer","description":"Number of results per page."},"Count":{"type":"integer","description":"Total number of UniTokens matching the criteria."}}}}}}}},"400":{"description":"Bad request - validation error or missing required parameters","content":{"application/json":{"schema":{"type":"object","properties":{"error_code":{"type":"string","description":"Error code identifying the specific validation failure.","enum":["UNITOKEN_FEATURE_NOT_ENABLED","CUSTOMER_REFERENCE_REQUIRED","CUSTOMER_REFERENCE_MISMATCH","UNITOKEN_VALIDATION_ERROR"]},"message":{"type":"string","description":"Detailed error message."}}}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.2checkout.com/api-reference/reference/payment-methods.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
