# How to create a exchange via API

**Creating exchange via API**

1. Check the exchange - [**limits**](https://docs.calypso.finance/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.

<figure><img src="https://1242099714-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlF2vAHahCu7Gtgm1PkXe%2Fuploads%2FjDlXEiUMiQYDuyLaiWh6%2Fimage.png?alt=media&#x26;token=da8d58ae-974d-4708-b601-531069e43763" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://1242099714-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlF2vAHahCu7Gtgm1PkXe%2Fuploads%2FxEHRJth9cEfrPT6h2rZt%2Fimage.png?alt=media&#x26;token=4128c60a-d4c5-4585-86b8-a6a5505dc880" alt=""><figcaption></figcaption></figure>

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

![](https://1242099714-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlF2vAHahCu7Gtgm1PkXe%2Fuploads%2FzpnRTKJLHzW9X8Juv7Dv%2Fimage.png?alt=media\&token=4a3ec7f2-58b9-4d79-8274-2ea7c2d530a1)<br>
