# 2Checkout APIs

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

Before you start using the 2Checkout API, make sure you check whether your integration requires PCI compliance. Find out more details about what PCI compliance means and what you must do to be PCI compliant here: <https://verifone.cloud/docs/2checkout/Onboarding/Merchant-PCI-Compliance>

### 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:

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

```php
"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.

```php
"Pagination": {
    "Page": 1,
    "Limit": 10,
    "Count": 230
}
```

### Connect to the 2Checkout API

{% stepper %}
{% step %}

### Sign up and activate

Sign up for a 2Checkout account and get it activated:

<https://verifone.cloud/docs/2checkout/Onboarding/Get-started-with-your-2Checkout-account\\>
<https://verifone.cloud/docs/2checkout/Onboarding/Activate-and-set-up-your-2Checkout-account>
{% endstep %}

{% step %}

### Get your credentials

To connect to the 2Checkout API, log in to your 2Checkout account and get your:

* merchant code
* secret key
* secret word

Login: <https://secure.2checkout.com/cpanel/logon.php>
{% endstep %}

{% step %}

### Retrieve codes from the Merchant Control Panel

These unique codes are automatically generated for your account. Retrieve them from your Merchant Control Panel Dashboard → Integrations → Webhooks and API.
{% endstep %}

{% step %}

### Copy merchant code and secret word

Copy the **merchant code** (found in the API section) and the Instant Notification Service (INS) **secret word** found in the **Secret word** area.

![secret word.png](/files/b2f3676a9dfc8cf59b6f3b006a386e0600640536)
{% endstep %}
{% endstepper %}

### 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:\
<https://verifone.cloud/docs/2checkout/API-Integration/01Start-using-the-2Checkout-API/API\\_Authentication>

### Read the API documentation

Once you've authenticated with the API, you can start configuring your environment for your specific business scenarios.

* [JSON-RPC API Reference](https://verifone.cloud/docs/2checkout/API-Integration/JSON-RPC_API_6.0/API-Requests/)
* [SOAP API Reference](https://verifone.cloud/docs/2checkout/API-Integration/SOAP_API_6.0/API-Requests/)
* [REST API Reference](https://verifone.cloud/api-catalog/2checkout-api-rest-reference)

### 2Checkout GitHub

Visit the [repository](https://github.com/avangate) to download and contribute to code samples.

### Webhooks

* [Instant Payment Notification (IPN)](https://verifone.cloud/docs/2checkout/API-Integration/Webhooks/06Instant_Payment_Notification_IPN) - automatic order/transaction notifications
* [License Change Notification (LCN)](https://verifone.cloud/docs/2checkout/API-Integration/Webhooks/08License_Change_Notification_LCN) - automatic subscription notifications
* [Instant Notification Service (INS)](https://verifone.cloud/docs/2checkout/API-Integration/Webhooks/Instant-Notification-Service-%2528INS%2529) - automatic notifications containing full event information&#x20;


---

# Agent Instructions: 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:

```
GET https://docs.2checkout.com/2checkout-apis/2checkout-apis.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
