How to create a exchange
Last updated
Last updated
Create exchange
To create a new exchange use the following endpoint:
You can find the detailed description of all the parameters in the documentation:
Here we consider the most important ones:
account - Merchant account ID
payload - Request for exchange
sourceCurrency - You sell currency
destinationCurrency - You buy currency
amount - Amount of the selling asset.
So, to create an exchange without additional commands, you just need to send a request:
Request
If the creation was successful you receive the response:
Response 200
After that, you will be able to track the status changes until the exchange is completed using the method below.
Get exchange
Here we consider the most important ones:
account - Merchant account ID
timestamp - Current unix UTC timestamp in milliseconds. Must not be less than 3 minutes in the past and not greater than 3 minutes in the future
payload - Request for exchange
id - Exchange ID
To get information about the exchange, you need to send a request:
Request
You receive the response with exchange data and state:
IN PROGRESSCOMPLETEDFAILED
You need to check the exchange details until you get the final exchange status.
To get the current status of the exchange use the following endpoint: