> 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/channel-manager-api/channel-manager-api/api-2.1/json-rpc-2.1/workflow.md).

# Workflow

{% stepper %}
{% step %}

### Use the API endpoint

Use the following URL: <https://api.avangate.com/channel-manager/2.1/rpc/>
{% endstep %}

{% step %}

### Authenticate

Authenticate using the `login` method and create a session (connection).
{% endstep %}

{% step %}

### Set partner

{% endstep %}

{% step %}

### Invoke API methods

Throughout the lifetime of the session (max 10 minutes), you can invoke all 2Checkout API methods. To invoke methods, you need to send a request to 2Checkout. Read the Request object below.
{% endstep %}

{% step %}

### Receive responses

The 2Checkout system responds to all requests. Read the Response object below.
{% endstep %}
{% endstepper %}

## Response

Whenever you call an API method, 2Checkout replies with a response. The response is a single object serialized using JSON.

There are two types of response, with the properties detailed below.

### Valid response

```json
{
  "id" : <int identifier>,
  "jsonrpc" : 2.0,
  "response" : {<return object>}
}
```

### Valid response object

| Properties   | Type / Description                                                                                                           |
| ------------ | ---------------------------------------------------------------------------------------------------------------------------- |
| **jsonrpc**  | **Required (string)**                                                                                                        |
|              | JSON-RPC protocol version. Must be 2.0.                                                                                      |
| **id**       | **Required (int)**                                                                                                           |
|              | Mandatory identifier that you control, used to identify the request and the response. Use only integer values.               |
| **response** | **Required (object)**                                                                                                        |
|              | Provided on success (is not included if there was an error invoking the method). Actual value depends on the method invoked. |

### Invalid response

```json
{
  "id" : <int identifier>,
  "jsonrpc" : 2.0,
  "error" : { "code" : <int error code>, "message" : "<error message>"}
}
```

Invalid response object

| Properties  | Type / Description                                                                                                          |
| ----------- | --------------------------------------------------------------------------------------------------------------------------- |
| **jsonrpc** | **Required (string)**                                                                                                       |
|             | JSON-RPC protocol version. Must be 2.0.                                                                                     |
| **id**      | **Required (int)**                                                                                                          |
|             | Mandatory identifier that you control, used to identify the request and the response. Use only integer values.              |
| error       | **Required (object)**                                                                                                       |
|             | <p>C<strong>ode -</strong> Integer identifying the error. </p><p><strong>Message -</strong> Error description (string).</p> |

## Request

Calling API methods involves sending an API request to Avangate. The request object is detailed below.

```json
{
  "jsonrpc" : 2.0,
  "id" : <int identifier>,
  "method" : "<methodName>",
  "params" : [<parameters array>]
}
```

### Request object

| Properties  | Type / Description                                                                                                                                                                                                                                                                                                          |
| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **jsonrpc** | **Required (string)** — JSON-RPC protocol version. Must be 2.0.                                                                                                                                                                                                                                                             |
| **id**      | **Required (int)** — Mandatory identifier that you control, used to identify the request and the response. Use only integer values.                                                                                                                                                                                         |
| **method**  | **Required (string)** — The name of the method invoked. Case sensitive.                                                                                                                                                                                                                                                     |
| **params**  | **Optional (object)** — An object/structure containing the parameters valid for invoking the method used. Parameters included into the RPC call need to be provided by-position using an Array (structured value). The values must be in the order expected by Avangate. At this point we don't support by-name parameters. |


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.2checkout.com/channel-manager-api/channel-manager-api/api-2.1/json-rpc-2.1/workflow.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
