8. Cancelling a PagBrasil Pix
It is possible to cancel an unpaid Pix payment request before the expiration date. Once cancelled, your customer will not be able to scan the QR code, although this may not prevent the payment from being processed if the customer has already scheduled it with their bank.
Your POST must be sent to https://sandbox.pagbrasil.com/api/order/cancel setting the content-type of the request header and body as "x-www-form-urlencoded".
Please note that this URL shall only be used for integration and testing procedures. Once the Payment Service Agreement is signed, you will receive the production environment's URL when you request your account to go live.
Request parameters:
Field | Description | Required | Length |
---|---|---|---|
secret | Secret phrase as defined in the PagBrasil Dashboard | Yes | 128 |
pbtoken | Token assigned to your merchant account. Your token is displayed at the PagBrasil Dashboard, menu Account > Settings. | Yes | 32 |
order | Order number | Yes | 64 |
Note: The response for the "/api/order/cancel" call will be an XML with the order details, in exactly the same format as a "/api/order/get" response (see item 5.2). From the response's parameter "order_status" you will be able to determine if the order was successfully cancelled or not. A cancelled order has the payment status "PR" (Payment Rejected). Please refer to item 5.2 for further information on the XML elements of the response.
CONFIDENTIAL