Bre-B via Widget
Display Bre-B in the DEUNA Payment Widget, choose between QR code and key payments, and verify the final payment status.
On this page
This guide explains how to offer Bre-B with the DEUNA Payment Widget. The shopper pays from their bank app with a QR code or a Bre-B key, and the widget updates automatically when DEUNA confirms the payment.
Prerequisites#
Before you start, make sure you have:
- The Bre-B connection enabled for your merchant. Contact your DEUNA account team.
- An order token for an order in
COP. - The DEUNA SDK integrated in your project.
- Reviewed the Payment Widget documentation for your platform.
Payment method configuration#
Display Bre-B in the Payment Widget by passing its configuration in the paymentMethods parameter:
[
{
"paymentMethod": "bank_transfer",
"processors": ["breb"]
}
]When paymentMethods contains only Bre-B, the widget opens directly on Bre-B.
Payment Widget — Web#
DeunaSDK.initPaymentWidget({
orderToken: 'YOUR_ORDER_TOKEN',
paymentMethods: [
{
paymentMethod: 'bank_transfer',
processors: ['breb'],
},
],
callbacks: { ... },
});Payment Widget — Android#
// MODAL
deunaSDK.initPaymentWidget(
context = context,
orderToken = orderToken,
callbacks = PaymentWidgetCallbacks().apply { ... },
paymentMethods = listOf(
mapOf(
"paymentMethod" to "bank_transfer",
"processors" to listOf("breb")
)
)
)
// EMBEDDED
PaymentWidgetConfiguration(
orderToken = orderToken,
paymentMethods = listOf(
mapOf(
"paymentMethod" to "bank_transfer",
"processors" to listOf("breb")
)
),
callbacks = PaymentWidgetCallbacks().apply { ... }
)Payment Widget — iOS#
// MODAL
deunaSDK.initPaymentWidget(
orderToken: "YOUR_ORDER_TOKEN",
callbacks: ...,
paymentMethods: [
[
"paymentMethod": "bank_transfer",
"processors": ["breb"]
]
]
)
// EMBEDDED
DeunaWidget(
deunaSDK: deunaSDK,
configuration: PaymentWidgetConfiguration(
orderToken: "YOUR_ORDER_TOKEN",
callbacks: PaymentWidgetCallbacks(
onSuccess: { order in },
onError: { error in },
onEventDispatch: { event, data in }
),
paymentMethods: [
[
"paymentMethod": "bank_transfer",
"processors": ["breb"]
]
]
)
)Payment Widget — React Native#
deunaSDK.initPaymentWidget({
orderToken: 'YOUR_ORDER_TOKEN',
paymentMethods: [
{
paymentMethod: 'bank_transfer',
processors: ['breb'],
},
],
callbacks: { ... },
});Choose the payment options#
Choose whether your shoppers pay with a QR code, a key, or can pick either one. The variant applies to every Bre-B payment of your merchant.
| Variant | Before paying | After clicking Pay |
|---|---|---|
qr (default) | A Bre-B card explains that a QR code is generated. | The QR code, a countdown, instructions, and a Descargar código QR (download QR code) button. |
key | A Bre-B card explains that a Bre-B key is generated. | The LLAVE (key) with a copy button, a countdown, and instructions to enter the key and the exact amount. |
key_qr | Two options: Llave Bre-B (selected by default) and QR Bre-B. | The QR code or the key, depending on the option the shopper selected. |
Set the variant in widgets_general_config.behavior.payment_methods.apms.breb.variant of your checkout configuration. If you do not set it, shoppers see the QR code.
curl --request PATCH \
--url https://api.sandbox.deuna.io/api/v1/merchants/{merchant_id}/checkout/configurations \
--header 'Authorization: Bearer YOUR_MERCHANT_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"widgets_general_config": {
"behavior": {
"payment_methods": {
"apms": {
"breb": {
"variant": "key_qr"
}
}
}
}
}
}'const response = await fetch("https://api.sandbox.deuna.io/api/v1/merchants/{merchant_id}/checkout/configurations", {
method: "PATCH",
headers: {
"Authorization": "Bearer YOUR_MERCHANT_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"widgets_general_config": {
"behavior": {
"payment_methods": {
"apms": {
"breb": {
"variant": "key_qr"
}
}
}
}
}
})
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const data = await response.json();import requests
response = requests.request(
"PATCH",
"https://api.sandbox.deuna.io/api/v1/merchants/{merchant_id}/checkout/configurations",
headers={
"Authorization": "Bearer YOUR_MERCHANT_TOKEN",
"Content-Type": "application/json"
},
json={
"widgets_general_config": {
"behavior": {
"payment_methods": {
"apms": {
"breb": {
"variant": "key_qr"
}
}
}
}
}
},
)
response.raise_for_status()
data = response.json()<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.deuna.io/api/v1/merchants/{merchant_id}/checkout/configurations",
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_MERCHANT_TOKEN",
"Content-Type: application/json"
],
CURLOPT_POSTFIELDS => json_encode([
"widgets_general_config" => [
"behavior" => [
"payment_methods" => [
"apms" => [
"breb" => [
"variant" => "key_qr"
]
]
]
]
]
])
]);
$response = curl_exec($curl);
curl_close($curl);import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.sandbox.deuna.io/api/v1/merchants/{merchant_id}/checkout/configurations"))
.header("Authorization", "Bearer YOUR_MERCHANT_TOKEN")
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"widgets_general_config\": {\n \"behavior\": {\n \"payment_methods\": {\n \"apms\": {\n \"breb\": {\n \"variant\": \"key_qr\"\n }\n }\n }\n }\n }\n }"))
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(
request, HttpResponse.BodyHandlers.ofString()
);
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
request, err := http.NewRequest("PATCH", "https://api.sandbox.deuna.io/api/v1/merchants/{merchant_id}/checkout/configurations", strings.NewReader("{\n \"widgets_general_config\": {\n \"behavior\": {\n \"payment_methods\": {\n \"apms\": {\n \"breb\": {\n \"variant\": \"key_qr\"\n }\n }\n }\n }\n }\n }"))
if err != nil { panic(err) }
request.Header.Set("Authorization", "Bearer YOUR_MERCHANT_TOKEN")
request.Header.Set("Content-Type", "application/json")
response, err := http.DefaultClient.Do(request)
if err != nil { panic(err) }
defer response.Body.Close()
body, _ := io.ReadAll(response.Body)
fmt.Println(string(body))
}{
"widgets_general_config": {
"behavior": {
"payment_methods": {
"apms": {
"breb": {
"variant": "key"
}
}
}
}
}
}For production, replace https://api.sandbox.deuna.io with https://api.deuna.io. Test the change in sandbox before applying it in production. The variant is read when the widget loads, so new widgets use the new value.
What the shopper sees after paying#
- QR code: the shopper scans the QR code from the Bre-B section of their bank app, checks the amount, and confirms. They can also download the QR code to scan it later from another device.
- Key: the shopper copies the key, enters it with the exact order amount in the Bre-B section of their bank app, and confirms.
- Countdown: the QR code or key is valid until the countdown ends.
- Change payment method: the shopper can go back and choose another payment method.
The screen updates automatically when DEUNA confirms the payment.
Verify the payment#
- Successful payment: the widget calls
onSuccesswith the order. Confirm the final status with your webhooks before fulfilling the order. - Payment not completed: if the shopper does not pay before the countdown ends, the payment expires and the widget reports an error through
onError. - Events: use
onEventDispatchto follow the shopper's progress, for example when they cancel or change the payment method.
Customization#
The Bre-B screens support the standard widget customizations through CustomStyle, such as the merchant logo, the payment method selector title, and Powered by DEUNA. See Customize the UI/UX of widgets using CustomStyles.
Limitations#
- Available in Colombia only and supports COP only.
- With the key option, a payment for a different amount than the order is not processed.
- The payment option is set per merchant through the variant; it cannot be set per order.
- Recurring payments are not supported in this flow.