Skip to main content
Use POST /v3/topups to create a credit top-up invoice from your server. The response contains a signed payment_url hosted on OTP.ID, such as:
You can open this URL without logging in to the dashboard. The hash binds the link to the invoice and merchant, so another invoice ID cannot reuse it.
Create top-ups from your server only. Your API key must never be exposed in browser JavaScript, mobile apps, or public repositories.

Endpoint

Request headers

Request body

integer
required
The credit package amount in rupiah. Accepted values are 10000, 100000, 500000, 1000000, and 2000000.
integer
Optional payment method ID. If omitted, OTP.ID chooses the first active payment method that supports the selected amount.

Response fields

string
The public invoice ID for this top-up. This is safe to show to users.
string
A signed OTP.ID payment page URL. Open this URL to show QRIS or Virtual Account details on OTP.ID without requiring dashboard login.
integer
The selected credit package amount.
integer
The final amount the user must pay, including admin fee. Display this number directly; do not separately render fee percentages.
integer
The payment method used for the invoice.
string
Human-readable payment method name, such as QRIS or BRI Virtual Account.
string
Payment instruction type returned by the payment gateway. Typical values are qr and va.
string
The payment expiry time in YYYY-MM-DD HH:MM:SS format (WIB, UTC+7). Top-up payment links expire after 3 hours.
string
The top-up status. New invoices start as Pending.

Example

Success response:

Payment page behavior

The payment_url opens an OTP.ID-hosted page with the same payment details shown in the dashboard top-up flow.
  • QRIS: the QR image is displayed directly on the page, with a Download QR button.
  • Virtual Account: the VA number is displayed directly on the page, with a Copy button.
  • The final amount to pay is shown in rupiah and already includes the admin fee.
  • After the 3-hour expiry window, QR/VA instructions are no longer displayed.

Errors