ORD-10482 for 12 500 DZD, paid by a customer from their Broco balance to a merchant connected as conn_mrc_4f7Kp2.
1
Prepare the order
When the customer selects Broco Pay at checkout, your server gathers the payment details.
2
Create the payment
Use a key tied to the order attempt, so a retry never creates a second payment.
Request
Response
3
Send the customer to Broco
Redirect the customer to
authorization_url. The customer sees the merchant and the amount, signs in if needed, and confirms. On a phone, the Broco app can open instead.4
Receive the result on your server
Broco sends If the customer returns before the event arrives, retrieve the payment with
payment.succeeded to your webhook endpoint. Check that data.id is the payment you created, then check data.merchant_connection, data.order_reference, data.amount and data.currency against the order. Then mark it as paid.Event (excerpt)
GET /v1/payments/pay_9Xc2LmQ7.5
Show the confirmation
When the customer returns to
return_url, display the status your server confirmed.Next step
Payment lifecycle
Handle pending, declined, canceled and expired payments.