Nakiba PayDeveloper Masuk dashboard

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

LingkunganBase URL
Productionhttps://pay.nakiba.com/api/v1
Sandbox (Midtrans sandbox)https://pay-sandbox.nakiba.com/api/v1
Local developmenthttp://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

NamaDiTipeKeterangan
Idempotency-Keywajibheaderstring

Panjang 1–255 karakter.

Body application/json

Skema CreatePaymentRequest

FieldTipeKeterangan
tenant_order_idwajibstring

The order ID in the tenant's system. Unique per tenant, no control characters.

Panjang maksimal 100 karakter.

amountwajibinteger

Total in rupiah. Must equal the sum of qty × unit_price.

Minimal 1.

customer_idstring (uuid)

A customer from the registry (POST /customers). Send this or customer, not both.

customerobject

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.emailstring (email)
customer.phonestring

8–15 digits, optionally starting with +

customer.namestring

Panjang maksimal 100 karakter.

itemswajibobject[]

1–100 item.

items[].skustring

Panjang maksimal 50 karakter.

items[].namewajibstring

Panjang maksimal 50 karakter.

items[].qtywajibinteger

Rentang 1–10000.

items[].unit_pricewajibinteger

Minimal 0.

methodsPaymentMethod[]

Methods to offer. Default is every method enabled for the tenant.

expiry_minutesinteger

Rentang 1–10080. Bawaan 1440.

