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

# API Interface

### API BASE URL

```
https://api.reelpay.com
```

### Token List

* Interface Description: Get a list of TOKENs supported by the system. &#x20;
* Interface Address:`/v1/transactions/currency` &#x20;
* Request Parameters: None &#x20;
* Field Description

| Field        | Type   | Description      |
| ------------ | ------ | ---------------- |
| currency\_id | string | Currency ID      |
| chain        | string | Chain            |
| token        | string | Token            |
| contract     | string | Contract address |
| protocol     | string | Protocol         |
| logo         | string | Logo             |
| decimal      | int    | Decimal          |

Sample Response

```json
{
    "code": 200,
    "message": "success",
    "data": [
        {
            "currency_id":"ZxkanKiq9w2skt7e9CSR4oUX2q9F23LB",
            "chain": "Ethereum",
            "token": "ETH",
            "contract": "ETH",
            "protocol": "ERC-20",
            "logo": "https://reel-block-n.s3.ap-east-1.amazonaws.com/coin/png/202211/2ff17a95bbd65925.png",
            "decimal": 18
        },
        {
            "currency_id":"ZxkanKiq9w2skt7e9CSR4oUX2q9F23cc",
            "chain": "BSC",
            "token": "COLX",
            "contract": "0xF8aCF86194443DCde55fc5B9e448e183c290D8Cb",
            "protocol": "BEP-20",
            "logo": "https://reel-block-n.s3.ap-east-1.amazonaws.com/coin/png/202211/4178bc4853d1e691.png",
            "decimal": 8
        }
    ]
}
```

### Get Amount

Interface Description: Get the current exchange price between TOKEN and fiat currency. &#x20;

Interface Address: `/v1/transactions/amount` &#x20;

Request Parameters

| Field        | Type   | Description                                              |
| ------------ | ------ | -------------------------------------------------------- |
| currency\_id | string | [Currency ID](/payment-api/api-interface.md#token-list). |
| fiat\_name   | string | Fiat name (USD)                                          |
| fiat\_amount | string | Fiat amount (1.2)                                        |

Field Description

| Field  | Type   | Description                               |
| ------ | ------ | ----------------------------------------- |
| amount | string | The number of tokens that need to be paid |

Sample Response

```json
{
    "code": 200,
    "message": "success",
    "data": {
        "amount": "0.00007971"
    }
}
```

### Create Payment Order

Interface Description: Submit a ReelPay payment order and get an acknowledgment message through this interface. &#x20;

Interface Address: `/v1/transactions/pay` &#x20;

Request Parameters

| Field          | Type   | Description       |
| -------------- | ------ | ----------------- |
| out\_trade\_no | string | Merchant Order ID |
| currency\_id   | string | Currency ID       |
| fiat\_name     | string | Fiat name         |
| fiat\_amount   | string | Fiat amount       |

Field Description

| Field        | Type   | Description                                                                                     |
| ------------ | ------ | ----------------------------------------------------------------------------------------------- |
| trade\_no    | string | ReelPay order ID                                                                                |
| pay\_address | string | The temporary payment address for current order,only effectivewithin the order validity period. |
| time\_expire | string | Payment deadline                                                                                |
| amount       | string | The number of tokens that need to be paid                                                       |
| chain        | string | Chain Name                                                                                      |
| token        | string | Token symbol                                                                                    |
| decimal      | int    | Token decimal                                                                                   |
| contract     | string | Contract address                                                                                |

Sample Response

```json
{
        "code": 200,
        "message": "success",
        "data": {
                "trade_no": "uz54NEW9TVhLSIDHUSYB4aEFupKoE7I8",
                "pay_address": "0x988519e9ba1c147ff687f4b59009d7573c49efed",
                "time_expire": 1673264871,
                "amount": "0.00007971",
                "chain": "Ethereum",
                "token": "ETH",
                "contract": "ETH",
                "decimal": 18
        }
}
```

### Order Information Interface

Interface Description: Check the order status through this interface. &#x20;

Interface Address: `/v1/transactions` &#x20;

Request Parameters

| Field     | Type   | Description      |
| --------- | ------ | ---------------- |
| trade\_no | string | ReelPay order ID |

&#x20;Field Description

| Field          | Type   | Description                                                  |
| -------------- | ------ | ------------------------------------------------------------ |
| trade\_no      | string | ReelPay order ID                                             |
| out\_trade\_no | string | Merchant Order ID                                            |
| chain          | string | Chain Name                                                   |
| token          | string | Token symbol                                                 |
| contract       | string | Contract address                                             |
| protocol       | string | Protocol                                                     |
| logo           | string | Logo                                                         |
| decimal        | int    | Token decimal                                                |
| fiat\_name     | string | Fiat name (USD)                                              |
| fiat\_amount   | string | Fiat amount (1.2)                                            |
| status         | string | [Transaction Status](/error-code.md#transaction-status-code) |

Sample Response

<pre class="language-json"><code class="lang-json"><strong>{
</strong>    "code": 200,
    "message": "success",
    "data": {
        "trade_no": "uGHT9KRRvLIl4WW8JAaTWmETf3mz8D60",
        "out_trade_no": "12344556dss",
        "chain": "Ethereum",
        "token": "ETH",
        "contract": "ETH",
        "fiat_name": "usd",
        "fiat_amount": "0.1",
        "amount": "0.00007974",
        "pay_address": "0x988519e9ba1c147ff687f4b59009d7573c49efed",
        "status": "TO-BE-PAID",
        "time_expire": 1672988562
    }
}
</code></pre>

### Close Order

Interface Description: Pending orders are closed through this interface. (Transactions closed by the merchant may result in unavailable payments already finished by the user.) &#x20;

Interface Address: `/v1/transactions/close` &#x20;

Request Parameters

| Field     | Type   | Description      |
| --------- | ------ | ---------------- |
| trade\_no | string | ReelPay order ID |

Sample Response

```json
{
    "code": 200,
    "message": "success",
    "data": null
}
```

### Request Refund

Interface Description: The merchant can refund the payment to the user's address through this interface. (When refunding, the user's address must be actual; the contract address may result in the user not receiving the correct payment.) &#x20;

Interface Address: `/v1/transactions/refund` &#x20;

Request Parameters

| Field     | Type   | Description                                   |
| --------- | ------ | --------------------------------------------- |
| txid      | string | TXID transaction on the chain                 |
| trade\_no | string | ReelPay order ID                              |
| fuel      | int    | GAS fee deduction method「1: merchant 2: user」 |

Field Description

| Field               | Type   | Description                        |
| ------------------- | ------ | ---------------------------------- |
| merchant\_deduction | string | Merchant deduction amount          |
| actual\_receipt     | string | Actual amount received by the user |

&#x20;Sample Response

```json
{
    "code": 200,
    "message": "success",
    "data": {
        "merchant_deduction": "1.0002",
        "actual_receipt": "0.0001"
    }
}
```
