Testing
Build and test your integration in test mode, with no real money.
Test mode lets you build your whole integration before you take real money. It is on for every account from sign-up, before business verification.
What test mode is
- You use a test key (
lbp_test_...) and the same base URL,https://pay.piti.id. The API, fields, errors and webhooks are the same as in live. - No money moves. The test QR on the payment page is not a real QRIS code, and test virtual account numbers cannot receive a transfer. You mark payments paid yourself (below).
- Test data is separate from live data: payments, refunds, events, balance and settlements. A test key never sees live data, and the reverse. In the dashboard, the switch at the top right (Mode uji / Live) chooses which data you see.
- Each app has its own test webhook URL. In test mode it may be
http; it must still be reachable from the internet.
Simulate a payment
A test payment becomes paid when you simulate it. There are three ways:
- Payment page: the Simulasikan pembayaran button on
checkout_url. - Dashboard: Simulasikan dibayar on the payment's detail.
- API:
POST /v1/payments/{id}/simulatewith a test key. No body is needed.
curl -X POST https://pay.piti.id/v1/payments/pay_8Fq2.../simulate \
-H "Authorization: Bearer lbp_test_xxxxxxxx"A simulated payment is confirmed the same way a real one is, so everything after it is real: the payment becomes paid, payment.paid goes to your webhook, and the payment is booked in your test balance.
What simulate does in each case:
| Payment | Result |
|---|---|
QRIS or virtual account, pending | Paid with the exact total. |
expired | Paid, with paid_late: true: use this to test a payment that arrives after it expired. |
method: any, no method picked yet | Through the API or the dashboard: paid as QRIS, as if the customer had picked it. On the payment page: pick a method first, then the button shows. |
Any other status (paid, failed, refunded) | 409 not_payable. |
See the simulate reference.
Test other cases
- Expiry: create a payment with a short
expires_in(at least60seconds) and wait. It becomesexpiredand you getpayment.expired. - Refunds: refund a paid test QRIS payment with
POST /v1/payments/{id}/refunds. See Refunds. - Webhooks: send a
webhook.testevent at any time withPOST /v1/webhooks/testor the test button on the Developer page. See every delivery withGET /v1/eventsor on the Webhook page, and send one again withPOST /v1/events/{id}/redeliver. - Settlements: test mode makes simulated settlements (
simulated: true, no money moved), so you can see the reports. See Balance & settlement. - Integration checklist: in test mode, the Developer page has a checklist per app (Uji integrasi) that ticks itself from real data: key made, payment created through the API, payment paid,
webhook.testandpayment.paiddelivered with2xx.
What you cannot simulate
- Live payments. Simulating with a live key gives
409 simulation_unavailable. - Problem payments. Simulate always pays the exact total, once. A customer paying a different amount, or paying twice, cannot be simulated; in live, such a payment is held for our team to check (
review_reasonon the payment) and is never booked as paid. - Failures from the payment networks, such as
502 payment_unavailablewhen a QR or virtual account cannot be made, or a refund that fails.
Before you go live
Check that your server verifies webhook signatures, skips repeated event ids, confirms the payment is paid before fulfilling, and sends a new Idempotency-Key for each new payment. Then submit your business verification (Verifikasi bisnis) and, once it is approved, create a live key. See API keys & modes.