> 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/scan-to-pay-api/order/create-an-order.md).

# Create an order

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

Allows your customer to create an order with the corresponding fiat amount

{% hint style="success" %}
**Supported fiat currencies.**

* VND  :flag\_vn:
* PHP  :flag\_ph:
* THB  :flag\_th:
* GLE (Georgia)  :flag\_ge:
* BRL :flag\_br:
* ARS :flag\_ar:
* PEN :flag\_pe:

**Please noted for new field "fiatCurrency"**
{% endhint %}

{% hint style="danger" %}
**Alix Pay required two new parameters from partner's integration**

<mark style="color:red;">userEmail and userKYCVerified</mark>
{% endhint %}

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

**Vietnam** :flag\_vn:

* VietQR

<details>

<summary>Example of request data payload</summary>

<pre><code>{
  "externalOrderId": "f1a2acc8-c865-44fe-8e6d-d0857ada4d37",
  "partnerCode": "kaiAlinex",
  "signature": "I7XDfTngWIraq----J6lN/Aw==",
  "webhookSecretKey": "81663eae----83636b86b",
  "currency": "USDT",
  "bankCode": "TECHCOMBANK",
  "bankAccountNumber": "888812345678",
  "content": "payment",
  "userKYCVerified": true,
  "userEmail": "dummy@abc.com"
  "fiatAmount": 10000,
  "fiatCurrency": "VND",
<strong>  "extendInfo":null
</strong>}
</code></pre>

</details>

**Phillippines** :flag\_ph:

* P2P(Pear-to-Pear) QRCode

<details>

<summary>Example of request data payload</summary>

```
{
  "externalOrderId": "f1a2acc8-c865-44fe-8e6d-d0857ada4d37",
  "partnerCode": "kaiAlinex",
  "signature": "I7XDfTngWIraq----J6lN/Aw==",
  "webhookSecretKey": "81663eae----83636b86b",
  "currency": "USDT",
  "fiatAmount": 10,
  "bankCode": "UBPHPHMM",
  "bankAccountNumber": "109645950075",
  "content": "content payment",
  "fiatCurrency": "PHP",
  "extendInfo": {
    "qrType": "com.p2pqrpay",
    "PH": {
      "recipientName": "Sophia Marie Chavez Dever",
      "additionalData": {
        "merchantMobileNumber": "",
        "merchantCity": "SAN PEDRO",
        "crcCode": "3708",
        "purpose": "",
        "mobileNumber": "",
        "tfrName": "Sophia Marie Chavez Dever",
        "tfrBnkCode": "UBPHPHMMXXX",
        "userId": "",
        "paymentType": "99964403",
        "customerLabel": "",
        "merchantCategoryCode": "6016",
        "tfrAcctNo": "109645950075",
        "postCode": "",
        "uniqueId": "com.p2pqrpay",
        "loyaltyNumber": ""
      }
    }
  }
}
```

</details>

* P2M(Pear-to-Merchant) QRCode

<details>

<summary>Example of request data payload</summary>

<pre><code><strong>{
</strong>  "externalOrderId": "f1a2acc8-c865-44fe-8e6d-d0857ada4d37",
  "partnerCode": "kaiAlinex",
  "signature": "I7XDfTngWIraq----J6lN/Aw==",
  "webhookSecretKey": "81663eae----83636b86b",
  "currency": "USDT",
  "bankCode": "UBPHPHMM",
  "bankAccountNumber": "109645950075",
  "content": "payment",
  "userKYCVerified": true,
  "userEmail": "dummy@abc.com"
  "fiatAmount": 10,
  "fiatCurrency": "PHP",
  "extendInfo": {
    "qrType": "com.p2pqrpay",
    "PH": {
      "recipientName": "VIETNAMIT BISTRO",
      "additionalData": {
        "merchantMobileNumber": "",
        "merchantCity": "PARANAQUE",
        "purpose": "",
        "referenceLabel": "TNcpj6J5F8BVLXUDrJSqno",
        "tfrName": "VIETNAMIT BISTRO",
        "tfrBnkCode": "PAPHPHM1XXX",
        "proxyNotify": "310",
        "storeLabel": "",
        "paymentType": "",
        "customerLabel": "",
        "terminalLabel": "",
        "merchantId": "200690490",
        "merchantCategoryCode": "5814",
        "tfrAcctNo": "200690490",
        "acqInfo": "",
        "postCode": "",
        "uniqueId": "ph.ppmi.p2m",
        "loyaltyNumber": ""
      }
    }
  }
}
</code></pre>

</details>

