Create limit order

post https://api.cryptomus.com/v2/user-api/convert/limit Copy

Request

Query parameters

NameParameter typeDefinition
from*stringmax:10Currency to convert From
to*stringmax:10Currency to convert To
amount*stringAmount to be converted in currency fromIf there are pennies in the amount, then send them with a separator '.'
Example: 10.28
price*stringPrice to convertIf there are pennies in the amount, then send them with a separator '.'
Example: 10.28
stop_loss_pricestring|nullThe threshold market price of the asset, upon reaching which the order will be automatically canceledIf there are pennies in the amount, then send them with a separator '.'
Example: 10.28

Parameter type

stringmax:10

Definition

Currency to convert From

Parameter type

stringmax:10

Definition

Currency to convert To

Parameter type

string

Definition

Amount to be converted in currency fromIf there are pennies in the amount, then send them with a separator '.'
Example: 10.28

Parameter type

string

Definition

Price to convertIf there are pennies in the amount, then send them with a separator '.'
Example: 10.28

Parameter type

string|null

Definition

The threshold market price of the asset, upon reaching which the order will be automatically canceledIf there are pennies in the amount, then send them with a separator '.'
Example: 10.28

* - mandatory parameter

Request example

curl https://api.cryptomus.com/v2/user-api/convert/limit \
    -X POST \
    -H 'userId: 8b03432e-385b-4670-8d06-064591096795' \
    -H 'sign: fe99035f86fa436181717b302b95bacff1' \
    -H 'Content-Type: application/json' \
    -d '{
        "from": "BTC",
        "to": "USDT",
        "amount": "0.0001",
        "price": "70000",
        "stop_loss_price": "0.21"
    }'
Copy

Response

Response parameters

NameParameter typeDefinition
order_idstringId of convert
uuidstringUUID of convert Order
convert_amount_fromstring|nullConvert amount from
convert_amount_tostring|nullConvert amount to
executed_amount_fromstring|nullExecuted amount from
executed_amount_tostring|nullExecuted amount to
convert_currency_fromstring|nullConvert currency from
convert_currency_tostring|nullConvert currency to
typestringType enumAvailable options:• market• limit
statusstringStatus enumAvailable options:• active• completed• partially_completed• cancelled• expired• failed
created_atstringDate time create
current_ratestring|nullCurrent rate
market_ratestring|nullMarket rate
limitstring|nullLimit value (only if type limit)
expires_atstringLimit expires date time
completed_atstringDate time when order completed (only if order completed)

Parameter type

string

Definition

Id of convert

Parameter type

string

Definition

UUID of convert Order

Parameter type

string|null

Definition

Convert amount from

Parameter type

string|null

Definition

Convert amount to

Parameter type

string|null

Definition

Executed amount from

Parameter type

string|null

Definition

Executed amount to

Parameter type

string|null

Definition

Convert currency from

Parameter type

string|null

Definition

Convert currency to

Parameter type

string

Definition

Type enumAvailable options:- market- limit

Parameter type

string

Definition

Status enumAvailable options:- active- completed- partially_completed- cancelled- expired- failed

Parameter type

string

Definition

Date time create

Parameter type

string|null

Definition

Current rate

Parameter type

string|null

Definition

Market rate

Parameter type

string|null

Definition

Limit value (only if type limit)

Parameter type

string

Definition

Limit expires date time

Parameter type

string

Definition

Date time when order completed (only if order completed)

Response example


1{
2  "state": 0,
3  "result": {
4    "order_id": "2d9bf426-98ef-448b-84c2-03cc1ec78feb",
5    "uuid": "740a39d1-2edd-4b4d-bf49-826caf324312",
6    "convert_amount_from": "10.000",
7    "convert_amount_to": "3.000",
8    "executed_amount_from": null,
9    "executed_amount_to": null,
10    "convert_currency_from": "USDT",
11    "convert_currency_to": "XMR",
12    "type": "limit",
13    "status": "active",
14    "created_at": "2024-07-11 , 18:06:04",
15    "current_rate": "100",
16    "market_rate": "100",
17    "limit": "70000",
18    "expires_at": "2024-07-12 , 18:06:04"
19  }
20}
Copy