# List all orders

Retrieves the partner's order list based on the finish time of order. And returns a Map with a `data` property that contains an object of [`OrderList`](#orderlist) with all the order details.

on-ramp: Currently only `FINISHED` orders will be contained in the response.`FINISHED` represents that transaction on chain is confirmed and user has received cryptocurrencies.\
nft: `FINISHED` `Settlement` `Settled`will be contained in the response.

## List all orders

<mark style="color:blue;">`GET`</mark> `https://api.ramp.fatpay.xyz/open/api/onramp/order`

Query orders list based on the create time of orders.

#### Query Parameters

| Name                                        | Type    | Description                                                             |
| ------------------------------------------- | ------- | ----------------------------------------------------------------------- |
| startTime<mark style="color:red;">\*</mark> | Long    | <p>Order finished time. Unix timestamp in second<br>e.g. 1661346861</p> |
| endTime<mark style="color:red;">\*</mark>   | Long    | <p>Order finished time. Unix timestamp in second<br>e.g. 1661346861</p> |
| page                                        | Integer | Current page index, default `1`                                         |
| size                                        | Integer | Page size, default `20`                                                 |

#### Headers

| Name                                              | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Content-Type<mark style="color:red;">\*</mark>    | String  | application/json                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| X-Fp-Version<mark style="color:red;">\*</mark>    | String  | <p>FaTPay API version <br>e.g. v1.0</p>                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| X-Fp-Timestamp<mark style="color:red;">\*</mark>  | Integer | <p>Unix timestamp in second <br>e.g. 1661346861</p>                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| X-Fp-Nonce<mark style="color:red;">\*</mark>      | Integer | <p>Random integer <br>e.g. 868964</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| X-Fp-Partner-Id<mark style="color:red;">\*</mark> | String  | <p>Partner ID assigned by FaTPay as Premium Partner <br>e.g. 2yQrS9A0xmM8xpfa</p>                                                                                                                                                                                                                                                                                                                                                                                                    |
| X-Fp-Signature<mark style="color:red;">\*</mark>  | String  | <p><a href="../../verification#signature-for-api-request">Signature</a> generated by <code>APIPrivateKey</code><br>e.g. zbBQ+1nv/5up9riH1wbTSSMmkb26LQj3g1cNWsutOordOrtpk8agcA5D5bdYaGeVlHK0qZ2MlUV+ZfOK9cXMuficeIm5fnEjMEm7s1IZtSivMt5te7EFqe52dtVFafE4hUgwqH6QBZB0yZ1FSqHs2dOCI0e8RKJQBDitxtHkibStl1Jt5wulzzq96qWbbVnwoBqGDT52OtwwEcDqMI4SIAzUAdBhAuLqUig1U4Ne9ufT8B1aAohEk5fvn/Sbom21bEjLdgbt5PwH2wmmuBx4tq31IgcP4V+qEBILY2eMAFzkvxNXaX3PsLbj9NpgyIc3HQl0FtRq3gdN7FsSvyvcWA==</p> |

{% tabs %}
{% tab title="200: OK Successful response" %}

