Skip to content
developers

FX

Conversions

Execute a quote with the origin or the destination amount, understand the rounding and follow the conversion until it settles.

Sandbox · coming soon
POST/v1/transactionsConvert with a quoteSandbox · coming soon

Execute a quote

Send the quote and one of the two amounts:

  • originAmount: what you hand over. zulu computes what you receive.
  • destinationAmount: what you want to receive. zulu computes what you hand over, rounding up so you never receive less than asked.

POST /v1/transactions

curl https://sandbox.zulu.com.co/v1/transactions \
  -H "Authorization: Bearer $ZULU_ACCESS_TOKEN" \
  -H "X-API-Key: $ZULU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "quote": "EQ-COPXUSDX-261124150405-SBX7Q",
  "originAmount": 4000000
}'

Response 201

{
  "transactionId": "SBX-OR-NPTRFI261124W8D3QF-2K",
  "type": "FX",
  "status": "IN_PROGRESS",
  "originCurrency": "COP",
  "originAmount": 4000000,
  "destinationCurrency": "USD",
  "destinationAmount": 1006.62,
  "factor": 3973.7,
  "factorFormula": "COP/USD",
  "settlementTerm": "SAME_DAY",
  "settlementDate": "2026-11-24"
}

If you send both amounts, they must match the factor exactly; otherwise the answer is 422.

How it rounds

zulu never computes with binary decimals: it takes everything to minor units (pesos and cents) and uses integers.

RuleOperations
With f₂ = factor × 100: COP→USD, cents = round(pesos × 10⁴ / f₂); USD→COP, pesos = round(cents × f₂ / 10⁴). With destinationAmount, the origin rounds up. Both sides must stay within the limits.createFxTransaction

With the quote above's factor 3973.70, f₂ = 397,370:

ConversionComputationResult
4,000,000 COP → USDround(4,000,000 × 10⁴ / 397,370) = 100,662 ¢1,006.62 USD
Receive 1,000 USDceil(100,000 × 397,370 / 10⁴) = 3,973,7003,973,700 COP

Run the same computation in your system with integers (BigInt in JavaScript, Decimal or integers in Python) if you need to show the result before executing.

Statuses

A conversion stays IN_PROGRESS until its settlement date and then turns COMPLETED; it never goes through SENT. The origin is debited when it is created and the destination is credited when it settles.

GET/v1/transactions/{transactionId}Get a transactionSandbox · coming soon

In the sandbox you can settle it without waiting:

POST/v1/sandbox/transactions/{transactionId}/advanceAdvance a transactionSandbox only

Errors

HTTPerrorcauseDescription
400BadRequestApiErrorerror in struct validationOne or more fields fail their validation. values carries one message per field, keyed by its JSON path, naming the Go validator that failed.
400BadRequestApiErrorinvalid json body: %sThe body is not valid JSON, or a field has the wrong type (a string where a number goes, for example). Answered before the fields are validated.
404NotFoundApiErrorquote "%s" not foundNo quote with that id exists in your workspace.
409ResourceConflictApiErroridempotency key "%s" is still being processedAnother call with the same Idempotency-Key is still running. Retry in a few seconds to receive its response.
422UnprocessableEntityApiErroridempotency key "%s" was used with a different requestThe Idempotency-Key was already used in the last 24 hours with a different body or operation. Use a new key for every distinct operation.
422UnprocessableEntityApiErrorquote "%s" is expiredThe quote expired (it lives 30 seconds). Request a new one.
422UnprocessableEntityApiErrorquote "%s" has already been usedEach quote serves a single conversion.
422UnprocessableEntityApiErrororigin or destination amount wasn't calculated with factor "%v"You sent originAmount and destinationAmount and they do not match the quote's factor. Send only one of them.
422UnprocessableEntityApiErrorinsufficient %s balance to convert %.2fThe balance of the origin currency is not enough.
422UnprocessableEntityApiError%s amount %.2f is below the minimum of %.2fOne side of the conversion is below the minimum (GET /v1/limits).
422UnprocessableEntityApiError%s amount %.2f is above the maximum of %.2fOne side of the conversion exceeds the maximum (GET /v1/limits).
422UnprocessableEntityApiErroramount %v has too many decimals for %s (max %d)The amount has more decimals than its currency allows: COP in whole pesos, USD up to 2 decimals.