> For the complete documentation index, see [llms.txt](https://aliniex.gitbook.io/alix-pay/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aliniex.gitbook.io/alix-pay/api-reference/on-off-ramp-api/off-ramp/create-off-ramp-order.md).

# Create off-ramp order

This endpoint is used to create an off-ramp order, allowing users to sell cryptocurrency and withdraw the equivalent fiat currency to a predefined bank account. The transaction will be processed based on the selected cryptocurrency amount and withdrawal bank.

**API end-point**

<mark style="color:green;">`POST`</mark> `/api/v2/on-off-ramp/create-sell-order`

**Headers**

| Name         | Value                                                                                    |    |               |
| ------------ | ---------------------------------------------------------------------------------------- | -- | ------------- |
| Content-Type | `application/json`                                                                       |    |               |
| lang         | <p>The default will en if this param has been empty. </p><p>Supported languages:<code>en | cn | vi</code></p> |

**Request Body**

```json
{
  "partnerCode": "string",
  "externalOrderId": "string",
  "currency": "string",
  "amount": 0,
  "fiatAmount": 50000,
  "network": "string",
  "bankCode": "string",
  "bankAccountNumber": "string",
  "bankAccountName": "string",
  "paymentMethod": "string",
  "webhookSecretKey": "string",
  "refCode": "string",
  "fiatCurrency": "string",
  "requestKycFields": {},
  "requestPaymentFields": {},
  "signature": "string"
}
```

<table><thead><tr><th width="248">Name</th><th width="100">Type</th><th width="109">Condition</th><th>Description</th></tr></thead><tbody><tr><td><code>partnerCode</code></td><td>string</td><td>Required</td><td>The code of partner has been provided to you during onboarding.</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">externalOrderId
</code></pre></td><td>string</td><td>Required</td><td></td></tr><tr><td><code>currency</code></td><td>string</td><td>Required</td><td>Please use the <code>code</code>It returned via the api end point <a href="/pages/SJcP2Kk5ciEX8TUd1Smt">get supported tokens</a></td></tr><tr><td> <code>amount</code></td><td>number</td><td>Optional</td><td>This is amount of crypto currency would like to sell</td></tr><tr><td>fiatAmount</td><td>number</td><td>Required</td><td></td></tr><tr><td><code>network</code></td><td>string</td><td>Required</td><td>Please use the <code>code</code>of corresponding network returned via the api end point <a href="/pages/SJcP2Kk5ciEX8TUd1Smt">get supported tokens</a></td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">bankCode
</code></pre></td><td>string</td><td>Required</td><td>the bank Code in the list of supported banks </td></tr><tr><td><p></p><pre><code><strong>bankAccountNumber
</strong></code></pre></td><td>string</td><td>Required</td><td>The bank account number of destination </td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">bankAccountName
</code></pre></td><td>string</td><td>Required</td><td>The bank account name of destination </td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">webhookSecretKey
</code></pre></td><td>string</td><td>Required</td><td>This is specify key of partner's configuration would like to receive the order status updates</td></tr><tr><td><code>paymentMethod</code></td><td>string</td><td>Required</td><td><strong>bank</strong> is default</td></tr><tr><td><code>fiatCurrency</code></td><td>string</td><td>Optional</td><td>VND is default</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">refCode
</code></pre></td><td>string</td><td>Optional</td><td>It could be skipped</td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">requestKycFields
</code></pre></td><td>string</td><td>Required</td><td><p>It is FullName of individual user  </p><p>The fields will be returned via <a href="/pages/fXRAdmxtR4x8UNWCWFLB">api get purchase details of off-ramp order</a></p></td></tr><tr><td><p></p><pre class="language-json"><code class="lang-json">requestPaymentFields
</code></pre></td><td>string</td><td>Required</td><td>The fields will be returned via <a href="/pages/fXRAdmxtR4x8UNWCWFLB">api get purchase details of off-ramp order</a></td></tr><tr><td><code>signature</code></td><td>string</td><td>Required</td><td><ul><li>Partner will digitally sign the transmitted data using <strong><code>SHA256</code></strong> with RSA algorithm</li><li>The <strong>public key</strong> that has been provided to you during onboarding.</li><li>Data shall be signed according to the structure <strong>partnerCode|externalOrderId|currency|amount|network|paymentMethod|bankCode|secretKey</strong></li></ul></td></tr></tbody></table>

**Response**

{% tabs %}
{% tab title="200" %}

```json

  "externalOrderId": "string",
  "type": "string",
  "fiatAmount": 0,
  "paidAmount": 0,
  "tokenTransfer": {
    "currency": "string",
    "network": "string",
    "price": 0,
    "amount": 0,
    "address": "string",
    "txHash": "string",
    "memo": "string"
  },
  "bankTransfer": {
    "bankAccountName": "string",
    "bankAccountNumber": "string",
    "bankName": "string",
    "contentPayment": "string",
    "totalPayment": 0,
    "qrUrl": "string"
  },
  "fees": {
    "systemFee": 0,
    "processingFee": 0
  },
  "status": "string",
  "descriptions": "string",
  "createdAt": "string",
  "expiresAt": "string",
  "signature": "string"
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "error": "Invalid request"
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Signature**&#x20;

* Partner will digitally sign the transmitted data using **`SHA256`** with RSA algorithm
* The **private key** that has been of yours
* Data shall be signed according to the structure **externalOrderId|type|fiatAmount|status|secretKey**
  {% endhint %}


---

# 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://aliniex.gitbook.io/alix-pay/api-reference/on-off-ramp-api/off-ramp/create-off-ramp-order.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.
