Trying to pay a Pix QR Code in the Sandbox without a registered key = 404 error
404 error when paying a Pix QR Code in the Sandbox
When using the endpoint below in the Sandbox, the API may return 404 Not Found:
POST /v3/pix/qrCodes/payThis error may occur when the QR Code was generated from a charge created through the interface and the account does not have a registered Pix key.
Cause
In the Sandbox, the QR Code payload may not be registered when:
- the account does not have a valid Pix key;
- the charge uses the Bradesco Pix integration, which does not generate this payload in the Sandbox.
In this scenario, although the payload appears on the charge, it cannot be found by the payment endpoint.
Example of the flow with the error
Account without a Pix key
↓
Create charge through the interface
↓
Get the QR Code payload
↓
Send the payment
↓
404 Not FoundRequest example:
{
"qrCode": {
"payload": "payloadObtainedFromCharge"
},
"value": 50
}How to fix it
- Register a Pix key in the Sandbox account.
- Create a new Pix charge after registering the key.
- Get the new QR Code payload.
- Send the payload to the payment endpoint.
- Validate the result of the operation.
Register Pix key
↓
Create new Pix charge
↓
Get the payload
↓
Pay the QR Code
↓
Validate the resultRegistering the key does not fix previously created QR Codes.
After registering the Pix key, generate a new charge to get another payload.
How to confirm the fix
After running the new test, confirm that:
- the payload was generated after the key was registered;
- the URL and the API key belong to the Sandbox;
- the paying account has a balance;
- the endpoint returned a response other than
404; - the transaction status was updated;
- the related Webhooks were processed by the application.
See the Pix QR Code payment reference for the request parameters.
Related content
Updated 11 days ago
Did this page help you?
