Skip to Content

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).

Terminal
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:

Response (part)
{
  "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:

  1. 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.
  2. Show it yourself. Render qris.content as 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_payer is always merchant.
  • total (what the customer pays) equals amount.
  • net (what you receive) is total - fee.
  • fee is 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:

FieldMeaning
expires_atWhen the payment closes. Set it with expires_in (seconds): 60 to 86400, default 86400 (24 hours).
qris.expires_atWhen 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:

Terminal
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.content changes.
  • If qris.expires_at has 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.
ErrorWhen
409 not_qrisThe payment has no QR (a virtual account, or method: any before the customer picked).
409 not_payableThe 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:

  • status becomes paid, paid_at is set, and qris becomes null.
  • We send the payment.paid webhook 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}/check asks 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.
Terminal
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

statusMeaning
pendingWaiting for the customer to pay.
paidPaid. Deliver the order.
expiredPast expires_at without payment. Can still become paid (paid_late).
failedThe QR could not be made. No customer saw it.
refundedThe 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.