> For the complete documentation index, see [llms.txt](https://docs.aevo.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aevo.xyz/api-reference/urls/private-api/postorders.md).

# POST /orders

Creates a new order.

`POST https://api.aevo.xyz/orders`

> **Authentication required.** Include your `AEVO-KEY` and `AEVO-SECRET` headers. See [Authentication](/api-reference/urls/authentication.md).

## Body Parameters

| Field                   | Type    | Required | Description                                                                                                                                          |
| ----------------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `instrument`            | integer | Yes      | Instrument ID number. Example: `12`                                                                                                                  |
| `maker`                 | string  | Yes      | Account's Ethereum address. Example: `0xE9b3a48d15BE316A8e34FAd53fFDFDddf0C3D24b`                                                                    |
| `is_buy`                | boolean | Yes      | True for long order, false for short order. Example: `True`                                                                                          |
| `amount`                | string  | Yes      | Number of contracts. In 6 decimals fixed number. Example: `1000000`                                                                                  |
| `limit_price`           | string  | Yes      | Order limit price. In 6 decimals fixed number. Example: `1000000`                                                                                    |
| `salt`                  | string  | Yes      | A randomly generated number to guarantee transaction uniqueness. In 6 decimals fixed number. Example: `12345678`                                     |
| `signature`             | string  | Yes      | Hash of order payload signature signed by the account. Example: `0x4c55895aa6f2dfc2da8189a71a054348ce63abbc1ae27267977e0d9cc6848e91`                 |
| `timestamp`             | string  | Yes      | Timestamp used in order signing in UNIX timestamp in seconds. Example: `1680249600`                                                                  |
| `post_only`             | boolean | No       | True for post-only maker orders, false for standard orders. Example: `False`                                                                         |
| `reduce_only`           | boolean | No       | True for reduce-only orders, false for standard orders. Example: `False`                                                                             |
| `time_in_force`         | string  | No       | Can be set to GTC or IOC (GTC is set by default)                                                                                                     |
| `mmp`                   | boolean | No       | Flag to include order into MMP. Example: `False`                                                                                                     |
| `stop`                  | string  | No       | Type of stop order.                                                                                                                                  |
| `trigger`               | string  | No       | The price to trigger the stop order at. `stop` is required when `trigger` is specified. Example: `1836.74`                                           |
| `close_position`        | boolean | No       | Is order a close position TPSL order. Example: `True`                                                                                                |
| `partial_position`      | boolean | No       | Is order a partial position TPSL order. Example: `False`                                                                                             |
| `parent_order_id`       | string  | No       | Order ID of the order which when cancelled, cancels this order as well Example: `0x4c43e0ab72a4edb72dfe4b129148899815d816837b9a7e22d964b884834639f8` |
| `perps_plus`            | boolean | No       | Whether this options order is part of a perps plus position Example: `False`                                                                         |
| `self_trade_prevention` | string  | No       | Can be set to EXPIRE\_NONE, EXPIRE\_MAKER OR EXPIRE\_TAKER (EXPIRE\_NONE is set by default)                                                          |

## Example Request

```bash
curl --request POST \
     --url https://api.aevo.xyz/orders \
     --header 'accept: application/json' \
     --header 'AEVO-KEY: <your-api-key>' \
     --header 'AEVO-SECRET: <your-api-secret>' \
     --header 'content-type: application/json' \
     --data '{ ... }'
```

## Responses

**`200`** — Order created.

| Field                   | Type    | Required | Description                                                                                                                                          |
| ----------------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `order_id`              | string  | Yes      | Order ID is the hash of the order payload Example: `0x4c43e0ab72a4edb72dfe4b129148899815d816837b9a7e22d964b884834639f8`                              |
| `account`               | string  | Yes      | Account's Ethereum address. Example: `0xE9b3a48d15BE316A8e34FAd53fFDFDddf0C3D24b`                                                                    |
| `instrument_id`         | string  | Yes      | Instrument ID number. Example: `12`                                                                                                                  |
| `instrument_name`       | string  | Yes      | Instrument name. Example: `ETH-30JUN23-1600-C`                                                                                                       |
| `instrument_type`       | string  | Yes      | Type of instrument. Example: `OPTION`                                                                                                                |
| `order_type`            | string  | Yes      | Order type. Example: `limit`                                                                                                                         |
| `side`                  | string  | Yes      | Trade side. Example: `buy`                                                                                                                           |
| `amount`                | string  | Yes      | Number of contracts. In 6 decimals fixed number. Example: `1000000`                                                                                  |
| `price`                 | string  | Yes      | Limit price for the order. Example: `12.34`                                                                                                          |
| `avg_price`             | string  | Yes      | Average entry price of the position. Example: `12.23`                                                                                                |
| `filled`                | string  | Yes      | Amount filled. Example: `12.23`                                                                                                                      |
| `order_status`          | string  | Yes      | Order status. Example: `filled`                                                                                                                      |
| `post_only`             | boolean | No       | True for post-only maker orders, false for standard orders. Example: `false` Example: `False`                                                        |
| `reduce_only`           | boolean | No       | True for reduce-only orders, false for standard orders. Example: `false` Example: `False`                                                            |
| `initial_margin`        | string  | No       | Margin required to keep an open order. Example: `12.23`                                                                                              |
| `option_type`           | string  | No       | Type of option contract. Example: `call`                                                                                                             |
| `iv`                    | string  | No       | Option's implied volatility. Example: `0.23`                                                                                                         |
| `expiry`                | string  | No       | Option expiry in UNIX timestamp in nanoseconds. Example: `1680249600000000000`                                                                       |
| `strike`                | string  | No       | Option strike price. Example: `2500`                                                                                                                 |
| `created_timestamp`     | string  | No       | Created timestamp in UNIX timestamp in nanoseconds. Example: `1680249600000000000`                                                                   |
| `timestamp`             | string  | Yes      | Timestamp in UNIX in nanoseconds. Example: `1680249600000000000`                                                                                     |
| `system_type`           | string  | Yes      | Can be set to API or WEB (API is set by default) Example: `API`                                                                                      |
| `time_in_force`         | string  | No       | Can be set to GTC or IOC (GTC is set by default) Example: `GTC`                                                                                      |
| `stop`                  | string  | No       | Type of stop order. Example: `STOP_LOSS`                                                                                                             |
| `trigger`               | string  | No       | The price to trigger the stop order at. `stop` is required when `trigger` is specified. Example: `1836.74`                                           |
| `close_position`        | boolean | No       | Is order a close position TPSL order. Example: `true` Example: `True`                                                                                |
| `partial_position`      | boolean | No       | Is order a partial position TPSL order. Example: `false` Example: `False`                                                                            |
| `isolated_margin`       | string  | No       | The change in isolated margin assigned to a position. In 6 decimals fixed number. Negative allowed. Example: `10000000`                              |
| `parent_order_id`       | string  | No       | Order ID of the order which when cancelled, cancels this order as well Example: `0x4c43e0ab72a4edb72dfe4b129148899815d816837b9a7e22d964b884834639f8` |
| `self_trade_prevention` | string  | No       | Can be set to EXPIRE\_NONE, EXPIRE\_MAKER OR EXPIRE\_TAKER (EXPIRE\_NONE is set by default) Example: `EXPIRE_NONE`                                   |
| `is_twap`               | boolean | No       | True if this is a TWAP order Example: `true` Example: `True`                                                                                         |
| `twap_total_amount`     | string  | No       | Total amount to execute for TWAP order (6 decimals) Example: `10000000`                                                                              |
| `twap_executed`         | string  | No       | Amount executed so far for TWAP order (6 decimals) Example: `5000000`                                                                                |
| `twap_remaining`        | string  | No       | Remaining amount to execute for TWAP order (6 decimals) Example: `5000000`                                                                           |
| `twap_slices_total`     | string  | No       | Total number of slices for TWAP order Example: `10`                                                                                                  |
| `twap_slices_executed`  | string  | No       | Number of slices executed for TWAP order Example: `5`                                                                                                |
| `twap_duration_seconds` | string  | No       | Total duration of TWAP order in seconds Example: `3600`                                                                                              |
| `twap_interval_seconds` | string  | No       | Interval between slices in seconds Example: `36`                                                                                                     |
| `twap_avg_price`        | string  | No       | Volume-weighted average price of executed slices Example: `3500000000`                                                                               |

**`400`** — Bad request.

| Field   | Type   | Required | Description                                     |
| ------- | ------ | -------- | ----------------------------------------------- |
| `error` | string | Yes      | Error message. Example: `ERR_MALFORMED_REQUEST` |

**`401`** — Unauthorized.

| Field   | Type   | Required | Description                            |
| ------- | ------ | -------- | -------------------------------------- |
| `error` | string | Yes      | Error message. Example: `UNAUTHORIZED` |

**`429`** — Rate limit exceeded.

| Field   | Type   | Required | Description                                   |
| ------- | ------ | -------- | --------------------------------------------- |
| `error` | string | Yes      | Error message. Example: `RATE_LIMIT_EXCEEDED` |

**`500`** — Internal server error.

| Field   | Type   | Required | Description                              |
| ------- | ------ | -------- | ---------------------------------------- |
| `error` | string | Yes      | Error message. Example: `INTERNAL_ERROR` |
