Skip to main content

Exchange Tutorial

The Exchange API provides operations related to currency exchange. This includes creating a quote, confirming an order, and subscribing to order events.

Creating a Quote

Before making an exchange, you should first create a quote. This can be done by making a POST request to the /v1/orders/exchange/quote endpoint. To create a quote, you need to provide the following details:

  • from: The currency you want to convert from.
  • to: The currency you want to convert to.
  • amount: The amount you want to exchange. Larger amounts may result in better rates.
  • settlementDate: The date by which you'll need to have funds in your account in order to place an order for this quote. This can be by the end of the working day, the next working day, or in 2 working days. Earlier settlement dates may result in better rates.

For more details, please refer to the Create Quote API documentation.

Confirming an Order

Once you have obtained a quote (see Creating a Quote), you can proceed to confirm an order. The order confirmation process involves using the ID of the quote. This ID is included in the Order object that you send in the body of the POST request to the /v1/orders/exchange/confirm endpoint.

In addition to the quoteId, the order must also include an externalRef. This externalRef should be a unique identifier generated by the user and will be treated as an idempotency key for the order. This ensures that if a request is retried, a duplicate order is not created.

For more details, please refer to the Confirm Order API documentation.

Subscribing to Exchange Events

To subscribe to exchange events, make a POST request to the /v1/orders/exchange/subscribe endpoint. The request body should include a SubscriptionRequest object.

For more details, please refer to the Subscribe to Exchange Events API documentation.

Please note that if a webhook delivery does not succeed for any reason, we will attempt to resend it using an exponential backoff strategy over a period of up to 7 days. We consider a delivery successful when we receive a 200 status code in response.