QR Cancellation
Overview
Our API provides a unified endpoint to cancel QR codes generated for point-of-sale transactions. This service acts as an orchestrator that automatically determines the correct cancellation route based on the QR type, whether it's an external payment QR (PIX, BANCARD, DEPAY) or a Ueno/Internal QR.
The cancellation process ensures data consistency by handling both external connector cancellation and internal Payment Intent (PI) cancellation in the correct order.
Sequence diagram
The cancellation flow varies depending on the QR type:
External QR Cancellation (PIX, BANCARD, DEPAY)
For external QR codes, the system first cancels the transaction with the external connector, and only proceeds to cancel the internal Payment Intent if the external cancellation is successful.
Ueno/Internal QR Cancellation
For Ueno/Internal QR codes, the system directly cancels the internal Payment Intent without contacting external connectors.
How it works
QR Type Identification
The service automatically identifies the QR type based on the QR ID:
- External QR: QR codes associated with external payment connectors (PIX, BANCARD, DEPAY)
- Ueno/Internal QR: QR codes generated internally by Geopagos
Cancellation Logic
External QR Codes
- Geopagos API identifies the external connector (PIX, BANCARD, or DEPAY)
- It invokes the cancellation endpoint of the corresponding connector
- If the external cancellation is successful, Geopagos API proceeds to cancel the internal Payment Intent
- If the external cancellation fails, the Payment Intent is NOT cancelled, and an error response is returned
Ueno/Internal QR Codes
- Geopagos API directly cancels the internal Payment Intent
- No external connector communication is required
Error Handling
If the cancellation fails at any step:
- For external QR codes: If the external connector cancellation fails, the entire operation fails and the Payment Intent remains active
- For internal QR codes: The error is returned directly to the caller
- Geopagos API returns a standardized error response indicating the failure reason
Request
The cancellation endpoint requires the following path parameters:
- point_of_sale_id: The point of sale identifier associated with the QR code (path parameter)
- qr_id: The unique identifier of the QR code to cancel (path parameter)
API reference
See the Acceptor API for detailed information about the cancellation endpoint, including request parameters, response formats, and error codes.