Send order
POST/sendorder
This endpoint allows sending a limit, stop, take profit or immediate-or-cancel order for a currently listed Futures contract.
Request
- application/json
Body
required
lmt
- a limit orderpost
- a post-only limit ordermkt
- an immediate-or-cancel order with 1% price protectionstp
- a stop ordertake_profit
- a take profit orderioc
- an immediate-or-cancel ordertrailing_stop
- a trailing stop ordermark
- the mark priceindex
- the index pricelast
- the last executed trade
The time before which the request should be processed, otherwise it is rejected.
Possible values: [lmt
, post
, ioc
, mkt
, stp
, take_profit
, trailing_stop
]
The order type:
The symbol of the Futures
Possible values: [buy
, sell
]
The direction of the order
The size associated with the order. Note that different Futures have different contract sizes.
The limit price associated with the order. Note that for stop orders, limitPrice denotes the worst price at
which the stp
or take_profit
order can get filled at. If no limitPrice
is
provided the stp
or take_profit
order will trigger a market order. If placing a trailing_stop
order then leave undefined.
The stop price associated with a stop or take profit order.
Required if orderType is stp
or take_profit
, but if placing a trailing_stop
then
leave undefined. Note that for stop orders, limitPrice denotes the worst price at
which the stp
or take_profit
order can get filled at. If no limitPrice
is
provided the stp
or take_profit
order will trigger a market order.
The order identity that is specified from the user. It must be globally unique.
Possible values: [mark
, spot
, last
]
If placing a stp
, take_profit
or trailing_stop
, the signal used for trigger.
Set as true if you wish the order to only reduce an existing position.
Any order which increases an existing position will be rejected. Default false.
Required if the order type is trailing_stop
. Maximum value of 50%, minimum value of 0.1% for 'PERCENT' 'maxDeviationUnit'.
Is the maximum distance the trailing stop's trigger price may trail behind the requested trigger signal. It defines the threshold at which the trigger price updates.
Possible values: [PERCENT
, QUOTE_CURRENCY
]
Required if the order type is trailing_stop
.
This defines how the trailing trigger price is calculated from the requested trigger signal. For example, if the max deviation is set to 10, the unit is 'PERCENT', and the underlying order is a sell, then the trigger price will never be more then 10% below the trigger signal. Similarly, if the deviation is 100, the unit is 'QUOTE_CURRENCY', the underlying order is a sell, and the contract is quoted in USD, then the trigger price will never be more than $100 below the trigger signal.
Can only be set for triggers, e.g. order types take_profit
, stop
and trailing_stop
.
If set, limitPriceOffsetUnit
must be set as well.
This defines a relative limit price depending on the trigger stopPrice
. The price is determined
when the trigger is activated by the triggerSignal
. The offset can be positive or negative, there
might be restrictions on the value depending on the limitPriceOffsetUnit
.
Possible values: [QUOTE_CURRENCY
, PERCENT
]
Can only be set together with limitPriceOffsetValue
.
This defines the unit for the relative limit price distance from the trigger's stopPrice
.
Responses
- 200
- application/json
- Schema
- placed
- rejected
- executed
Schema
- Success Response
- ErrorResponse
- Array [
- PlaceEvent
- CancelEvent
- EditEvent
- RejectEvent
- ExecuteEvent
- PlaceTriggerEvent
- CancelTriggerEvent
- RejectTriggerEvent
- OrderJson
- OrderJson
POST_WOULD_EXECUTE
- The post-only order would be filled upon placement, thus is cancelled.IOC_WOULD_NOT_EXECUTE
- The immediate-or-cancel order would not execute.- OrderJson
- OrderTriggerJson
- OrderTriggerJson
- ]
placed
- the order was placed successfullycancelled
- the order was cancelled successfullyinvalidOrderType
- the order was not placed because orderType is invalidinvalidSide
- the order was not placed because side is invalidinvalidSize
- the order was not placed because size is invalidinvalidPrice
- the order was not placed because limitPrice and/or stopPrice are invalidinsufficientAvailableFunds
- the order was not placed because available funds are insufficientselfFill
- the order was not placed because it would be filled against an existing order belonging to the same accounttooManySmallOrders
- the order was not placed because the number of small open orders would exceed the permissible limitmaxPositionViolation
- Order would cause you to exceed your maximum position in this contract.marketSuspended
- the order was not placed because the market is suspendedmarketInactive
- the order was not placed because the market is inactiveclientOrderIdAlreadyExist
- the specified client id already existclientOrderIdTooLong
- the client id is longer than the permissible limitoutsidePriceCollar
- the order would have executed outside of the price collar for its order typepostWouldExecute
- the post-only order would be filled upon placement, thus is cancellediocWouldNotExecute
- the immediate-or-cancel order would not execute.wouldCauseLiquidation
- returned when a new order would fill at a worse price than the mark price, causing the portfolio value to fall below maintenance margin and triggering a liquidation.wouldNotReducePosition
- the reduce only order would not reduce position.wouldProcessAfterSpecifiedTime
- order would be processed after the time specified inprocessBefore
parameter.accountInactive
: The Futures account the request refers to is inactiveapiLimitExceeded
: The API limit for the calling IP address has been exceededauthenticationError
: The request could not be authenticatedinsufficientFunds
: The amount requested for transfer is below the amount of funds availableinvalidAccount
: The Futures account the transfer request refers to is invalidinvalidAmount
: The amount the transfer request refers to is invalidinvalidArgument
: One or more arguments provided are invalidinvalidUnit
: The unit the transfer request refers to is invalidJson Parse Error
: The request failed to pass valid JSON as an argumentmarketUnavailable
: The market is currently unavailablenonceBelowThreshold
: The provided nonce is below the thresholdnonceDuplicate
: The provided nonce is a duplicate as it has been used in a previous requestnotFound
: The requested information could not be foundrequiredArgumentMissing
: One or more required arguments are missingServer Error
: There was an error processing the requestUnavailable
: The endpoint being called is unavailableunknownError
: An unknown error has occurred
sendStatus object
A structure containing information on the send order request.
The unique client order identifier. This field is returned only if the order has a client order ID.
orderEvents object[]
Possible values: [PLACE
]
Always PLACE
.
order object
The placed order.
The UID associated with the order.
The client order id or null if order does not have one.
Possible values: [lmt
, ioc
, post
, liquidation
, assignment
, stp
, unwind
, block
]
The order type
The symbol of the Futures.
Possible values: [buy
, sell
]
The side associated with the order
The quantity (size) associated with the order.
The total amount of the order that has been filled.
The limit price associated with a limit order.
Is the order a reduce only order or not.
The date and time the order was placed.
The date and time the order was edited.
The amount of quantity that was removed before placement or null if the order is not a reduce only.
Possible values: [CANCEL
]
Always CANCEL
.
The UID associated with the order.
order object
The UID associated with the order.
The client order id or null if order does not have one.
Possible values: [lmt
, ioc
, post
, liquidation
, assignment
, stp
, unwind
, block
]
The order type
The symbol of the Futures.
Possible values: [buy
, sell
]
The side associated with the order
The quantity (size) associated with the order.
The total amount of the order that has been filled.
The limit price associated with a limit order.
Is the order a reduce only order or not.
The date and time the order was placed.
The date and time the order was edited.
Possible values: [EDIT
]
Always EDIT
.
old object
The order before the edit was applied.
The UID associated with the order.
The client order id or null if order does not have one.
Possible values: [lmt
, ioc
, post
, liquidation
, assignment
, stp
, unwind
, block
]
The order type
The symbol of the Futures.
Possible values: [buy
, sell
]
The side associated with the order
The quantity (size) associated with the order.
The total amount of the order that has been filled.
The limit price associated with a limit order.
Is the order a reduce only order or not.
The date and time the order was placed.
The date and time the order was edited.
new object
The order after the edit was applied.
The UID associated with the order.
The client order id or null if order does not have one.
Possible values: [lmt
, ioc
, post
, liquidation
, assignment
, stp
, unwind
, block
]
The order type
The symbol of the Futures.
Possible values: [buy
, sell
]
The side associated with the order
The quantity (size) associated with the order.
The total amount of the order that has been filled.
The limit price associated with a limit order.
Is the order a reduce only order or not.
The date and time the order was placed.
The date and time the order was edited.
The amount of quantity that was removed from the edited order or null if the order is not a reduce only.
Possible values: [REJECT
]
Always REJECT
.
The UID associated with the order.
order object
The UID associated with the order.
The client order id or null if order does not have one.
Possible values: [lmt
, ioc
, post
, liquidation
, assignment
, stp
, unwind
, block
]
The order type
The symbol of the Futures.
Possible values: [buy
, sell
]
The side associated with the order
The quantity (size) associated with the order.
The total amount of the order that has been filled.
The limit price associated with a limit order.
Is the order a reduce only order or not.
The date and time the order was placed.
The date and time the order was edited.
Possible values: [POST_WOULD_EXECUTE
, IOC_WOULD_NOT_EXECUTE
]
The rejection reason:
Possible values: [EXECUTION
]
Always EXECUTION
.
The UID associated with the execution.
The price of the execution.
The executed amount.
orderPriorEdit object
The UID associated with the order.
The client order id or null if order does not have one.
Possible values: [lmt
, ioc
, post
, liquidation
, assignment
, stp
, unwind
, block
]
The order type
The symbol of the Futures.
Possible values: [buy
, sell
]
The side associated with the order
The quantity (size) associated with the order.
The total amount of the order that has been filled.
The limit price associated with a limit order.
Is the order a reduce only order or not.
The date and time the order was placed.
The date and time the order was edited.
orderPriorExecution object
The order before it executes.
The UID associated with the order.
The client order id or null if order does not have one.
Possible values: [lmt
, ioc
, post
, liquidation
, assignment
, stp
, unwind
, block
]
The order type
The symbol of the Futures.
Possible values: [buy
, sell
]
The side associated with the order
The quantity (size) associated with the order.
The total amount of the order that has been filled.
The limit price associated with a limit order.
Is the order a reduce only order or not.
The date and time the order was placed.
The date and time the order was edited.
The amount of quantity that was removed from the order before execution or null if the order is not a reduce only.
Possible values: [PLACE
]
Always PLACE
.
orderTrigger object
The UID associated with the order.
The client order id or null if order does not have one.
Possible values: [lmt
, ioc
, post
, liquidation
, assignment
, stp
, unwind
]
The order type
The symbol of the Futures.
Possible values: [buy
, sell
]
The side associated with the order
The quantity (size) associated with the order.
The limit price associated with a limit order.
Possible values: [trigger_above
, trigger_below
]
Possible values: [mark_price
, last_price
, spot_price
]
Is the order a reduce only order or not.
The date and time the order was placed.
The date and time the order was edited.
Possible values: [CANCEL
]
Always CANCEL
.
orderTrigger object
The UID associated with the order.
The client order id or null if order does not have one.
Possible values: [lmt
, ioc
, post
, liquidation
, assignment
, stp
, unwind
]
The order type
The symbol of the Futures.
Possible values: [buy
, sell
]
The side associated with the order
The quantity (size) associated with the order.
The limit price associated with a limit order.
Possible values: [trigger_above
, trigger_below
]
Possible values: [mark_price
, last_price
, spot_price
]
Is the order a reduce only order or not.
The date and time the order was placed.
The date and time the order was edited.
Possible values: [REJECT
]
Always REJECT
.
orderTrigger object
The UID associated with the order.
The client order id or null if order does not have one.
Possible values: [lmt
, ioc
, post
, liquidation
, assignment
, stp
, unwind
]
The order type
The symbol of the Futures.
Possible values: [buy
, sell
]
The side associated with the order
The quantity (size) associated with the order.
The limit price associated with a limit order.
Possible values: [trigger_above
, trigger_below
]
Possible values: [mark_price
, last_price
, spot_price
]
Is the order a reduce only order or not.
The date and time the order was placed.
The date and time the order was edited.
Possible values: [MARKET_SUSPENDED
, MARKET_NOT_FOUND
, INVALID_PRICE
, INVALID_QUANTITY
, SMALL_ORDER_LIMIT_EXCEEDED
, INSUFFICIENT_MARGIN
, WOULD_CAUSE_LIQUIDATION
, CLIENT_ORDER_ID_IN_USE
, CLIENT_ORDER_ID_TOO_LONG
, MAX_POSITION_EXCEEDED
, PRICE_COLLAR
, PRICE_DISLOCATION
, EDIT_HAS_NO_EFFECT
, ORDER_FOR_CANCELLATION_NOT_FOUND
, ORDER_FOR_EDIT_NOT_FOUND
, ORDER_CANNOT_HAVE_TRIGGER_PRICE
, POST_WOULD_EXECUTE
, IOC_WOULD_NOT_EXECUTE
, WOULD_EXECUTE_SELF
, WOULD_NOT_REDUCE_POSITION
, REJECTED_AFTER_EXECUTION
, MARKET_IS_POST_ONLY
, ORDER_LIMIT_EXCEEDED
, FIXED_LEVERAGE_TOO_HIGH
, CANNOT_EDIT_TRIGGER_PRICE_OF_TRAILING_STOP
, CANNOT_EDIT_LIMIT_PRICE_OF_TRAILING_STOP
, TRAILING_STOP_ORDER_LIMIT_EXCEEDED
, TRAILING_STOP_PERCENT_DEVIATION_EXCEEDS_MAX_DECIMAL_PLACES
, TRAILING_STOP_QUOTE_DEVIATION_NOT_MULTIPLE_OF_TICK_SIZE
, TRAILING_STOP_MAX_DEVIATION_TOO_LARGE
, TRAILING_STOP_MAX_DEVIATION_TOO_SMALL
, INSUFFICIENT_HEADROOM_AROUND_CURRENT_PRICE_TO_EDIT_TRAILING_STOP
, NO_REFERENCE_PRICE_AVAILABLE_FOR_CALCULATING_TRAILING_STOP_TRIGGER_PRICE
, INSUFFICIENT_CLOSING_MARGIN
, LIMIT_PRICE_SET_AS_ABSOLUTE_AND_RELATIVE
, LIMIT_PRICE_OFFSET_VALUE_INVALID
, LIMIT_PRICE_OFFSET_UNIT_INVALID
, LIMIT_PRICE_OFFSET_MUST_HAVE_VALUE_AND_UNIT
, LIMIT_PRICE_OFFSET_QUOTE_CURRENCY_VALUE_MUST_BE_MULTIPLE_OF_TICK_SIZE
, LIMIT_PRICE_OFFSET_PERCENT_VALUE_TOO_MANY_DECIMAL_PLACES
, LIMIT_PRICE_OFFSET_TOO_HIGH
, LIMIT_PRICE_OFFSET_TOO_LOW
]
The unique identifier of the order
The date and time the order was received.
Possible values: [placed
, partiallyFilled
, filled
, cancelled
, edited
, marketSuspended
, marketInactive
, invalidPrice
, invalidSize
, tooManySmallOrders
, insufficientAvailableFunds
, wouldCauseLiquidation
, clientOrderIdAlreadyExist
, clientOrderIdTooBig
, maxPositionViolation
, outsidePriceCollar
, wouldIncreasePriceDislocation
, notFound
, orderForEditNotAStop
, orderForEditNotFound
, postWouldExecute
, iocWouldNotExecute
, selfFill
, wouldNotReducePosition
, marketIsPostOnly
, tooManyOrders
, fixedLeverageTooHigh
, clientOrderIdInvalid
, cannotEditTriggerPriceOfTrailingStop
, cannotEditLimitPriceOfTrailingStop
, wouldProcessAfterSpecifiedTime
]
The status of the order, either of:
Possible values: [success
]
Server time in Coordinated Universal Time (UTC)
Possible values: [accountInactive
, apiLimitExceeded
, authenticationError
, insufficientFunds
, invalidAccount
, invalidAmount
, invalidArgument
, invalidUnit
, Json Parse Error
, marketUnavailable
, nonceBelowThreshold
, nonceDuplicate
, notFound
, requiredArgumentMissing
, Server Error
, Unavailable
, unknownError
]
Possible values: [accountInactive
, apiLimitExceeded
, authenticationError
, insufficientFunds
, invalidAccount
, invalidAmount
, invalidArgument
, invalidUnit
, Json Parse Error
, marketUnavailable
, nonceBelowThreshold
, nonceDuplicate
, notFound
, requiredArgumentMissing
, Server Error
, Unavailable
, unknownError
]
Error description.
Possible values: [error
]
Server time in Coordinated Universal Time (UTC)
{
"result": "success",
"sendStatus": {
"order_id": "179f9af8-e45e-469d-b3e9-2fd4675cb7d0",
"status": "placed",
"receivedTime": "2019-09-05T16:33:50.734Z",
"orderEvents": [
{
"type": "PLACE",
"order": {
"orderId": "179f9af8-e45e-469d-b3e9-2fd4675cb7d0",
"type": "lmt",
"symbol": "PI_XBTUSD",
"side": "buy",
"quantity": 10000,
"filled": 0,
"limitPrice": 9400,
"reduceOnly": false,
"timestamp": "2019-09-05T16:33:50.734Z",
"lastUpdateTimestamp": "2019-09-05T16:33:50.734Z"
}
}
]
},
"serverTime": "2019-09-05T16:33:50.734Z"
}
{
"result": "success",
"sendStatus": {
"order_id": "614a5298-0071-450f-83c6-0617ce8c6bc4",
"status": "iocWouldNotExecute",
"receivedTime": "2019-09-05T16:32:54.076Z",
"orderEvents": [
{
"type": "REJECT",
"uid": "614a5298-0071-450f-83c6-0617ce8c6bc4",
"reason": "IOC_WOULD_NOT_EXECUTE",
"order": {
"orderId": "614a5298-0071-450f-83c6-0617ce8c6bc4",
"type": "lmt",
"symbol": "PI_XBTUSD",
"side": "buy",
"quantity": 10000,
"filled": 0,
"limitPrice": 9400,
"reduceOnly": true,
"timestamp": "2019-09-05T16:32:54.076Z",
"lastUpdateTimestamp": "2019-09-05T16:32:54.076Z"
}
}
]
},
"serverTime": "2019-09-05T16:32:54.077Z"
}
{
"result": "success",
"sendStatus": {
"order_id": "61ca5732-3478-42fe-8362-abbfd9465294",
"status": "placed",
"receivedTime": "2019-12-11T17:17:33.888Z",
"orderEvents": [
{
"type": "EXECUTION",
"executionId": "e1ec9f63-2338-4c44-b40a-43486c6732d7",
"price": 7244.5,
"amount": 10,
"orderPriorExecution": {
"orderId": "61ca5732-3478-42fe-8362-abbfd9465294",
"type": "lmt",
"symbol": "PI_XBTUSD",
"side": "buy",
"quantity": 10,
"filled": 0,
"limitPrice": 7500,
"reduceOnly": false,
"timestamp": "2019-12-11T17:17:33.888Z",
"lastUpdateTimestamp": "2019-12-11T17:17:33.888Z"
}
}
]
},
"serverTime": "2019-12-11T17:17:33.888Z"
}