Skip to main content
POST
Run Swap
Debits the source wallet and credits the destination wallet in one step. Keep the reference from the response to look the swap up later.
Retrying with the same Idempotency-Key returns the original swap. No second swap runs.
See Currency Swap for the error messages.

Authorizations

X-Api-Key
string
header
required

Your API key (yativo_pk_...) from Developers → API Keys. Send together with X-Api-Secret.

X-Api-Secret
string
header
required

Your API secret (yativo_sk_...), shown once when the key is created.

Headers

Idempotency-Key
string
required

A unique string per request to ensure idempotent processing.

Body

application/json
from_currency
string
required

Currency of the wallet to debit.

Example:

"USD"

to_currency
string
required

Currency of the wallet to credit. Must differ from from_currency.

Example:

"USDC"

amount
number
required

Amount to swap in from_currency, including the fee. Must be greater than 0.

Example:

1000

idempotency_key
string

POST /wallet/swap only. Alternative to the Idempotency-Key header.

Maximum string length: 100

Response

Swap completed

status
string
Example:

"success"

status_code
integer
Example:

200

message
string
Example:

"Request successful"

data
object