# Executions API

There are several differences with V2 endpoints. Firstly, the data is encapsulated in a `data` payload. Secondly, there now exists a `pagination` object that, if applicable, will hold a `startsAfter` token. You can use the `startsAfter` token as a query parameter to query successive data, until `startsAfter` is **null**, signifying that you have reached the end of the pagination.

{% hint style="info" %}
if `startsAfter` is a string while there is no data in the payload, it means there is more data to be fetched, even if it seems to be returning an empty array. Do not stop calling until the `startsAfter` token has an empty string ("")**.** Do not rely on the data received to determine if you should keep fetching.
{% endhint %}

## Get or query orders

<mark style="color:blue;">`GET`</mark> `https://api.aquanow.io/trades/v2/order`

To view example requests for this endpoint, visit Aquanow's [Postman](https://developer.aquanow.io/#b09a9378-63c1-4cfa-9cc2-25f3bd2abc61) documentation.

<mark style="color:orange;">NOTE:</mark> The limit for this endpoint is a maximum payload of **5 mb**. For larger payloads, use the [v2 endpoint](#orders-v2) or change the time range parameters to query for less results.

#### Query Parameters

| Name                                  | Type   | Description                                                                              |
| ------------------------------------- | ------ | ---------------------------------------------------------------------------------------- |
| -                                     | -      | Query all orders if no query parameters are provided.                                    |
| orderId                               | String | Query by order ID.                                                                       |
| accountId                             | String | Query orders by account.                                                                 |
| startTime/endTime                     | Number | Query by time range, requires both startTime and endTime.                                |
| expirationStartTime/expirationEndTime | Number | Query by expiration time range, requires both expirationStartTime and expirationEndTime. |
| openOrders=true                       | Bool   | Query for open orders                                                                    |
| startsAfter                           | String | Pagination token used to fetch extra data                                                |
| usernameRef                           | String | Query by usernameRef                                                                     |

#### Headers

| Name                                          | Type   | Description                                                                                                                                                        |
| --------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| x-api-key<mark style="color:red;">\*</mark>   | String | <p><code>{{x-api-key}}</code></p><p>API Auth Key</p>                                                                                                               |
| x-signature<mark style="color:red;">\*</mark> | String | <p><code>32c92660f65cbb78d0eaf9a4361fb6b0a2cb8bb4c40f531e9974a0afc12d9a328b5ff621w544d242ee9ba1dfa799c85a</code></p><p>Signature created using your API secret</p> |
| x-nonce<mark style="color:red;">\*</mark>     | String | <p><code>1657731573930</code></p><p>Timestamp in millisecond</p>                                                                                                   |

{% tabs %}
{% tab title="200: OK Get order by orderId" %}
Returns an [OrdersV2Object](/aquanow/legacy/data-objects-and-statuses/executions-objects.md#ordersv2object).

```json
{
  "pagination": {
    "startsAfter": "",
    "limit": 1000
  },
  "data": {
    "orderId": "905910d8-ad90-42f6-91af-910defeae2ad",
    "remainingQtyBase": 0,
    "tradeSize": 0.1,
    "exchangeOrderId": "-",
    "tradePriceAvg": 71874.9,
    "fillPct": 100,
    "finalizeReturnedQtyBase": 0,
    "tradeSide": "buy",
    "exchangeClientOrderId": "-",
    "tradeTime": 1712618352305,
    "childOrderCount": 0,
    "itemDateTime": 1712618353772,
    "baseSymbol": "USD",
    "strategy": "RFQ",
    "fillQtyQuote": 0.1,
    "usernameRef": "-",
    "fillQtyBase": 7187.49,
    "accountId": "CA1000101R",
    "exchangePair": "aquax-BTC-USD",
    "symbol": "BTC-USD",
    "tradeStatus": "COMPLETE",
    "commissionRate": 0,
    "createdAt": 1712618352379,
    "message": "-",
    "priceLimit": 71874.9,
    "quoteSymbol": "BTC",
    "remainingQtyQuote": 0,
    "orderIdParent": "905910d8-ad90-42f6-91af-910defeae2ad",
    "orderType": "parentOrder",
    "updatedAt": 1712618353772,
    "exchange": "aquax",
    "tradeDuration": 30,
    "username": "helloWorld",
    "fillFeeQuoteAqua": 0
  }
}
```

{% endtab %}

{% tab title="200: OK Get orders by accountId" %}
Returns an array of [OrdersV2Object](/aquanow/legacy/data-objects-and-statuses/executions-objects.md#ordersv2object).

```json
{
  "pagination": {
    "startsAfter": "",
    "limit": 1000
  },
  "data": [
    {
      "orderId": "905910d8-ad90-42f6-91af-910defeae2ad",
      "remainingQtyBase": 0,
      "tradeSize": 0.1,
      "exchangeOrderId": "-",
      "tradePriceAvg": 71874.9,
      "fillPct": 100,
      "finalizeReturnedQtyBase": 0,
      "tradeSide": "buy",
      "exchangeClientOrderId": "-",
      "tradeTime": 1712618352305,
      "childOrderCount": 0,
      "itemDateTime": 1712618353772,
      "baseSymbol": "USD",
      "strategy": "RFQ",
      "fillQtyQuote": 0.1,
      "usernameRef": "-",
      "fillQtyBase": 7187.49,
      "accountId": "CA1000051R",
      "exchangePair": "aquax-BTC-USD",
      "symbol": "BTC-USD",
      "tradeStatus": "COMPLETE",
      "commissionRate": 0,
      "createdAt": 1712618352379,
      "message": "-",
      "priceLimit": 71874.9,
      "quoteSymbol": "BTC",
      "remainingQtyQuote": 0,
      "orderIdParent": "905910d8-ad90-42f6-91af-910defeae2ad",
      "orderType": "parentOrder",
      "updatedAt": 1712618353772,
      "exchange": "aquax",
      "tradeDuration": 30,
      "username": "helloWorld",
      "fillFeeQuoteAqua": 0
    },
    {
      "orderId": "b6cf97fb-f906-4fef-a12e-a320e34c2527",
      "remainingQtyBase": 0,
      "tradeSize": 100,
      "exchangeOrderId": "-",
      "tradePriceAvg": 1,
      "fillPct": 100,
      "finalizeReturnedQtyBase": 0,
      "tradeSide": "buy",
      "exchangeClientOrderId": "-",
      "tradeTime": 1712615969854,
      "childOrderCount": 0,
      "itemDateTime": 1712615971165,
      "baseSymbol": "USD",
      "strategy": "RFQ",
      "fillQtyQuote": 100,
      "usernameRef": "-",
      "fillQtyBase": 100,
      "accountId": "CA1000051R",
      "exchangePair": "aquax-USDT-USD",
      "symbol": "USDT-USD",
      "tradeStatus": "COMPLETE",
      "commissionRate": 0,
      "createdAt": 1712615969901,
      "message": "-",
      "priceLimit": 1,
      "quoteSymbol": "USDT",
      "remainingQtyQuote": 0,
      "orderIdParent": "b6cf97fb-f906-4fef-a12e-a320e34c2527",
      "orderType": "parentOrder",
      "updatedAt": 1712615971165,
      "exchange": "aquax",
      "tradeDuration": 30,
      "username": "helloWorld",
      "fillFeeQuoteAqua": 0
    },
    {
      "orderId": "e76ed244-6a72-464c-beff-6f57f7c7978c",
      "remainingQtyBase": 0,
      "tradeSize": 0.0836481758,
      "exchangeOrderId": "-",
      "tradePriceAvg": 71729,
      "fillPct": 100,
      "finalizeReturnedQtyBase": 0,
      "tradeSide": "sell",
      "exchangeClientOrderId": "-",
      "tradeTime": 1712615254394,
      "childOrderCount": 0,
      "itemDateTime": 1712615255735,
      "baseSymbol": "BTC",
      "strategy": "RFQ",
      "fillQtyQuote": 6000,
      "usernameRef": "-",
      "fillQtyBase": 0.0836481758,
      "accountId": "CA1000051R",
      "exchangePair": "aquax-BTC-USD",
      "symbol": "BTC-USD",
      "tradeStatus": "COMPLETE",
      "commissionRate": 0,
      "createdAt": 1712615254433,
      "message": "-",
      "priceLimit": 71729,
      "quoteSymbol": "USD",
      "remainingQtyQuote": 0,
      "orderIdParent": "e76ed244-6a72-464c-beff-6f57f7c7978c",
      "orderType": "parentOrder",
      "updatedAt": 1712615255735,
      "exchange": "aquax",
      "tradeDuration": 30,
      "username": "helloWorld",
      "fillFeeQuoteAqua": 0
    },
    {
      "orderId": "242aa1e3-3bc4-4725-a4ec-781739cd8431",
      "remainingQtyBase": 0,
      "tradeSize": 1,
      "exchangeOrderId": "-",
      "tradePriceAvg": 3689.65,
      "fillPct": 100,
      "finalizeReturnedQtyBase": 0,
      "tradeSide": "sell",
      "exchangeClientOrderId": "-",
      "tradeTime": 1712610345382,
      "childOrderCount": 0,
      "itemDateTime": 1712610346741,
      "baseSymbol": "ETH",
      "strategy": "RFQ",
      "fillQtyQuote": 3689.65,
      "usernameRef": "-",
      "fillQtyBase": 1,
      "accountId": "CA1000051R",
      "exchangePair": "aquax-ETH-USD",
      "symbol": "ETH-USD",
      "tradeStatus": "COMPLETE",
      "commissionRate": 0,
      "createdAt": 1712610345395,
      "message": "-",
      "priceLimit": 3689.65,
      "quoteSymbol": "USD",
      "remainingQtyQuote": 0,
      "orderIdParent": "242aa1e3-3bc4-4725-a4ec-781739cd8431",
      "orderType": "parentOrder",
      "updatedAt": 1712610346741,
      "exchange": "aquax",
      "tradeDuration": 30,
      "username": "helloWorld",
      "fillFeeQuoteAqua": 0
    },
    {
      "orderId": "8004ae83-d201-4b10-8881-364f84f7d678",
      "remainingQtyBase": 0,
      "tradeSize": 0.1,
      "exchangeOrderId": "-",
      "tradePriceAvg": 71755.72,
      "fillPct": 100,
      "finalizeReturnedQtyBase": 0,
      "tradeSide": "buy",
      "exchangeClientOrderId": "-",
      "tradeTime": 1712610305889,
      "childOrderCount": 0,
      "itemDateTime": 1712610307488,
      "baseSymbol": "USD",
      "strategy": "RFQ",
      "fillQtyQuote": 0.1,
      "usernameRef": "-",
      "fillQtyBase": 7175.572,
      "accountId": "CA1000051R",
      "exchangePair": "aquax-BTC-USD",
      "symbol": "BTC-USD",
      "tradeStatus": "COMPLETE",
      "commissionRate": 0,
      "createdAt": 1712610305967,
      "message": "-",
      "priceLimit": 71755.72,
      "quoteSymbol": "BTC",
      "remainingQtyQuote": 0,
      "orderIdParent": "8004ae83-d201-4b10-8881-364f84f7d678",
      "orderType": "parentOrder",
      "updatedAt": 1712610307488,
      "exchange": "aquax",
      "tradeDuration": 30,
      "username": "helloWorld",
      "fillFeeQuoteAqua": 0
    },
    {
      "orderId": "1848e32b-f5c8-406d-9119-62b20fc4436d",
      "remainingQtyBase": 0,
      "tradeSize": 0,
      "exchangeOrderId": "-",
      "tradePriceAvg": 107.82,
      "fillPct": 100,
      "tradeSide": "buy",
      "exchangeClientOrderId": "-",
      "tradeTime": 1703717118309,
      "childOrderCount": 0,
      "baseSymbol": "USD",
      "strategy": "FOK",
      "fillQtyQuote": 0,
      "usernameRef": "-",
      "fillQtyBase": 0,
      "accountId": "CA1000051R",
      "exchangePair": "--SOL-USD",
      "symbol": "SOL-USD",
      "tradeStatus": "CANCELLED",
      "commissionRate": 0,
      "createdAt": 1703717118312,
      "message": "Cancelled - Price not marketable",
      "priceLimit": 107.72,
      "quoteSymbol": "SOL",
      "remainingQtyQuote": 0,
      "orderIdParent": "1848e32b-f5c8-406d-9119-62b20fc4436d",
      "orderType": "parentOrder",
      "updatedAt": 1703717118312,
      "exchange": "-",
      "tradeDuration": 0,
      "username": "helloWorld",
      "fillFeeQuoteAqua": 0
    },
    {
      "orderId": "741e4cf0-44c3-457d-ad70-8c28d5f5cfa4",
      "remainingQtyBase": 0,
      "tradeSize": 1,
      "exchangeOrderId": "-",
      "tradePriceAvg": 108.03,
      "fillPct": 100,
      "finalizeReturnedQtyBase": 0,
      "tradeSide": "buy",
      "exchangeClientOrderId": "-",
      "tradeTime": 1703717081374,
      "childOrderCount": 0,
      "itemDateTime": 1703717084055,
      "baseSymbol": "USD",
      "strategy": "RFQ",
      "fillQtyQuote": 1,
      "usernameRef": "-",
      "fillQtyBase": 108.03,
      "accountId": "CA1000051R",
      "exchangePair": "aquax-SOL-USD",
      "symbol": "SOL-USD",
      "tradeStatus": "COMPLETE",
      "commissionRate": 0,
      "createdAt": 1703717081443,
      "message": "-",
      "priceLimit": 108.03,
      "quoteSymbol": "SOL",
      "remainingQtyQuote": 0,
      "orderIdParent": "741e4cf0-44c3-457d-ad70-8c28d5f5cfa4",
      "orderType": "parentOrder",
      "updatedAt": 1703717084056,
      "exchange": "aquax",
      "tradeDuration": 30,
      "username": "helloWorld",
      "fillFeeQuoteAqua": 0
    }
  ]
}
```

{% endtab %}

{% tab title="200: OK Get order by time range" %}
Returns an array of [OrdersV2Object](/aquanow/legacy/data-objects-and-statuses/executions-objects.md#ordersv2object).

```json
{
  "pagination": {
    "startsAfter": "",
    "limit": 1000
  },
  "data": [
    {
      "orderId": "905910d8-ad90-42f6-91af-910defeae2ad",
      "remainingQtyBase": 0,
      "tradeSize": 0.1,
      "exchangeOrderId": "-",
      "tradePriceAvg": 71874.9,
      "fillPct": 100,
      "finalizeReturnedQtyBase": 0,
      "tradeSide": "buy",
      "exchangeClientOrderId": "-",
      "tradeTime": 1712618352305,
      "childOrderCount": 0,
      "itemDateTime": 1712618353772,
      "baseSymbol": "USD",
      "strategy": "RFQ",
      "fillQtyQuote": 0.1,
      "usernameRef": "-",
      "fillQtyBase": 7187.49,
      "accountId": "CA1000051R",
      "exchangePair": "aquax-BTC-USD",
      "symbol": "BTC-USD",
      "tradeStatus": "COMPLETE",
      "commissionRate": 0,
      "createdAt": 1712618352379,
      "message": "-",
      "priceLimit": 71874.9,
      "quoteSymbol": "BTC",
      "remainingQtyQuote": 0,
      "orderIdParent": "905910d8-ad90-42f6-91af-910defeae2ad",
      "orderType": "parentOrder",
      "updatedAt": 1712618353772,
      "exchange": "aquax",
      "tradeDuration": 30,
      "username": "helloWorld",
      "fillFeeQuoteAqua": 0
    },
    {
      "orderId": "b6cf97fb-f906-4fef-a12e-a320e34c2527",
      "remainingQtyBase": 0,
      "tradeSize": 100,
      "exchangeOrderId": "-",
      "tradePriceAvg": 1,
      "fillPct": 100,
      "finalizeReturnedQtyBase": 0,
      "tradeSide": "buy",
      "exchangeClientOrderId": "-",
      "tradeTime": 1712615969854,
      "childOrderCount": 0,
      "itemDateTime": 1712615971165,
      "baseSymbol": "USD",
      "strategy": "RFQ",
      "fillQtyQuote": 100,
      "usernameRef": "-",
      "fillQtyBase": 100,
      "accountId": "CA1000051R",
      "exchangePair": "aquax-USDT-USD",
      "symbol": "USDT-USD",
      "tradeStatus": "COMPLETE",
      "commissionRate": 0,
      "createdAt": 1712615969901,
      "message": "-",
      "priceLimit": 1,
      "quoteSymbol": "USDT",
      "remainingQtyQuote": 0,
      "orderIdParent": "b6cf97fb-f906-4fef-a12e-a320e34c2527",
      "orderType": "parentOrder",
      "updatedAt": 1712615971165,
      "exchange": "aquax",
      "tradeDuration": 30,
      "username": "helloWorld",
      "fillFeeQuoteAqua": 0
    },
    {
      "orderId": "e76ed244-6a72-464c-beff-6f57f7c7978c",
      "remainingQtyBase": 0,
      "tradeSize": 0.0836481758,
      "exchangeOrderId": "-",
      "tradePriceAvg": 71729,
      "fillPct": 100,
      "finalizeReturnedQtyBase": 0,
      "tradeSide": "sell",
      "exchangeClientOrderId": "-",
      "tradeTime": 1712615254394,
      "childOrderCount": 0,
      "itemDateTime": 1712615255735,
      "baseSymbol": "BTC",
      "strategy": "RFQ",
      "fillQtyQuote": 6000,
      "usernameRef": "-",
      "fillQtyBase": 0.0836481758,
      "accountId": "CA1000051R",
      "exchangePair": "aquax-BTC-USD",
      "symbol": "BTC-USD",
      "tradeStatus": "COMPLETE",
      "commissionRate": 0,
      "createdAt": 1712615254433,
      "message": "-",
      "priceLimit": 71729,
      "quoteSymbol": "USD",
      "remainingQtyQuote": 0,
      "orderIdParent": "e76ed244-6a72-464c-beff-6f57f7c7978c",
      "orderType": "parentOrder",
      "updatedAt": 1712615255735,
      "exchange": "aquax",
      "tradeDuration": 30,
      "username": "helloWorld",
      "fillFeeQuoteAqua": 0
    },
    {
      "orderId": "242aa1e3-3bc4-4725-a4ec-781739cd8431",
      "remainingQtyBase": 0,
      "tradeSize": 1,
      "exchangeOrderId": "-",
      "tradePriceAvg": 3689.65,
      "fillPct": 100,
      "finalizeReturnedQtyBase": 0,
      "tradeSide": "sell",
      "exchangeClientOrderId": "-",
      "tradeTime": 1712610345382,
      "childOrderCount": 0,
      "itemDateTime": 1712610346741,
      "baseSymbol": "ETH",
      "strategy": "RFQ",
      "fillQtyQuote": 3689.65,
      "usernameRef": "-",
      "fillQtyBase": 1,
      "accountId": "CA1000051R",
      "exchangePair": "aquax-ETH-USD",
      "symbol": "ETH-USD",
      "tradeStatus": "COMPLETE",
      "commissionRate": 0,
      "createdAt": 1712610345395,
      "message": "-",
      "priceLimit": 3689.65,
      "quoteSymbol": "USD",
      "remainingQtyQuote": 0,
      "orderIdParent": "242aa1e3-3bc4-4725-a4ec-781739cd8431",
      "orderType": "parentOrder",
      "updatedAt": 1712610346741,
      "exchange": "aquax",
      "tradeDuration": 30,
      "username": "helloWorld",
      "fillFeeQuoteAqua": 0
    },
    {
      "orderId": "8004ae83-d201-4b10-8881-364f84f7d678",
      "remainingQtyBase": 0,
      "tradeSize": 0.1,
      "exchangeOrderId": "-",
      "tradePriceAvg": 71755.72,
      "fillPct": 100,
      "finalizeReturnedQtyBase": 0,
      "tradeSide": "buy",
      "exchangeClientOrderId": "-",
      "tradeTime": 1712610305889,
      "childOrderCount": 0,
      "itemDateTime": 1712610307488,
      "baseSymbol": "USD",
      "strategy": "RFQ",
      "fillQtyQuote": 0.1,
      "usernameRef": "-",
      "fillQtyBase": 7175.572,
      "accountId": "CA1000051R",
      "exchangePair": "aquax-BTC-USD",
      "symbol": "BTC-USD",
      "tradeStatus": "COMPLETE",
      "commissionRate": 0,
      "createdAt": 1712610305967,
      "message": "-",
      "priceLimit": 71755.72,
      "quoteSymbol": "BTC",
      "remainingQtyQuote": 0,
      "orderIdParent": "8004ae83-d201-4b10-8881-364f84f7d678",
      "orderType": "parentOrder",
      "updatedAt": 1712610307488,
      "exchange": "aquax",
      "tradeDuration": 30,
      "username": "helloWorld",
      "fillFeeQuoteAqua": 0
    }
  ]
}
```

{% endtab %}

{% tab title="200: OK No results found" %}

```json
{
  "pagination": {
    "startsAfter": "",
    "limit": 1000
  },
  "data": []
}
```

{% endtab %}

{% tab title="401: Unauthorized Unauthorized, missing API key or signature" %}

```json
{
    "errors": [
        {
            "id": "19a58d88-f605-457a-be64-3e13242e37e1",
            "message": "Unauthorized"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Endpoint to initiate an LIMIT/GTC/GTD request to Aquanow.

<mark style="color:green;">`POST`</mark> `https://api.aquanow.io/trades/v2/order`

<mark style="color:orange;">NOTE:</mark> Either **deliverQuantity** or **receiveQuantity** must be specified. If both are specified, receiveQuantity will be considered for sell orders, and deliverQuantity will be considered for buy orders.

If order is not filled, the request will return a 200 response with receiveQuantity and deliverQuantity set to 0.

To view example requests for this endpoint, visit Aquanow's [Postman](https://developer.aquanow.io/#8bc626a6-97e7-4421-a62c-8bb19ab1ee15) documentation.

#### Headers

| Name                                           | Type   | Description                                                                                                                                                        |
| ---------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| x-api-key<mark style="color:red;">\*</mark>    | String | <p><code>{{x-api-key}}</code></p><p>API Auth Key</p>                                                                                                               |
| x-signature<mark style="color:red;">\*</mark>  | String | <p><code>49c6260c194f4d7ed5cb917dc70b9821673246b2abc1cf28f05df6a75fd24181e00f8e57b321d15ae45db58b3bffe27a</code></p><p>Signature created using your API secret</p> |
| x-nonce<mark style="color:red;">\*</mark>      | Number | <p><code>1618307861949</code></p><p>Timestamp in millisecond</p>                                                                                                   |
| Content-Type<mark style="color:red;">\*</mark> | String | `application/json`                                                                                                                                                 |

#### Request Body

| Name                                              | Type   | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ------------------------------------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| strategy<mark style="color:red;">\*</mark>        | String | `"LIMIT"`, `"GTC"` or `"GTD"`                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| accountId<mark style="color:red;">\*</mark>       | String | Identifier for account the order will be applied to.                                                                                                                                                                                                                                                                                                                                                                                                             |
| ticker<mark style="color:red;">\*</mark>          | String | <p>e.g., <code>BTC-CAD</code></p><p>Currency pair</p>                                                                                                                                                                                                                                                                                                                                                                                                            |
| tradeSide<mark style="color:red;">\*</mark>       | String | `"buy"` or `"sell"`                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| priceLimit<mark style="color:red;">\*</mark>      | String | Limit price of a ticker symbol, determined by `tradeSide` and `deliverQuantity`/`receiveQuantity`                                                                                                                                                                                                                                                                                                                                                                |
| deliverQuantity<mark style="color:red;">\*</mark> | String | <p><mark style="color:orange;">NOTE:</mark> specify either <code>deliverQuantity</code> or <code>receiveQuantity</code>.</p><p></p><p>Quantity of currency delivered by user based on the ticker and tradeSide. </p><p>For example, if ticker is <strong>BTC-USD</strong> and tradeSide is <strong>buy</strong>, then the delivered currency is <strong>USD.</strong> If tradeSide is <strong>sell,</strong> the delivered currency is <strong>BTC.</strong></p> |
| receiveQuantity<mark style="color:red;">\*</mark> | String | <p><mark style="color:orange;">NOTE:</mark> specify either <code>deliverQuantity</code> or <code>receiveQuantity</code>.</p><p></p><p>Quantity of currency received by user based on the ticker and tradeSide. </p><p>For example, if ticker is <strong>BTC-USD</strong> and tradeSide is <strong>buy</strong>, then the received currency is <strong>BTC.</strong> If tradeSide is <strong>sell,</strong> the received currency is <strong>USD.</strong></p>    |
| expirationTime<mark style="color:red;">\*</mark>  | Number | <p><mark style="color:orange;">NOTE:</mark> only required for <strong>GTD</strong> orders.</p><p></p><p>e.g., <code>1669972404350</code></p><p>Expiration time in milliseconds of when the pre-existing order will expire. Expiration time must be within 90 days of order creation.</p>                                                                                                                                                                         |
| usernameRef<mark style="color:red;">\*</mark>     | String | A new reference string for sub-accounts. Must be less than 64 characters, cannot contain special characters.                                                                                                                                                                                                                                                                                                                                                     |

{% tabs %}
{% tab title="200: OK LIMIT buy BTC with receiveQuantity" %}
Returns an [ExecutionsObject](/aquanow/legacy/data-objects-and-statuses/executions-objects/duration-order-objects.md).

```json
{
  "type": "limitOrderAck",
  "data": {
    "accountId": "CA1264810R",
    "quoteId": "44fa0d89-0b1c-4179-8a29-c4cd08030ba0",
    "quoteTime": 1738110845616,
    "expireTime": 1738197245616,
    "ticker": "BTC-USD",
    "tradeSide": "buy",
    "receiveCurrency": "BTC",
    "receiveQuantity": "0.02000000",
    "deliverCurrency": "USD",
    "deliverQuantity": "2020.93",
    "price": "102536.06"
  }
}
```

{% endtab %}

{% tab title="200: OK LIMIT sell BTC with deliverQuantity" %}
Returns an [ExecutionsObject](/aquanow/legacy/data-objects-and-statuses/executions-objects/duration-order-objects.md).

```json
{
  "type": "limitOrderAck",
  "data": {
    "accountId": "CA1264810R",
    "quoteId": "34bb8cea-314c-4fc0-83c8-fb5063d66a8f",
    "quoteTime": 1738091795908,
    "expireTime": 1738178195908,
    "ticker": "BTC-USD",
    "tradeSide": "sell",
    "receiveCurrency": "USD",
    "receiveQuantity": "1526847.30",
    "deliverCurrency": "BTC",
    "deliverQuantity": "15.00000000",
    "price": "102536.06"
  }
}
```

{% endtab %}

{% tab title="200: OK GTC sell BTC with deliverQuantity" %}
Returns an [ExecutionsObject](/aquanow/legacy/data-objects-and-statuses/executions-objects/duration-order-objects.md).

```json
{
  "type": "gtcOrderAck",
  "data": {
    "accountId": "CA1264810R",
    "quoteId": "9ce058ce-1cc3-47fe-8498-e2f565a52481",
    "quoteTime": 1738111104719,
    "expireTime": 1745887104719,
    "ticker": "BTC-USD",
    "tradeSide": "sell",
    "receiveCurrency": "USD",
    "receiveQuantity": "2012.74",
    "deliverCurrency": "BTC",
    "deliverQuantity": "0.02000000",
    "price": "102028.52"
  }
}
```

{% endtab %}

{% tab title="200: OK GTC sell BTC with receiveQuantity" %}
Returns an [ExecutionsObject](/aquanow/legacy/data-objects-and-statuses/executions-objects/duration-order-objects.md).

```json
{
  "type": "gtcOrderAck",
  "data": {
    "accountId": "CA1264810R",
    "quoteId": "9ce058ce-1cc3-47fe-8498-e2f565a52481",
    "quoteTime": 1738111104719,
    "expireTime": 1745887104719,
    "ticker": "BTC-USD",
    "tradeSide": "sell",
    "receiveCurrency": "USD",
    "receiveQuantity": "2012.74",
    "deliverCurrency": "BTC",
    "deliverQuantity": "0.02000000",
    "price": "102028.52"
  }
}
```

{% endtab %}

{% tab title="200: OK GTD buy BTC with deliverQuantity" %}
Returns an [ExecutionsObject](/aquanow/legacy/data-objects-and-statuses/executions-objects/duration-order-objects.md).

```json
{
  "type": "gtdOrderAck",
  "data": {
    "accountId": "CA1264810R",
    "quoteId": "0c317868-3207-4f94-ad5a-47635cf00a85",
    "quoteTime": 1738092098363,
    "expireTime": 1738351211363,
    "ticker": "BTC-USD",
    "tradeSide": "buy",
    "receiveCurrency": "BTC",
    "receiveQuantity": "0.01000000",
    "deliverCurrency": "USD",
    "deliverQuantity": "1023.15",
    "price": "102299.79"
  }
}
```

{% endtab %}

{% tab title="200: OK GTD sell BTC with receiveQuantity" %}
Returns an [ExecutionsObject](/aquanow/legacy/data-objects-and-statuses/executions-objects/duration-order-objects.md).

```json
{
  "type": "gtdOrderAck",
  "data": {
    "accountId": "CA1264810R",
    "quoteId": "566b0333-c7d4-4086-8c04-5ab3a6a29280",
    "quoteTime": 1738092132480,
    "expireTime": 1738351211480,
    "ticker": "BTC-USD",
    "tradeSide": "sell",
    "receiveCurrency": "USD",
    "receiveQuantity": "100.00",
    "deliverCurrency": "BTC",
    "deliverQuantity": "0.00098161",
    "price": "102299.79"
  }
}
```

{% endtab %}

{% tab title="200: OK Insufficient funds" %}
Returns an [ExecutionsObject](/aquanow/legacy/data-objects-and-statuses/executions-objects/duration-order-objects.md#executionsobject).

```json
{
  "errors": [
    {
      "id": "ea640ecc-0b9f-4857-9535-a45c0a6753da",
      "message": "Insufficient Trade Credit"
    }
  ]
}
```

{% endtab %}

{% tab title="400: Bad Request GTD order error, invalid expirationTime" %}

```json
{
  "errors": [
    {
      "id": "ea640ecc-0b9f-4857-9535-a45c0a6753da",
      "message": "expirationTime should be within 90 days from now: 1869972405009"
    }
  ]
}
```

{% endtab %}

{% tab title="400: Bad Request GTD order error, missing expirationTime" %}

```json
{
  "errors": [
    {
      "id": "60a6a307-d980-43f5-b2cb-9b7d6c6af935",
      "message": "data must have required property 'expirationTime'"
    }
  ]
}
```

{% endtab %}

{% tab title="400: Bad Request Invalid ticker" %}

```json
{
  "errors": [
    {
      "id": "60a6a307-d980-43f5-b2cb-9b7d6c6af935",
      "message": "data/ticker must be equal to one of the allowed values"
    }
  ]
}
```

{% endtab %}

{% tab title="400: Bad Request Trade size below minimum" %}

```json
{
  "errors": [
    {
      "id": "60a6a307-d980-43f5-b2cb-9b7d6c6af935",
      "message": "Trade size must be bigger than minimum size 1e-7. You submitted: 1e-9"
    }
  ]
}
```

{% endtab %}

{% tab title="400: Bad Request Invalid trade side" %}

```json
{
  "errors": [
    {
      "id": "60a6a307-d980-43f5-b2cb-9b7d6c6af935",
      "message": "data/tradeSide must be equal to one of the allowed values"
    }
  ]
}
```

{% endtab %}

{% tab title="403: Forbidden User doesn't have trade permission" %}

```json
{
  "errors": [
    {
      "id": "60a6a307-d980-43f5-b2cb-9b7d6c6af935",
      "message": "Access Denied"
    }
  ]
}
```

{% endtab %}

{% tab title="502: Bad Gateway Strategy not enabled" %}

```json
{
  "errors": [
    {
      "id": "60a6a307-d980-43f5-b2cb-9b7d6c6af935",
      "message": "User not authorized for LIMIT"
    }
  ]
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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://docs.aquanow.io/aquanow/legacy/api-endpoints-or-v2.0/executions-api.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.
