One Trading API
REST APIWebSocket API
REST APIWebSocket API
  1. Trading
  • Introduction
  • Authenticate
  • Subscribe
  • Ping / Pong
  • Trading
    • Introduction
    • Dead Man Switch (Auto Cancellation)
    • Create Order
    • Cancel All Orders
    • Cancel Order by Client ID
    • Cancel Order by Order ID
    • Margin Update
    • Settlement
    • Funding Payment
    • Order Booked
    • Order Rejected
    • Order Closed
    • Trade Executed
    • Order Fully Filled
    • Balance Adjustment
  • Orderbook
    • Introduction
    • Orderbook Snapshot
    • Orderbook Update
  • Price Ticks
    • Introduction
    • Price Tick
  • Book Ticker
    • Introduction
    • Book Tick
  1. Trading

Create Order

You must be authenticated and subscribed to the TRADING channel in order to send trading messages.

Create Order Request#

{
    "type": "CREATE_ORDER",
    "order": {
        "instrument_code": "BTC_EUR",
        "amount": "0.1",
        "side": "SELL",
        "type": "LIMIT",
        "price": "85000",
        "time_in_force": "GOOD_TILL_CANCELLED"
    }     
 }
CreateOrderRequest
type
enum<string> 
required
Allowed value:
CREATE_ORDER
order
object (CreateOrder) 
required
instrument_code
string 
required
The id of the market to create the order on. Use the /instruments endpoint to get the ids of ACTIVE markets to trade on
type
enum<string> 
required
The type of order you wish to create
Allowed value:
LIMIT
side
enum<string> 
required
BUY or SELL
Allowed values:
BUYSELL
amount
string 
required
The amount of currency for this order
price
string 
required
The price at which the order is set to execute
client_id
string <uuid>
optional
Unique client identifier for the order. It is your responsibility for the uniqueness of the client_id, if you create multiple orders with the same client_id, any subsequent operation performed using this client_id will only apply to the latest
time_in_force
enum<string> 
optional
Defines the duration and conditions under which an order is considered valid in the market. Defaults to GOOD_TILL_CANCELLED
Allowed values:
GOOD_TILL_CANCELLEDIMMEDIATE_OR_CANCELLEDFILL_OR_KILLPOST_ONLY
reserve_price
string 
optional
Used for MOVE orders and is the max we can move to

Create Order Response#

Success#

{
    "channel_name": "TRADING",
    "type": "BOOKED", // DEPRECATED
    "event": "ORDER",
    "status": "OPEN",
    "order_book_sequence": 70422217646,
    "side": "SELL",
    "amount": "0.1",
    "price": "85000",
    "instrument_code": "BTC_EUR",
    "tif": "GTC",
    "client_id": "c95d3780-cd25-44e2-a7c6-5f04991e819e",
    "order_id": "b3572bca-4c88-4fc0-8537-2ada40cd91c1",
    "time": 1743072083415515130,
    "bals": [
        {
            "c": "BTC",
            "a": "10"
        },
        {
            "c": "EUR",
            "a": "20000"
        }
    ],
    "lckd_bals": [
        {
            "c": "BTC",
            "a": "0.1"
        },
        {
            "c": "EUR",
            "a": "0"
        }
    ]
}
SpotBookedOrder
channel_name
enum<string> 
required
The name of the WebSocket channel, always TRADING.
Allowed value:
TRADING
type
enum<string> 
deprecated
This field is deprecated and will be removed soon, please use the event and status fields.
Allowed value:
BOOKED
event
enum<string> 
required
The event type this message relates to.
Allowed value:
ORDER
status
enum<string> 
required
The order status.
Allowed values:
OPENFILLFILLED_FULLYCANCELLEDMOVEDINSUFFICIENT_FUNDSINSUFFICIENT_LIQUIDITYSELF_TRADEMOVE_SELF_TRADEMATCHING_POST_ONLY_RESULTS_IN_MATCHMATCHING_MOVE_FAILED_PRICE_OVER_RISK_LIMITRISK_MARGIN_TRADING_DISABLEDRISK_INVALID_RESERVE_BID_PRICERISK_FAILED_OVER_MAX_POSITION
order_book_sequence
integer 
required
The order book sequence number.
side
string 
required
BUY or SELL
amount
string 
required
The amount for the order.
price
string 
required
The price the order was booked at.
instrument_code
string 
required
The instrument code of the market.
tif
enum<string> 
required
Time in force.
Allowed values:
GTCFOKIOCPOST_ONLY
client_id
string <uuid>
required
The client provided, or system generated client id.
order_id
string <uuid>
required
The system generated order id.
time
number 
required
Nanosecond timestamp the order was accepted into the order book
bals
array[object (TradingBalance) {2}] 
required
Available balances for the currencies concerned with this market.
c
string 
required
Currency code of the balance
a
string 
required
Amount of the balance
lckd_bals
array[object (TradingBalance) {2}] 
required
Locked balances for the currencies concerned with this market.
c
string 
required
Currency code of the balance
a
string 
required
Amount of the balance

Errors#

A create order request may be initially be rejected if it first fails validation.
{
    "error": "MIN_NOTIONAL_ERROR",
    "payload": {
        "type": "CREATE_ORDER",
        "order": {
            "instrument_code": "BTC_EUR",
            "type": "LIMIT",
            "side": "BUY",
            "amount": "0.00001",
            "price": "80000",
            "time_in_force": "GTC",
            "reserve_price": "100000"
        }
    }
}
OrderErrorResponse
error
enum<string> 
required
The reason the request was rejected
Allowed values:
PRICE_PRECISION_FIELD_ERRORAMOUNT_PRECISION_FIELD_ERRORCLIENT_ID_ERRORORDER_ID_ERRORTIME_IN_FORCE_ERRORORDER_TYPE_NOT_SUPPORTED_ERRORPAIR_ERRORUNSUPPORTED_COMMANDINVALID_FORMATPRICE_FORMAT_ERRORQUANTITY_FORMAT_ERRORMAX_OPEN_ORDERS_EXCEEDEDORDER_NOT_FOUNDMAX_ORDER_SIZE_EXCEEDEDMIN_NOTIONAL_ERRORTYPE_FIELD_NOT_FIRSTMIN_PRICE_EXCEEDED_ERRORMAX_PRICE_EXCEEDED_ERRORSUSPENDED_PAIRPRICE_OUT_OF_COLLAR_ERRORMAX_ORDER_VOLUME_ERRORMAX_ORDER_VALUE_ERRORONLY_POST_ONLY_ALLOWED_ERROR
payload
object 
required
The payload sent which resulted in the error.
It may then be subsequently rejected if it passes initial validation.
See: Order Rejected
Previous
Dead Man Switch (Auto Cancellation)
Next
Cancel All Orders
Built with