Referensi API
Nakiba Pay Tenant API · versi 1.2.0 · openapi.yaml
Payment API for products of PT Nakiba Data Teknologi (tenants).
Authentication: Authorization: Bearer <api_key>. Sandbox keys
(nk_sandbox_…) work only on the sandbox deployment, production keys
(nk_production_…) only on production.
Idempotency: every POST requires an Idempotency-Key header (1–255
printable ASCII characters, e.g. a UUID). Retrying with the same key and
body returns the original response with Idempotent-Replayed: true.
Reusing a key with a different body returns 422. Successful (2xx)
responses are remembered for 24 hours; 4xx and 5xx responses are not, so
a fixed request can be sent again with the same key.
Integration guide: https://pay.nakiba.com/docs/integrasi.
Rate limits: 600 requests per 10 seconds per API key (and 50 per
second per IP at the edge). Above that the API answers 429
rate_limited with Retry-After (seconds); RateLimit-Limit,
RateLimit-Remaining, and RateLimit-Reset show the key's budget.
Amounts are integer rupiah (IDR). No decimals.
Webhooks: every payment status change is POSTed to the tenant's
callback URL; see the webhooks section and
https://pay.nakiba.com/docs/webhook.
Server
| Lingkungan | Base URL |
|---|---|
| Production | https://pay.nakiba.com/api/v1 |
| Sandbox (Midtrans sandbox) | https://pay-sandbox.nakiba.com/api/v1 |
| Local development | http://localhost:8080/api/v1 |
Pembayaran
Create a payment
POST/api/v1/payments
Creates a Midtrans Snap checkout session and returns its redirect_url
and snap_token. The payment starts as pending; the final status
arrives through the payment.* webhooks.
Requires scope payments:write.
Parameter
| Nama | Di | Tipe | Keterangan |
|---|---|---|---|
Idempotency-Keywajib | header | string | Panjang 1–255 karakter. |
Body application/json
Skema CreatePaymentRequest
| Field | Tipe | Keterangan |
|---|---|---|
tenant_order_idwajib | string | The order ID in the tenant's system. Unique per tenant, no control characters. Panjang maksimal 100 karakter. |
amountwajib | integer | Total in rupiah. Must equal the sum of Minimal 1. |
customer_id | string (uuid) | A customer from the registry (POST /customers). Send this or |
customer | object | Optional. When given, email or phone is required, and the customer is stored and passed to Midtrans (shown on the payment page, used for payment instructions). Omit it entirely when the tenant does not share buyer contact data. |
customer.email | string (email) | |
customer.phone | string | 8–15 digits, optionally starting with + |
customer.name | string | Panjang maksimal 100 karakter. |
itemswajib | object[] | 1–100 item. |
items[].sku | string | Panjang maksimal 50 karakter. |
items[].namewajib | string | Panjang maksimal 50 karakter. |
items[].qtywajib | integer | Rentang 1–10000. |
items[].unit_pricewajib | integer | Minimal 0. |
methods | PaymentMethod[] | Methods to offer. Default is every method enabled for the tenant. |
expiry_minutes | integer | Rentang 1–10080. Bawaan |
success_redirect_url | string (uri) | Where the customer returns after the Snap page (https). Without it, Midtrans sends the customer to the neutral Nakiba Pay page /checkout/finish, which only shows the status. |
metadata | object | Free-form data (max 4 KB), returned on the payment and in webhooks. |
coupon_code | string | One of the tenant's coupons. Panjang maksimal 40 karakter. |
Contoh:
{
"tenant_order_id": "LMS-ORD-10293",
"amount": 499000,
"customer": {
"email": "budi@example.com",
"name": "Budi"
},
"items": [
{
"sku": "COURSE-K8S-101",
"name": "Kubernetes Fundamental",
"qty": 1,
"unit_price": 499000
}
],
"methods": [
"qris",
"bca_va",
"gopay"
],
"expiry_minutes": 60,
"success_redirect_url": "https://lms.gladi.id/orders/10293",
"metadata": {
"course_id": 42
}
}
Respons
| Kode | Keterangan | Isi |
|---|---|---|
201 | Payment created | Payment |
400 | Malformed JSON, unknown fields, NUL (\u0000) in a string, or a missing or non-ASCII Idempotency-Key. | Error |
401 | Missing, invalid, revoked, or wrong-environment API key. | Error |
403 | The key lacks the required scope, or the tenant is inactive. | Error |
409 |
| Error |
422 |
| Error |
502 | Midtrans is unavailable. Nothing was created; retry with the same Idempotency-Key. | Error |
Get a payment
GET/api/v1/payments/{id}
Requires scope payments:read.
Parameter
| Nama | Di | Tipe | Keterangan |
|---|---|---|---|
idwajib | path | string (uuid) |
Respons
| Kode | Keterangan | Isi |
|---|---|---|
200 | The payment | Payment |
401 | Missing, invalid, revoked, or wrong-environment API key. | Error |
404 | The payment does not exist for this tenant. | Error |
Refund a paid payment
POST/api/v1/payments/{id}/refunds
Full or partial refund. Card, GoPay, ShopeePay, and QRIS payments are
refunded through Midtrans. VA and retail payments cannot be refunded by
Midtrans: destination is required and Nakiba Pay Finance transfers
the money. Once the refunds of a payment add up to more than
Rp500.000, each further refund waits for a second person's approval.
The outcome arrives as payment.refunded or refund.failed.
Requires scope refunds:write.
Parameter
| Nama | Di | Tipe | Keterangan |
|---|---|---|---|
idwajib | path | string (uuid) | |
Idempotency-Keywajib | header | string | Panjang 1–255 karakter. |
Body application/json
Skema CreateRefundRequest
| Field | Tipe | Keterangan |
|---|---|---|
amount | integer | Rupiah. Omit to refund everything not yet refunded. Minimal 1. |
reasonwajib | string | Panjang maksimal 500 karakter. |
destination | object | Required for VA and retail payments. |
destination.bankwajib | string | Panjang maksimal 50 karakter. |
destination.account_numberwajib | string | 5-20 digits |
destination.account_namewajib | string | Panjang maksimal 100 karakter. |
Respons
| Kode | Keterangan | Isi |
|---|---|---|
201 | Refund finished ( | Refund |
202 | Refund accepted and not finished yet (pending approval, manual transfer, or processing). | Refund |
401 | Missing, invalid, revoked, or wrong-environment API key. | Error |
403 | The key lacks the required scope, or the tenant is inactive. | Error |
404 | The payment does not exist for this tenant. | Error |
409 |
| Error |
422 |
| Error |
List a payment's refunds
GET/api/v1/payments/{id}/refunds
Requires scope payments:read.
Parameter
| Nama | Di | Tipe | Keterangan |
|---|---|---|---|
idwajib | path | string (uuid) |
Respons
| Kode | Keterangan | Isi |
|---|---|---|
200 | Refunds, oldest first. | object |
401 | Missing, invalid, revoked, or wrong-environment API key. | Error |
404 | The payment does not exist for this tenant. | Error |
Cancel a pending payment
POST/api/v1/payments/{id}/cancel
Cancels the payment at Midtrans and closes its checkout page. Only
pending payments can be cancelled. If Midtrans already reports the
payment as paid or expired, the request returns 409 and the status is
updated from the Midtrans notification instead.
Requires scope payments:write.
Parameter
| Nama | Di | Tipe | Keterangan |
|---|---|---|---|
idwajib | path | string (uuid) | |
Idempotency-Keywajib | header | string | Panjang 1–255 karakter. |
Respons
| Kode | Keterangan | Isi |
|---|---|---|
200 | Payment cancelled | Payment |
401 | Missing, invalid, revoked, or wrong-environment API key. | Error |
404 | The payment does not exist for this tenant. | Error |
409 |
| Error |
502 | Midtrans is unavailable. Nothing was created; retry with the same Idempotency-Key. | Error |
Checkout
Settings for opening the Snap popup
GET/api/v1/checkout/config
Requires scope payments:write. Load snap_js_url with
data-client-key set to client_key, then call
window.snap.pay(snap_token) with the token from createPayment.
The values change only when the Midtrans account changes, so cache
them. 404 when the popup is not configured; use redirect_url.
Respons
| Kode | Keterangan | Isi |
|---|---|---|
200 | Snap popup settings for this environment | CheckoutConfig |
401 | Missing, invalid, revoked, or wrong-environment API key. | Error |
403 | The key lacks the required scope, or the tenant is inactive. | Error |
404 | The payment does not exist for this tenant. | Error |
Customer
Create or update a customer
POST/api/v1/customers
The tenant's customer registry. Finds the customer by external_id,
then email, then phone (for customers without email), updates the
fields given, and creates the customer when none matches. Fields left
out keep their stored value. At least one of external_id, email,
or phone is required.
Requires scope payments:write.
Parameter
| Nama | Di | Tipe | Keterangan |
|---|---|---|---|
Idempotency-Keywajib | header | string | Panjang 1–255 karakter. |
Body application/json
Skema CustomerRequest
| Field | Tipe | Keterangan |
|---|---|---|
external_id | string | The customer's ID in the tenant's system. Unique per tenant. Panjang maksimal 100 karakter. |
email | string (email) | |
phone | string | 8–15 digits, optionally starting with + |
name | string | Panjang maksimal 100 karakter. |
tax_id | string | NPWP, 15 or 16 digits; dots, dashes, and spaces are removed. |
company_name | string | For B2B invoices. Panjang maksimal 200 karakter. |
address | string | May span several lines. Panjang maksimal 500 karakter. |
Contoh:
{
"external_id": "ORG-7781",
"email": "finance@pt-maju.co.id",
"name": "Sari Wulandari",
"company_name": "PT Maju Bersama",
"tax_id": "01.234.567.8-901.000",
"address": "Jl. Jend. Sudirman No. 1\nJakarta 10220"
}
Respons
| Kode | Keterangan | Isi |
|---|---|---|
200 | The customer already existed and was updated. | Customer |
201 | Customer created. | Customer |
401 | Missing, invalid, revoked, or wrong-environment API key. | Error |
409 |
| Error |
422 |
| Error |
Look a customer up
GET/api/v1/customers
Requires scope payments:read. Filter by external_id or email; the list is empty when none matches.
Parameter
| Nama | Di | Tipe | Keterangan |
|---|---|---|---|
external_id | query | string | |
email | query | string |
Respons
| Kode | Keterangan | Isi |
|---|---|---|
200 | Zero or one customer. | object |
400 | Malformed JSON, unknown fields, NUL (\u0000) in a string, or a missing or non-ASCII Idempotency-Key. | Error |
401 | Missing, invalid, revoked, or wrong-environment API key. | Error |
Get a customer
GET/api/v1/customers/{id}
Requires scope payments:read.
Parameter
| Nama | Di | Tipe | Keterangan |
|---|---|---|---|
idwajib | path | string (uuid) |
Respons
| Kode | Keterangan | Isi |
|---|---|---|
200 | The customer | Customer |
401 | Missing, invalid, revoked, or wrong-environment API key. | Error |
404 | The payment does not exist for this tenant. | Error |
A customer's payment history
GET/api/v1/customers/{id}/payments
Newest first. For the next page, pass the created_at of the last
row as before. Requires scope payments:read.
Parameter
| Nama | Di | Tipe | Keterangan |
|---|---|---|---|
idwajib | path | string (uuid) | |
limit | query | integer | Rentang 1–100. Bawaan |
before | query | string (date-time) |
Respons
| Kode | Keterangan | Isi |
|---|---|---|
200 | Payments | object |
401 | Missing, invalid, revoked, or wrong-environment API key. | Error |
404 | The payment does not exist for this tenant. | Error |
Erase a customer's personal data (UU PDP)
POST/api/v1/customers/{id}/anonymize
For a customer's erasure request. Name, email, phone, tax ID, company,
address, and external_id are removed for good, also from queued
e-mails and stored webhook copies. Payments, refunds, and issued
invoices are kept as tax records (counted in retained). The profile
cannot be used for new payments or invoices afterwards. Calling it
again changes nothing. Requires scope payments:write.
Parameter
| Nama | Di | Tipe | Keterangan |
|---|---|---|---|
idwajib | path | string (uuid) | |
Idempotency-Keywajib | header | string | Panjang 1–255 karakter. |
Respons
| Kode | Keterangan | Isi |
|---|---|---|
200 | The erased profile | object |
401 | Missing, invalid, revoked, or wrong-environment API key. | Error |
404 | The payment does not exist for this tenant. | Error |
Kupon
Create a coupon
POST/api/v1/coupons
Requires scope coupons:write. Codes are unique per tenant, case-insensitive.
Parameter
| Nama | Di | Tipe | Keterangan |
|---|---|---|---|
Idempotency-Keywajib | header | string | Panjang 1–255 karakter. |
Body application/json
Skema CouponRequest
| Field | Tipe | Keterangan |
|---|---|---|
codewajib | string | Pola |
description | string | Panjang maksimal 200 karakter. |
kindwajib | string | Nilai: |
valuewajib | integer | Percent (1-100) or rupiah. Minimal 1. |
max_discount | integer | Cap on a percent discount, in rupiah. |
min_amount | integer | Smallest item total the coupon applies to. |
quota | integer | Number of payments that may use it; omit for unlimited. |
starts_at | string (date-time) | |
ends_at | string (date-time) |
Contoh:
{
"code": "OKTOBER15",
"kind": "percent",
"value": 15,
"max_discount": 75000,
"quota": 100,
"ends_at": "2026-11-01T00:00:00+07:00"
}
Respons
| Kode | Keterangan | Isi |
|---|---|---|
201 | Coupon created | Coupon |
401 | Missing, invalid, revoked, or wrong-environment API key. | Error |
403 | The key lacks the required scope, or the tenant is inactive. | Error |
409 |
| Error |
422 |
| Error |
List coupons with their use counts
GET/api/v1/coupons
Requires scope payments:read.
Respons
| Kode | Keterangan | Isi |
|---|---|---|
200 | Coupons, active first | object |
401 | Missing, invalid, revoked, or wrong-environment API key. | Error |
What a code gives on an order
GET/api/v1/coupons/{code}
Checks the code against an item total without using it, so the price
can be shown before the payment is created. The payment can still be
refused if the quota runs out in between. Requires scope payments:read.
Parameter
| Nama | Di | Tipe | Keterangan |
|---|---|---|---|
codewajib | path | string | |
amountwajib | query | integer | Item total in rupiah Minimal 1. |
Respons
| Kode | Keterangan | Isi |
|---|---|---|
200 | The quote; | object |
400 | Malformed JSON, unknown fields, NUL (\u0000) in a string, or a missing or non-ASCII Idempotency-Key. | Error |
401 | Missing, invalid, revoked, or wrong-environment API key. | Error |
404 | The payment does not exist for this tenant. | Error |
Disable a coupon
POST/api/v1/coupons/{code}/disable
New payments can no longer use it; pending payments keep their discount. Requires scope coupons:write.
Parameter
| Nama | Di | Tipe | Keterangan |
|---|---|---|---|
codewajib | path | string | |
Idempotency-Keywajib | header | string | Panjang 1–255 karakter. |
Respons
| Kode | Keterangan | Isi |
|---|---|---|
200 | The coupon, now inactive | Coupon |
401 | Missing, invalid, revoked, or wrong-environment API key. | Error |
403 | The key lacks the required scope, or the tenant is inactive. | Error |
404 | The payment does not exist for this tenant. | Error |
Invoice
Create an invoice
POST/api/v1/invoices
A draft, or issued right away with issue: true. Issuing gives the
invoice its number (per issuer, per year, without gaps), freezes it,
and makes invoice_url (a public page with a pay button) and
pdf_url available. The buyer comes from customer_id (registry),
with buyer fields overriding it. PPN follows tax_mode; the
default is the issuer's. When paid, the tenant receives
invoice.paid (and payment.paid for the underlying payment).
Requires scope invoices:write.
Parameter
| Nama | Di | Tipe | Keterangan |
|---|---|---|---|
Idempotency-Keywajib | header | string | Panjang 1–255 karakter. |
Body application/json
Skema InvoiceRequest
| Field | Tipe | Keterangan |
|---|---|---|
customer_id | string (uuid) | |
buyer | object | Who the invoice is addressed to; overrides the registry customer's fields. |
buyer.name | string | Panjang maksimal 200 karakter. |
buyer.company | string | Panjang maksimal 200 karakter. |
buyer.tax_id | string | NPWP, 15 or 16 digits |
buyer.address | string | Panjang maksimal 500 karakter. |
buyer.email | string (email) | |
lineswajib | object[] | 1–99 item. |
lines[].descriptionwajib | string | Panjang maksimal 200 karakter. |
lines[].qtywajib | integer | Rentang 1–10000. |
lines[].unit_pricewajib | integer | Minimal 0. |
due_datewajib | string (date) | |
tax_mode | string |
Nilai: |
notes | string | Panjang maksimal 1000 karakter. |
reference | string | The tenant's own reference; unique per tenant. Panjang maksimal 100 karakter. |
methods | PaymentMethod[] | Methods offered when paying; those Midtrans cannot take for the total are left out. |
tax_invoice_requested | boolean | The buyer wants a faktur pajak; buyer.tax_id is then required. |
metadata | object | |
issue | boolean | Issue right away instead of saving a draft. |
Contoh:
{
"customer_id": "0192a3c4-5d6e-7f80-9a1b-2c3d4e5f6071",
"reference": "GLD-REG-7781",
"due_date": "2026-10-15",
"lines": [
{
"description": "Bootcamp Kubernetes (3 hari)",
"qty": 8,
"unit_price": 1500000
}
],
"tax_invoice_requested": true,
"issue": true
}
Respons
| Kode | Keterangan | Isi |
|---|---|---|
201 | Invoice created | Invoice |
401 | Missing, invalid, revoked, or wrong-environment API key. | Error |
403 | The key lacks the required scope, or the tenant is inactive. | Error |
409 |
| Error |
422 |
| Error |
Look an invoice up by reference
GET/api/v1/invoices
Requires scope payments:read.
Parameter
| Nama | Di | Tipe | Keterangan |
|---|---|---|---|
referencewajib | query | string |
Respons
| Kode | Keterangan | Isi |
|---|---|---|
200 | Zero or one invoice. | object |
401 | Missing, invalid, revoked, or wrong-environment API key. | Error |
Get an invoice
GET/api/v1/invoices/{id}
Requires scope payments:read.
Parameter
| Nama | Di | Tipe | Keterangan |
|---|---|---|---|
idwajib | path | string (uuid) |
Respons
| Kode | Keterangan | Isi |
|---|---|---|
200 | The invoice | Invoice |
401 | Missing, invalid, revoked, or wrong-environment API key. | Error |
404 | The payment does not exist for this tenant. | Error |
Issue a draft
POST/api/v1/invoices/{id}/issue
Requires scope invoices:write.
Parameter
| Nama | Di | Tipe | Keterangan |
|---|---|---|---|
idwajib | path | string (uuid) | |
Idempotency-Keywajib | header | string | Panjang 1–255 karakter. |
Respons
| Kode | Keterangan | Isi |
|---|---|---|
200 | The issued invoice | Invoice |
404 | The payment does not exist for this tenant. | Error |
409 |
| Error |
Void an unpaid invoice
POST/api/v1/invoices/{id}/void
Cancels the payment still open for it first. The number stays used.
Requires scope invoices:write.
Parameter
| Nama | Di | Tipe | Keterangan |
|---|---|---|---|
idwajib | path | string (uuid) | |
Idempotency-Keywajib | header | string | Panjang 1–255 karakter. |
Body application/json
| Field | Tipe | Keterangan |
|---|---|---|
reasonwajib | string | Panjang maksimal 500 karakter. |
Respons
| Kode | Keterangan | Isi |
|---|---|---|
200 | The voided invoice | Invoice |
404 | The payment does not exist for this tenant. | Error |
409 |
| Error |
Webhook
Dikirim Nakiba Pay ke callback_url tenant. Panduan lengkap: Webhook.
Payment status changed
POSTcallback_url
Sent to the tenant's callback URL for payment.paid, payment.failed,
payment.expired, payment.cancelled, payment.refunded, and
payment.chargeback. Verify X-Nakiba-Signature
(t=<unix>,v1=<hex HMAC-SHA256(secret, "<t>.<body>")>), reject
timestamps older than 5 minutes, deduplicate by X-Nakiba-Event-Id,
and answer 2xx within 10 seconds. Failed deliveries are retried for
24 hours.
Parameter
| Nama | Di | Tipe | Keterangan |
|---|---|---|---|
X-Nakiba-Signaturewajib | header | string | |
X-Nakiba-Event-Idwajib | header | string (uuid) | |
X-Nakiba-Event-Typewajib | header | string |
Body application/json
| Field | Tipe | Keterangan |
|---|---|---|
id | string (uuid) | |
type | string | Nilai: |
created_at | string (date-time) | |
data | object | |
data.payment | Payment | |
data.refund | Refund | Present on payment.refunded (when requested through Nakiba Pay) and refund.failed. |
data.invoice | Invoice | Present on invoice.paid (instead of payment). |
Respons
| Kode | Keterangan | Isi |
|---|---|---|
200 | Any 2xx acknowledges the event. |
Skema
PaymentMethod
Tipe: string
Nilai: bca_va, bni_va, bri_va, mandiri_va, permata_va, qris, gopay, shopeepay, credit_card, alfamart, indomaret.
PaymentStatus
Tipe: string
Nilai: pending, paid, failed, expired, cancelled, refunded, partially_refunded, chargeback.
CreatePaymentRequest
| Field | Tipe | Keterangan |
|---|---|---|
tenant_order_idwajib | string | The order ID in the tenant's system. Unique per tenant, no control characters. Panjang maksimal 100 karakter. |
amountwajib | integer | Total in rupiah. Must equal the sum of Minimal 1. |
customer_id | string (uuid) | A customer from the registry (POST /customers). Send this or |
customer | object | Optional. When given, email or phone is required, and the customer is stored and passed to Midtrans (shown on the payment page, used for payment instructions). Omit it entirely when the tenant does not share buyer contact data. |
customer.email | string (email) | |
customer.phone | string | 8–15 digits, optionally starting with + |
customer.name | string | Panjang maksimal 100 karakter. |
itemswajib | object[] | 1–100 item. |
items[].sku | string | Panjang maksimal 50 karakter. |
items[].namewajib | string | Panjang maksimal 50 karakter. |
items[].qtywajib | integer | Rentang 1–10000. |
items[].unit_pricewajib | integer | Minimal 0. |
methods | PaymentMethod[] | Methods to offer. Default is every method enabled for the tenant. |
expiry_minutes | integer | Rentang 1–10080. Bawaan |
success_redirect_url | string (uri) | Where the customer returns after the Snap page (https). Without it, Midtrans sends the customer to the neutral Nakiba Pay page /checkout/finish, which only shows the status. |
metadata | object | Free-form data (max 4 KB), returned on the payment and in webhooks. |
coupon_code | string | One of the tenant's coupons. Panjang maksimal 40 karakter. |
Payment
| Field | Tipe | Keterangan |
|---|---|---|
id | string (uuid) | |
order_id | string | Global order ID sent to Midtrans: {TENANT_CODE}-{YYYYMMDD}-{ULID}. |
tenant_order_id | string | |
status | PaymentStatus | |
amount | integer | What the customer pays (subtotal minus discount). |
subtotal | integer | Item total. |
discount | integer | |
coupon_code | string | null | |
currency | string | Nilai: |
methods | PaymentMethod[] | |
paid_method | string | null | |
review_reason | string | null | Set when Nakiba Pay Finance must review the payment: paid_after_cancelled, paid_after_expired, paid_after_failed, or amount_mismatch. Usually null. |
snap_token | string | Present only while the payment is pending. |
redirect_url | string (uri) | Midtrans checkout page. Present only while the payment is pending. |
checkout_url | string (uri) | Nakiba Pay's hosted checkout page for this payment, in the tenant's colors, with a button to the Midtrans page. Present only while the payment is pending. The page itself stays reachable and shows the final status afterwards. |
customer | object | |
customer.id | string (uuid) | |
customer.external_id | string | null | |
customer.email | string | null | |
customer.phone | string | null | |
customer.name | string | null | |
items | object[] | |
items[].sku | string | null | |
items[].name | string | |
items[].qty | integer | |
items[].unit_price | integer | |
metadata | object | |
expires_at | string | null (date-time) | |
paid_at | string | null (date-time) | |
created_at | string (date-time) | |
updated_at | string (date-time) |
CustomerRequest
| Field | Tipe | Keterangan |
|---|---|---|
external_id | string | The customer's ID in the tenant's system. Unique per tenant. Panjang maksimal 100 karakter. |
email | string (email) | |
phone | string | 8–15 digits, optionally starting with + |
name | string | Panjang maksimal 100 karakter. |
tax_id | string | NPWP, 15 or 16 digits; dots, dashes, and spaces are removed. |
company_name | string | For B2B invoices. Panjang maksimal 200 karakter. |
address | string | May span several lines. Panjang maksimal 500 karakter. |
Customer
| Field | Tipe | Keterangan |
|---|---|---|
id | string (uuid) | |
external_id | string | null | |
email | string | null | |
phone | string | null | |
name | string | null | |
tax_id | string | null | NPWP digits |
company_name | string | null | |
address | string | null | |
created_at | string (date-time) | |
updated_at | string (date-time) |
CouponRequest
| Field | Tipe | Keterangan |
|---|---|---|
codewajib | string | Pola |
description | string | Panjang maksimal 200 karakter. |
kindwajib | string | Nilai: |
valuewajib | integer | Percent (1-100) or rupiah. Minimal 1. |
max_discount | integer | Cap on a percent discount, in rupiah. |
min_amount | integer | Smallest item total the coupon applies to. |
quota | integer | Number of payments that may use it; omit for unlimited. |
starts_at | string (date-time) | |
ends_at | string (date-time) |
Coupon
| Field | Tipe | Keterangan |
|---|---|---|
id | string (uuid) | |
code | string | |
description | string | null | |
kind | string | Nilai: |
value | integer | |
max_discount | integer | null | |
min_amount | integer | |
quota | integer | null | |
used | integer | Paid payments (list only). |
held | integer | Pending payments holding a unit (list only). |
starts_at | string | null (date-time) | |
ends_at | string | null (date-time) | |
active | boolean | |
created_at | string (date-time) |
InvoiceRequest
| Field | Tipe | Keterangan |
|---|---|---|
customer_id | string (uuid) | |
buyer | object | Who the invoice is addressed to; overrides the registry customer's fields. |
buyer.name | string | Panjang maksimal 200 karakter. |
buyer.company | string | Panjang maksimal 200 karakter. |
buyer.tax_id | string | NPWP, 15 or 16 digits |
buyer.address | string | Panjang maksimal 500 karakter. |
buyer.email | string (email) | |
lineswajib | object[] | 1–99 item. |
lines[].descriptionwajib | string | Panjang maksimal 200 karakter. |
lines[].qtywajib | integer | Rentang 1–10000. |
lines[].unit_pricewajib | integer | Minimal 0. |
due_datewajib | string (date) | |
tax_mode | string |
Nilai: |
notes | string | Panjang maksimal 1000 karakter. |
reference | string | The tenant's own reference; unique per tenant. Panjang maksimal 100 karakter. |
methods | PaymentMethod[] | Methods offered when paying; those Midtrans cannot take for the total are left out. |
tax_invoice_requested | boolean | The buyer wants a faktur pajak; buyer.tax_id is then required. |
metadata | object | |
issue | boolean | Issue right away instead of saving a draft. |
Invoice
| Field | Tipe | Keterangan |
|---|---|---|
id | string (uuid) | |
number | string | null | e.g. INV/NKB/2026/10/0001; null while draft |
reference | string | null | |
status | string | Nilai: |
overdue | boolean | Issued and past its due date. |
customer_id | string | null (uuid) | |
buyer | object | |
buyer.name | string | |
buyer.company | string | null | |
buyer.tax_id | string | null | |
buyer.address | string | null | |
buyer.email | string | null | |
lines | object[] | |
lines[].description | string | |
lines[].qty | integer | |
lines[].unit_price | integer | |
lines[].amount | integer | |
tax_mode | string | Nilai: |
subtotal | integer | Line total. |
tax_base | integer | DPP nilai lain. |
tax_amount | integer | PPN. |
total | integer | |
currency | string | Nilai: |
issue_date | string | null (date) | |
due_date | string (date) | |
notes | string | null | |
invoice_url | string (uri) | Public page with the pay button (issued invoices). |
pdf_url | string (uri) | |
tax_invoice | object | |
tax_invoice.requested | boolean | |
tax_invoice.number | string | null | |
tax_invoice.date | string | null (date) | |
payment_id | string | null (uuid) | |
paid_at | string | null (date-time) | |
void_reason | string | |
metadata | object | |
created_at | string (date-time) |
CreateRefundRequest
| Field | Tipe | Keterangan |
|---|---|---|
amount | integer | Rupiah. Omit to refund everything not yet refunded. Minimal 1. |
reasonwajib | string | Panjang maksimal 500 karakter. |
destination | object | Required for VA and retail payments. |
destination.bankwajib | string | Panjang maksimal 50 karakter. |
destination.account_numberwajib | string | 5-20 digits |
destination.account_namewajib | string | Panjang maksimal 100 karakter. |
Refund
| Field | Tipe | Keterangan |
|---|---|---|
id | string (uuid) | |
payment_id | string (uuid) | |
amount | integer | |
reason | string | |
channel | string | Nilai: |
status | string | Nilai: |
destination | string | null | Masked, e.g. "BCA ••••2233 a.n. Budi Santoso". |
transfer_reference | string | null | |
failure_reason | string | null | |
rejection_reason | string | null | |
approved_at | string | null (date-time) | |
completed_at | string | null (date-time) | |
created_at | string (date-time) |
CheckoutConfig
| Field | Tipe | Keterangan |
|---|---|---|
client_keywajib | string | Public Midtrans client key (not a secret) |
snap_js_urlwajib | string | |
environmentwajib | string | Nilai: |
Error
| Field | Tipe | Keterangan |
|---|---|---|
error | object | |
error.code | string | Nilai: |
error.message | string | |
error.details | For validation_error, a list of {field, message}. | |
request_id | string | Also returned in the X-Request-Id header. Quote it when contacting support. |
