Appearance
Place market order
POST
/v1/orders/market
Create a new market order.
When the response is 202 Accepted, you can either use the Order Status REST API or WebSocket API to receive updates about this order.
| Parameter | Description |
|---|---|
| side (required) | BUY or SELL |
| baseAmount / quoteAmount (required) | Either the baseAmount or quoteAmount must be provided. If quoteAmount is specified for a SELL order, your account will be credited with quoteAmount minus taker fees. If baseAmount is specified for a BUY order, your account will be credited with baseAmount minus taker fees. If baseAmount is provided, it will be truncated to baseDecimalPlaces of the currency pair. |
| pair (required) | Can be any supported currency pair. |
| timeInForce (optional) | Can be FOK or IOC (must be uppercase). If not specified, IOC is used by default. |
| customerOrderId (optional) | Alphanumeric value. Must be unique across all open orders. Supports alphanumeric characters and dashes ("-"), 50-character limit. |
| allowMargin (optional) | true or false. Default value is false. Set to true for margin/leverage trades. |
| reduceOnly (optional) | true or false. Default value is false. Set to true for Perpetual Futures orders that should only reduce a position. |
| conditionalOrderData (optional) | Used on futures pairs to manage exposure through adding a Take Profit and/or Stop Loss (TPSL) to the order. |
Fee currency (market orders are always taker):
| Side | Fee Currency |
|---|---|
| BUY | Base currency |
| SELL | Quote currency |
V1 order endpoints return 202 Accepted. Validation errors such as insufficient balance are delivered asynchronously via WebSocket, not as HTTP error responses. Use the Order Status REST API or WebSocket API to receive the status of this order.
Notes
-
timeInForce:
IOC(Immediate or Cancel): Fills as much of the order as possible within the allowed slippage, then cancels the remainder.
FOK(Fill or Kill): The entire order must fill within the allowed slippage or it is cancelled completely. -
customerOrderId:
Optional field for tracking orders using your internal system. It supports alphanumeric characters and dashes ("-"), with a 50-character limit. Special characters are not allowed. ThecustomerOrderIdmust be unique across all open orders for a given account. Reusing an id from an active order will prevent the new order from being placed (use the order status API to check an order's status). -
allowMargin:
Set totruefor margin/leverage trades. Only subaccounts can trade on margin, and each must be enabled individually via the account/status API. -
reduceOnly:
Set totruefor Perpetual Futures orders that should only reduce an existing position, preventing the order from opening a new position or increasing the size of an existing one. -
conditionalOrderData:
Used on futures pairs to manage exposure by attaching a Take Profit and/or Stop Loss (TPSL) to the order. AconditionalOrderIdis returned in the response when a conditional order is attached.
Authorizations
apiKey
Your API key
Type
API Key (header: X-VALR-API-KEY)
apiSignature
HMAC SHA512 signature of the request (see Authentication section)
Type
API Key (header: X-VALR-SIGNATURE)
apiTimestamp
Request timestamp in milliseconds
Type
API Key (header: X-VALR-TIMESTAMP)
Request Body
application/json
JSON
{
"side": "SELL",
"baseAmount": "0.100000",
"pair": "BTCUSDT",
"customerOrderId": "1234",
"allowMargin": "false",
"timeInForce": "FOK"
}
Responses
Market order accepted
application/json
JSON
{
"id": "14ed7fbc-272e-4bac-a4f9-7ec8df36df34"
}