PIX Test Scenarios
In the sandbox environment, you can test different transaction scenarios to understand how the API responds in various situations.
By default, all attempts to generate a QR Code are configured to be approved. To simulate other flows, use the following expiration:
Test Expiration for QR Code Generation​
| Expiration | Test Scenario | Result Description |
|---|---|---|
| 321 | Timeout in QR Code Generation | This expiration time is used to test scenarios where the API may return a timeout (502) during QR Code generation. |
Test Scenarios for Refund​
To test the refund scenario, you must first create a QR Code and store the ID returned upon creation.
After that, use the QR Code ID in the refund request.
By default, if the amount passed in the refund matches the amount of the generated QR Code, the refund will be approved.
If it is different, a 400 error will be returned.
Tips for Scenario Testing​
- Make sure to test all scenarios to ensure your application can handle different API responses.
- Observe how your application handles errors and response messages provided by the API.