Skip to main content
POST
Quote a currency conversion

Authorizations

api-key
string
header
required

Headers

Melio-Entity-Id
string
required

Entity the request operates on — an entity id (ent_<uuid>) or me (the partner's sole entity).

Body

application/json

Only accounts that actually convert currency can be quoted: an international-fx account denominated in something other than USD. Anything else — a domestic account, a USD-denominated international account, or international-gusd, which is dollar-denominated — is rejected with 400.

receivingAccountId
string
required

External receiving account id (acct_), the credit account

amount
integer
required

Minor units of currency — the amount the counterparty would receive.

currency
string

Must match the receiving account's currency. Optional, but sending it turns a wrong assumption into a 400 instead of a quote in an unexpected currency.

Pattern: ^[A-Za-z]{3}$
purpose
string

Why the money is being sent. Passed to the currency provider when the quote is minted, so send the same value you will send as compliance.purpose on the payment.

Response

The priced conversion and the token that locks it.

A priced currency conversion. foreignAmount is what the counterparty receives and amount is what the entity is debited, both in minor units of their own currency and both excluding fees.

currency
string
required

ISO 4217 code of the currency delivered

foreignAmount
integer
required

Minor units of currency delivered to the counterparty

amount
integer
required

Minor units of USD debited from the entity, before fees

usdToForeignRate
number
required

The applied rate: units of currency per USD

quoteToken
string
required

Opaque, short-lived token locking this rate. Pass it as fxQuoteToken on POST /payments, for a payment of this amount in this currency — the token is checked against both, so it cannot be spent on a payment it was not quoted for. Treat it as opaque; its format is not part of this contract.

midMarketRate
number

The mid-market reference rate, for comparison

expiresAt
string<date-time>

When the token stops being accepted. After this, quote again.