# Receive over Bre-B

> Register alphanumeric Bre-B keys so people transfer straight into your COP balance, instantly and at any hour.

[Sandbox · coming soon]

Bre-B is Colombia's instant payment system. With a key (`@yourcompany`) your customers transfer from their bank's app and the money lands in your COP balance within seconds, any day at any hour.

## Register a key

**POST** `/v1/bre-b/keys` — Create a Bre-B key · [Sandbox · coming soon] · [See the reference](https://developers.zulu.com.co/en/reference/create-bre-b-key.md)

**POST /v1/bre-b/keys**

```bash
curl https://sandbox.zulu.com.co/v1/bre-b/keys \
  -H "Authorization: Bearer $ZULU_ACCESS_TOKEN" \
  -H "X-API-Key: $ZULU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "key": "@acmepagos"
}'
```

```javascript
const response = await fetch('https://sandbox.zulu.com.co/v1/bre-b/keys', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.ZULU_ACCESS_TOKEN}`,
    'X-API-Key': process.env.ZULU_API_KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "key": "@acmepagos"
  }),
});

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

```python
import os

import requests

response = requests.post(
    "https://sandbox.zulu.com.co/v1/bre-b/keys",
    headers={
        "Authorization": f"Bearer {os.environ['ZULU_ACCESS_TOKEN']}",
        "X-API-Key": os.environ["ZULU_API_KEY"],
    },
    json={
        "key": "@acmepagos",
    },
    timeout=30,
)
print(response.status_code, response.json())
```

- The key is `@` followed by 1 to 30 letters or digits.
- Keys starting with `@zulu` and the sandbox's test data are reserved.
- A workspace holds up to 5 keys. To create another, delete one you do not use.

You can use several keys to split your collection channels (`@acmestore`, `@acmebilling`): every deposit carries the key that received it.

## Key statuses

| Status              | Receives payments | What it means                                         |
| ------------------- | ----------------- | ----------------------------------------------------- |
| `ACTIVE`            | Yes               | Active.                                               |
| `ACTIVE_BY_CLIENT`  | Yes               | Active, reactivated by its holder after a suspension. |
| `BLOCKED_BY_ZULU`   | No                | Blocked by zulu.                                      |
| `BLOCKED_BY_CLIENT` | No                | Suspended by its holder.                              |

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

**DELETE** `/v1/bre-b/keys/{key}` — Delete a Bre-B key · [Sandbox · coming soon] · [See the reference](https://developers.zulu.com.co/en/reference/delete-bre-b-key.md)

To delete a key, send it URL-encoded: `@acmepagos` → `%40acmepagos`. QR codes tied to that key stop taking payments.

## Receive a transfer

Every transfer to your key creates a deposit with `method: BRE_B` and `reference` equal to the key, and sends the `DEPOSITS` webhook. Bre-B accepts up to 12,110,000 COP per transfer.

In the sandbox, simulate the incoming transfer:

**POST** `/v1/sandbox/bre-b/transfers/in` — Simulate an incoming Bre-B transfer · [Sandbox only] · [See the reference](https://developers.zulu.com.co/en/reference/simulate-bre-b-transfer-in.md)

**POST /v1/sandbox/bre-b/transfers/in**

```bash
curl https://sandbox.zulu.com.co/v1/sandbox/bre-b/transfers/in \
  -H "Authorization: Bearer $ZULU_ACCESS_TOKEN" \
  -H "X-API-Key: $ZULU_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "key": "@acmepagos",
  "amount": 250000,
  "payer": {
    "fullName": "Marta Ruiz",
    "documentType": "CC",
    "documentNumber": "52123456",
    "bankName": "Banco Davivienda"
  }
}'
```

```javascript
const response = await fetch('https://sandbox.zulu.com.co/v1/sandbox/bre-b/transfers/in', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.ZULU_ACCESS_TOKEN}`,
    'X-API-Key': process.env.ZULU_API_KEY,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "key": "@acmepagos",
    "amount": 250000,
    "payer": {
      "fullName": "Marta Ruiz",
      "documentType": "CC",
      "documentNumber": "52123456",
      "bankName": "Banco Davivienda"
    }
  }),
});

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

```python
import os

import requests

response = requests.post(
    "https://sandbox.zulu.com.co/v1/sandbox/bre-b/transfers/in",
    headers={
        "Authorization": f"Bearer {os.environ['ZULU_ACCESS_TOKEN']}",
        "X-API-Key": os.environ["ZULU_API_KEY"],
    },
    json={
        "key": "@acmepagos",
        "amount": 250000,
        "payer": {
            "fullName": "Marta Ruiz",
            "documentType": "CC",
            "documentNumber": "52123456",
            "bankName": "Banco Davivienda",
        },
    },
    timeout=30,
)
print(response.status_code, response.json())
```

## Errors

| HTTP | error | cause | Description |
| --- | --- | --- | --- |
| 404 | `NotFoundApiError` | `bre-b key "%s" not found` | The key does not exist (in your workspace, or in the Bre-B directory when resolving it). Test data: `@notfound`. |
| 409 | `ResourceConflictApiError` | `bre-b key "%s" already exists` | You already registered that key. |
| 422 | `UnprocessableEntityApiError` | `the workspace already has %d bre-b keys` | You reached the workspace maximum of keys. Delete one to create another. |
| 422 | `UnprocessableEntityApiError` | `bre-b key "%s" is reserved` | Keys starting with `@zulu` and the sandbox test data are reserved. |
| 422 | `UnprocessableEntityApiError` | `bre-b key "%s" is blocked` | The key is blocked and does not receive payments. |
| 422 | `UnprocessableEntityApiError` | `amount %d is above the bre-b maximum of %d` | Bre-B accepts up to 12,110,000 COP per transfer. |

> **Want to pay a Bre-B key?**
>
> That is a withdrawal: see [Pay over Bre-B](https://developers.zulu.com.co/en/docs/payout/bre-b.md).
