API referenceWallet Conversions

Wallet Conversions

Move money between your own wallets, debit one currency, credit another at the rate Swappr quotes for that pair.

Conversions work in either direction (e.g. USD → NGN or NGN → USD). A conversion succeeds only when an active rate is available for that exact from_currencyto_currency pair, otherwise it’s rejected and no money moves.

The result is environment-scoped to your API key: a sandbox (sk_test_…) key converts your sandbox wallets; a live (sk_live_…) key converts your live wallets.

Before you convert

  • Enable the capability on your key. The API key must carry the conversion capability, enable it in the dashboard under API keys (it mirrors the cross-currency-payout capability). A key without it gets 403.
  • The rate is applied at execution. The value you preview can change before you send; a rate that is being refreshed is rejected (fx_rate_stale) and no money moves.
  • Idempotency-Key is required. Send a unique value per logical conversion. A retry with the same key returns the same conversion (200); the same key with a genuinely different conversion is a 409 conflict.

POSTCreate conversion

POST/v1/conversions

Debit one wallet and credit another at the rate Swappr quotes for the pair. Provide exactly one amount basis:

  • from_amount_minor: source basis: the exact amount to debit from your from_currency wallet. The credited amount is derived at the rate.
  • to_amount_minor: target basis: the exact amount to credit to your to_currency wallet. The debited amount is derived at the rate.
Request body
from_currencystringRequired

The currency to debit (ISO 4217, e.g. USD).

to_currencystringRequired

The currency to credit (ISO 4217, e.g. NGN). Must differ from from_currency.

from_amount_minorstring

Source basis, the exact amount to debit (minor units; string for values > 2⁵³). XOR with to_amount_minor.

to_amount_minorstring

Target basis, the exact amount to credit (minor units). XOR with from_amount_minor.

Response fields

FieldTypeNotes
objectstringAlways conversion.
idstringThe conversion id.
from_currency / to_currencystringThe pair converted.
from_amount_minorstringDebited from your from_currency wallet (minor units).
to_amount_minorstringCredited to your to_currency wallet (minor units).
ratestringDestination-per-source rate applied, as a decimal string.
statusstringcompleted.

Errors

CodeHTTPCause
ambiguous_amount400Both from_amount_minor and to_amount_minor were sent.
amount_required400Neither amount was sent.
invalid_currency_pair400from_currency equals to_currency.
unsupported_currency400A currency code is not valid.
permission_denied403The API key isn’t enabled for conversions.
idempotency_conflict409The Idempotency-Key was already used for a different conversion.
fx_rate_unavailable422No active rate for this pair.
fx_rate_stale422The rate is being refreshed, retry shortly. No money moved.
fx_rate_inverted422The rate isn’t available to convert at right now.
insufficient_funds402Your from_currency wallet balance is too low.
fx_convert_unavailable503Conversions for the destination currency aren’t available right now (temporary).
fx_exposure_cap_exceeded422The conversion is above the current limit, try a smaller amount.
Request
# Convert $1,000.00 (100000 minor) USD into NGN (source basis)
curl -X POST 'https://api.swappr.me/api/v1/conversions' \
  -H "Authorization: Bearer sk_live_..." \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "from_currency": "USD",
    "to_currency": "NGN",
    "from_amount_minor": "100000"
  }'
Response
{
  "object": "conversion",
  "id": "cmq...",
  "from_currency": "USD",
  "to_currency": "NGN",
  "from_amount_minor": "100000",
  "to_amount_minor": "130000000",
  "rate": "1300.0",
  "status": "completed"
}
201 Created

POSTPreview conversion

POST/v1/conversions/quote

Read-only, advisory preview. Resolves the active rate for the pair and derives the exact debit/credit at the given basis. No money moves, no row is written, no capability gate, a valid key is the only requirement.

The request takes the same fields as a conversion (from_currency, to_currency, and exactly one of from_amount_minor / to_amount_minor).

Response fields

FieldTypeNotes
objectstringAlways conversion_quote.
from_amount_minorstringWhat would be debited (minor units).
to_amount_minorstringWhat would be credited (minor units).
ratestringDestination-per-source rate, as a decimal string.
as_ofstring | nullWhen the active rate was approved (indicative).
indicativebooleanAlways true, the binding rate applies at execution.
Request
curl -X POST 'https://api.swappr.me/api/v1/conversions/quote' \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "from_currency": "USD",
    "to_currency": "NGN",
    "from_amount_minor": "100000"
  }'
Response
{
  "object": "conversion_quote",
  "from_currency": "USD",
  "to_currency": "NGN",
  "from_amount_minor": "100000",
  "to_amount_minor": "130000000",
  "rate": "1300.0",
  "as_of": "2026-07-12T09:00:00.000Z",
  "indicative": true
}
200 OK