1. Foreign exchange request for quote

Introduction

A user may sell a set amount of a currency they hold in their wallet for another currency.

Customate will go to the foreign exchange market and obtain a real-time quote valid for 30 seconds to exchange the currencies.

You will need to have sufficient funds in the selling wallet to honour the exchange.

You need to request a quote (step 1) and then you have 30 seconds to accept that quote (step 2).

How to execute an exchange of currencies

 

Step 1 – call the create_currency_exchange endpoint.

Exchange an amount in the currency_to_sell for an amount in the currency_to_buy.

Customate will go to the foreign exchange market to exchange the currencies.

The minimum amount is 100 pence/cents. The maximum is 150 million pence/cents, or 1.5 million GBP, EUR, or USD.

The amount bought (counterparty_amount) is calculated based on the quoted exchange_rate.

Example JSON create Currency Exchange (request):
{
  "amount": 10000,
  "currency_to_sell": "GBP",
  "currency_to_buy": "EUR",
  "execution_date": "2022-08-31",
  "description": "Exchange £100 for Euros",
  "metadata": {
    "sample_internal_id": "d2f148cf-901c-4fee-8792-21016da755a0"
  }
}
Example JSON Create Currency Exchange (response):
{
  "id": "a41bcee0-9b08-49cf-b17a-1842f4b93d40",
  "creation_datetime": "2022-09-22T10:13:34.104752Z",
  "status": "pending",
  "type": "forex",
  "funding_source_id": "3dc5d753-7052-48e4-b5b3-fb40346f492e",
  "amount": 10000,
  "currency_to_sell": "GBP",
  "exchange_rate": 0.87271,
  "currency_to_buy": "EUR",
  "counterparty_amount": 11458,
  "counterparty_payee_id": "2514719e-d27e-4eb8-b507-5ab71c411a14",
  "quote_expiry_datetime": "2022-09-22T10:14:04.083889Z",
  "description": "Exchange £100 for Euros",
  "metadata": {
    "sample_internal_id": "d2f148cf-901c-4fee-8792-21016da755a0"
  }
}

Step 2 – call the create_currency_exchange endpoint.

Once you have a quote and wish to proceed, to action a currency exchange, call the execute_quote endpoint.

Quotes are valid for 30 seconds. Calls made after the expiry date will fail.

Call the get currency exchange endpoints to check the status. The status will be updated within 15 seconds.

{} i.e. an empty body

The URL is https://api.gocustomate.com/v1/profiles/{profile_id}/currency_exchanges/{currency_exchange_id}/execute_quote

The {currency_exchange_id} in the PUT request above to execute a quote is the “id” returned when creating the exchange.

Example JSON after executing quote (response):
{
  "result": "Currency exchange (ID: 46c3a786-5767-4c99-8f32-8610bee55838) is being processed."
}