Start using the 2Checkout API
Overview
Use the 2Checkout API to:
- Build apps that connect to the 2Checkout system
- Place and manage orders
- Manage subscriptions and customers
- Create, update, and extract product catalog and pricing information for your account
- Manage partner accounts
- Integrate with 2Checkout to automate your backend operations
Availability
2Checkout API is available for all accounts.
Protocols and versioning
The 2Checkout API is accessible under three protocols across a number of major and minor versions.
The URL for each API protocol and version is composed by following this rule:
https://api.2checkout.com/{protocol}/{version}
The 2Checkout API is accessible under three protocols:
- REST - under https://api.2checkout.com/rest/
- SOAP - under https://api.2checkout.com/soap/
- JSON-RPC (standard RPC protocol with the payload being JSON encoded) - under https://api.2checkout.com/rpc/
In order to maintain backward compatibility, any changes or new features that would break existing integrations are published under a new API version. The current latest version of the 2Checkout API is API version 6.0 (publicly launched in December 2019).
Accessing a certain version of the 2Checkout API is easy, as the API version is used in the API URL: https://api.2checkout.com/{protocol}/{version}.
Pagination in API
All main resources used in the 2Checkout API support searching and pagination.
This is achieved by using two standard parameters: page and limit. Both parameters are integers, optional, and can be passed as NULL.
"Pagination": {
"Page": 1,
"Limit": 10,
}
The page and limit parameters can be sent directly in the payload of the request, or, in some cases, under a Pagination object.
Typically, the response for a search call will return a list of items, as well as the provided pagination options. Additionally, a total count of items is provided in order to facilitate navigation.
"Pagination": {
"Page": 1,
"Limit": 10,
"Count": 230
}
Connect to the 2Checkout API
To connect to the API, follow these steps:
- Sign up for a 2Checkout account and get it activated.
- To connect to the 2Checkout API, you need to log in to your 2Checkout account and get your:
- merchant code
- secret key
- secret word.
- These unique codes are automatically generated for your account, and you can retrieve them from your Merchant Control Panel Dashboard → Integrations → Webhooks and API.
- Copy the merchant code (found in the API section) and the Instant Notification Service (INS) secret word found in the Secret word area.
API Authentication
Use the merchant code and secret key to authenticate with the API. Follow this guide to learn how to authenticate with the 2Checkout API.
Read the API documentation
Once you've authenticated with the API, you can start configuring your environment for your specific business scenarios.
2Checkout GitHub
Feel free to visit our GitHub repository to download and contribute to our code samples. We also encourage you to submit your projects related to the 2Checkout API.
Webhooks
- Instant Payment Notification (IPN) works as a message service generating automatic order/transaction notifications for your 2Checkout account. Use the notifications to process order data into your own management systems by synchronizing it with 2Checkout account events.
- License Change Notification (LCN) works as a message service generating automatic subscription notifications for your 2Checkout account.
- Instant Notification Service (INS) works as a message service that generates automatic notifications containing all the information you need about a specific event (such as when a recurring order re-bills successfully).
API Authentication | REST API Reference |