QRIS
Take payments with one QR code that any bank or e-wallet app can pay.
QRIS is the default method. The customer scans the QR code with a bank or e-wallet app and pays. One code works for every bank and e-wallet.
Create a QRIS payment
Send method: "qris", or leave method out (QRIS is the default). Every POST that creates something needs an Idempotency-Key header (see Idempotency).
curl https://pay.piti.id/v1/payments \
-H "Authorization: Bearer lbp_test_xxxxxxxx" \
-H "Idempotency-Key: order-1042" \
-H "Content-Type: application/json" \
-d '{
"amount": 150000,
"reference": "INV-1042",
"method": "qris",
"description": "Order 1042",
"return_url": "https://shop.example/orders/1042"
}'The answer is 201 with the payment. The parts that matter for QRIS:
{
"id": "pay_8Fq2...",
"object": "payment",
"method": "qris",
"status": "pending",
"amount": 150000,
"fee": 1050,
"total": 150000,
"net": 148950,
"fee_payer": "merchant",
"checkout_url": "https://pay.piti.id/pay/pay_8Fq2...",
"qris": {
"content": "00020101021226...",
"expires_at": "2026-11-30T03:07:30Z"
},
"va": null,
"expires_at": "2026-12-01T03:00:00Z",
"paid_at": null
}The fee above is only an example. See the fee for an amount with GET /v1/methods?amount=.
Show the QR
Two ways:
- The payment page (easiest). Send the customer to
checkout_url. It shows the QR, renews it by itself and shows the result. See Payment page. - Show it yourself. Render
qris.contentas a QR image with any QR library. You then renew the QR when it is about to run out (below).
Amounts
- Whole rupiah, from Rp1,000 to Rp10,000,000 per payment (Bank Indonesia's QRIS limit).
- Outside that range, or not a whole number:
400 invalid_amount.
The merchant always pays the fee
Bank Indonesia does not allow charging the customer for QRIS. For QRIS:
fee_payeris alwaysmerchant.total(what the customer pays) equalsamount.net(what you receive) istotal - fee.feeis fixed when the payment is created and never changes.
Do not add the QRIS fee to the price the customer pays.
Two expiries: the payment and the QR
The payment and its QR code expire separately:
| Field | Meaning |
|---|---|
expires_at | When the payment closes. Set it with expires_in (seconds): 60 to 86400, default 86400 (24 hours). |
qris.expires_at | When the current QR code stops working. Much sooner, usually a few minutes. |
While the payment is open, a QR that runs out can be replaced with a new QR for the same payment.
Renew the QR
The payment page does this by itself. If you show the QR yourself, call POST /v1/payments/{id}/qris when qris.expires_at is near:
curl -X POST https://pay.piti.id/v1/payments/pay_8Fq2.../qris \
-H "Authorization: Bearer lbp_test_xxxxxxxx"- It returns the payment with a new QR in
qris, or unchanged if the current QR still has more than 30 seconds. It is safe to call repeatedly. - Replace the QR image whenever
qris.contentchanges. - If
qris.expires_athas not moved after the QR ran out, try again a moment later. - Earlier QRs are still watched. A customer who paid an older QR is still credited, once.
- A payment can have at most 60 QRs.
| Error | When |
|---|---|
409 not_qris | The payment has no QR (a virtual account, or method: any before the customer picked). |
409 not_payable | The payment is no longer waiting for payment (paid, expired or failed). |
If two QRs are paid
Only the first QR read as paid counts. If the customer also pays another QR of the same payment, that second payment is not booked and our team checks it (review_reason: "duplicate_payment").
When the payment is paid
We mark a payment paid only after we read a paid status with the exact amount from the QRIS issuer. Then:
statusbecomespaid,paid_atis set, andqrisbecomesnull.- We send the
payment.paidwebhook with the payment. See Webhooks.
If a different amount was paid, the payment is not marked paid. Our team checks it (review_reason: "amount_mismatch").
A paid payment is never undone, only refunded.
Expiry
After expires_at, the status becomes expired (shortly after) and we send the payment.expired webhook.
A customer who paid a QR just before it ran out can still be credited later. The payment then becomes paid with paid_late: true, and you get payment.paid. So handle payment.paid even after payment.expired.
Check the status
Rely on webhooks. As a fallback:
GET /v1/payments/{id}returns the payment as we have it now.POST /v1/payments/{id}/checkasks us to read the status from the QRIS issuer now, then returns the payment. At most once every 5 seconds per payment; calls more often return the payment as it is.
curl -X POST https://pay.piti.id/v1/payments/pay_8Fq2.../check \
-H "Authorization: Bearer lbp_test_xxxxxxxx"We also read open payments on our own, on a schedule.
Payment statuses
status | Meaning |
|---|---|
pending | Waiting for the customer to pay. |
paid | Paid. Deliver the order. |
expired | Past expires_at without payment. Can still become paid (paid_late). |
failed | The QR could not be made. No customer saw it. |
refunded | The whole amount was refunded. |
If the QR cannot be made when you create the payment, you get 502 payment_unavailable. Nothing was charged. Create a new payment with a new Idempotency-Key, or try another method. See Errors.
Try it in the sandbox
With an lbp_test_ key, pay a test payment with POST /v1/payments/{id}/simulate or the simulate button on the payment page. See Testing.