SPOT_TRADE | Success: 201 Created| Field | Type | Required | Notes |
|---|---|---|---|
symbol | string | Yes | BASE-QUOTE, 2 to 15 alphanumerics each side. Lowercase is accepted and uppercased |
side | string | Yes | BUY or SELL |
type | string | Yes | MARKET or LIMIT |
quantity | decimal string | Yes | Greater than 0. Up to 20 integer and 18 fractional digits. No sign, no exponent |
price | decimal string | Conditional | Required for LIMIT. Must be left out for MARKET. Sending it is a rejection, not an ignore |
clientOrderId input. The server mints one for you.BUY reserves the quote coin (quantity x price, plus a slippage buffer on MARKET). A SELL reserves the base coin. reservedAsset tells you which. Fees are not part of the reserve, so leave headroom. If funds are short, nothing at all is written and you get 409.
201does not mean the market accepted your orderIt means we accepted it and set your money aside. The venue's verdict comes later, and a rejection is not an HTTP error. Branch on the statusfield in the body, never on the HTTP status code.PENDING_SUBMITandSUBMITTEDare in flight.FILLED,CANCELED,EXPIREDandREJECTEDare final.UNKNOWNmeans the venue did not answer, your funds are still reserved, and you must poll rather than re-place.
The field you send is type. The field you get back isorderType. They are not the same name.timeInForcecomes back as"GTC"on LIMIT andnullon MARKET, andpriceisnullon MARKET.
| Status | code | Cause |
|---|---|---|
400 | VALIDATION_ERROR | Schema failure, an instrument limit breach, or a missing Idempotency-Key |
409 | INSUFFICIENT_BALANCE | Not enough spendable balance to reserve. Nothing was written |
409 | IDEMPOTENCY_IN_PROGRESS | An earlier request with this key is still running |
429 | TOO_MANY_OPEN_ORDERS | 200 orders already open on this symbol. Retrying will not help, so cancel one |
429 | RATE_LIMIT_EXCEEDED | Per-key rate limit |
403 | API_PERMISSION_DENIED | The key lacks SPOT_TRADE |
400 VALIDATION_ERROR, and the message usually suggests a corrected value, for example price must be a multiple of tickSize (0.01), try 60000.00.