Moves amount from this account into toAccountId, an account of the same owner in another currency, at the market rate of the moment less the client's markup, and takes the client's exchange fee in this account's currency. The response states what was applied.

Requires an Idempotency-Key header. A repeat of the same key returns the original exchange rather than making a second one.

Parameters

NameInTypeRequiredDescription
accountId path string yes

The account sold from.

Request body

application/json · ExchangeRequest · required

FieldTypeRequiredDescription
amount string yes

Amount taken from the account sold from, in its currency, fee included.

expectedTargetAmount string no

Create only: the amount the quote showed. The exchange is refused with 409 when the rate of the moment would credit less.

toAccountId string yes

Account bought into; same owner as the account sold from.

Responses

StatusBodyDescription
200 Exchange

The exchange made.

400 Error

Invalid request, insufficient funds, or no rate available right now.

403 Error

Exchange is not enabled for this client.

404 Error

Account not found.

409 Error

The idempotency key was already used for a different exchange, or the rate moved below expectedTargetAmount.

Specification

This page is generated from the OpenAPI specification, which remains the authoritative machine-readable source.