**Thailand(Phuket)** :flag\_th:&#x20;

<details>

<summary>Example of request data payload</summary>

```
{
  "externalOrderId": "f1a2acc8-c865-44fe-8e6d-d0857ada4d37",
  "partnerCode": "kaiAlinex",
  "signature": "I7XDfTngWIraq----J6lN/Aw==",
  "webhookSecretKey": "81663eae----83636b86b",
  "currency": "USDT",
  "fiatAmount": 0,
  "bankCode": "Ethereum Mainnet",
  "bankAccountNumber": "0xA51Aa2cBe4ab28D4D146d7934cfB1C241aB33c57",
  "content": "Payment",
  "fiatCurrency": "THB",
  "extendInfo": {
    "qrType": "thailand.pwc",
    "TH": {
      "recipientName": "0xA51Aa2cBe4ab28D4D146d7934cfB1C241aB33c57",
      "additionalData": {
        "timestamp": "2025-05-29T08:19:13.006Z",
        "chainCode": "ETH",
        "recipientAddress": "0xA51Aa2cBe4ab28D4D146d7934cfB1C241aB33c57",
        "tokenSymbol": "USDC",
        "tokenAmount": 99
      }
    }
  }
}
```

</details>

**Georgia** :flag\_ge:&#x20;

<details>

<summary>Example of request data payload</summary>

