Skip to Content

Errors

The error format, every error code, and which errors to retry.

Format

Every error is JSON with an HTTP status:

{
  "error": {
    "code": "invalid_amount",
    "message": "QRIS amounts are whole rupiah from 1000 to 10000000."
  }
}
  • Act on code: it is stable.
  • message is for people (logs, your support team) and may change. Do not parse it.

Which errors to retry

AnswerWhat to do
No answer (timeout, connection error)Retry with the same Idempotency-Key.
429 rate_limitedWait for the seconds in Retry-After, then retry.
409 idempotency_in_progressRetry the same request after a moment.
500 internal_errorRetry with the same Idempotency-Key.
502 payment_unavailableDo not retry. Create a new payment with a new Idempotency-Key, or offer another method.
Any other 4xxDo not retry as it is. Fix the request, the key or the setting the code names.

See Idempotency.

Handling errors (Node.js)
const res = await fetch('https://pay.piti.id/v1/payments', { /* ... */ });
const body = await res.json();
if (!res.ok) {
  switch (body.error.code) {
    case 'method_disabled':
      // switch the method on in the dashboard, or offer another one
      break;
    case 'payment_unavailable':
      // create a new payment with a new Idempotency-Key
      break;
    default:
      console.error(res.status, body.error.code, body.error.message);
  }
}

All codes

StatusCodeMeaningWhat to do
400invalid_requestA field is missing, the wrong type or out of range; message names it.Fix the request.
400invalid_amountThe amount is not whole rupiah, or outside the method's range (QRIS, virtual account; a virtual account total with a customer-paid fee over the limit).Change the amount or the method.
422invalid_amountA refund is more than what is left to refund.Refund less.
400method_unknownmethod or va_bank is not one we know.Use qris, va (with mandiri, bri, bni, bsi, cimb, permata, maybank or danamon) or any.
400idempotency_key_requiredA POST that creates something was sent without Idempotency-Key.Add the header.
401unauthorizedNo API key, or a key that is wrong or revoked.Check the key and its mode (lbp_test_ / lbp_live_).
403account_suspendedYour business is suspended.Contact us.
403live_not_enabledA live key, but live payments are not on for your business (verification not approved yet).Use a test key, or finish business verification.
403app_disabledThis key's app is turned off in the dashboard (Developer). Its webhooks wait.Turn the app on.
404not_foundNo such payment, refund, event, plan or subscription for this key. Another app's, another mode's and another business's are all "not found".Check the id and the key.
404no_webhookGET /v1/webhooks: no webhook URL is set for this app and mode.Set one in the dashboard.
409no_webhookA test event or a resend, but no webhook URL is set.Set a webhook URL first.
409compat_activeA test event while a Xendit or Duitku compatibility mode owns this app's callback (it has no test event).Turn the compatibility mode off to use our own webhooks.
409idempotency_in_progressThe first request with this Idempotency-Key is still running.Retry the same request after a moment.
409method_disabledThe method is switched off for this app, or (method: any) no switched-on method takes this amount.Switch it on in the dashboard (Metode pembayaran), or pick another.
409not_payableThe payment is no longer waiting for payment (paid, expired or failed).Create a new payment.
409not_qrisA new QR was asked for a payment that has none (a virtual account).Use the virtual account number.
409method_not_chosenSimulating a method: any payment before the customer picked a method, where it cannot be picked for you.Pick a method on the payment page first.
409simulation_unavailableOnly test payments can be simulated, and this one cannot (a live payment, or a test payment your account sends to the provider's sandbox).Simulate test payments only. If every test payment gets this, contact us.
409not_refundableOnly paid payments can be refunded; or the payment is under review.Check the status; contact us for one under review.
409plan_inactiveSubscribing to a plan that is switched off.Switch the plan on.
409subscription_active, subscription_paused, subscription_cancelled, subscription_completedThe action does not fit the subscription's status (resume an active one, pause a cancelled one, ...). The code names the current status.Read the subscription first.
409app_disabledCreating a payment, plan or subscription for an app that is turned off (from the dashboard).Turn the app on.
413body_too_largeThe request body is too large.Send less (payments: up to 64 KB).
422idempotency_mismatchThe Idempotency-Key was used before with a different body.Use a new key for a new request.
422insufficient_balanceA refund needs your unsettled balance to cover it, and it does not.Wait for new payments, or contact us.
422method_unavailableVirtual accounts are not available yet for your business.Use QRIS.
429rate_limitedOver 120 requests a minute for this key.Back off; see Retry-After.
500internal_errorOur error. The request may not have been applied.Retry with the same Idempotency-Key.
502payment_unavailableThe QR or virtual account could not be made. Nothing was charged; no customer saw it.Create a new payment (new Idempotency-Key), or try another method.