Conversions

Convert part of your own balance from one currency to another, at a price you lock first with a quote.

A conversion moves value between two of your own balances: CAD or USD into a digital dollar (USDC or USDT), or back. You always know the exact price before anything moves, because a conversion executes a quote you requested first.

Two calls, one price

  1. Quote the conversion with POST /v1/quotes, without method: that's what makes it a conversion instead of a payout.
  2. Convert with POST /v1/conversions, sending the quote's id while it lasts.

You pay exactly the quote's source.total and receive exactly its destination.amount.

Canadian dollars

CAD reaches your balance through Canadian rails (Interac e-Transfer, EFT), which run in sandbox only for now. See Countries and methods.

1. Quote the conversion

POST/v1/quotes
curl "$CAIBO_API/v1/quotes" \
  -H "Authorization: Bearer $CAIBO_API_KEY" \
  -H "Idempotency-Key: convert-quote-001" \
  -H "Content-Type: application/json" \
  -d '{
    "source_currency": "USD",
    "destination_currency": "USDC",
    "amount": "1000.00",
    "amount_side": "source"
  }'
FieldDescription
source_currencyThe balance the money leaves.
destination_currencyThe balance the money arrives in.
amountThe fixed amount, as a decimal string.
amount_sidesource: amount is what leaves your balance. destination: amount is what arrives.

The quote tells you the rate, what leaves (source.total, which is principal + platform_fee + tenant_markup) and what arrives (destination.amount). It's valid for a short time: use it before it expires.

2. Convert

POST/v1/conversions
curl "$CAIBO_API/v1/conversions" \
  -H "Authorization: Bearer $CAIBO_API_KEY" \
  -H "Idempotency-Key: convert-001" \
  -H "Content-Type: application/json" \
  -d '{ "quote_id": "quo_01m3sgaz0000000000000000" }'

The quote's total is held from your available balance in the source currency, and the quote can't be used by anything else. The conversion is executed asynchronously.

Statuses

StatusWhat it means
pendingThe total is held and the conversion is being executed.
pending_reviewThe risk controls asked a person to look. The total is held and nothing is executed until then; risk_decision_id says which decision. Approved, it becomes pending; rejected, it fails with risk_rejected and the hold is released.
completeddestination.amount is in your available balance.
failedNothing was converted and the hold was released. failure_code says why: conversion_refused or risk_rejected.

Follow it with the conversion.created, conversion.completed and conversion.failed events, or with GET/v1/conversions/{id}.

When it's refused

Nothing is held and the quote is not used in any of these cases:

ResponseWhy
422 insufficient_fundsYour available balance doesn't cover the total. The quote stays usable while it lasts.
422 quote_expiredThe quote expired. Request a new one.
409 quote_already_usedThe quote was already used by another operation.
404The quote isn't yours.
422 limit_exceededA limit on your account.
422 risk_blockedThe risk controls refused it.
503 operation_suspendedConversions are paused for now. Retry later.

Repeating the request with the same Idempotency-Key returns the same conversion: it never converts twice. See Idempotency.

Sur cette page