Add Order Batch
POST/private/AddOrderBatch
Sends a collection of orders (minimum of 2 and maximum 15):
- If any orders are rejected due to validation errors, the remainder of the batch will continue to be processed.
- All orders in batch should be limited to a single pair.
- The order of returned txid's in the response array is the same as the order of the order list sent in request.
Note: See the AssetPairs endpoint for details on the available trading pairs, their price and quantity precisions, order minimums, available leverage, etc.
API Key Permissions Required: Orders and trades - Create & modify orders
and Orders and trades - Cancel & close orders
Request
- application/json
Body
required
- Array [
- Long UUID:
6d1b345e-2821-40e2-ad83-4ecb18a06876
32 hex characters separated with 4 dashes. - Short UUID:
da8e4ad59b78481c93e589746b0cf91f
32 hex characters with no dashes. - Free text:
arb-20240509-00010
Free format ascii text up to 18 characters. - Limit price for
limit
andiceberg
orders - Trigger price for
stop-loss
,stop-loss-limit
,take-profit
, andtake-profit-limit
orders - Relative Prices: Either
price
orprice2
can be preceded by+
,-
, or#
to specify the order price as an offset relative to the last traded price.+
adds the amount to, and-
subtracts the amount from the last traded price.#
will either add or subtract the amount to the last traded price, depending on the direction and order type used. Prices can also be suffixed with a%
to signify the relative amount as a percentage, rather than an absolute price difference. - Limit price for
stop-loss-limit
andtake-profit-limit
- To keep triggers serviceable, the last price will be used as fallback reference price during connectivity issues with external index feeds.
cancel-newest
- if self trade is triggered, arriving order will be canceledcancel-oldest
- if self trade is triggered, resting order will be canceledcancel-both
- if self trade is triggered, both arriving and resting orders will be canceled- •
post
post-only order (available when ordertype = limit) - •
fcib
prefer fee in base currency (default if selling) - •
fciq
prefer fee in quote currency (default if buying, mutually exclusive withfcib
) - •
nompp
disable market price protection for market orders - •
viqc
order volume expressed in quote currency. This option is supported only for buy market orders. Also not available on margin orders. 0
now (default)+<n>
schedule start timeseconds from now <n>
= unix timestamp of start time0
no expiration (default)+<n>
= expireseconds from now, minimum 5 seconds <n>
= unix timestamp of expiration time- ]
Nonce used in construction of API-Sign
header
orders object[]required
User reference id
userref
is an optional user-specified integer id that can be associated with any number of orders. Many clients choose a userref
corresponding to a unique integer id generated by their systems (e.g. a timestamp). However, because we don't enforce uniqueness on our side, it can also be used to easily group orders by pair, side, strategy, etc. This allows clients to more readily cancel or query information about orders in a particular group, with fewer API calls by using userref
instead of our txid
, where supported.
Adds an alphanumeric client order identifier which uniquely identifies an open order for each client. This field is mutually exclusive with userref
parameter.
The cl_ord_id
parameter can be one of the following formats:
Possible values: [market
, limit
, iceberg
, stop-loss
, take-profit
, stop-loss-limit
, take-profit-limit
, trailing-stop
, trailing-stop-limit
, settle-position
]
Order type
Possible values: [buy
, sell
]
Order direction (buy/sell)
Order quantity in terms of the base asset
Note: Volume can be specified as
0
for closing margin orders to automatically fill the requisite quantity.
For iceberg
orders only, it defines the quantity to show in the book while the rest of order quantity remains hidden. Minimum value is 1 / 15 of volume
.
Price:
Notes:
Secondary Price:
Possible values: [index
, last
]
Default value: last
Price signal used to trigger stop-loss
, stop-loss-limit
, take-profit
, and take-profit-limit
orders
Notes:
Amount of leverage desired (default: none)
If true
, order will only reduce a currently open position, not increase it or open a new position.
Possible values: [cancel-newest
, cancel-oldest
, cancel-both
]
Default value: cancel-newest
Self trade prevention behaviour definition:
Comma delimited list of order flags
Possible values: [GTC
, IOC
, GTD
]
Default value: GTC
Time-in-force of the order to specify how long it should remain in the order book before being cancelled. GTC (Good-'til-cancelled) is default if the parameter is omitted. IOC (immediate-or-cancel) will immediately execute the amount possible and cancel any remaining balance rather than resting in the book. GTD (good-'til-date), if specified, must coincide with a desired expiretm
.
Scheduled start time, can be specified as an absolute timestamp or as a number of seconds in the future:
Expiry time on GTD orders can be set up to one month in future, it is specified as an absolute timestamp or as a number of seconds from now:
Asset pair id
or altname
RFC3339 timestamp (e.g. 2021-04-01T00:18:45Z) after which the matching engine should reject the new order request, in presence of latency or order queueing. min now() + 2 seconds, max now() + 60 seconds.
Validate inputs only. Do not submit order.
Responses
- 200
Orders added.
- application/json
- Schema
- Example (from schema)
- Limits, one with conditional stop-loss
Schema
- Array [
- ]
result object
orders object[]
descr object
Order description info
Error description from individual order processing
Transaction ID for order
(if order was added successfully)
{
"error": [],
"result": {
"orders": [
{
"txid": "65LRD3-AHGRA-YAH8E5",
"descr": {
"order": "buy 1.02010000 XBTUSD @ limit 29000.0"
}
},
{
"txid": "OK8HFF-5J2PL-XLR17S",
"descr": {
"order": "sell 0.14000000 XBTUSD @ limit 40000.0"
}
}
]
}
}
{
"error": [],
"result": {
"orders": [
{
"txid": "O5OR23-ADFAD-Y2G61C",
"descr": {
"order": "buy 0.80300000 XBTUSD @ limit 28300.0"
},
"close": "close position @ stop loss 27000.0 -> limit 26000.0"
},
{
"txid": "9K6KFS-5H3PL-XBRC7A",
"descr": {
"order": "sell 0.10500000 XBTUSD @ limit 36000.0"
}
}
]
}
}