success_redirect_urlstring (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.

metadataobject

Free-form data (max 4 KB), returned on the payment and in webhooks.

coupon_codestring

One of the tenant's coupons. amount stays the item total; the payment charges amount minus the discount, and Midtrans shows a discount line. 422 on coupon_code when the coupon does not apply.

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

KodeKeteranganIsi
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

duplicate_tenant_order_id: a payment already exists for this tenant_order_id (its ID is in error.details.payment_id), or idempotency_key_in_progress.

Error
422

validation_error (see error.details) or idempotency_key_reused.

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

NamaDiTipeKeterangan
idwajibpathstring (uuid)

Respons

KodeKeteranganIsi
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

NamaDiTipeKeterangan
idwajibpathstring (uuid)
Idempotency-Keywajibheaderstring

Panjang 1–255 karakter.

Body application/json

Skema CreateRefundRequest

FieldTipeKeterangan
amountinteger

Rupiah. Omit to refund everything not yet refunded.

Minimal 1.

reasonwajibstring

Panjang maksimal 500 karakter.

destinationobject

Required for VA and retail payments.

destination.bankwajibstring

Panjang maksimal 50 karakter.

destination.account_numberwajibstring

5-20 digits

destination.account_namewajibstring

Panjang maksimal 100 karakter.

Respons

KodeKeteranganIsi
201

Refund finished (succeeded or failed).

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

invalid_state: the payment is not paid or partially refunded.

Error
422

validation_error (see error.details) or idempotency_key_reused.

Error

List a payment's refunds

GET/api/v1/payments/{id}/refunds

Requires scope payments:read.

Parameter

NamaDiTipeKeterangan
idwajibpathstring (uuid)

Respons

KodeKeteranganIsi
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

NamaDiTipeKeterangan
idwajibpathstring (uuid)
Idempotency-Keywajibheaderstring

Panjang 1–255 karakter.

Respons

KodeKeteranganIsi
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

invalid_state: the payment is not pending, or the customer is paying right now.

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

KodeKeteranganIsi
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

NamaDiTipeKeterangan
Idempotency-Keywajibheaderstring

Panjang 1–255 karakter.

Body application/json

Skema CustomerRequest

FieldTipeKeterangan
external_idstring

The customer's ID in the tenant's system. Unique per tenant.

Panjang maksimal 100 karakter.

emailstring (email)
phonestring

8–15 digits, optionally starting with +

namestring

Panjang maksimal 100 karakter.

tax_idstring

NPWP, 15 or 16 digits; dots, dashes, and spaces are removed.

company_namestring

For B2B invoices.

Panjang maksimal 200 karakter.

addressstring

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

KodeKeteranganIsi
200

The customer already existed and was updated.

Customer
201

Customer created.

Customer
401

Missing, invalid, revoked, or wrong-environment API key.

Error
409

customer_conflict: the email or external_id belongs to another customer.

Error
422

validation_error (see error.details) or idempotency_key_reused.

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

NamaDiTipeKeterangan
external_idquerystring
emailquerystring

Respons

KodeKeteranganIsi
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

NamaDiTipeKeterangan
idwajibpathstring (uuid)

Respons

KodeKeteranganIsi
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

NamaDiTipeKeterangan
idwajibpathstring (uuid)
limitqueryinteger

Rentang 1–100. Bawaan 20.

beforequerystring (date-time)

Respons

KodeKeteranganIsi
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

NamaDiTipeKeterangan
idwajibpathstring (uuid)
Idempotency-Keywajibheaderstring

Panjang 1–255 karakter.

Respons

KodeKeteranganIsi
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

NamaDiTipeKeterangan
Idempotency-Keywajibheaderstring

Panjang 1–255 karakter.

Body application/json

Skema CouponRequest

FieldTipeKeterangan
codewajibstring

Pola ^[A-Za-z0-9][A-Za-z0-9_-]{2,39}$.

descriptionstring

Panjang maksimal 200 karakter.

kindwajibstring

Nilai: percent, amount.

valuewajibinteger

Percent (1-100) or rupiah.

Minimal 1.

max_discountinteger

Cap on a percent discount, in rupiah.

min_amountinteger

Smallest item total the coupon applies to.

quotainteger

Number of payments that may use it; omit for unlimited.

starts_atstring (date-time)
ends_atstring (date-time)

Contoh:

{
  "code": "OKTOBER15",
  "kind": "percent",
  "value": 15,
  "max_discount": 75000,
  "quota": 100,
  "ends_at": "2026-11-01T00:00:00+07:00"
}

Respons

KodeKeteranganIsi
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

coupon_exists: the tenant already has this code.

Error
422

validation_error (see error.details) or idempotency_key_reused.

Error

List coupons with their use counts

GET/api/v1/coupons

Requires scope payments:read.

Respons

KodeKeteranganIsi
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

NamaDiTipeKeterangan
codewajibpathstring
amountwajibqueryinteger

Item total in rupiah

Minimal 1.

Respons

KodeKeteranganIsi
200

The quote; valid false with a reason when the code does not apply.

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

NamaDiTipeKeterangan
codewajibpathstring
Idempotency-Keywajibheaderstring

Panjang 1–255 karakter.

Respons

KodeKeteranganIsi
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

NamaDiTipeKeterangan
Idempotency-Keywajibheaderstring

Panjang 1–255 karakter.

Body application/json

Skema InvoiceRequest

FieldTipeKeterangan
customer_idstring (uuid)
buyerobject

Who the invoice is addressed to; overrides the registry customer's fields.

buyer.namestring

Panjang maksimal 200 karakter.

buyer.companystring

Panjang maksimal 200 karakter.

buyer.tax_idstring

NPWP, 15 or 16 digits

buyer.addressstring

Panjang maksimal 500 karakter.

buyer.emailstring (email)
lineswajibobject[]

1–99 item.

lines[].descriptionwajibstring

Panjang maksimal 200 karakter.

lines[].qtywajibinteger

Rentang 1–10000.

lines[].unit_pricewajibinteger

Minimal 0.

due_datewajibstring (date)
tax_modestring

exclusive: prices exclude PPN, which is added. inclusive: prices include it. PPN is 12% of DPP nilai lain (11/12 of the selling price). Default: the issuer's setting.

Nilai: none, exclusive, inclusive.

notesstring

Panjang maksimal 1000 karakter.

referencestring

The tenant's own reference; unique per tenant.

Panjang maksimal 100 karakter.

methodsPaymentMethod[]

Methods offered when paying; those Midtrans cannot take for the total are left out.

tax_invoice_requestedboolean

The buyer wants a faktur pajak; buyer.tax_id is then required.

metadataobject
issueboolean

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

KodeKeteranganIsi
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

duplicate_reference, or issuer_incomplete (the issuer lacks an address or NPWP for a PPN invoice).

Error
422

validation_error (see error.details) or idempotency_key_reused.

Error

Look an invoice up by reference

GET/api/v1/invoices

Requires scope payments:read.

Parameter

NamaDiTipeKeterangan
referencewajibquerystring

Respons

KodeKeteranganIsi
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

NamaDiTipeKeterangan
idwajibpathstring (uuid)

Respons

KodeKeteranganIsi
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

NamaDiTipeKeterangan
idwajibpathstring (uuid)
Idempotency-Keywajibheaderstring

Panjang 1–255 karakter.

Respons

KodeKeteranganIsi
200

The issued invoice

Invoice
404

The payment does not exist for this tenant.

Error
409

invalid_state (not a draft) or issuer_incomplete.

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

NamaDiTipeKeterangan
idwajibpathstring (uuid)
Idempotency-Keywajibheaderstring

Panjang 1–255 karakter.

Body application/json

FieldTipeKeterangan
reasonwajibstring

Panjang maksimal 500 karakter.

Respons

KodeKeteranganIsi
200

The voided invoice

Invoice
404

The payment does not exist for this tenant.

Error
409

invalid_state: already paid or void, or the open payment is being paid.

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

NamaDiTipeKeterangan
X-Nakiba-Signaturewajibheaderstring
X-Nakiba-Event-Idwajibheaderstring (uuid)
X-Nakiba-Event-Typewajibheaderstring

Body application/json

FieldTipeKeterangan
idstring (uuid)
typestring

Nilai: payment.paid, payment.failed, payment.expired, payment.cancelled, payment.refunded, payment.chargeback, refund.failed, invoice.paid, ping.

created_atstring (date-time)
dataobject
data.paymentPayment
data.refundRefund

Present on payment.refunded (when requested through Nakiba Pay) and refund.failed.

data.invoiceInvoice

Present on invoice.paid (instead of payment).

Respons

KodeKeteranganIsi
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

FieldTipeKeterangan
tenant_order_idwajibstring

The order ID in the tenant's system. Unique per tenant, no control characters.

Panjang maksimal 100 karakter.

amountwajibinteger

Total in rupiah. Must equal the sum of qty × unit_price.

Minimal 1.

customer_idstring (uuid)

A customer from the registry (POST /customers). Send this or customer, not both.

customerobject

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.emailstring (email)
customer.phonestring

8–15 digits, optionally starting with +

customer.namestring

Panjang maksimal 100 karakter.

itemswajibobject[]

1–100 item.

items[].skustring

Panjang maksimal 50 karakter.

items[].namewajibstring

Panjang maksimal 50 karakter.

items[].qtywajibinteger

Rentang 1–10000.

items[].unit_pricewajibinteger

Minimal 0.

methodsPaymentMethod[]

Methods to offer. Default is every method enabled for the tenant.

expiry_minutesinteger

Rentang 1–10080. Bawaan 1440.

success_redirect_urlstring (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.

metadataobject

Free-form data (max 4 KB), returned on the payment and in webhooks.

coupon_codestring

One of the tenant's coupons. amount stays the item total; the payment charges amount minus the discount, and Midtrans shows a discount line. 422 on coupon_code when the coupon does not apply.

Panjang maksimal 40 karakter.

Payment

FieldTipeKeterangan
idstring (uuid)
order_idstring

Global order ID sent to Midtrans: {TENANT_CODE}-{YYYYMMDD}-{ULID}.

tenant_order_idstring
statusPaymentStatus
amountinteger

What the customer pays (subtotal minus discount).

subtotalinteger

Item total.

discountinteger
coupon_codestring | null
currencystring

Nilai: IDR.

methodsPaymentMethod[]
paid_methodstring | null
review_reasonstring | 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_tokenstring

Present only while the payment is pending.

redirect_urlstring (uri)

Midtrans checkout page. Present only while the payment is pending.

checkout_urlstring (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.

customerobject
customer.idstring (uuid)
customer.external_idstring | null
customer.emailstring | null
customer.phonestring | null
customer.namestring | null
itemsobject[]
items[].skustring | null
items[].namestring
items[].qtyinteger
items[].unit_priceinteger
metadataobject
expires_atstring | null (date-time)
paid_atstring | null (date-time)
created_atstring (date-time)
updated_atstring (date-time)

CustomerRequest

FieldTipeKeterangan
external_idstring

The customer's ID in the tenant's system. Unique per tenant.

Panjang maksimal 100 karakter.

emailstring (email)
phonestring

8–15 digits, optionally starting with +

namestring

Panjang maksimal 100 karakter.

tax_idstring

NPWP, 15 or 16 digits; dots, dashes, and spaces are removed.

company_namestring

For B2B invoices.

Panjang maksimal 200 karakter.

addressstring

May span several lines.

Panjang maksimal 500 karakter.

Customer

FieldTipeKeterangan
idstring (uuid)
external_idstring | null
emailstring | null
phonestring | null
namestring | null
tax_idstring | null

NPWP digits

company_namestring | null
addressstring | null
created_atstring (date-time)
updated_atstring (date-time)

CouponRequest

FieldTipeKeterangan
codewajibstring

Pola ^[A-Za-z0-9][A-Za-z0-9_-]{2,39}$.

descriptionstring

Panjang maksimal 200 karakter.

kindwajibstring

Nilai: percent, amount.

valuewajibinteger

Percent (1-100) or rupiah.

Minimal 1.

max_discountinteger

Cap on a percent discount, in rupiah.

min_amountinteger

Smallest item total the coupon applies to.

quotainteger

Number of payments that may use it; omit for unlimited.

starts_atstring (date-time)
ends_atstring (date-time)

Coupon

FieldTipeKeterangan
idstring (uuid)
codestring
descriptionstring | null
kindstring

Nilai: percent, amount.

valueinteger
max_discountinteger | null
min_amountinteger
quotainteger | null
usedinteger

Paid payments (list only).

heldinteger

Pending payments holding a unit (list only).

starts_atstring | null (date-time)
ends_atstring | null (date-time)
activeboolean
created_atstring (date-time)

InvoiceRequest

FieldTipeKeterangan
customer_idstring (uuid)
buyerobject

Who the invoice is addressed to; overrides the registry customer's fields.

buyer.namestring

Panjang maksimal 200 karakter.

buyer.companystring

Panjang maksimal 200 karakter.

buyer.tax_idstring

NPWP, 15 or 16 digits

buyer.addressstring

Panjang maksimal 500 karakter.

buyer.emailstring (email)
lineswajibobject[]

1–99 item.

lines[].descriptionwajibstring

Panjang maksimal 200 karakter.

lines[].qtywajibinteger

Rentang 1–10000.

lines[].unit_pricewajibinteger

Minimal 0.

due_datewajibstring (date)
tax_modestring

exclusive: prices exclude PPN, which is added. inclusive: prices include it. PPN is 12% of DPP nilai lain (11/12 of the selling price). Default: the issuer's setting.

Nilai: none, exclusive, inclusive.

notesstring

Panjang maksimal 1000 karakter.

referencestring

The tenant's own reference; unique per tenant.

Panjang maksimal 100 karakter.

methodsPaymentMethod[]

Methods offered when paying; those Midtrans cannot take for the total are left out.

tax_invoice_requestedboolean

The buyer wants a faktur pajak; buyer.tax_id is then required.

metadataobject
issueboolean

Issue right away instead of saving a draft.

Invoice

FieldTipeKeterangan
idstring (uuid)
numberstring | null

e.g. INV/NKB/2026/10/0001; null while draft

referencestring | null
statusstring

Nilai: draft, issued, paid, void.

overdueboolean

Issued and past its due date.

customer_idstring | null (uuid)
buyerobject
buyer.namestring
buyer.companystring | null
buyer.tax_idstring | null
buyer.addressstring | null
buyer.emailstring | null
linesobject[]
lines[].descriptionstring
lines[].qtyinteger
lines[].unit_priceinteger
lines[].amountinteger
tax_modestring

Nilai: none, exclusive, inclusive.

subtotalinteger

Line total.

tax_baseinteger

DPP nilai lain.

tax_amountinteger

PPN.

totalinteger
currencystring

Nilai: IDR.

issue_datestring | null (date)
due_datestring (date)
notesstring | null
invoice_urlstring (uri)

Public page with the pay button (issued invoices).

pdf_urlstring (uri)
tax_invoiceobject
tax_invoice.requestedboolean
tax_invoice.numberstring | null
tax_invoice.datestring | null (date)
payment_idstring | null (uuid)
paid_atstring | null (date-time)
void_reasonstring
metadataobject
created_atstring (date-time)

CreateRefundRequest

FieldTipeKeterangan
amountinteger

Rupiah. Omit to refund everything not yet refunded.

Minimal 1.

reasonwajibstring

Panjang maksimal 500 karakter.

destinationobject

Required for VA and retail payments.

destination.bankwajibstring

Panjang maksimal 50 karakter.

destination.account_numberwajibstring

5-20 digits

destination.account_namewajibstring

Panjang maksimal 100 karakter.

Refund

FieldTipeKeterangan
idstring (uuid)
payment_idstring (uuid)
amountinteger
reasonstring
channelstring

Nilai: gateway, manual.

statusstring

Nilai: pending_approval, approved, processing, succeeded, failed, rejected.

destinationstring | null

Masked, e.g. "BCA ••••2233 a.n. Budi Santoso".

transfer_referencestring | null
failure_reasonstring | null
rejection_reasonstring | null
approved_atstring | null (date-time)
completed_atstring | null (date-time)
created_atstring (date-time)

CheckoutConfig

FieldTipeKeterangan
client_keywajibstring

Public Midtrans client key (not a secret)

snap_js_urlwajibstring
environmentwajibstring

Nilai: sandbox, production.

Error

FieldTipeKeterangan
errorobject
error.codestring

Nilai: bad_request, validation_error, unauthorized, forbidden, not_found, duplicate_tenant_order_id, customer_conflict, coupon_exists, duplicate_reference, issuer_incomplete, invalid_state, idempotency_key_required, idempotency_key_reused, idempotency_key_in_progress, gateway_error, internal_error, request_too_large, unsupported_media_type.

error.messagestring
error.details

For validation_error, a list of {field, message}.

request_idstring

Also returned in the X-Request-Id header. Quote it when contacting support.