# API reference

> Every endpoint, generated from the same contract the sandbox validates against: parameters, responses, errors with their exact text and examples you can run.

## Conventions

- **Authentication**: `POST /v1/auth/token` exchanges `client_id` and `client_secret` for a one-hour access token. Every other endpoint needs `Authorization: Bearer <access_token>` (401 when missing) and `X-API-Key` (403).
- **Errors**: `{error, cause, message?, values?}`; on a validation 400, `values` carries one message per field. The token endpoint answers OAuth2 errors `{error, error_description}` and the gateway `{message}`.
- **Money and dates**: Amounts as JSON numbers: COP in whole pesos (except `/v1/transfer`, up to 2 decimals) and USD up to 2 decimals. RFC 3339 UTC timestamps.
- **Lists**: `page` (from 1) and `size` (10 by default, up to 100) → `{data, page, size, pages, count, total}`.

## Authentication

OAuth2 `client_credentials`: exchange your `client_id` and `client_secret` for a one-hour access token and send it as `Authorization: Bearer` together with your `X-API-Key`.

- [Production] [Get an access token](https://developers.zulu.com.co/en/reference/get-token.md) — `POST /v1/auth/token`

## Pay-in

Receive money into your COP balance: PSE payment links, Bre-B keys and Bre-B QR codes, and the deposits they produce.

- [Sandbox · coming soon] [Create a PSE payment link](https://developers.zulu.com.co/en/reference/create-recharge-link.md) — `POST /v1/recharge-links`
- [Sandbox · coming soon] [List payment links](https://developers.zulu.com.co/en/reference/list-recharge-links.md) — `GET /v1/recharge-links`
- [Sandbox · coming soon] [Get a payment link](https://developers.zulu.com.co/en/reference/get-recharge-link.md) — `GET /v1/recharge-links/{slug}`
- [Sandbox · coming soon] [Cancel a payment link](https://developers.zulu.com.co/en/reference/cancel-recharge-link.md) — `DELETE /v1/recharge-links/{slug}`
- [Sandbox · coming soon] [List your Bre-B keys](https://developers.zulu.com.co/en/reference/list-bre-b-keys.md) — `GET /v1/bre-b/keys`
- [Sandbox · coming soon] [Create a Bre-B key](https://developers.zulu.com.co/en/reference/create-bre-b-key.md) — `POST /v1/bre-b/keys`
- [Sandbox · coming soon] [Delete a Bre-B key](https://developers.zulu.com.co/en/reference/delete-bre-b-key.md) — `DELETE /v1/bre-b/keys/{key}`
- [Sandbox · coming soon] [Create a Bre-B QR code](https://developers.zulu.com.co/en/reference/create-qr-code.md) — `POST /v1/bre-b/qr-codes`
- [Sandbox · coming soon] [Get a QR code](https://developers.zulu.com.co/en/reference/get-qr-code.md) — `GET /v1/bre-b/qr-codes/{id}`
- [Sandbox · coming soon] [List deposits](https://developers.zulu.com.co/en/reference/list-deposits.md) — `GET /v1/deposits`
- [Sandbox · coming soon] [Get a deposit](https://developers.zulu.com.co/en/reference/get-deposit.md) — `GET /v1/deposits/{depositId}`

## FX

Convert between USD and COP: request a 30-second quote and execute it once, settling the same, the next or the second business day.

- [Sandbox · coming soon] [Quote a conversion](https://developers.zulu.com.co/en/reference/get-quote.md) — `GET /v1/quotes`
- [Sandbox · coming soon] [Convert with a quote](https://developers.zulu.com.co/en/reference/create-fx-transaction.md) — `POST /v1/transactions`

## Payout

Withdraw COP balance to bank accounts in Colombia: zulu picks Bre-B, online ACH or manual payment. Resolve Bre-B keys before paying.

- [Production] [Withdraw COP balance](https://developers.zulu.com.co/en/reference/create-transfer.md) — `POST /v1/transfer`
- [Sandbox · coming soon] [Resolve a Bre-B key](https://developers.zulu.com.co/en/reference/resolve-bre-b-key.md) — `GET /v1/bre-b/keys/{key}`

## Account

Your balances, your current limits and the transaction history (withdrawals and conversions).

- [Sandbox · coming soon] [List transactions](https://developers.zulu.com.co/en/reference/list-transactions.md) — `GET /v1/transactions`
- [Sandbox · coming soon] [Get a transaction](https://developers.zulu.com.co/en/reference/get-transaction.md) — `GET /v1/transactions/{transactionId}`
- [Sandbox · coming soon] [Get balances](https://developers.zulu.com.co/en/reference/list-balances.md) — `GET /v1/balances`
- [Sandbox · coming soon] [Get limits](https://developers.zulu.com.co/en/reference/get-limits.md) — `GET /v1/limits`

## Catalogs

The banks and document types the other endpoints accept.

- [Sandbox · coming soon] [List banks](https://developers.zulu.com.co/en/reference/list-banks.md) — `GET /v1/banks`
- [Sandbox · coming soon] [List document types](https://developers.zulu.com.co/en/reference/list-document-types.md) — `GET /v1/document-types`

## Simulators

Tools that only exist in the sandbox: they simulate third-party payments, advance transactions and top up balances so you can test every flow end to end.

- [Sandbox only] [Simulate a PSE link payment](https://developers.zulu.com.co/en/reference/simulate-recharge-link-payment.md) — `POST /v1/sandbox/recharge-links/{slug}/pay`
- [Sandbox only] [Simulate an incoming Bre-B transfer](https://developers.zulu.com.co/en/reference/simulate-bre-b-transfer-in.md) — `POST /v1/sandbox/bre-b/transfers/in`
- [Sandbox only] [Simulate a QR code payment](https://developers.zulu.com.co/en/reference/simulate-qr-code-payment.md) — `POST /v1/sandbox/bre-b/qr-codes/{id}/pay`
- [Sandbox only] [Advance a transaction](https://developers.zulu.com.co/en/reference/advance-transaction.md) — `POST /v1/sandbox/transactions/{transactionId}/advance`
- [Sandbox only] [Top up the simulated balance](https://developers.zulu.com.co/en/reference/top-up-balance.md) — `POST /v1/sandbox/balances/top-up`

## Webhooks

What zulu POSTs to you when something changes. Set them up in the dashboard: one URL per type and up to 5 static headers.

Success = exactly HTTP 200. On failure it retries after 30 s, 2 min, 10 min, 1 h and 6 h; then the delivery is `DEAD`. An endpoint is disabled after 50 consecutive failures. Each type has one URL and up to 5 static headers, set in the dashboard.

Signature: `v1=` + hex(HMAC-SHA256(secret, "zulu-webhook/v1\n" + id + "\n" + timestamp + "\n" + hex(SHA-256(raw body))))`. The secret is used as UTF-8 bytes. Compare in constant time and reject timestamps more than 300 s away.

- [Sandbox · coming soon] `TRANSACTIONS`: Sent every time a withdrawal or a conversion changes status (`IN_PROGRESS`, `SENT`, `COMPLETED`, `REJECTED`…). It is production's shape (`{transactionId, status}`); whether production sends it for `POST /v1/transfer` is not decided yet, hence the Sandbox label.
- [Sandbox · coming soon] `DEPOSITS`: Sent when money arrives into your COP balance: a paid PSE link, a Bre-B transfer to your key or a paid QR code.
- [Sandbox · coming soon] `RECHARGE_LINKS`: Sent when a PSE link changes status (`AWAITING_PAYMENT`, `PAID`, `REFUSED`, `EXPIRED`, `CANCELLED`).
