# Instant payments

> Pay instantly from your product (marketplace withdrawals, refunds, disbursements) and show your user an honest status at every moment.

[Production]

A marketplace lets its sellers withdraw their balance whenever they want, and wants the money to arrive instantly when possible, with a clear status when not.

## The flow

1. The seller asks to withdraw; your system reserves the amount in their internal balance.
2. You call `POST /v1/transfer` with their Bre-B key if they have one; otherwise with their account.
3. You show the status from `method` and `status`, and update it with the `TRANSACTIONS` webhook.

## 1. Request the withdrawal

**POST** `/v1/transfer` — Withdraw COP balance · [Production] · [See the reference](https://developers.zulu.com.co/en/reference/create-transfer.md)

With `breBKey` and an amount within the Bre-B maximum, the money arrives in seconds. Without a key, a whole-peso amount to a bank in the catalog goes out by online ACH the same day.

## 2. The status you see and the one you show

| `method` | `status`               | What to show                                                            |
| -------- | ---------------------- | ----------------------------------------------------------------------- |
| `BRE_B`  | `CREATED`              | "Sending… arrives in seconds"                                           |
| `ACH`    | `IN_PROGRESS` / `SENT` | "Sent to your bank, arrives today"                                      |
| `MANUAL` | `IN_PROGRESS`          | "Processing, arrives next business day"                                 |
| any      | `COMPLETED`            | "Paid"                                                                  |
| any      | `REJECTED`             | "We could not pay: check your account" and release the reserved balance |

## 3. Timeouts without paying twice

A withdrawal that answers 5xx or does not answer may have been created. Do not let the seller request it again until you confirm it: read [Retries without duplicates](https://developers.zulu.com.co/en/docs/payout/transfers.md#retries-without-duplicates).

| HTTP | error | cause | Description |
| --- | --- | --- | --- |
| 422 | `UnprocessableEntityApiError` | `insufficient COP balance to withdraw %.2f` | The COP balance does not cover the amount plus the dispersion fee. The figure in the message is that sum. |
| 500 | `InternalServerApiError` | `unexpected error %s` | The withdrawal failed at an internal step. Check the withdrawal before retrying so the payment is not duplicated. |
| 500 | `InternalServerApiError` | `[code:1] unexpected error` | Internal error. On operations that move money, check the state before retrying so the operation is not duplicated. |

## 4. Test it

| Field | Value | Effect | Operations |
| --- | --- | --- | --- |
| `destination.bankAccount.accountNumber` | `0000000001` | The withdrawal goes out by ACH (`IN_PROGRESS`), reaches `SENT` and ends `REJECTED`; the debit is reversed and a webhook is sent for each change. | [`createTransfer`](https://developers.zulu.com.co/en/reference/create-transfer.md), [`getTransaction`](https://developers.zulu.com.co/en/reference/get-transaction.md), [`advanceTransaction`](https://developers.zulu.com.co/en/reference/advance-transaction.md) |
| `destination.bankAccount.accountNumber` | `0000000002` | The ACH dispatch does not queue: the withdrawal continues as a manual payment and answers `{status: IN_PROGRESS, method: MANUAL}`. | [`createTransfer`](https://developers.zulu.com.co/en/reference/create-transfer.md) |
| `destination.breBKey.key` | `@failbreb` | The Bre-B transfer fails: the withdrawal is left for manual payment and answers `{status: CREATED, method: MANUAL}`, as in production. | [`createTransfer`](https://developers.zulu.com.co/en/reference/create-transfer.md) |
| `destination.documentNumber` | `1111111111` | The beneficiary is registered but not verified: 422 `the beneficiary with document "1111111111" is not verified`. | [`createTransfer`](https://developers.zulu.com.co/en/reference/create-transfer.md) |
| `destination.documentNumber` | `2222222222` | The beneficiary is already registered as "Ana Pérez". A name sharing a word (regardless of accents, case or order) passes; any other answers 422 `the name does not match the beneficiary registered with document "2222222222"`. | [`createTransfer`](https://developers.zulu.com.co/en/reference/create-transfer.md) |
| `destination.bankAccount.bankCode` | `9999` | The bank is not in the catalog: 422 `bank with code "9999" is not supported`. | [`createTransfer`](https://developers.zulu.com.co/en/reference/create-transfer.md) |

Test every row of the status table with the test data and advance the withdrawals with the simulator to see each transition:

**POST** `/v1/sandbox/transactions/{transactionId}/advance` — Advance a transaction · [Sandbox only] · [See the reference](https://developers.zulu.com.co/en/reference/advance-transaction.md)
