> For the complete documentation index, see [llms.txt](https://docs.pagsmile.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pagsmile.com/reference/payout/submit-a-payout/colombia/bre-b.md).

# Bre-B

How to use Bre-B to submit a payout in Colombia.

### Overview

Bre-B is Colombia's interoperable instant payment system. Pagsmile enables merchants to send payouts to recipients using a Bre-B key, such as a phone number, email address, identification number, alias, or merchant number.

Before submitting a payout, merchants can optionally use the **Resolve a Bre-B Key** endpoint to validate the key and retrieve its associated recipient and bank account information. This recommended pre-check helps confirm the intended recipient and reduce payouts sent to an incorrect or inactive key.

{% hint style="info" %}
Key resolution is a read-only operation. It does not create a payout, reserve funds, or transfer money. A successfully resolved key does not guarantee that the subsequent payout will succeed.
{% endhint %}

### Recommended Integration Flow

1. Collect the recipient's Bre-B key.
2. Optionally resolve the key and confirm its status and associated recipient information.
3. Submit the Bre-B payout after the recipient information has been confirmed.
4. Use the payout notification or the Payout Detail API to determine the final payout result.

{% hint style="info" %}
The Bre-B payment method, fee configuration, and route must be enabled for the merchant application before either endpoint can be used.
{% endhint %}

### Resolve a Bre-B Key

<mark style="color:green;">`POST`</mark> `https://sandbox.transfersmile.com/api/payout/resolve-key`

Use this endpoint to validate a Bre-B key and retrieve its associated recipient and account information before submitting a payout.

#### Headers

| Name            | Type   | Required | Description                                                                                                                                                        |
| --------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Content-Type`  | string | Yes      | Request content type. Use `application/json; charset=UTF-8`.                                                                                                       |
| `AppId`         | string | Yes      | Merchant application ID obtained from the Pagsmile dashboard.                                                                                                      |
| `Authorization` | string | Yes      | SHA-256 signature generated from the sorted Request Body parameters and the merchant App Key. See [Security](https://docs.pagsmile.com/reference/payout/security). |

#### Request Body

| Name        | Type    | Required | Constraints                                                                                              | Description                                                                                 |
| ----------- | ------- | -------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| `method`    | string  | Yes      | Fixed value: `BRE-B`.                                                                                    | Payment method.                                                                             |
| `country`   | string  | Yes      | Fixed value: `COL`.                                                                                      | ISO 3166-1 alpha-3 country code for Colombia.                                               |
| `key`       | string  | Yes      | Maximum length: 255 characters. Must not be empty or contain only spaces.                                | Bre-B key to resolve. Submit the original value without removing prefixes or leading zeros. |
| `key_type`  | string  | Yes      | One of `EMAIL`, `PHONE`, `ID`, `ALIAS`, or `MERNO`. Values are case-sensitive and must be uppercase.     | Type of Bre-B key.                                                                          |
| `timestamp` | integer | Yes      | Current Unix timestamp in seconds. It must be within 15 seconds before or after the current server time. | Time when the request is sent.                                                              |

#### Supported Key Types

| Value   | Description                                      |
| ------- | ------------------------------------------------ |
| `EMAIL` | Email address registered as a Bre-B key.         |
| `PHONE` | Phone number registered as a Bre-B key.          |
| `ID`    | Identification number registered as a Bre-B key. |
| `ALIAS` | Alias registered as a Bre-B key.                 |
| `MERNO` | Merchant number registered as a Bre-B key.       |

#### Request Sample

```json
{
  "method": "BRE-B",
  "country": "COL",
  "key": "31******37",
  "key_type": "PHONE",
  "timestamp": 1793259280
}
```

Replace `timestamp` with the current Unix timestamp in seconds and generate `Authorization` using the final Request Body values.

#### Success Response

`data` is always an array, including when only one account is resolved.

```json
{
  "code": 200,
  "msg": "success",
  "time": 1793259037,
  "data": [
    {
      "key_status": "ACTIVA",
      "key": "31******37",
      "key_type": "PHONE",
      "document_type": "CC",
      "document_id": "10******71",
      "name": "IN********LO",
      "account_type": "PHONE",
      "account_number": "87********48",
      "bank_name": "Nequi"
    }
  ]
}
```

#### Response Body

| Name   | Type    | Description                                                               |
| ------ | ------- | ------------------------------------------------------------------------- |
| `code` | integer | Response code. `200` indicates that the key resolution request succeeded. |
| `msg`  | string  | Response message.                                                         |
| `time` | integer | Unix timestamp in seconds indicating when the response was generated.     |
| `data` | array   | Resolved Bre-B key and recipient account information.                     |

Each object in `data` contains the following fields:

| Name             | Type   | Description                                                                                |
| ---------------- | ------ | ------------------------------------------------------------------------------------------ |
| `key_status`     | string | Status returned for the Bre-B key. For example, `ACTIVA` indicates that the key is active. |
| `key`            | string | Bre-B key submitted in the request.                                                        |
| `key_type`       | string | Type of Bre-B key submitted in the request.                                                |
| `document_type`  | string | Recipient identification document type.                                                    |
| `document_id`    | string | Recipient identification document number.                                                  |
| `name`           | string | Recipient name.                                                                            |
| `account_type`   | string | Type of the associated recipient account.                                                  |
| `account_number` | string | Associated recipient account number.                                                       |
| `bank_name`      | string | Name of the financial institution associated with the recipient account.                   |

{% hint style="info" %}
`code: 200` means that the key resolution request succeeded; it does not mean that a payout was completed. Confirm `key_status` and the returned recipient information before continuing with the payout.
{% endhint %}

#### Key Could Not Be Resolved

The following response is returned when no account can be resolved from the supplied key:

```json
{
  "code": 4001302,
  "msg": "bank account error: key could not be resolved",
  "time": 1793259619,
  "data": {}
}
```

### Submit a Payout by Bre-B in Colombia

<mark style="color:green;">`POST`</mark> `https://sandbox.transfersmile.com/api/payout`

Use this endpoint to submit a Bre-B payout in Colombia.

#### Headers

| Name            | Type   | Required | Description                                                                                                                                                        |
| --------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `Content-Type`  | string | Yes      | Request content type. Use `application/json; charset=UTF-8`.                                                                                                       |
| `AppId`         | string | Yes      | Merchant application ID obtained from the Pagsmile dashboard.                                                                                                      |
| `Authorization` | string | Yes      | SHA-256 signature generated from the sorted Request Body parameters and the merchant App Key. See [Security](https://docs.pagsmile.com/reference/payout/security). |

#### Request Body

| Name                | Type   | Required | Constraints                                                                  | Description                                                                                                       |
| ------------------- | ------ | -------- | ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `name`              | string | Yes      | Length: 5–100 characters. Must match the name associated with `document_id`. | Recipient's full name.                                                                                            |
| `account`           | string | Yes      | Maximum length: 64 characters.                                               | Recipient's Bre-B key. Supported key forms include email address, phone number, identification number, and alias. |
| `document_id`       | string | Yes      | See Supported Document Types.                                                | Recipient's identification document number.                                                                       |
| `document_type`     | string | Yes      | One of `CC`, `CE`, `PEP`, `NIT`, `TI`, or `PAS`.                             | Recipient's identification document type.                                                                         |
| `method`            | string | Yes      | Fixed value: `BRE-B`.                                                        | Payout method.                                                                                                    |
| `custom_code`       | string | Yes      | Maximum length: 50 characters. Must be unique for the merchant application.  | Merchant-defined payout reference.                                                                                |
| `fee_bear`          | string | Yes      | One of `merchant` or `beneficiary`.                                          | Party that bears the payout fee.                                                                                  |
| `amount`            | number | Yes      | Integer from `1,000` to `11,550,000`.                                        | Payout amount. The currency represented by this value is determined by `amount_type`.                             |
| `amount_type`       | string | No       | One of `source_amount` or `arrival_amount`. Default: `arrival_amount`.       | Specifies whether `amount` is the debit amount in `source_currency` or the amount received in `arrival_currency`. |
| `source_currency`   | string | Yes      | One of `USD`, `GBP`, `EUR`, or `COP`.                                        | Currency debited from the merchant balance.                                                                       |
| `arrival_currency`  | string | Yes      | Fixed value: `COP`.                                                          | Currency received by the recipient.                                                                               |
| `notify_url`        | string | Yes      | Valid URL; maximum length: 255 characters.                                   | URL that receives asynchronous payout status notifications.                                                       |
| `additional_remark` | string | Yes      | Length: 4–40 characters.                                                     | Additional payout description.                                                                                    |
| `country`           | string | Yes      | Fixed value: `COL`.                                                          | ISO 3166-1 alpha-3 country code for Colombia.                                                                     |

#### Request Sample

```json
{
  "name": "TEST USER",
  "account": "pagsmile_test_success@pagsmile.com",
  "document_id": "10******71",
  "document_type": "CC",
  "method": "BRE-B",
  "custom_code": "breb_payout_202610290001",
  "fee_bear": "merchant",
  "amount": "1000",
  "amount_type": "arrival_amount",
  "source_currency": "COP",
  "arrival_currency": "COP",
  "notify_url": "https://merchant.example.com/payout/notify",
  "additional_remark": "Bre-B payout",
  "country": "COL"
}
```

#### Success Response

```json
{
  "code": 200,
  "msg": "success",
  "time": 1793259700,
  "data": {
    "id": "TS2026********",
    "custom_code": "breb_payout_202610290001",
    "arrival_amount": "1000",
    "arrival_currency": "COP",
    "source_amount": "1000",
    "source_currency": "COP",
    "status": "IN_PROCESSING"
  }
}
```

{% hint style="warning" %}
The synchronous response only confirms that the payout request was accepted. Use the payout notification or the Payout Detail API as the source of truth for the final payout status.
{% endhint %}

#### Response Body

| Name                    | Type    | Description                                                           |
| ----------------------- | ------- | --------------------------------------------------------------------- |
| `code`                  | integer | Response code. `200` indicates that the payout request was accepted.  |
| `msg`                   | string  | Response message.                                                     |
| `time`                  | integer | Unix timestamp in seconds indicating when the response was generated. |
| `data.id`               | string  | Pagsmile payout transaction ID.                                       |
| `data.custom_code`      | string  | Merchant-defined payout reference submitted in the request.           |
| `data.arrival_amount`   | string  | Amount to be received by the recipient.                               |
| `data.arrival_currency` | string  | Currency to be received by the recipient.                             |
| `data.source_amount`    | string  | Amount debited from the merchant balance.                             |
| `data.source_currency`  | string  | Currency debited from the merchant balance.                           |
| `data.status`           | string  | Initial payout status.                                                |

#### Error Responses

{% tabs %}
{% tab title="400 Invalid Parameter" %}

```json
{
  "code": 4001000,
  "msg": "invalid parameter",
  "time": 1793259700,
  "data": {}
}
```

{% endtab %}

{% tab title="403 Permission Denied" %}

```json
{
  "code": 4004003,
  "msg": "permission denied",
  "time": 1793259700,
  "data": {}
}
```

{% endtab %}

{% tab title="500 Fee Not Configured" %}

```json
{
  "code": 5001003,
  "msg": "fee not configured",
  "time": 1793259700,
  "data": {}
}
```

{% endtab %}

{% tab title="500 Balance Insufficient" %}

```json
{
  "code": 5001102,
  "msg": "balance insufficient",
  "time": 1793259700,
  "data": {}
}
```

{% endtab %}

{% tab title="500 System Error" %}

```json
{
  "code": 5001000,
  "msg": "system error",
  "time": 1793259700,
  "data": {}
}
```

{% endtab %}
{% endtabs %}

### Supported Document Types

| Value | Document                            | Constraints                            |
| ----- | ----------------------------------- | -------------------------------------- |
| `CC`  | Cédula de Ciudadanía                | 6–10 numeric characters.               |
| `CE`  | Cédula de Extranjería               | Maximum length: 12 characters.         |
| `PEP` | Permiso Especial de Permanencia     | Maximum length: 15 numeric characters. |
| `NIT` | Número de Identificación Tributaria | 9–10 numeric characters.               |
| `TI`  | Tarjeta de Identidad                | 6–10 numeric characters.               |
| `PAS` | Pasaporte                           | Maximum length: 9 numeric characters.  |
