Market order creation
post
https://api.cryptomus.com/v2/user-api/exchange/orders/market
Request
Query parameters
Name | Parameter type | Definition |
---|---|---|
market* | string | Designation of available trading pair (e.g. `TRX_USDT`) |
quantity* | string | Quantity in base_currency |
value* | string | Limit price for order execution in quote_currency |
direction* | string | Order typeAvailable options:• buy• sell |
client_order_id | string | Unique identifier created by the client |
tag | string | Broker Tag |
Parameter type
stringDefinition
Designation of available trading pair (e.g. `TRX_USDT`)Parameter type
stringDefinition
Quantity in base_currencyParameter type
stringDefinition
Limit price for order execution in quote_currencyParameter type
stringDefinition
Order typeAvailable options:- buy- sellParameter type
stringDefinition
Unique identifier created by the clientParameter type
stringDefinition
Broker Tag
* - mandatory parameter
Request example
curl https://api.cryptomus.com/v2/user-api/exchange/orders/market \
-X POST \
-H 'userId: 8b03432e-385b-4670-8d06-064591096795' \
-H 'sign: fe99035f86fa436181717b302b95bacff1' \
-H 'Content-Type: application/json' \
-d '{
"market": "TRX_USDT",
"quantity": "100",
"direction": "sell"
}'
COPYPossible codes
200: The order was successfully created
404: User or resource not found
422: Invalid input data
500: Internal server error
Response example
1{
2 "order_id": "01JEXAFCCC5ZVJPZAAHHDKQBNG"
3}
COPYPossible errors
Example responses:
1{
2 "state": 1,
3 "message": "Market validation error"
4}
COPY
1{
2 "state": 2,
3 "message": "Incorrect amount or price accuracy"
4}
COPY
1{
2 "state": 3,
3 "message": "Order amount is out of acceptable ranges"
4}
COPY
1{
2 "state": 6,
3 "message": "Insufficient balance"
4}
COPY
1{
2 "state": 7,
3 "message": "client_order_id error"
4}
COPY
1{
2 "state": 0,
3 "message": "Standard validation error"
4}
COPYResponse example with error
1{
2 "state": 3,
3 "message": "Order quantity must be between 10 and 10000000000 size."
4}
COPY