{\
"externalOrderId": "f1a2acc8-c865-44fe-8e6d-d0857ada4d37",\
"partnerCode": "kaiAlinex",\
"signature": "I7XDfTngWIraq----J6lN/Aw==",\
"webhookSecretKey": "81663eae----83636b86b",\
"currency": "USDT",\
"fiatAmount": 1,\
"bankCode": "Georgia QR Pay",\
"bankAccountNumber": "Georgia QR",\
"content": "content payment",\
"userKYCVerified": false,\
"fiatCurrency": "GEL",\
"userEmail": "<hainguyen250203@gmail.com>",\
"extendInfo": {\
&#x20; "qrType": "georgia.customer.k",\
&#x20; "GE": {\
&#x20;   "recipientName": "Demo Merchant",\
&#x20;   "additionalData": {\
&#x20;         "infoPayment":        "921b43b4d693d90feeb4616dd199286d:273940c3d928b6cc5aa34c87a191dc28a316668ee0249fe2b07c0cc5544aea714de04ea681914ec2f58081195025a5b1"\
&#x20;      }\
&#x20;   }\
&#x20; }\
}

</details>

**Brazil**  :flag\_br:&#x20;

<details>

<summary>Example of request data payload</summary>

```
{
    "externalOrderId": "3532edba-d19d-4a1b-a803-936a38740e65",
    "partnerCode": "kaiAlinex",
    "signature": "PRZHIYyQoOlKWO1SM8cchRl7xk5zgGcwijTNBoVN5THesQk3KP9xxtz1wMw9Iy6d3NtUuv74kvFp5bBRK2KLI2GTK0nreQKsRYkIRWcOnxnL6LFHyADmi+uppyy/LQVEZA7h2Ll9yT5WU2BKfxhfc7WQtzhWmche1gNWwO2ciiGZnMzHHRXfFkrhKROzKaE1N4bR2+MzrDiWBxm61sI29B2p3VW89P1CiyT2DOa+mQZDu76GP76OxrqrFQ5D0Xw6nIDNBksrQDrMMI76xij24zeIyjovog6rsoJIexjKEFx1EYlpjWNvlO3yDE2whIXvBNjejqZQQRZEwyyeBUdCUw==",
    "currency": "USDT",
    "fiatAmount": 4,
    "bankCode": "PIX BR",
    "bankAccountNumber": "12345678909",
    "content": "content payment",
    "userKYCVerified": true,
    "fiatCurrency": "BRL",
    "userEmail": "testkyc12074746@yopmail.com",
    "extendInfo": {
      "qrType": "PIX",
      "BR": {
        "recipientName": "Chiquinho Santos",
        "additionalData": {
          "infoPayment": "pixfailure"
        }
      }
    }
  }
```

</details>

**Argentina** :flag\_ar:

<details>

<summary>Example of request data payload</summary>

```
{
    "externalOrderId": "ca129241-2d47-467f-b86c-00a0dc56f970",
    "partnerCode": "kaiAlinex",
    "signature": "Pd4QWgP4XrKrdcYYLenGqTqPa0nYeCmzFw8SrYboun7zOba9NWrSOVX8r3pJ7CLMbPRZPUxAely9qadjvxkjJI5PWLq8fVVL5r9FoITuJrtSSGYZmkQAhG+Vn1nGLWAG0ZBYSp9G/KNIepGBInM/EfBYa/JrRIehmZRRN7YfClsNU9z6UlNEsTxYkMxG4+VcbvC4gNEcu6F/zB1pTSTQtuAkeumkNV2se+RZv6a6F+GS35qSDPPZ8ILHd+QEdn+85teSmHcdoDiaga7hoiX59+oJfXWfzxOz/tjB4uU+Nvg/JI4vPJvGKh69C1H/HXpjBV3zVGDbUVX3b6B1+TNa3g==",
    "currency": "USDT",
    "fiatAmount": 1224.54,
    "bankCode": "QR3 AR",
    "bankAccountNumber": "20065533016",
    "content": "content payment",
    "userKYCVerified": true,
    "fiatCurrency": "ARS",
    "userEmail": "haitestkycs01@yopmail.com",
    "extendInfo": {
      "qrType": "QR3",
      "AR": {
        "recipientName": "Ricardo Fort",
        "additionalData": {
          "infoPayment": "00020101021140200010com.yacare02022350150011336972350495204739953030325802AR5910HAVANNA SA6012BUENOS AIRES81220010com.yacare0204Y2156304E401refund"
        }
      }
    }
  }
```

</details>

**Peru** :flag\_pe:

<details>

<summary>Example of request data payload</summary>

```
{
    "externalOrderId": "ca129241-2d47-467f-b86c-00a0dc56f970",
    "partnerCode": "kaiAlinex",
    "signature": "Pd4QWgP4XrKrdcYYLenGqTqPa0nYeCmzFw8SrYboun7zOba9NWrSOVX8r3pJ7CLMbPRZPUxAely9qadjvxkjJI5PWLq8fVVL5r9FoITuJrtSSGYZmkQAhG+Vn1nGLWAG0ZBYSp9G/KNIepGBInM/EfBYa/JrRIehmZRRN7YfClsNU9z6UlNEsTxYkMxG4+VcbvC4gNEcu6F/zB1pTSTQtuAkeumkNV2se+RZv6a6F+GS35qSDPPZ8ILHd+QEdn+85teSmHcdoDiaga7hoiX59+oJfXWfzxOz/tjB4uU+Nvg/JI4vPJvGKh69C1H/HXpjBV3zVGDbUVX3b6B1+TNa3g==",
    "currency": "USDT",
    "fiatAmount": 1224.54,
    "bankCode": "QR3 PE",
    "bankAccountNumber": "20065533016",
    "content": "content payment",
    "userKYCVerified": true,
    "fiatCurrency": "PEN",
    "userEmail": "haitestkycs01@yopmail.com",
    "extendInfo": {
      "qrType": "QR3",
      "AR": {
        "recipientName": "Ricardo Fort",
        "additionalData": {
          "infoPayment": "00020101021140200010com.yacare02022350150011336972350495204739953030325802AR5910HAVANNA SA6012BUENOS AIRES81220010com.yacare0204Y2156304E401refund"
        }
      }
    }

```

</details>

**Nigeria** :flag\_ng:

<details>

<summary>Example of request data payload</summary>

```
{
    "externalOrderId": "92d6a08b-1200-463a-802d-1e675b38c600",
    "partnerCode": "kaiAlinex",
    "signature": "S8vAeU0PId5/xsikasEx0rcan13qG9b+BehZ+CFRSD6YbBxSqLQCe2dtvTX63Ip1/V4kjwC8LLEBm+XShLajCnKtA6urulReb3Ig/zlj5NDb9sGtH2p0mvkZI7252BDwgQ9/4hkMWax4e/DvBBo57lDDOsDncwB5bFCcU+umP34wWv1bwox/i0kU1h6FkcQBbqXguivMN+tRuKLghs6P7SS4NsTuzDJ5w3bXuO/4FyG225Ow68DVSyhmCnP7qRDQl4ZTYcT0n75ZViXblXER3FqVo8rW2e1DEM05gTEq+0ELHTosbYfaHPjdMkVZv0E6I/4z5Nq9+62aehMWDk+nJA==",
    "currency": "USDT",
    "bankCode": "000004",
    "bankAccountNumber": "2184648058",
    "content": "payment home 123",
    "userKYCVerified": true,
    "userEmail": "haitestnewS2P001@yopmail.com",
    "fiatAmount": 4000,
    "fiatCurrency": "NGN",
    "extendInfo": null
  }
```

</details>

<table><thead><tr><th width="192">Name</th><th width="85.4140625">Type</th><th width="89.52734375">Condition</th><th>Description</th></tr></thead><tbody><tr><td>partnerCode</td><td>string</td><td>required</td><td>Code of of the partner</td></tr><tr><td><mark style="color:red;">userEmail</mark></td><td><mark style="color:red;">string</mark></td><td><mark style="color:red;">required</mark></td><td><mark style="color:red;">The email address from the end-user of your application</mark></td></tr><tr><td><mark style="color:red;">userKYCVerified</mark></td><td><p><mark style="color:red;">boolean</mark></p><p> <mark style="color:red;">true | false</mark></p></td><td><mark style="color:red;">optional</mark></td><td><mark style="color:red;">The user's KYC status on your application</mark> </td></tr><tr><td>currency</td><td>string</td><td>required</td><td>cryptocurrency that you wants to sell. for example: <code>USDT | ETH | BTC</code> </td></tr><tr><td><mark style="color:red;"><strong>fiatCurrency</strong></mark> </td><td><mark style="color:red;"><strong>string</strong></mark></td><td><mark style="color:red;"><strong>optional</strong></mark></td><td><p><mark style="color:red;"><strong>Supported fiat currencies:</strong></mark></p><ul><li><mark style="color:red;"><strong>VND</strong></mark></li><li><mark style="color:red;"><strong>PHP</strong></mark></li><li><mark style="color:red;"><strong>THB</strong></mark></li><li><mark style="color:red;"><strong>GEL</strong></mark></li><li><mark style="color:red;"><strong>BRL</strong></mark></li><li><mark style="color:red;"><strong>ARS</strong></mark></li><li><mark style="color:red;"><strong>PEN</strong></mark></li><li><mark style="color:red;"><strong>NGN</strong></mark><br><em><mark style="color:red;">(If the field is empty. Default will be VND)</mark></em></li></ul></td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>fiatAmount</td><td>number</td><td>required</td><td><p>The amount of fiat (VND) the user wants to sell. <br><mark style="color:red;">The minimum value should be:</mark></p><ul><li><mark style="color:red;">VND 10000 (Sandbox: 50000)</mark></li><li><mark style="color:red;">PHP: 10</mark> </li><li><mark style="color:red;">THB: 0</mark></li><li><mark style="color:red;">IDR: 10000</mark></li><li><mark style="color:red;">GEL: 1</mark></li><li><mark style="color:red;">BRL: 1</mark></li><li><mark style="color:red;">ARS: 1</mark></li><li><mark style="color:red;">PEN: 1</mark></li><li><mark style="color:red;">NGN: 1</mark></li></ul></td></tr><tr><td>bankCode</td><td>string</td><td>required</td><td>Code of bank </td></tr><tr><td>bankAccountNumber</td><td>string</td><td>required</td><td>bank account number wants to send to fiat </td></tr><tr><td>content</td><td>string</td><td>optional</td><td>Content of transaction</td></tr><tr><td>webhookSecretKey</td><td>string</td><td>required</td><td>It is secret key created by partner dashboard</td></tr><tr><td>signature</td><td>string</td><td>required</td><td><ul><li>The signature created with  SHA256 by using RSA created private key of partner</li><li>The <strong>public key</strong> that has been provided to you during onboarding.</li><li>The data shall be signed according to the structure: <strong><code>partnerCode|externalOrderId|currency|</code>fiatAmount<code>|bankCode|bankAccountNumber|content|</code></strong><mark style="color:red;"><strong><code>userEmail</code></strong></mark><strong><code>|secretKey</code></strong></li></ul></td></tr><tr><td>externalOrderId</td><td>string</td><td>required</td><td>This <strong>unique id</strong> for order created and managed in partner side. It will keep the update for transaction status after created it</td></tr><tr><td>extendInfo</td><td>Object</td><td>Optional</td><td><p><mark style="color:red;">Only Apply for <strong>ScanToPay</strong></mark></p><p></p><p>The additionalData getting from api get the information of QRCode</p><p><br><strong>Vietnam</strong></p><p>"extendInfo": null</p><p></p><p><strong>Phillipines</strong><br>"extendInfo": {</p><pre><code>    "qrType": "com.p2pqrpay",
    "PH": {
      "recipientName": "VIETNAMIT BISTRO",
      "additionalData": {
        "merchantMobileNumber": "",
        "merchantCity": "PARANAQUE",
        "purpose": "",
        "referenceLabel": "TNcpj6J5F8BVLXUDrJSqno",
        "tfrName": "VIETNAMIT BISTRO",
        "tfrBnkCode": "PAPHPHM1XXX",
        "proxyNotify": "310",
        "storeLabel": "",
        "paymentType": "",
        "customerLabel": "",
        "terminalLabel": "",
        "merchantId": "200690490",
        "merchantCategoryCode": "5814",
        "tfrAcctNo": "200690490",
        "acqInfo": "",
        "postCode": "",
        "uniqueId": "ph.ppmi.p2m",
        "loyaltyNumber": ""
      }
    }
  }
