Orders
The orders API contains private endpoints for submitting orders and querying order state. Requires a base64-encoded SHA256 HMAC signature as defined in Authentication.
Submitting Orders
| HTTP Method | Endpoint |
|---|---|
POST | /orders |
Orders on the Bitnomial Exchange are bids to buy a product, or asks to sell that product. Beyond the order price and quantity requested, an order is treated differently based on its time-in-force, of which there are three:
- immediate-or-cancel (IOC) orders will be cancelled if they cannot be matched immediately;
- day orders are valid until they either match, get cancelled explicitly by the user, or the end of the daily trading session is reached.
- good-till-cancel (GTC) orders are valid until they match, get cancelled explicitly by the user, or the product they refer to is no longer listed.
Note: Order submissions are currently only available in the production environment.
Request Parameters
The supported query parameters are:
| Parameter | Optionality | Notes |
|---|---|---|
account_id | required | Account code assigned by your clearing firm. |
short_clearing_firm_name | required | Short code associated with your clearing firm. |
The body of the POST request is a JSON object, expected to have the following fields:
| Field | Notes |
|---|---|
product_symbol | Symbol of the product. See the Product API to get a view of available products in real-time. |
side | Side of the order, i.e. whether this order is a bid or ask. |
price | Price of the bid or ask in ticks. See the Product API for the conversion between price and tick of any product. See the WebSocket Protocol to keep track of recent prices by product. |
quantity_requested | Amount of contracts requested, which must be strictly greater than 0. |
time_in_force | Order time-in-force. See above for a description of the semantics of time-in-force. |
The schema of the body of the request is formally defined as:
;
;
;
Querying Order State
| HTTP Method | Endpoint |
|---|---|
GET | /orders |
The endpoint supports the following query parameters:
| Parameter | Optionality | Notes |
|---|---|---|
symbol | optional | Filter orders by product symbol, only works in production |
product_id | optional | Filter orders by product ID, only works in production |
product_type | optional | Filter orders by product type, only works in production |
clearing_firm_code | optional | Filter orders by clearing firm code, only works in production |
account_id | optional | Filter orders by account code, only works in production |
connection_id | optional | Filter orders by connection ID, only works in production |
day | optional | Get range for day, overrides begin_time and end_time |
limit | optional | Limit number of orders per page |
begin_time | optional | Begin time for order time range, see Time for more details |
end_time | optional | End time for order time range, see Time for more details |
order | optional | Page order, either asc or desc |
cursor | optional | Cursor string for paginated query |
The endpoint returns a pagination response of the type Pagination<Order, CursorInfo>. More details
on paginated APIs can be found in Pagination.
Order is defined as follows:
;
;
;
;
Start Trading
Trade US Perpetual Futures, Physical Futures, and Options on the Bitcoin Complex®, XRP, ETH, SOL, and more.