Test Scenarios
In the sandbox environment, you can test different payment link scenarios to understand how the API responds in various situations. By default, attempts to create, deactivate, refund, list charge transactions, and retrieve charge details are configured to return successfully if the rules are followed. To simulate other flows, use the following payment link IDs and temporary transaction IDs:
Payment Link IDsβ
ID | Test Scenario | Status Code | Result Description |
---|---|---|---|
17496673826849ce36a1c29 | Non-existent payment link | 404 | This ID simulates a scenario where the payment link was not found. Use it to test how your application handles non-existent payment links. |
17496626166849bb9851578 | Transaction fetch failure | 500 | This ID simulates a scenario in which fetching transactions by payment link ID fails. Use it on the transaction listing route to test and handle this scenario in your application. |
173887430167a51dbd8ee2d | Payment link with no transaction | 200 | This ID simulates a scenario where the payment link has no associated transaction. Use it to test how your application handles valid links with no transactions. |
Any other ID will return a fixed listing on the transaction listing route.
Deactivating Payment Linksβ
To test deactivation, you must create a payment link in the sandbox environment using the
creation route and use the generated ID found in the URL within the link
attribute.
Considering a response for payment link generation like:
{
...
"link": "https://link.ppay.me/p/173887430167a51dbd8ee2x",
...
}
The ID would be 173887430167a51dbd8ee2x
.
None of the IDs from the previous table will be valid here; all will return an error (status code 404).
Transaction IDsβ
Successful Responseβ
Status code: 200
These IDs simulate a scenario where a refund is performed successfully. Use them to test how your application handles successful full or partial refunds.
9f1c6b2a-3f4e-4b8d-a6c2-22e12f5a9d74
d5307f3e-6a0b-4f1b-bf44-85e1f6bce2e2
a834d7f4-1d3c-4eaa-8c10-b4a6f7587b29
c25b3c7e-04f9-4dfe-bdf1-1b59ecbbd0e4
7f4ae1b9-28a2-40c3-b74e-0a8f09b6a1d3
Error Responseβ
Status code: 400
These IDs simulate a scenario where the refund fails. Use them to test how your application handles failed full or partial refunds.
e379b4d5-791c-48c8-bc19-3e908a6de9b7
0e35f4a7-68b5-4d30-91f6-7d6e4d5acddb
b9d174c9-49f9-4b30-945a-90fc0d39e7a1
8b65a34f-0b21-46f9-b4e7-f2db2a3cb278
3d62b85f-9e74-4f66-9a44-4c73c94b9f5f
For partial refunds, the response will depend on the value sent and will be shown in the amount
field together with the original transaction amount in the originalAmount
field.
Example Given a transaction listing for a payment link like the following:
{
"originId": "Payment_Link_ID",
"transactions": [
{
"id": "9f1c6b2a-3f4e-4b8d-a6c2-22e12f5a9d74",
"status": "PAYED",
"amount": 450,
"createdAt": "2025-04-13 13:12:55",
"updatedAt": "2025-04-15 13:12:55"
},
],
"perPage": 10,
"currentPage": 1,
"nextPage": null
}
The partial refund response will be:
{
"transactionId": "9f1c6b2a-3f4e-4b8d-a6c2-22e12f5a9d74",
"amount": 100,
"originalAmount": 450
}
Scenario Testing Tipsβ
- Make sure to test all scenarios so your application can handle different API responses.
- Watch how your application treats errors and the API response messages.
By using these cards or tokens in your sandbox environment tests, you can prepare your application for a variety of situations that may occur in production.