Lewati ke konten

Create a payment

Creates a payment: QRIS (returns qris.content), a virtual account (va_bank; returns va.number) or any (the buyer picks on the checkout page). Always returns the hosted checkout_url.

Otorisasi

apiKey
headerAuthorizationBearer <token>

lbp_test_... or lbp_live_...

Parameter header

Idempotency-Key*string
Lengthlength <= 255

Body permintaan

application/json
  1. body
amount*integer

Whole rupiah. QRIS: 1,000 to 10,000,000. Virtual account: 10,000 to 50,000,000. any: 1,000 to 50,000,000 (the buyer sees only the methods that take the amount).

Range1000 <= value <= 50000000
reference*string

Your order id.

Length1 <= length <= 64
method?string

qris (the default) or va (needs va_bank) fix the method now. any lets the buyer pick on the checkout page among the app's switched-on methods that take this amount; until then the payment has no qris or va, fee 0 and total = amount, and the method, fee, total and fee_payer are set by the buyer's pick.

Default"qris"
Value in"qris""va""any"
va_bank?string

For method va: the bank of the virtual account. Amounts from 10,000 to 50,000,000.

Value in"mandiri""bri""bni""bsi""cimb""permata""maybank""danamon"
expires_in?integer

Seconds the payment stays open: up to 86400 (24 h) for qris and va, up to 2592000 (30 days) for any. Its QR is renewed as needed (see POST /v1/payments/{id}/qris).

Range60 <= value <= 2592000
Default86400
description?string
Lengthlength <= 255
customer?
return_url?string

https URL the buyer returns to after paying.

metadata?

Up to 20 keys and 4 KB

Body respons

Created

application/json
  1. response
id*string
object*"payment"
Value in"payment"
app_id*string

The app (integration) the payment belongs to: the key's app, or the one picked in the dashboard.

mode*string
Value in"test""live"
reference*string
method*string

any: the buyer has not picked a method yet on the checkout page (fee, total and fee_payer are final once it is qris or va).

Value in"qris""va""any"
status*string

A paid payment is never undone, only refunded.

Value in"pending""paid""expired""failed""refunded"
currency*"IDR"
Value in"IDR"
amount*integer
fee*integer

Our fee

total*integer

What the buyer pays: the amount, plus the fee when fee_payer is customer.

net*integer

What the merchant receives: total minus fee.

fee_payer*string

Who pays our fee, from the app's settings when the payment was created. customer (virtual accounts only): the buyer pays amount + fee. QRIS is always merchant.

Value in"merchant""customer"
refunded_amount*integer
paid_late*boolean

Paid after it expired.

review_reason*|

Set when our team is checking this payment: a different amount was paid (never booked), a second QR of the payment was paid too (not booked), or the issuer reports a refund we did not make. Null otherwise.

Value in"amount_mismatch""duplicate_payment""refunded_at_issuer"null
description*string
customer*
metadata*
return_url*string|null
checkout_url*string
provider_ref*|

The payment provider's reference, for reconciliation with bank or provider reports: the paid QR's (or, while pending, the current QR's) reference number, or the virtual account's transaction id. Null until there is one (method any before the buyer's pick).

qris*|

Present while pending.

va*|

For method va: the account the buyer transfers the exact total to. Paid is confirmed by the bank's callback; it may arrive after expires_at (paid_late).

expires_at*string
Formatdate-time
paid_at*|
Formatdate-time
created_at*string
Formatdate-time
source*|

Who made it: an API key, a team member on the dashboard (a tagihan), a subscription's invoice, a Xendit-compatible invoice, or a Duitku-compatible transaction. Null for payments made before 2026-11-29.

Value in"api""dashboard""subscription""xendit""duitku"null
created_by*|

For source dashboard: the team member who made it (their name then).

subscription*|

For a subscription's invoice: which subscription and which period (cycle from 1; periods skipped while paused or while the plan was off keep their numbers).

Contoh permintaan
curl -X POST 'https://pay.piti.id/v1/payments' \  -H 'Idempotency-Key: string' \  -H 'Content-Type: application/json' \  -d '{  "amount": 150000,  "reference": "INV-1042",  "method": "qris",  "description": "Order 1042",  "return_url": "https://shop.example/orders/1042"}'
Contoh respons
{  "id": "string",  "object": "payment",  "app_id": "string",  "mode": "test",  "reference": "string",  "method": "qris",  "status": "pending",  "currency": "IDR",  "amount": 0,  "fee": 0,  "total": 0,  "net": 0,  "fee_payer": "merchant",  "refunded_amount": 0,  "paid_late": true,  "review_reason": "amount_mismatch",  "description": "string",  "customer": {},  "metadata": {},  "return_url": "string",  "checkout_url": "string",  "provider_ref": "string",  "qris": {    "content": "string",    "expires_at": "2019-08-24T14:15:22Z"  },  "va": {    "bank": "mandiri",    "bank_name": "string",    "number": "string"  },  "expires_at": "2019-08-24T14:15:22Z",  "paid_at": "2019-08-24T14:15:22Z",  "created_at": "2019-08-24T14:15:22Z",  "source": "api",  "created_by": {    "id": "string",    "name": "string"  },  "subscription": {    "id": "string",    "cycle": 0,    "period_start": "2019-08-24T14:15:22Z",    "period_end": "2019-08-24T14:15:22Z"  }}