Simulate a collection attempt
Simulates a payment attempt to a collection in the sandbox environment.
Requirements:
- The creditor key must exist, be active and needs to be related to a collection
- The associated tenant account must be valid
Payer information: If payer information is not provided, it will be randomly generated.
Paying a QR:
Send the QR's payment_id to simulate a payment by QR, either as the QR
creation returned it (CO.COM.CRB.TRXIDP…) or as the transaction ID read
from the QR itself (P…, subfield 01 of the CO.COM.CRB.TRXID template).
It must belong to a QR of the creditor key, or the request fails with
qr_code_not_found. Leave it out to simulate a payment to the key.
Error simulation:
Use the error field to simulate different failure scenarios. The payment
will be created successfully but will receive a failure event with the
specified error.
Request Body
application/json
Sandbox attempt request
TypeScript Definitions
Use the request body type in TypeScript.
The amount of the payment
The type of the creditor's Bre-B key. Defaults to alphanumeric.
"alphanumeric""identification" | "cellphone" | "email" | "alphanumeric" | "merchant_code""alphanumeric"The value of the creditor's Bre-B key
"@MN1234567890"Optional error to simulate. If provided, the payment will fail with the specified error.
Available errors:
- tx_unknown: An unexpected error occurred
- tx_provider_unavailable: Bre-B system is unavailable
- tx_breb_timeout: Bre-B timeout
- tx_risk_control: Transaction blocked by risk control
"tx_unknown" | "tx_provider_unavailable" | "tx_breb_timeout" | "tx_risk_control""tx_risk_control"The payer's information. If not provided, will be randomly generated.
The payment_id of the QR the payer scanned, to simulate a payment by QR: either as the
QR creation returned it (CO.COM.CRB.TRXIDP…) or as the transaction ID read from the QR
itself (P…). It must belong to a QR of the creditor key. Leave it out to simulate a
payment to the key.
length <= 36"CO.COM.CRB.TRXIDPc80692c3571ffe51e4"Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://breb-participant.cert.monoban.co/api/v1/sandbox/collections/attempts" \ -H "Content-Type: application/json" \ -d '{ "amount": { "amount": 100000000, "currency": "COP" }, "creditor_key_value": "@MN1234567890" }'{
"attempt_id": "bbcolat_5tgliBmzjZ6mpQPRbQjfKj",
"attempt_state_reason": "risk_control",
"collection_id": "bbcol_5tgliBmzjZ6mpQPRbQjfKj",
"transfer_id": "bbit_5tgliBmzjZ6mpQPRbQjfKj"
}{
"code": "400 Bad Request",
"errors": [
{
"error_code": "key_not_found",
"message": "Key not found",
"path": null,
"url": null
}
],
"id": "log_7MkWaFqvfosB8fzHhb1Eql",
"message": "Malformed request"
}{
"code": "404 Not Found",
"errors": [
{
"error_code": "qr_code_not_found",
"message": "The QR code doesn't exist for this collection",
"path": null,
"url": null
}
],
"id": "log_7MkWaFqvfosB8fzHhb1Eql",
"message": "Resource not defined"
}{
"code": "500 Internal Server Error",
"errors": [
{
"error_code": "internal_error",
"message": "An unexpected error occurred",
"path": null,
"url": null
}
],
"id": "log_7MkWaFqvfosB8fzHhb1Eql",
"message": "Something went wrong on the Server"
}