# Collect an exact amount (/fr/docs/collect-one-payment)

<Endpoint method="POST" path="/v1/funding-accounts" href="/api#tag/funding/POST/v1/funding-accounts" />

With `amount`, the funding account is a **one-time payment**: your customer pays exactly that amount, in the `currency`, and the account closes when the payment completes.

| Field | Required | What it is |
| --- | --- | --- |
| `method` | Yes | `pix`, `bank_transfer`, `nequi`, `bre_b`… |
| `currency` | Yes | What your customer pays: `BRL`, `PEN`, `COP`… |
| `amount` | Yes, for a one-time payment | Your order amount. |
| `payer` | Depends on the method | The payer details that `payment_method_fields` asks for in capabilities. |
| `settlement_currency` | No | The currency your balance is credited in. Defaults to the `settlement_asset` from capabilities. |

<Tabs items={["Brazil · PIX", "Peru · bank transfer", "Colombia · Nequi and Bre-B"]}>
<Tab value="Brazil · PIX">

PIX requires the payer's name. The key in `payer` is the field's full name, exactly as capabilities gives it: `payer.name`.

```bash
curl "$CAIBO_API/v1/funding-accounts" \
  -H "Authorization: Bearer $CAIBO_API_KEY" \
  -H "Idempotency-Key: payin-order-8812" \
  -H "Content-Type: application/json" \
  -d '{
    "method": "pix",
    "currency": "BRL",
    "amount": "250.00",
    "payer": { "payer.name": "Ana Souza" }
  }'
```

```json title="201"
{
  "id": "fa_01m3sg9w0000000000000000",
  "status": "pending",
  "method": "pix",
  "currency": "BRL",
  "settlement_currency": "USDT",
  "amount": "250.00",
  "created_at": "2026-10-18T12:00:00Z"
}
```

Once it's `active`:

```json
{
  "id": "fa_01m3sg9w0000000000000000",
  "status": "active",
  "method": "pix",
  "currency": "BRL",
  "settlement_currency": "USDT",
  "amount": "250.00",
  "instructions": {
    "copy_paste_code": "00020126580014br.gov.bcb.pix...",
    "qr_code_image_base64": "iVBORw0KGgoAAAANSUhEUgAA...",
    "amount": "250.00",
    "currency": "BRL"
  },
  "created_at": "2026-10-18T12:00:00Z"
}
```

Show the QR code (`qr_code_image_base64`, a base64-encoded PNG image) and the **PIX copia e cola** code (`copy_paste_code`) so your customer can pay from their bank.

</Tab>
<Tab value="Peru · bank transfer">

For soles, no payer details are needed.

```bash
curl "$CAIBO_API/v1/funding-accounts" \
  -H "Authorization: Bearer $CAIBO_API_KEY" \
  -H "Idempotency-Key: payin-order-8813" \
  -H "Content-Type: application/json" \
  -d '{ "method": "bank_transfer", "currency": "PEN", "amount": "1000.00" }'
```

Once it's `active`:

```json
{
  "id": "fa_01m3sgaa0000000000000000",
  "status": "active",
  "method": "bank_transfer",
  "currency": "PEN",
  "settlement_currency": "USDT",
  "amount": "1000.00",
  "instructions": {
    "bank_account": "Bank … · Account …",
    "expires_at": "2026-10-18T12:25:00Z",
    "amount": "1000.00",
    "currency": "PEN"
  },
  "created_at": "2026-10-18T12:00:00Z"
}
```

Show `bank_account` and the amount. Your customer must transfer **the exact amount** before `expires_at`. If `instructions` includes `reference`, ask them to include it in the transfer.

</Tab>
<Tab value="Colombia · Nequi and Bre-B">

In Colombian pesos you collect with `nequi` (your customer pays from their Nequi account) or with `bre_b` (they pay by Bre-B from their bank). Both ask for the same payer details.

```bash
curl "$CAIBO_API/v1/funding-accounts" \
  -H "Authorization: Bearer $CAIBO_API_KEY" \
  -H "Idempotency-Key: payin-order-8814" \
  -H "Content-Type: application/json" \
  -d '{
    "method": "nequi",
    "currency": "COP",
    "amount": "50000.00",
    "payer": {
      "first_name": "Carlos Andrés",
      "last_name": "Restrepo Díaz",
      "document.type": "CC",
      "document.number": "1012345678",
      "payer_email": "carlos@example.com",
      "phone": "+573001234567"
    }
  }'
```

| `payer` key | What it is |
| --- | --- |
| `first_name`, `last_name` | Given and family names, as their identity document writes them. |
| `document.type` | `CC`, `CE`, `NIT`, `PPT` or `PAS`. |
| `document.number` | 5 to 15 digits, without dots or spaces. |
| `payer_email` | Their email address. |
| `phone` | `+57` and the 10 digits of their mobile number. With `nequi`, the one of their Nequi account. |

Once it is `active`:

```json
{
  "id": "fa_01m3sgab0000000000000000",
  "status": "active",
  "method": "nequi",
  "currency": "COP",
  "settlement_currency": "USDT",
  "amount": "50000.00",
  "instructions": {
    "payment_url": "https://…",
    "amount": "50000.00",
    "currency": "COP"
  },
  "created_at": "2026-11-26T12:00:00Z"
}
```

Send your customer to `payment_url` to pay. The amount is in **whole pesos** (`50000.00`, not `50000.50`): an amount with cents cannot be collected and the account becomes `failed`.

</Tab>
</Tabs>

## The instructions [#the-instructions]

`instructions` is a map of strings whose keys depend on the method. Show them as-is to whoever is paying:

| Key | What it is |
| --- | --- |
| `amount`, `currency` | What gets paid: always your order amount. |
| `copy_paste_code` | The code to paste into the banking app (PIX copia e cola). |
| `qr_code_image_base64` | The QR code, as a base64-encoded PNG image. |
| `bank_account` | The account to transfer to. |
| `reference` | The reference the transfer must include. |
| `payment_url` | A link to pay. |
| `expires_at` | Until when payment is possible, if the method expires. |

A new key may appear in the future. Show it or ignore it, but don't fail because of it.

<Callout title="No fees for your customer">
`instructions.amount` is always your order amount. If the bank charges to receive, Caibo absorbs that fee: your customer pays 1,000.00, not 1,002.70, and your balance receives the value of the full 1,000.00.

On a method with a Caibo fee (`fee_bps` in capabilities, today PayPal and Zelle), your customer still pays exactly the amount, and the fee comes off what you're credited: the funding account shows it in `fee` and what you'll receive in `net_amount`. See [Collect with PayPal and Zelle](/docs/collect-paypal-zelle).
</Callout>

## Wait for the payment [#wait-for-the-payment]

Listen for webhooks, or query the account and its events:

1. `funding_account.active` includes `instructions`. The amount is in `instructions.amount`; the account's `amount` is in `GET /v1/funding-accounts/{id}`.
2. `payin.completed` arrives when the bank confirms the payment. Its `data` is the [credited pay-in](/docs/payins), with what was credited to your balance.
3. If the payment expires or doesn't go through, `payin.failed` arrives and the account moves to `closed`.

```bash
curl "$CAIBO_API/v1/events?resource_id=fa_01m3sg9w0000000000000000" \
  -H "Authorization: Bearer $CAIBO_API_KEY"
```

## Withdraw a request [#withdraw-a-request]

If nobody has paid yet, you can withdraw the request when its rail allows it (for example, an Interac request for money the payer hasn't approved yet; Canadian rails run in sandbox only for now):

```bash
curl -X POST "$CAIBO_API/v1/funding-accounts/fa_01m3sg9w0000000000000000/cancel" \
  -H "Authorization: Bearer $CAIBO_API_KEY" \
  -H "Idempotency-Key: withdraw-order-1042"
```

1. The response is `202` with `cancellation.status: requested`. We ask the provider to withdraw it (`funding_account.cancel_requested`).
2. When the provider confirms it ended without a payment, `payin.failed` arrives with `failure_code: cancelled_at_provider`, the account moves to `closed` and `cancellation.status` to `cancelled`. Nothing is credited; no funds were held either.
3. A payment always wins: if the payer paid first, it's credited like any other (`payin.completed`) and `cancellation.status` moves to `refused` (`already_paid` or `refused_by_provider`).

If it can't be withdrawn, the response is `409 funding_account_not_cancellable` with the reason in `reasons`: `not_a_request`, `not_open_yet`, `provider_cannot_cancel`, `already_paid`, `already_closed` or `managed_by_remittance`.

## Errors on create [#errors-on-create]

| HTTP | `code` | Why |
| --- | --- | --- |
| 400 | `invalid_parameter` · `payer` | A payer detail is missing, unrecognized, or malformed. Or you sent `payer` without `amount`. |
| 400 | `invalid_request` | `amount` isn't a positive decimal, or the currency doesn't exist. |
| 422 | `amount_required` | That method and currency are collected with an amount: send `amount`. |
| 422 | `one_payment_unavailable` | That method and currency open an account without an amount: don't send `amount`. |
| 422 | `amount_below_minimum` | The amount is below the method's minimum (`min_amount` on the capability; 32.70 PEN by bank transfer in Peru). |
| 422 | `amount_above_maximum` | The amount is above the method's maximum (`max_amount` on the capability). |
| 422 | `amount_below_fee` | The amount doesn't cover the method's fee (`fee_bps` and `fee_fixed` on the capability). |
| 422 | `unsupported_method` | That method and currency aren't available for collecting. |
| 503 | `operation_suspended` | It's suspended for now. |

If the account can't be opened, it's still created and moves to `failed` with a `failure_code` (`provider_rejected`, `provider_unavailable`, `provider_amount_mismatch`, `no_route`). In that case, create another one with a new `Idempotency-Key`.
