# Deposits and reconciliation

> Everything that lands in your COP balance is a deposit with its payer and your reference. This is how you read and reconcile it.

[Sandbox · coming soon]

A deposit is money that landed in your COP balance: a paid PSE link, a Bre-B transfer to your key or a paid QR code. It is the piece you reconcile against your invoices and orders.

**Response 200**

```json
{
  "depositId": "SBX-MOV-CREDIT-5d1b2f0e-6c3a-4e8b-9f7d-1a2b3c4d5e6f",
  "method": "BRE_B",
  "amount": 250000,
  "currency": "COP",
  "reference": "@acmepagos",
  "externalId": "SBXBREB2611241504052K9Q",
  "payer": {
    "fullName": "Marta Ruiz",
    "documentType": "CC",
    "documentNumber": "52123456",
    "bankName": "Banco Davivienda"
  },
  "createdAt": "2026-11-24T15:04:05.123Z"
}
```

## What `reference` carries

| `method`   | `reference`                                                |
| ---------- | ---------------------------------------------------------- |
| `PSE`      | The link's `reference` (or its `slug` when you sent none). |
| `BRE_B`    | The key that received the transfer.                        |
| `BRE_B_QR` | The QR's `reference` (or its id).                          |

`externalId` is the network's identifier (PSE's CUS or the Bre-B transfer id): use it when you talk to the payer's bank. In the sandbox it is synthetic.

## Read them

**GET** `/v1/deposits` — List deposits · [Sandbox · coming soon] · [See the reference](https://developers.zulu.com.co/en/reference/list-deposits.md)

**GET** `/v1/deposits/{depositId}` — Get a deposit · [Sandbox · coming soon] · [See the reference](https://developers.zulu.com.co/en/reference/get-deposit.md)

**GET /v1/deposits**

```bash
curl "https://sandbox.zulu.com.co/v1/deposits?reference=FAC-2026-0042" \
  -H "Authorization: Bearer $ZULU_ACCESS_TOKEN" \
  -H "X-API-Key: $ZULU_API_KEY"
```

```javascript
const response = await fetch('https://sandbox.zulu.com.co/v1/deposits?reference=FAC-2026-0042', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.ZULU_ACCESS_TOKEN}`,
    'X-API-Key': process.env.ZULU_API_KEY,
  },
});

console.log(response.status, await response.json());
```

```python
import os

import requests

response = requests.get(
    "https://sandbox.zulu.com.co/v1/deposits?reference=FAC-2026-0042",
    headers={
        "Authorization": f"Bearer {os.environ['ZULU_ACCESS_TOKEN']}",
        "X-API-Key": os.environ["ZULU_API_KEY"],
    },
    timeout=30,
)
print(response.status_code, response.json())
```

Filter by `method` and `reference`, bound by Bogotá dates with `dateFrom`/`dateTo` and walk the pages as in [Pagination](https://developers.zulu.com.co/en/docs/pagination.md).

## Reconcile without losing payments

1. **Listen to the `DEPOSITS` webhook** and answer 200 as soon as it arrives.
2. **Process each `depositId` exactly once**: store it under a unique constraint and drop repeats (retries carry the same deposit).
3. **Match on `reference`** against your invoice, order or customer, and check `amount`.
4. **Sweep daily** with `GET /v1/deposits?dateFrom=…&dateTo=…`: it recovers any webhook you did not receive.

> **Partial payments and overpayments**
>
> On open-amount links, static QR codes and Bre-B keys the payer decides how much to pay. Compare `amount` with what you expected before settling an invoice.

## Errors

| HTTP | error | cause | Description |
| --- | --- | --- | --- |
| 400 | `BadRequestApiError` | `invalid value for "%s": %s` | A URL parameter can not be converted to its type (for example `page=abc`). |
| 400 | `BadRequestApiError` | `error in struct validation` | One or more fields fail their validation. `values` carries one message per field, keyed by its JSON path, naming the Go validator that failed. |
| 404 | `NotFoundApiError` | `deposit "%s" not found` | No deposit with that id exists in your workspace. |