</code></pre></td></tr><tr><td>extendInfo.recipientName</td><td>string</td><td>Optional</td><td>it should be used the tfrName field from the api <a href="/pages/kf5Ga7qtJPzCjOG27IcC">get the content of QRcode</a></td></tr><tr><td>extendInfo.additionalData</td><td>Object</td><td>Optional</td><td>it should be used the additionalData field from the api <a href="/pages/kf5Ga7qtJPzCjOG27IcC">get the content of QRcode</a></td></tr><tr><td>qrType</td><td>string</td><td>qrType</td><td>It belong to extendInfo Object and getting from <a href="/pages/kf5Ga7qtJPzCjOG27IcC">API</a> <br>- VN: "<strong>vietqr</strong>" <br>- PH:  "<strong>ph.ppmi.p2m | com.p2pqrpay</strong>" <br>- TH: "<strong>thailand.pwc</strong>" <br>- ID: "<strong>qris</strong>"</td></tr><tr><td>countryCode</td><td>string</td><td>Optional</td><td><p>the countryCode getting from api get the information of QRCode</p><ul><li>VN:  <span data-gb-custom-inline data-tag="emoji" data-code="1f1fb-1f1f3">🇻🇳</span></li><li>PH:  <span data-gb-custom-inline data-tag="emoji" data-code="1f1f5-1f1ed">🇵🇭</span></li><li>TH: <span data-gb-custom-inline data-tag="emoji" data-code="1f1f9-1f1ed">🇹🇭</span></li><li>GE: <span data-gb-custom-inline data-tag="emoji" data-code="1f1ec-1f1ea">🇬🇪</span></li><li>BR: <span data-gb-custom-inline data-tag="emoji" data-code="1f1e7-1f1f7">🇧🇷</span></li><li>AR: <span data-gb-custom-inline data-tag="emoji" data-code="1f1e6-1f1f7">🇦🇷</span></li><li>PE: <span data-gb-custom-inline data-tag="emoji" data-code="1f1f5-1f1ea">🇵🇪</span></li><li>NG: <span data-gb-custom-inline data-tag="emoji" data-code="1f1f3-1f1ec">🇳🇬</span> </li></ul><p></p></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,
    "walletAddress": "string",
    "txHash": "string"
  },
  "bankTransfer": {
    "bankAccountName": "string",
    "bankAccountNumber": "string",
    "bankName": "string",
    "contentPayment": "string",
    "totalPayment": 0,
    "qrUrl": "string"
  },
  "fees": {
    "systemFee": 0,
    "processingFee": 0
  },
  "status": "string", // AWAITING_PAYMENT | PAYMENT_COMPLETED | PROCESSING_TOKEN_TRANSFER | SUCCESS | ERROR 
  "description": "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 %}

