Skip to main content
Once the customer picks a route, quote the amount they want to send. Run preflight after they fill in the form to check whether the order has enough data to proceed. The examples use route 2 and test account details. Substitute values from your installation at https://your-exchange. The commands use the quickstart setup and jq for JSON processing. For your own HTTP client, follow the signing rules.

1. Get a quote

HTTP request excerpt
Required scope is public-api:exchange:quotes:read. Request and response reference
Send amount or its alias income_amount as a decimal string, for example "10.50". result.quote.amounts contains the calculated amounts on both sides. The calculator accepts route_id, direction_id, or the two exchanger currency IDs. Supply both currency IDs if you select a pair without a route ID. If you include the route and currencies together, all values must identify the same route.
200 OK · response excerpt
Show the customer result.quote.rate and the amount to receive. Read components and adjustments for the calculation breakdown. base_rate gives the rate before adjustments. If a city has an independent rate formula, the general base rate may be unavailable. In that case, base_rate.available is false and value and display are null. Use selected_fees to send a fee selection in new requests. The request fields selected_fee_type and selector_fees remain for compatibility. The API ignores checkbox_fees. The selector_fees response field still describes the available options. Request another quote when the amount, city, or options change. A quote is an estimate. The funds remain available and the rate can change.

Amount precision and snapshot expiration

The API accepts a decimal string or a positive JSON number in ordinary decimal notation. Send a string with a decimal point, without an exponent or grouping separators. Store and compare returned amounts with decimal arithmetic to preserve their digits. If the route offers a rate mode, read quote.rate.selected. fixed and floating correspond to type_rate values 0 and 1. If you omit the parameter, the exchange applies the route default. The floating mode permits recalculation in statuses allowed by the exchange’s settings. The exchange can configure separate recalculation rules for fixed orders. Refresh the order amounts from the API when the state changes.

2. Check the completed form

HTTP request excerpt
Either public-api:exchange:preflight:read or public-api:exchange:quotes:read allows this request. Request and response reference Add the account details and route fields to the same quote parameters. This example uses the snapshot in quote-response.json and test account details. snapshot is optional. Supply it to check whether the conditions of the quoted route have changed.
Request
200 OK · response excerpt
Read the current form fields in result.preflight.operation_contract and the verification requirements in result.preflight.requirements. For application logic, read structured validation_issues with field, code, and message. The validation_errors map remains available for compatibility, and allowed has the same value as can_create_order. The snapshot includes expires_at and a signature. Copy the complete object. A processed preflight can record an order.preflight event for subscribed webhooks. Preflight does not create an order.

Create an order

Send the checked order data with a retry key.

Handle errors

Error codes, fields, and retry conditions.

Prompt for your coding agent