Skip to content

Place a market order via WebSocket

RECEIVE Client to Server on wss://api.valr.com/ws/account

Submit a market order through the WebSocket connection. Specify either baseAmount or quoteAmount but not both. The server responds with a PLACE_MARKET_WS_RESPONSE message. If the request is invalid, an INVALID_PLACE_MARKET_REQUEST message is returned.

Request format:

json
{
    "type": "PLACE_MARKET_ORDER",
    "clientMsgId": "unique-correlation-id",
    "payload": { ... }
}

Authentication

This operation requires API key authentication (HMAC-SHA512 via query parameters or in-band AUTHENTICATE message).

Message

Event type: PLACE_MARKET_ORDER

Payload Schema

PropertyTypeRequiredDescription
sidestringYes-
baseAmountstringNo-
quoteAmountstringNo-
pairstringYes-
customerOrderIdstringNo-
allowMarginbooleanNo-
timeInForcestringNo-
reduceOnlybooleanNo-

Example

json
"{\n    \"type\": \"PLACE_MARKET_ORDER\",\n    \"clientMsgId\": \"b2c3d4e5-correlation-id\",\n    \"payload\": {\n        \"side\": \"BUY\",\n        \"baseAmount\": \"0.01\",\n        \"quoteAmount\": null,\n        \"pair\": \"BTCZAR\",\n        \"customerOrderId\": \"my-market-order-1\",\n        \"allowMargin\": false,\n        \"timeInForce\": \"FOK\",\n        \"reduceOnly\": false\n    }\n}"

Channel

Channel: account Address: wss://api.valr.com/ws/account