<pre class="language-javascript"><code class="lang-javascript">{
    "code": 10000,
    "msg": "Success",
    "data":
    {
        "page": 1,
        "size": 20,
        "totalCount": 2,
        "list": [
        {
            "orderId": "jIdvChO85Bw.",
            "orderStatus": 3,
            "userId": "test-4Q4-zf4mDKh7h3FNXPFNaA..",
            "payTime": 1661177568,
            "deliverTime": 1661177536,
            "finishTime": 1661177536,
            "fiatCurrency": "USD",
            "currencyAmount": 100,
            "cryptoCurrency": "USDC",
            "cryptoCurrencyCode": "USDC_Polygon",
            "cryptoCurrencyAmount": 93.09000000,
            "cryptoCurrencyUnitPrice": 1.03,
            "walletAddress": "0x9a078d5109a9268cE307884e825576520733e2FE",
            "walletAddressTag": "88888888",
            "gasFee": 0.01,
            "gasFeeUnit": "USDC",
            "platformFee": 5.00,
            "platformFeeUnit": "USDC",
            "totalFee": 5.01,
            "totalFeeUnit": "USDC",
            "payment": "CREDIT_DEBIT_CARD",
            "txHash": "0x777fb52e7f77d14f7d6d51eefa90c4c2f03d0b6d21e51dcc4c056baedf5f7e4e",
            "network": "polygon_mumbai",
            "blockchainExplorer": "https://mumbai.polygonscan.com/tx/"
        },
        {
            "orderId": "s0cec3BQ8i4.",
            "orderStatus": 3,
            "nftDetails": [
<strong>                {
</strong>                    "externalCustomerId": "123333",
                    "tokenId": "",
                    "nftNetwork": "ethereum",
                    "transferWalletAddress": "0x0B4DF75c947e225b459B949F1625AcAb171053c4",
                    "merchantUniqueId": "112233",
                    "contractAddress": "0xe785E82358879F061BC3dcAC6f0444462D4b5330",
                    "mintQuantity": 2,
                    "type": "MINT",
                    "merchantOrderNo": "123321"
                    }
            "userId": "test-4Q4-zf4mDKh7h3FNXPFNaA..",
            "payTime": 1661163885,
            "deliverTime": 1661163847,
            "finishTime": 1661163847,
            "fiatCurrency": "USD",
            "currencyAmount": 10,
            "cryptoCurrency": "USDC",
            "cryptoCurrencyCode": "USDC_Polygon",
            "cryptoCurrencyAmount": 9.30000000,
            "cryptoCurrencyUnitPrice": 1.03,
            "walletAddress": "0x9a078d5109a9268cE307884e825576520733e2FE",
            "gasFee": 0.01,
            "gasFeeUnit": "USDC",
            "platformFee": 0.50,
            "platformFeeUnit": "USDC",
            "totalFee": 0.51,
            "totalFeeUnit": "USDC",
            "payment": "CREDIT_DEBIT_CARD",
            "txHash": "0x93da31ee10015ecf3c0dee4a5fa1c74a7a2e02f88ec71f60317c2055f80f3d3c",
            "network": "polygon_mumbai",
            "blockchainExplorer": "https://mumbai.polygonscan.com/tx/",
            "ext": "ext"
        }]
    }
}
</code></pre>

{% endtab %}
{% endtabs %}

### Objects definition

### `OrderList`

<table><thead><tr><th width="183">Key</th><th width="125">Format</th><th width="122">Required</th><th>Description</th></tr></thead><tbody><tr><td>page</td><td>Integer</td><td>Y</td><td>Current page index.<br>e.g. 1</td></tr><tr><td>size</td><td>Integer</td><td>Y</td><td>Page size.<br>e.g. 20</td></tr><tr><td>totalCount</td><td>Integer</td><td>Y</td><td>Total amount of orders.<br>e.g 40</td></tr><tr><td>list</td><td>Object</td><td>Y</td><td>An array of <a href="#order"><code>Order</code></a>.</td></tr></tbody></table>

### `Order`

<table><thead><tr><th width="182">Key</th><th width="125">Format</th><th width="122">Required</th><th>Description</th></tr></thead><tbody><tr><td>orderId</td><td>String</td><td>Y</td><td>Order ID<br>e.g. jIdvChO85Bw</td></tr><tr><td>orderStatus</td><td>Integer</td><td>Y</td><td>On-ramp:<br>Order status fixed as <br><code>3</code>：<code>FINISHED</code><br><br><code>NFT Checkout:</code><br><code>1</code>：<code>FINISHED</code><br><code>2</code>：<code>Settlement</code><br><code>3</code>：<code>Settled</code></td></tr><tr><td>userId</td><td>String</td><td>Y</td><td>FaTPay User ID<br>e.g. test-4Q4-zf4mDKh7h3FNXPFNaA..</td></tr><tr><td>payTime</td><td>String</td><td>Y</td><td>Payment time.<br>Unix timestamp in second<br>e.g. 1661346861</td></tr><tr><td>deliverTime</td><td>String</td><td>Y</td><td>Tx on chain created time<br>Unix timestamp in second<br>e.g. 1661346861</td></tr><tr><td>finishTime</td><td>String</td><td>Y</td><td>Tx on chain confirmed time<br>Unix timestamp in second<br>e.g. 1661346861</td></tr><tr><td>fiatCurrency</td><td>String</td><td>Y</td><td>ISO code of fiat currency, e.g. USD, THB, etc.</td></tr><tr><td>currencyAmount</td><td>Long</td><td>Y</td><td>Fiat currency amount, up to two decimal places.<br>e.g. 199</td></tr><tr><td>cryptoCurrency</td><td>String</td><td>Y</td><td>Cryptocurrency bought by the user.<br>e.g. USDT</td></tr><tr><td>cryptoCurrencyCode</td><td>String</td><td>Y</td><td>Cryptocurrency code, e.g. USDT_ERC20</td></tr><tr><td>cryptoCurrencyAmount</td><td>Decimal</td><td>Y</td><td>The amount of cryptocurrency delivered to the user.<br>up to two decimal places.<br>e.g. 182</td></tr><tr><td>cryptoCurrencyUnitPrice</td><td>Decimal</td><td>Y</td><td>Unit price of cryptocurrency, up to two decimal places.<br>e.g. 1.03</td></tr><tr><td>walletAddress</td><td>String</td><td>Y</td><td>Wallet address.</td></tr><tr><td>gasFee</td><td>Decimal</td><td>Y</td><td>Gas fee, up to two decimal places.<br>e.g. 1.32</td></tr><tr><td>gasFeeUnit</td><td>String</td><td>Y</td><td>Unit of gas fee, e.g. BTC.<br><em><mark style="color:orange;">* After 2022/10/18, gas fee of all order will be converted to be the same as purchased cryptocurrency. If BTC is purchased, gasFeeUnit will be BTC.</mark></em></td></tr><tr><td>platformFee</td><td>Decimal</td><td>Y</td><td>Processing fee charged by FaTPay, up to two decimal places.<br>e.g. 11.94</td></tr><tr><td>platformFeeUnit</td><td>String</td><td>Y</td><td>Unit of processing fee, e.g. USD.</td></tr><tr><td>totalFee</td><td>Decimal</td><td>Y</td><td>Total fee = Gas fee + Processing fee, up to two decimal places.<br>e.g. 13.26</td></tr><tr><td>totalFeeUnit</td><td>String</td><td>Y</td><td>Unit of total fee, e.g. USD.</td></tr><tr><td>payment</td><td>String</td><td>Y</td><td>Payment method.<br>See detail at <a data-mention href="../list-all-fiat-currencies-and-payment-methods#paymentoption">#paymentoption</a></td></tr><tr><td>txHash</td><td>String</td><td>Y</td><td>Transaction Hash ID on blockchain.<br>e.g. 0x93da31ee10015ecf3c0dee4a5fa1c74a7a2e02f88ec71f60317c2055f80f3d3c</td></tr><tr><td>network</td><td>String</td><td>Y</td><td>Blockchain.<br>e.g. ethereum_mainnet</td></tr><tr><td>blockchainExplorer</td><td>String</td><td>Y</td><td>Transaction details on blockchain.<br>e.g. <a href="https://mumbai.polygonscan.com/tx/">https://mumbai.polygonscan.com/tx/</a></td></tr><tr><td>ext</td><td>String</td><td>Y</td><td>e.g. <br>ext</td></tr><tr><td>nftDetails</td><td>Object</td><td>N</td><td>An array of <a href="#nftdetails">nftDetails</a></td></tr></tbody></table>

### `nftDetails`

<table><thead><tr><th width="229">Key</th><th width="125">Format</th><th width="122">Required</th><th>Description</th></tr></thead><tbody><tr><td>contractAddress</td><td>String</td><td>Y</td><td>Total amount of orders.<br>e.g 40</td></tr><tr><td>nftNetwork</td><td>String</td><td>Y</td><td></td></tr><tr><td>tokenId</td><td>String</td><td>N</td><td></td></tr><tr><td>merchantUniqueId</td><td>String</td><td>N</td><td></td></tr><tr><td>type</td><td>String</td><td>Y</td><td></td></tr><tr><td>mintQuantity</td><td>String</td><td>N</td><td></td></tr><tr><td>ownerWalletAddress</td><td>String</td><td>N</td><td></td></tr><tr><td>transferWalletAddress</td><td>String</td><td>Y</td><td></td></tr><tr><td>merchantOrderNo</td><td>String</td><td>N</td><td></td></tr><tr><td>externalCustomerId</td><td>String</td><td>N</td><td></td></tr></tbody></table>
