> For the complete documentation index, see [llms.txt](https://passimpay.gitbook.io/passimpay-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://passimpay.gitbook.io/passimpay-api/exchange/exchange.md).

# Exchange

<mark style="color:green;">`POST`</mark> `https://api.passimpay.io/v2/exchange`

This method creates an order for currency exchange.

Once the exchange is completed, you will receive a [callback](/passimpay-api/exchange/webhook.md) with the exchange identifier.

**Rate Limit**: 1 requests per second

#### **Headers**

<table><thead><tr><th width="221">Name</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>x-signature</code></td><td>string</td><td>SHA-256 encrypted signature</td></tr><tr><td><code>Content-Type</code></td><td>string</td><td>application/json</td></tr></tbody></table>

#### **Request Body**

<table><thead><tr><th width="191">Name</th><th width="124">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>platformId</code></td><td>integer</td><td>Platform Id</td></tr><tr><td><code>paymentFromId</code></td><td>integer</td><td>Currency ID. You can get the list of currency IDs <a href="/passimpay-api/list-of-cryptocurrencies.md">here</a>.</td></tr><tr><td><code>paymentToId</code></td><td>integer</td><td>Currency ID. You can get the list of currency IDs <a href="/passimpay-api/list-of-cryptocurrencies.md">here</a>.</td></tr><tr><td><code>amount</code></td><td>string</td><td>The exchange amount. </td></tr></tbody></table>

#### **Successful response (200)**

<table><thead><tr><th width="200">Name</th><th width="131">Type</th><th>Description</th></tr></thead><tbody><tr><td>result</td><td>integer</td><td>Request result: <br><code>1</code>: success </td></tr><tr><td>exchangeId</td><td>integer</td><td>The unique identifier of the created exchange order.</td></tr></tbody></table>

#### **Error Response (400)**

<table><thead><tr><th width="154">Name</th><th width="176">Type</th><th>Description</th></tr></thead><tbody><tr><td>result</td><td>integer</td><td>Request result: <br><code>0</code>: error</td></tr><tr><td>message</td><td>string</td><td>Error description</td></tr></tbody></table>
