Collections
Guide to testing and simulating collection payments in the Bre-B sandbox environment
This sandbox environment lets you test your collection integration end-to-end without processing real payments. You can simulate incoming payments to your collections, including both successful and failed scenarios.
Prerequisites
- At least one collection with an active Bre-B key
- The collection associated to the Bre-B key must be in
readyorminimum_paidstate.
Simulating a collection attempt
Send a POST request to simulate a payer making a payment to one of your
collection keys. This endpoint is only available in the sandbox environment.
Minimal example
{
"creditor_key_value": "@YOURBREBKEY",
"amount": {
"amount": 50000,
"currency": "COP"
}
}The sandbox will generate random payer information and payment_id if they aren't provided, and process the payment
through the full flow.
You will receive a 202 Accepted response immediately:
{
"collection_id": "bbcol_5g8k2mNpQrStUvWx",
"attempt_id": "bbcolat_7hJkLmNpQrStUvWx",
"transfer_id": "bbit_1a2b3c4d5e6f7g8h9i0j",
"attempt_state_reason": null
}A few seconds later, the webhook events will be delivered to your configured webhook URL with the final attempt result. You could receive the following collection webhooks:
collection.attempt_successful: The payment attempt was settled successfully by the simulation workflow.collection.attempt_unsuccessful: The payment attempt was rejected (either by a simulated error or a validation failure).collection.paid: The collection has reached its total amount.collection.minimum_paid: The collection has reached its minimum required amount.
Error simulation
By default, simulated payments complete successfully. To test how your
integration handles failures, pass an error field:
{
"creditor_key_value": "@MN1234567890",
"amount": {
"amount": 50000,
"currency": "COP"
},
"error": "tx_risk_control"
}The payment is still created and you will receive the 202 Accepted response,
but the subsequent webhook event will carry a rejection status.
Available error codes
| Error code | Description |
|---|---|
tx_unknown | An unexpected error occurred |
tx_provider_unavailable | The Bre-B system is unavailable |
tx_breb_timeout | The Bre-B system timed out |
tx_risk_control | Transaction blocked by risk control rules |
Expected flow
- You call the sandbox endpoint to simulate a payment.
- The API responds with
202 Accepted. - After a short delay (2–5 seconds), a webhook is sent to your configured URL.
- If no
errorwas specified, the payment settles successfully. - If an
errorwas specified, the payment is rejected with the corresponding reason.
- If no