> For the complete documentation index, see [llms.txt](https://docs.calypso.money/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.calypso.money/exchange/how-to-create-a-exchange-via-api.md).

# How to create a exchange via API

**Creating exchange via API**

1. Check the exchange - [**limits**](https://docs.calypso.money/general/limits).
2. Create an exchange by using the method POST | Create exchange;
3. Get exchange details and state by using the method POST | Get exchange;

**Scheme of information process interaction**

Below is an example of creating a exchange from a client’s site or application.

Names of requests on the scheme indicate certain payment API methods.

**Exchange statuses:**

| Status       | Description                                                                                                                                                                                                                                                       |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| IN\_PROGRESS | The exchange order has been created and is awaiting execution.                                                                                                                                                                                                    |
| COMPLETED    | The funds have been successfully exchanged on the account.                                                                                                                                                                                                        |
| FAILED       | <p>An error occurred during the exchange. There may be many reasons for the error. You can follow the steps below to fix it:<br><br>1. Wait for a while and create a new exchange.<br>2. Contact our <a href="https://t.me/calypsosup">technical support</a>.</p> |

<br>

**Exchange statuses**

Diagram indicate exchange statuses, arrows indicate processes a successful completion of which transfers an exchange from one status to another.

**Create an exchange via API with additional functions (optional requests)**

1. If you want to make sure that your account has enough assets for exchange and get available asset balances on the account, then use this function:
   * Check account balance and ensure enough assets for exchange are available by using the method POST | Get the account;
2. If you want to get a list of available currency pairs for exchanges, use this function:
   * Getting available pairs for exchange by using the method POST | Get currency pairs;
3. If you want to know the maximum and minimum available limits for currency exchange, use this function:
   * Get upper exchange limits for currencies by using the method POST | Get upper exchange limit by currency;
4. If you want to get a preliminary calculation of the exchange, then use this function:
   * Get a preliminary calculation of the exchange amounts by using the method POST | Pre-calculate
5. Create an exchange by using the method POST | Create exchange;
6. Get exchange details and state by using the method POST | Get exchange;

**Scheme of information process interaction**

Below is an example of creating a exchange from a client’s site or application.

Names of requests on the scheme indicate certain payment API methods.

<br>


---

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

```
GET https://docs.calypso.money/exchange/how-to-create-a-exchange-via-api.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.