### How to create and verify the signature  <a href="#how-to-do-signature-creation-verification" id="how-to-do-signature-creation-verification"></a>

#### 1. Creation

```typescript
import * as crypto from 'crypto';

function create(data: string, privateKey: string): string 
{
  const signer = crypto.createSign('RSA-SHA256');
  signer.update(data);
  signer.end();

  return signer.sign(privateKey, 'base64');
}
```

#### 2. Verification

```typescript

function verify (data: string, signature: string, pubKey: string): boolean
{
        const verify = createVerify('RSA-SHA256');
        verify.update(data);
        verify.end();
        return verify.verify(pubKey, signature, 'base64');
}
```

**Transaction status**

| Status name                 | Description                                                                                                                                  |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| AWAITING\_PAYMENT           | <p>The order created successfully. It is waiting </p><p><mark style="color:red;">(please wait IPN or manual check with operation)</mark></p> |
| PAYMENT\_COMPLETED          | When payment has transferred from AliX Pay to your customer bank account                                                                     |
| PROCESSING\_TOKEN\_TRANSFER | When the token has deducted from your account wallet on AliX Pay                                                                             |
| SUCCESS                     | When an transaction has completed                                                                                                            |
| FAIL                        | When an transaction has failed with any reasons                                                                                              |
| ERROR                       | When an transaction has failed with any reasons                                                                                              |
