How it works
The following diagram describes the different steps required to exchange funds internally with Equals Money. Click on the image to enlarge it.
Exchange currencies within a budget
Before you start
To exchange currencies within a budget, you first need to create a quote where:
type.from and type.to are set to balance
- at least one of
sourceCurrency.amount or targetCurrency.amount is provided
sourceCurrency.currency.budgetId and targetCurrency.currency.budgetId are set to the ID of the parent budget
For example, to convert 10 GBP to USD:
curl -i -X POST \
'https://api.equalsmoney.com/v2/orders/quote?accountId=F12345' \
-H 'Authorization: ApiKey YOUR_API_KEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"sourceCurrency": {
"amount": 10,
"currency": {
"budgetId": "b489ea2c-0dd1-4fb1-b345-de5a596a5527",
"currencyCode": "GBP"
}
},
"targetCurrency": {
"currency": {
"budgetId": "b489ea2c-0dd1-4fb1-b345-de5a596a5527",
"currencyCode": "USD"
}
},
"settlementDate": "20231001",
"type": {
"from": "balance",
"to": "balance"
}
}'
Request
Use this request to exchange currencies within a budget, using the orderId and quoteRequestId returned when you created a quote.
curl -i -X POST \
'https://api.equalsmoney.com/v2/orders/trade?accountId=F12345' \
-H 'Authorization: ApiKey YOUR_API_KEY_HERE' \
-H 'Content-Type: application/json' \
-d '{
"orderId": "FPLZQVE5G2ZZKS",
"quoteRequestId": "SLQMQKRV8NR32DA3T0GZ7OC1SNDKO7X1HH"
}'
Query parameters
The ID of the account that you’re creating an order for.Allowable values: An existing accountId
Request body schema
The ID of the order.Allowable values: An existing orderId (≤ 36 characters)
The ID of the quote request.Allowable values: An existing quoteRequestId (≤ 36 characters)
Response
If your request is successful, you’ll receive a 200 response.
{
"orderId": "FPLZQVE5G2ZZKS",
"quoteRequestId": "SLQMQKRV8NR32DA3T0GZ7OC1SNDKO7X1HH",
"settlement": {
"date": "20230825",
"price": {
"amount": 10,
"currency": "EUR"
},
"charges": {
"fee": 0
}
},
"quote": {
"rate": 1,
"inverseRate": 1,
"fromGbpAmount": 10,
"from": {
"amount": 10,
"currency": "GBP"
},
"to": {
"amount": 10,
"currency": "EUR"
},
"direction": "1"
}
}
For more detailed information about this request and its response, see the API reference.