POST
/
api
/
v1
/
merchants
/
exchange
/
create
curl --request POST \
  --url https://payvra.com/api/v1/merchants/exchange/create \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "fromCurrency": "<string>",
  "toCurrency": "<string>",
  "amount": 1
}'
{
  "id": "<string>",
  "status": "SUCCESS",
  "fromWallet": {
    "currency": {
      "symbol": "<string>"
    }
  },
  "toWallet": {
    "currency": {
      "symbol": "<string>"
    }
  },
  "amount": 123,
  "rate": 123,
  "toAmount": 123,
  "createdAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
fromCurrency
string
required

Symbol of the source cryptocurrency

toCurrency
string
required

Symbol of the target cryptocurrency

amount
number
required

Amount to exchange from the source currency

Required range: x >= 0Must be a multiple of 1e-8

Response

200
application/json
Exchange created successfully
id
string
status
enum<string>
Available options:
SUCCESS,
FAILED
fromWallet
object
toWallet
object
amount
number
rate
number
toAmount
number
createdAt
string