# Authentication Source: https://docs.singapay.id/api-reference/authentication Authenticate SingaPay Payment Gateway REST API requests using OAuth 2.0 client credentials, Bearer tokens, and required headers. All REST API endpoints require authentication before you can call them. Webhook callbacks use a separate [HMAC signature scheme](/api-reference/webhooks/security-and-signature). *** ## Obtain an access token Request a JWT access token using your **Client ID** and **Client Secret** from the merchant dashboard. Request a token using **`POST /api/v1.1/access-token/b2b`**, listed under **Security** in the API reference sidebar (OpenAPI-generated endpoint page). > [!NOTE] > > You can also use `POST /api/v1.0/access-token/b2b` on older integrations. ### Token request headers | Header | Value | | - | - | | `Authorization` | `Basic {base64(client_id:client_secret)}` | | `X-PARTNER-ID` | Your API key (Partner ID) | | `Content-Type` | `application/x-www-form-urlencoded` or `application/json` | ### Token request body | Field | Value | | - | - | | `grant_type` | `client_credentials` | The response includes a Bearer token and expiry time. Request a new token before the current one expires. *** ## Authenticated API requests Include these headers on every REST API call after you obtain a token: | Header | Description | | - | - | | `Authorization` | `Bearer {access_token}` | | `X-PARTNER-ID` | Your API key from the merchant dashboard | | `Content-Type` | `application/json` (unless the endpoint specifies otherwise) | ```http theme={null} Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... X-PARTNER-ID: b3ed7d4b-a96c-6c08-b3c7-12c3124242d9 Content-Type: application/json ``` *** ## Signed requests (selected endpoints) Some money-out operations require additional headers for request signing: | Header | Description | | - | - | | `X-Signature` | HMAC-SHA512 signature of the request | | `X-Timestamp` | Unix timestamp in seconds | Endpoints that typically require signing include: * Disbursement transfer (`POST /api/v2.0/disbursement/transfer`) * QRIS issuer payment credit and related money-out flows * E-Wallet trigger top-up (`POST /api/v2.0/ewallet/trigger-topup`) Refer to the OpenAPI reference for each endpoint to confirm required headers. See [Building the X-Signature Header](/api-reference/building-x-signature) for the full signing formula, required headers, and code examples in PHP, Node.js, and Python. *** ## IP whitelist Merchant API routes may require your server IP to be registered on the merchant account before requests are accepted. Configure allowed IPs in the merchant dashboard before going to production. > [!WARNING] > > **IP Whitelist Required** — Ensure your server IP is registered for the merchant account before making API requests from production systems. *** ## Environments | Environment | Base URL | | - | - | | Sandbox | `https://sandbox-payment-b2b.singapay.id` | | Production | `https://payment-b2b.singapay.id` | Use Sandbox for development and testing. No real money moves in Sandbox. # Building the X-Signature Header Source: https://docs.singapay.id/api-reference/building-x-signature Construct the HMAC-SHA512 X-Signature header for the access token endpoint and for signed money-out API requests. Some endpoints require a request signature for authentication, sent as the `X-Signature` header. There are **two different signature schemes**, used in two different situations. Both use **HMAC-SHA512**, but the string being signed is different — read the section relevant to the endpoint you're calling. > [!NOTE] > > This page covers signatures you generate for **outbound** requests to the SingaPay API. To validate signatures SingaPay sends you on **inbound** webhook callbacks, see [Security and Signature Validation](/api-reference/webhooks/security-and-signature). | Scheme | Used for | Signed with | | - | - | - | | [Access Token Signature](#1-access-token-signature) | Obtaining a Bearer access token (`POST /api/v1.1/access-token/b2b`) | Your `client_secret` | | [Request Signature](#2-request-signature) | Authenticating individual requests to money-out endpoints (Disbursement, Account Transfer, E-Wallet Top Up, etc.) | Your `client_secret` | *** ## 1. Access Token Signature Used only when calling `POST /api/v1.1/access-token/b2b` to obtain a Bearer token. ### Formula ```text theme={null} payload = "{client_id}_{client_secret}_{YYYYMMDD}" X-Signature = HMAC-SHA512(payload, client_secret) // lowercase hex digest ``` > [!NOTE] > > `YYYYMMDD` is the **current server date** (UTC+7 / Asia/Jakarta), e.g. `20260727`. The signature is only valid for that calendar day. ### Required headers | Header | Description | | - | - | | `X-PARTNER-ID` | Your merchant API key | | `X-CLIENT-ID` | Your `client_id` | | `X-Signature` | Signature computed as above | ### Request body ```json theme={null} { "grant_type": "client_credentials" } ``` ### Examples ```php PHP theme={null} $clientId = 'your_client_id'; $clientSecret = 'your_client_secret'; $currentDate = date('Ymd'); // e.g. 20260727 $payload = "{$clientId}_{$clientSecret}_{$currentDate}"; $signature = hash_hmac('sha512', $payload, $clientSecret); // Headers: // X-PARTNER-ID: your_api_key // X-CLIENT-ID: your_client_id // X-Signature: <$signature> ``` ```javascript Node.js theme={null} const crypto = require('crypto'); const clientId = 'your_client_id'; const clientSecret = 'your_client_secret'; const currentDate = new Date().toISOString().slice(0, 10).replace(/-/g, ''); // YYYYMMDD (Asia/Jakarta date) const payload = `${clientId}_${clientSecret}_${currentDate}`; const signature = crypto.createHmac('sha512', clientSecret).update(payload).digest('hex'); ``` ```python Python theme={null} import hmac import hashlib from datetime import datetime client_id = 'your_client_id' client_secret = 'your_client_secret' current_date = datetime.now().strftime('%Y%m%d') # Asia/Jakarta date payload = f'{client_id}_{client_secret}_{current_date}' signature = hmac.new(client_secret.encode(), payload.encode(), hashlib.sha512).hexdigest() ``` Use the returned `access_token` as `Authorization: Bearer ` on subsequent requests. *** ## 2. Request Signature Used for money-out endpoints that require per-request signing, e.g.: * `POST /api/v2.0/disbursement/transfer` * `POST /api/v2.0/ewallet/trigger-topup` * Account Transfer endpoints **1. Normalize the request body** Sort all object keys **recursively and alphabetically**. **2. Hash the normalized body** Hash the normalized JSON with **SHA-256** to get `hashed_body` (hex digest). **3. Build the string to sign** ```text theme={null} string_to_sign = "{METHOD}:{ENDPOINT}:{ACCESS_TOKEN}:{hashed_body}:{TIMESTAMP}" ``` **4. Sign it** ```text theme={null} X-Signature = HMAC-SHA512(string_to_sign, client_secret) // lowercase hex digest ``` Where: * `METHOD` — HTTP method in uppercase, e.g. `POST`. * `ENDPOINT` — the request path **including query string**, e.g. `/api/v2.0/disbursement/transfer`. Do not include the domain. * `ACCESS_TOKEN` — the Bearer token obtained from the access-token endpoint (without the `Bearer ` prefix). * `TIMESTAMP` — current Unix timestamp in **seconds** (not milliseconds), sent as a string. ### Required headers | Header | Description | | - | - | | `X-PARTNER-ID` | Your merchant API key | | `Authorization` | `Bearer ` | | `X-Timestamp` | Unix timestamp (seconds) used in the signature | | `X-Signature` | Signature computed as above | > [!WARNING] > > Regenerate the signature for **every request** — the timestamp and body are always part of the signed string, so a signature cannot be reused across requests or replayed after it expires. ### Examples ```php PHP theme={null} $method = 'POST'; $endpoint = '/api/v2.0/disbursement/transfer'; // path + query string, no domain $accessToken = 'your_bearer_token'; $secretKey = 'your_client_secret'; $timestamp = (string) time(); // 1. Normalize body (recursive key sort) function sortRecursive(array &$arr): void { ksort($arr, SORT_STRING); foreach ($arr as &$value) { if (is_array($value)) { sortRecursive($value); } } } $body = [ 'account_number' => '1234567890', 'amount' => 100000, 'bank_code' => 'BCA', ]; sortRecursive($body); $normalizedJson = json_encode($body, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); // 2. Hash body $hashedBody = hash('sha256', $normalizedJson); // 3. Build string to sign $stringToSign = "{$method}:{$endpoint}:{$accessToken}:{$hashedBody}:{$timestamp}"; // 4. Sign $signature = hash_hmac('sha512', $stringToSign, $secretKey); // Headers: // X-PARTNER-ID: your_api_key // Authorization: Bearer your_bearer_token // X-Timestamp: <$timestamp> // X-Signature: <$signature> ``` ```javascript Node.js theme={null} const crypto = require('crypto'); function sortKeysRecursive(obj) { if (Array.isArray(obj)) return obj.map(sortKeysRecursive); if (obj !== null && typeof obj === 'object') { return Object.keys(obj).sort().reduce((acc, key) => { acc[key] = sortKeysRecursive(obj[key]); return acc; }, {}); } return obj; } const method = 'POST'; const endpoint = '/api/v2.0/disbursement/transfer'; const accessToken = 'your_bearer_token'; const secretKey = 'your_client_secret'; const timestamp = Math.floor(Date.now() / 1000).toString(); const body = { account_number: '1234567890', amount: 100000, bank_code: 'BCA' }; const normalizedJson = JSON.stringify(sortKeysRecursive(body)); const hashedBody = crypto.createHash('sha256').update(normalizedJson).digest('hex'); const stringToSign = `${method}:${endpoint}:${accessToken}:${hashedBody}:${timestamp}`; const signature = crypto.createHmac('sha512', secretKey).update(stringToSign).digest('hex'); ``` ```python Python theme={null} import hashlib import hmac import json import time def sort_keys_recursive(obj): if isinstance(obj, list): return [sort_keys_recursive(v) for v in obj] if isinstance(obj, dict): return {k: sort_keys_recursive(obj[k]) for k in sorted(obj.keys())} return obj method = 'POST' endpoint = '/api/v2.0/disbursement/transfer' access_token = 'your_bearer_token' secret_key = 'your_client_secret' timestamp = str(int(time.time())) body = {'account_number': '1234567890', 'amount': 100000, 'bank_code': 'BCA'} normalized_json = json.dumps(sort_keys_recursive(body), separators=(',', ':'), ensure_ascii=False) hashed_body = hashlib.sha256(normalized_json.encode()).hexdigest() string_to_sign = f'{method}:{endpoint}:{access_token}:{hashed_body}:{timestamp}' signature = hmac.new(secret_key.encode(), string_to_sign.encode(), hashlib.sha512).hexdigest() ``` *** ## Common mistakes | Symptom | Likely cause | | - | - | | Signature always invalid | `ENDPOINT` doesn't match the exact request path (including query string) sent to the server | | Signature valid on retry but not first try | Body was modified/reformatted between signing and sending (e.g. number vs. string, key order, extra whitespace) | | Signature works for GET but not POST/PUT | `METHOD` not uppercase, or body normalization skipped for empty body | | Intermittent 401 | Timestamp too old — requests are only accepted within a limited time window from `X-Timestamp`; generate a fresh signature right before sending | | Works locally, fails in production | Client secret or client ID mismatch, or numeric fields serialized differently (e.g. `100000` vs `"100000.00"`) across environments | > [accordion] Best practices > > * Never log or expose your `client_secret` in client-side code, logs, or version control. > * Always use HTTPS. > * Generate the signature immediately before sending the request — don't reuse an old signature/timestamp pair. # Binding Card Source: https://docs.singapay.id/api-reference/direct-debit/binding-card https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/direct-debit/binding Initiates a Direct Debit binding flow. The merchant must redirect the customer to `data.redirect_url` to complete bank authentication; the link is single-use and expires at `data.expires_at` (typically ~15 minutes). Final binding outcome is delivered via the configured `direct_debit_notif_url` callback. # Binding Status Source: https://docs.singapay.id/api-reference/direct-debit/binding-status https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v2.0/direct-debit/binding/{binding_id} Returns the current state of a binding. Use this endpoint to poll for `PENDING_AUTH → ACTIVE` transitions when webhook delivery is unavailable; otherwise prefer the `direct-debit.binding.succeeded` callback. `{binding_id}` is constrained to UUID at the route layer, so malformed values return **404** before controller execution. # Charge Source: https://docs.singapay.id/api-reference/direct-debit/charge https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/direct-debit/charge Pulls funds from a bound bank account into the merchant settlement account. # Get Transaction Source: https://docs.singapay.id/api-reference/direct-debit/get-transaction https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v2.0/direct-debit/transaction/{transaction_id} Returns the latest known state of a Direct Debit charge. If the row remains non-terminal beyond the configurable reconciliation window, this endpoint attempts an upstream reconcile before responding so the result is as fresh as possible. Reconcile failures are logged and the existing record is still returned. `{transaction_id}` is constrained to UUID at the route layer. # Overview Source: https://docs.singapay.id/api-reference/direct-debit/introduction Pull funds directly from a customer's bank account using a one-time authorization binding — no card required. Direct Debit lets you debit funds directly from a customer's bank account after a one-time authorization setup. The customer links their bank account once through a hosted webview, and you can charge it on demand — without redirecting the customer again. > [!NOTE] > > This is a **Money In** operation. Each charge pulls funds from the customer's bound bank account into your Singapay merchant settlement account. > [card] One-time setup > > Customer authorizes their bank account once via a hosted webview. All future charges use the stored `binding_id` — no customer redirect needed. > [card] OTP-aware charging > > Some banks require an OTP per charge. SingaPay handles both flows automatically and signals when `/verify-otp` is needed. > [card] Multi-bank support > > Supports BRI, Mandiri, BNI, Danamon, BCA, CIMB, BNC, and more via BI/SNAP bank codes. *** ## How Direct Debit Works Direct Debit has two phases: **Binding** (one-time) and **Charge** (repeatable). * **Binding** — The customer authorizes their bank account via a hosted webview. On success, an `ACTIVE` binding is created and can be used for future charges indefinitely. * **Charge** — The merchant initiates a pull payment using the `binding_id`. Depending on the bank's `payment_otp_mode`, the charge either completes silently or requires the customer to submit an OTP. *** ## Flow Diagram ```mermaid theme={null} sequenceDiagram participant C as Customer participant M as Merchant System participant S as SingaPay API participant B as Bank Note over C,B: Phase 1 — Binding (one-time setup) M->>S: POST /direct-debit/bindings Note over M,S: customer_ref, phone_no, bank_code, payment_otp_mode S-->>M: binding_id, redirect_url, expires_at (status: PENDING_AUTH) M->>C: Redirect to redirect_url C->>B: Authorize via hosted webview B-->>S: Binding result callback S->>S: Binding status → ACTIVE / FAILED / EXPIRED S-->>M: Webhook: binding.succeeded / binding.failed Note over C,B: Phase 2 — Charge (repeatable, no customer redirect) M->>S: POST /direct-debit/charge Note over M,S: binding_id, amount, merchant_reference alt No OTP required S->>B: Debit bank account B-->>S: Settlement confirmation S->>S: Transaction status → SUCCESS S-->>M: Webhook: transaction SUCCESS else OTP required S-->>M: HTTP 202 — requires_otp: true, transaction_id B->>C: OTP delivered by bank C->>M: Submit OTP M->>S: POST /direct-debit/verify-otp Note over M,S: transaction_id + otp S->>B: Verify OTP & debit account B-->>S: Settlement confirmation S->>S: Transaction status → SUCCESS / FAILED S-->>M: Webhook: transaction SUCCESS / FAILED end ``` *** ## Binding Status | Status | Description | | - | - | | `PENDING_AUTH` | Binding initiated — customer has been redirected to the bank webview for authorization. | | `ACTIVE` | Customer authorized successfully. This binding can be used for charges. | | `UNBOUND` | Binding was revoked by the merchant via the Unbind endpoint. | | `FAILED` | Customer cancelled or the bank rejected the authorization. | | `EXPIRED` | Customer did not complete authorization before `expires_at`. | *** ## Transaction Status | Status | Description | | - | - | | `PENDING` | Charge accepted, awaiting settlement confirmation from the bank. | | `PENDING_OTP` | OTP required — waiting for customer to submit OTP via `/verify-otp`. | | `SUCCESS` | Funds credited to merchant settlement account. Fee breakdown available in `fees`. | | `FAILED` | Bank rejected the charge — check `failure_code` and `failure_reason`. | | `EXPIRED` | OTP not submitted in time, or upstream timeout. | *** ## Recommended Flow **1. Create a binding** Call **Binding Card** with the customer's phone number, bank code, and preferred OTP mode. Redirect the customer to the returned `redirect_url` to complete bank authorization. **2. Confirm binding is active** Listen for the `direct-debit.binding.succeeded` webhook, or poll **Binding Status** until the status is `ACTIVE`. Store the `binding_id` — you will use it for all future charges. **3. Charge the bound account** Call **Charge** with the `binding_id`, `amount`, and a unique `merchant_reference`. If the bank requires OTP (`requires_otp: true`), proceed to the next step. **4. Verify OTP (if required)** If the Charge response returns HTTP 202 with `requires_otp: true`, prompt the customer to enter the OTP sent by their bank, then call **Verify OTP** with the `transaction_id` and OTP value. **5. Confirm payment outcome** Listen for the transaction webhook or call **Get Transaction** by `transaction_id` to confirm the final `SUCCESS` or `FAILED` status. *** ## Supported Banks | Bank | Bank Code | | - | - | | Bank Rakyat Indonesia (BRI) | `002` | | Bank Mandiri | `008` | | Bank Negara Indonesia (BNI) | `009` | | Bank Danamon | `011` | | Bank Central Asia (BCA) | `014` | | CIMB Niaga | `022` | | Bank Neo Commerce (BNC) | `490` | *** ## Important Notes > [accordion] Redirect URL is single-use and short-lived > > The `redirect_url` returned on binding creation is **single-use** and expires at `expires_at` (typically \~15 minutes). Treat it as opaque — do not parse or hardcode its host or path. If it expires before the customer completes authorization, create a new binding. > [accordion] OTP mode is bank-determined > > The `payment_otp_mode` parameter is a preferred hint — the bank may require OTP regardless of this setting. Always check the Charge response for `requires_otp` before assuming a silent charge will complete. > [accordion] Idempotency via merchant\_reference > > The `merchant_reference` field acts as an idempotency key for charges. Submitting the same reference twice returns `SP_DD_DUPLICATE_REFERENCE` — store the first `transaction_id` and query its status instead of retrying with a new request. > [accordion] Unbinding may also require OTP > > Some banks require OTP verification when revoking a binding. If the Unbind response returns `otp_required: true`, call **Verify OTP** with the `binding_id` and the `unbind_context` from the `otp_handoff` block. > [accordion] Signature required for charge > > The **Charge** endpoint requires additional `X-Signature` and `X-Timestamp` headers — separate from the standard Bearer token. See [Authentication](/api-reference/authentication) for signing requirements. > [accordion] IP whitelisting required > > All Direct Debit endpoints require IP whitelisting. Ensure your server IP is registered under the merchant account before going live. *** ## Available Endpoints > [card] [Binding Card](./binding-card) > > Initiate a binding — returns a hosted webview `redirect_url` for the customer to authorize their bank account. > [card] [Binding Status](./binding-status) > > Check the current state of a binding by `binding_id`. > [card] [Unbind Card](./unbind-card) > > Revoke an active binding. May require OTP verification for some banks. > [card] [Charge](./charge) > > Pull funds from a bound bank account. Returns `requires_otp: true` when OTP verification is needed. > [card] [Verify OTP](./verify-otp) > > Submit the customer OTP to complete a charge or unbinding that requires verification. > [card] [Get Transaction](./get-transaction) > > Retrieve the latest status of a Direct Debit charge by `transaction_id`. > [!NOTE] > > All endpoints require authentication. The Charge endpoint additionally requires `X-Signature` and `X-Timestamp`. See [Authentication](/api-reference/authentication). # Unbind Card Source: https://docs.singapay.id/api-reference/direct-debit/unbind-card https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/direct-debit/binding/{binding_id}/unbind Revokes an active binding. After this completes the binding can no longer be charged. Some banks require OTP; in that case the response is **HTTP 202** with `data.otp_required=true` and an `otp_handoff` block, and the merchant must follow up with `POST /verify-otp`. Other banks use a fire-and-forget flow; the binding remains in its current `status` until the `direct-debit.unbinding.succeeded` webhook confirms the final state. No request body is required. # Verify OTP Source: https://docs.singapay.id/api-reference/direct-debit/verify-otp https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/direct-debit/verify-otp Completes OTP verification for either payment or unbinding flows. Use `transaction_id` for payment OTP (after `POST /charge` returns `requires_otp=true`), or `binding_id` + `unbind_context` for unbind OTP (after `POST /binding/{id}/unbind` returns `otp_handoff`). Submitting both or neither returns **422 SP018**. # Check fee Source: https://docs.singapay.id/api-reference/disbursement-money-out/check-fee https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v1.0/disbursement/{account_id}/check-fee Calculates the transfer fee and total debit amount before you submit a disbursement. Provide the destination bank SWIFT code and the net amount the beneficiary should receive. The quote fails if the resulting gross amount would exceed the account available balance or merchant transfer limits. Recommended before transfer. # Disburse Transfer Source: https://docs.singapay.id/api-reference/disbursement-money-out/disburse-transfer https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/disbursement/transfer Submits a bank disbursement using the v2 API contract. The merchant account is specified in the request body (`account_id`), not in the URL path. See `Response Code` for SP000–SP020 definitions and merchant actions. **CRITICAL:** This is a money-out operation requiring **X-Signature** and **X-Timestamp** authentication per internal signing protocol. # Inquiry Status Source: https://docs.singapay.id/api-reference/disbursement-money-out/inquiry-status https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/disbursement/{account_id}/inquiry-status Retrieves the current status and details of a disbursement using your `reference_number` and the account in the path. For pending transactions, the service may refresh status from the banking partner before responding, See `Response Code` for the full SP000–SP020 reference. # Overview Source: https://docs.singapay.id/api-reference/disbursement-money-out/introduction Send funds from your Singapay account to any bank account in Indonesia — with fee checking and real-time status tracking. The Disbursement API lets you programmatically transfer funds from your Singapay balance to any Indonesian bank account. Use it to automate payouts to vendors, sellers, employees, or customers — with built-in fee checking before committing to a transfer. > [!NOTE] > > This is a **Money Out** operation. Each disbursement debits funds from your Singapay Payment Gateway account and transfers them to the destination bank account. > [card] Pre-transfer fee check > > Check the transfer fee and total debit amount before initiating any transfer. > [card] Real-time status > > Query disbursement status by reference number at any point in the transfer lifecycle. > [card] Multi-bank coverage > > Transfer to all major Indonesian banks using bank code or SWIFT code. *** ## Recommended flow **1. Check disbursement fee** Call **Check Disbursement Fee** to get the gross amount, fee, and net amount for the destination bank. This ensures transparency before the transfer is committed. **2. Initiate transfer** Call **Disburse Transfer** with the destination bank details and confirmed amount. A unique `reference_number` is returned to track the transaction. **3. Track status** Use **Inquiry Disbursement Status** with the `reference_number` to poll or verify the final transfer status — especially for pending transactions. *** ## Disbursement status | Status | Description | | - | - | | `pending` | Transfer initiated, awaiting processing by the bank network. | | `success` | Funds successfully transferred to the destination account. | | `failed` | Transfer failed — check the error code for the reason. | *** ## Important notes > [accordion] Fee structure > > Disbursement fees vary by destination bank. Use **Check Disbursement Fee** to get an accurate breakdown of gross, fee, and net amounts before committing to a transfer. > [accordion] Bank code formats > > The `bank_code` field accepts either a **3-digit numeric code** (e.g. `014` for BCA) or a **SWIFT code** (e.g. `CENAIDJA`). Both formats are supported on the **Disburse Transfer** endpoint. **Check Disbursement Fee** accepts the SWIFT code only (`bank_swift_code`). > [accordion] Signature required for transfers > > The **Disburse Transfer** and **Inquiry Status** endpoints require an additional `X-Signature` and `X-Timestamp` header using internal signing rules — separate from the standard Bearer token auth. > [accordion] Idempotency via reference number > > Always store the `reference_number` returned from a transfer. Use it to query status and handle retries safely — submitting the same reference number twice will not create a duplicate transfer. *** ## Available endpoints > [card] [List Disbursements](./list) > > Paginated list of disbursement transactions for an account (last 12 months). > [card] [Get Disbursement by Transaction ID](./show) > > Retrieve a single disbursement by its business `transaction_id` string. > [card] [Check Disbursement Fee](./check-fee) > > Get gross, fee, and net breakdown for a destination bank before transferring. > [card] [Disburse Transfer](./disburse-transfer) > > Initiate a bank transfer from your Singapay balance to the destination account. > [card] [Inquiry Disbursement Status](./inquiry-status) > > Query the current status of a disbursement by reference number. > [!NOTE] > > All endpoints require authentication, including `X-Signature` and `X-Timestamp` on transfer endpoints. See [Authentication](/api-reference/authentication). # List Source: https://docs.singapay.id/api-reference/disbursement-money-out/list https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/disbursement/{account_id} Returns a paginated list of bank disbursements for the specified merchant account. Includes transactions from the last twelve months, twenty-five records per page, sorted newest first. Requires merchant API authentication; the account must belong to the authenticated merchant. # Show Source: https://docs.singapay.id/api-reference/disbursement-money-out/show https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/disbursement/{account_id}/{transaction_id} Returns the details of a single disbursement for the specified account. Identify the transaction using the disbursement `transaction_id` (SingaPay business identifier), not the internal database primary key. # Create v1 (Legacy) Source: https://docs.singapay.id/api-reference/e-wallet-money-in/create-v1-legacy https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v1.0/ewallet-native/{account_id}/create-checkout Creates a native e-wallet checkout for the specified account. Payment amount must be within merchant configuration limits for the selected e-wallet vendor. # Create v2 Source: https://docs.singapay.id/api-reference/e-wallet-money-in/create-v2 https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/ewallet-native/create-order Creates a native e-wallet checkout with the account identifier in the request body. # Inquiry status Source: https://docs.singapay.id/api-reference/e-wallet-money-in/inquiry-status https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/ewallet-native/{account_id}/inquiry-status/{id} Inquires the current status of an e-wallet transaction. For open transactions, the system may contact the vendor to refresh the status. # Overview Source: https://docs.singapay.id/api-reference/e-wallet-money-in/introduction Learn how to process incoming payments using e-wallet apps like ShopeePay and Dana on the Singapay Payment Gateway. E-Wallet Native is a money-in payment method that allows your customers to pay directly using their e-wallet apps. When a checkout is created, the customer receives a redirect URL to authorize and complete the payment within their preferred e-wallet application. > [!NOTE] > > **Money In Operation:** Funds are transferred from the customer's e-wallet to your SingaPay Payment Gateway account. For top-ups to customer e-wallets (Money Out), please refer to the [E-Wallet Top Up (Money Out)](/api-reference/e-wallet-money-out/introduction) documentation. ## E-Wallet Payment Flow The process from creating a checkout to successfully confirming a payment: ```mermaid theme={null} sequenceDiagram participant M as Merchant System participant S as SingaPay API participant C as Customer participant E as E-Wallet Provider M->>S: POST /ewallet-native/{account_id}/create-checkout S-->>M: checkout_url & checkout_url_app M->>C: Redirect to e-wallet (web or deep link) C->>E: Authorize & complete payment E->>S: Payment confirmation notification S->>S: Update status: open → success S-->>M: Webhook notification (optional) M->>S: GET /inquiry-status (optional) S-->>M: Latest transaction status ``` **1. Create Checkout** **Merchant System** sends a `POST /ewallet-native/{account_id}/create-checkout` request to the SingaPay API containing the bill amount, vendor, and customer information. **2. Receive Redirect URLs** **SingaPay API** responds by providing the `checkout_url` and `checkout_url_app`. **3. Redirect Customer** **Merchant System** redirects the customer using the web URL or deep link to their e-wallet app. **4. Authorize Payment** **Customer** authorizes and completes the payment within the **E-Wallet Provider** app. **5. Payment Notification** **E-Wallet Provider** sends a payment confirmation notification to the **SingaPay API**. **6. Process Payment** **SingaPay API** processes the payment internally, changing the transaction status from `open` to `success`. **7. Webhook Notification (Optional)** **SingaPay API** sends a webhook notification to the **Merchant System** to inform them that the payment has been received. **8. Verify Status** **Merchant System** can call `GET /inquiry-status` or `/list` to verify the latest payment status. ## Supported E-Wallet Vendors > [card] ShopeePay > > `EWALLET_SHOPEEPAY` > > Supports web redirect and app deep link. > [card] Dana > > `EWALLET_DANA` > > Supports web redirect. > [card] OVO > > `EWALLET_OVO` > > Supports push to pay. ## Transaction Status Lifecycle Every e-wallet transaction goes through the following status lifecycle: | Status | Description | | - | - | | `open` | Checkout has been created, waiting for the customer to authorize and complete the payment via the e-wallet app. Checkout URL is active. | | `success` | Payment completed successfully. Funds have been received from the customer. | | `expired` | Checkout link has expired. Computed automatically when the `expired_at` timestamp has passed while the status is still `open`. | | `canceled` | Transaction was canceled before the payment was completed. | | `failed` | Payment attempt failed due to an error during processing. | ## Available endpoints > [card] [Create Checkout (Legacy)](./create-v1-legacy) > > Create a new e-wallet checkout order with a redirect URL for the customer > [card] [Create Checkout v2](./create-v2) > > Create a new e-wallet checkout order with a redirect URL for the customer > [card] [List E-Wallet](./list-transactions) > > Retrieve a paginated list of all e-wallet transactions for an account, with filters available. > [card] [Show E-Wallet](./show-transaction) > > Get detailed information about a specific e-wallet transaction. > [card] [Inquiry Status](./inquiry-status) > > Check and sync the latest payment status from the e-wallet vendor. This operation can trigger state changes. ## Important Notes > [accordion] Checkout Expiration & Auto-Expire > > By default, checkout URLs expire after **30 minutes**. You can set a custom expiration using the `expired_at` parameter. The `status_computed` field automatically shows `expired` when an open transaction's `expired_at` has passed, even if the raw status is still `open`. > [accordion] Understanding Redirect URLs > > The API returns two types of links: > > * `checkout_url`: Used for redirecting to a web browser. > * `checkout_url_app`: A deep link to directly open the related e-wallet app (if supported by the vendor). > [accordion] Fees & Settlements > > Each transaction details a `vendor_fee`, `merchant_fee`, and `net_amount` for transparent fee tracking. You can monitor reconciliation and settlement statuses via the `has_recon` and `has_settle` fields. > [accordion] Data Retention & Deletion Restrictions > > * Only transactions with the status `open` can be deleted. Paid or settled transactions cannot be deleted. > * Transaction history records from the **last 1 year** are available via the API. Older records are safely archived. # List transactions Source: https://docs.singapay.id/api-reference/e-wallet-money-in/list-transactions https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/ewallet-native-transactions/{account_id} Retrieves a paginated list of e-wallet native transactions for the specified account. Supports optional query filters for reference, status, vendor, amounts, settlement, and date ranges. # Show transaction Source: https://docs.singapay.id/api-reference/e-wallet-money-in/show-transaction https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/ewallet-native-transactions/{account_id}/{transaction_id} Retrieves the details of a single e-wallet transaction within the specified account. # Overview Source: https://docs.singapay.id/api-reference/e-wallet-money-out/introduction Transfer funds from your Singapay balance directly to customers' e-wallets — OVO, Dana, ShopeePay, GoPay, and more. The E-Wallet Top Up API lets you send funds from your Singapay account to any supported Indonesian e-wallet. Use it to automate cashback, refunds, rewards, or seller payouts directly to customers' e-wallet balances — no bank account required. > [!NOTE] > > This is a **Money Out** operation. Each top-up debits funds from your Singapay Payment Gateway balance and credits the destination e-wallet account. > [card] OVO > > Top up OVO balance directly. > [card] Dana > > Transfer to Dana accounts. > [card] ShopeePay > > Fund ShopeePay wallets. > [card] GoPay & more > > GoPay and other supported providers. *** ## Recommended flow ```mermaid theme={null} sequenceDiagram participant M as Merchant System participant S as SingaPay API participant E as E-Wallet Provider M->>S: Trigger Transfer (provider + phone number + amount) S->>S: Debit Singapay balance S->>E: Dispatch top-up to provider S-->>M: reference_number + status (pending/success/failed) M->>S: Inquiry Status (reference_number) S-->>M: Final transaction status ``` **1. Trigger top-up** Call **E-Wallet Top Up — Trigger Transfer** with the e-wallet provider, the customer's e-wallet phone number, and the amount. Singapay debits your balance and dispatches the top-up job to the provider. A `reference_number` is returned to track the transaction. **2. Inquiry status** Use **E-Wallet Top Up — Inquiry Status** with the `reference_number` to verify the final outcome — especially for transactions that remain in `pending` state. *** ## Transaction status | Status | Description | | - | - | | `pending` | Top-up initiated, awaiting processing by the e-wallet provider. | | `success` | Funds successfully credited to the destination e-wallet. | | `failed` | Top-up failed — check the response code for the reason. | *** ## Important notes > [accordion] Destination account validation > > **Trigger Transfer** validates the destination e-wallet account. If the account isn't found, the request fails with response code `SP117`. > [accordion] Provider-specific limits > > Each e-wallet provider has its own minimum and maximum top-up limits. Make sure the amount is within the provider's limits before you submit a transfer. > [accordion] Signature required for transfers > > The **Trigger Transfer** endpoint requires additional `X-Signature` and `X-Timestamp` headers using internal signing rules — separate from standard Bearer token auth. See [Authentication](/api-reference/authentication) for signing requirements. > [accordion] Reference number for tracking > > Store the `reference_number` returned from the Trigger Transfer call. Use it with **Inquiry Status** to safely check the outcome and handle retries without creating duplicate top-ups. > [accordion] Pending status handling > > For transactions that return `pending`, use **Inquiry Status** to refresh the status. If a `vendor_reference_no` exists on a pending record, Singapay will attempt to refresh the status from the provider — timeouts return response code `SP005`. *** ## Available endpoints > [card] [Trigger Transfer](./trigger-top-up) > > Initiate the top-up and transfer funds from your Singapay balance to the e-wallet. > [card] [Inquiry Status](./inquiry-status) > > Query the current status of a top-up transaction by reference number. > [!NOTE] > > All endpoints require `Authorization: Bearer ` and `X-PARTNER-ID` on every request. The Trigger Transfer endpoint additionally requires `X-Signature` and `X-Timestamp`. See [Authentication](/api-reference/authentication) for details. # Trigger Top-Up Source: https://docs.singapay.id/api-reference/e-wallet-money-out/trigger-top-up https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/ewallet/trigger-topup Initiates an e-wallet fund transfer to a beneficiary. This endpoint performs comprehensive validation, deducts funds from merchant balance atomically, creates a transaction record, and queues processing through the job system. The response indicates transaction has been queued with status typically Pending until background processing completes. **CRITICAL:** This is a money-out operation requiring **X-Signature** and **X-Timestamp** authentication per internal signing protocol. Middleware validation includes kill-switch check, request signature verification, rate limiting, and anomaly detection. Duplicate reference numbers within 24 hours are rejected with error code SP004. # Introduction Source: https://docs.singapay.id/api-reference/introduction Explore comprehensive information about Singapay Payment Gateway API, including endpoints, request methods, parameters, and response formats. Explore comprehensive information about the Singapay Payment Gateway API, including endpoints, request methods, parameters, and response formats. Learn how to integrate and utilize the API to enhance your payment processing capabilities. *** ## API Information The current stable release of the Singapay Payment Gateway API. All endpoints and request formats documented here reflect this version. > [card] Product > > Singapay Payment Gateway > [card] Latest Version > > `v1.0` — Stable *** ## Endpoints > [card] [Sandbox](https://sandbox-payment-b2b.singapay.id) > > `https://sandbox-payment-b2b.singapay.id` > [card] [Production](https://payment-b2b.singapay.id) > > `https://payment-b2b.singapay.id` > [!NOTE] > > Use the **Sandbox** environment for development and testing. No real transactions are processed. > [!WARNING] > > Only use the **Production** endpoint for live transactions. Make sure your integration is fully tested in Sandbox first. *** ## Version Control | Version | Date | Description | Author | | - | - | - | - | | `v1.0` | 25 Apr 2024 | Baseline version | Singapay | # Create v1 (Legacy) Source: https://docs.singapay.id/api-reference/payment-link/create-v1-legacy https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v1.0/payment-link-manage/{account_id} Creates a new payment link for an active account. The account must exist and be in active status. # Create v2 Source: https://docs.singapay.id/api-reference/payment-link/create-v2 https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/payment-link/{account_id} Creates a new payment link for an active account. Simplified body compared to v1 — several fields (`title`, `is_multiple_payment`, `is_unlimited_usage`, `redirect_url_enabled`) are no longer accepted and are derived automatically instead. See `CreatePaymentLinkV2Request` for the full set of derivation rules. # Delete Source: https://docs.singapay.id/api-reference/payment-link/delete https://payment-b2b.singapay.id/api/docs/merchant-api.json delete /api/v1.0/payment-link-manage/{account_id}/{payment_link_id} Permanently deletes a payment link from the specified account. Deletion is blocked if the link has associated payment histories. # Overview Source: https://docs.singapay.id/api-reference/payment-link/introduction Create shareable payment URLs that accept multiple payments over time, across VA, QRIS, and E-Wallet — all tracked as individual Payment Link Histories. Payment Link lets you generate a single reusable URL that customers can use to complete payments. Each payment made through the link is recorded separately as a **Payment Link History**, giving you a clean audit trail per transaction. > [card] Reusable URL > > One link can receive unlimited payments, each tracked independently. > [card] Multi-method > > Supports VA (BRI, BNI, BCA, Maybank, Danamon), QRIS, and E-Wallet. > [card] Shareable > > Send via WhatsApp, email, or SMS — no redirect flow needed. *** ## Payment Link flow ```mermaid theme={null} sequenceDiagram autonumber participant M as Merchant System participant S as SingaPay API participant C as Customer participant P as Payment Provider M->>S: POST /payment-link-manage/{account_id} Note over M,S: Create link with items & amount S-->>M: Payment URL (e.g. singapay.com/b2b/INV-001) M->>C: Share payment URL Note over M,C: WhatsApp, email, or SMS C->>S: Open payment page C->>S: Select payment method (VA / QRIS / E-Wallet) C->>P: Complete payment P->>S: Payment notification S->>S: Create Payment Link History (pending → paid) S-->>M: Webhook notification (optional) M->>S: GET /payment-link-histories/{account_id} Note over M,S: Track all payments ``` *** ## Payment Link vs Payment Link History Understanding the parent-child relationship is key to using this API correctly. > [card] Payment Link (Parent) > > **Reusable and configurable.** Defines what is being paid for. > > * Reusable payment URL > * Contains items and pricing > * Optional payment method whitelist > * Configurable usage limit and expiration > [card] Payment Link History (Child) > > **Per-payment record.** Created every time a customer pays. > > * Individual payment records > * Each has its own payment method > * Tracks status and settlement > * One link → multiple histories > [!NOTE] > > **Example:** Payment Link `INV-001` receives 3 payments via VA BRI, QRIS, and GoPay → 3 separate Payment Link History records are created, each with its own status and settlement data. *** ## Important notes > [accordion] One link, multiple payments > > A single Payment Link can receive multiple payments over its lifetime. Each payment is independently tracked as a Payment Link History record — including its own payment method, status, and settlement info. > [accordion] Payment method whitelist > > You can restrict which payment methods are available per link. For example, allow only VA BRI and QRIS, and hide E-Wallet options entirely. > [accordion] Customer detail collection > > Optionally require customers to submit their name, email, and phone number before proceeding to payment — useful for invoicing and event registrations. > [accordion] Usage limit and expiration > > Control how many times a link can be used with `max_usage`, and set an optional `expired_at` to prevent payments after a certain date. > [accordion] Cannot delete a link with histories > > Once a Payment Link has received at least one payment, it cannot be deleted. This preserves the integrity of your transaction history. > [accordion] Item details > > Include an itemized breakdown (name, quantity, unit price) in each link for better customer experience and cleaner accounting records. *** ## Use cases > [card] Invoicing > > Send payment links to customers for invoice payments via email or WhatsApp — no checkout page needed. > [card] E-Commerce checkout > > Use as a lightweight checkout alternative without a complex frontend integration. > [card] Donations & crowdfunding > > Accept contributions from multiple donors using a single persistent link. > [card] Event registration > > Collect payments for event tickets with usage limits to cap the number of attendees. *** ## Available endpoints > [card] [List Payment Links](./list) > > Paginated list of payment links for an account. > [card] [List Available Payment Methods](./list-payment-methods) > > Active methods that support payment links. > [card] [Create Payment Link](./create-v2) > > Generate a new payment link with items and configuration. > [card] [Show Payment Link](./show-v2) > > Retrieve a single payment link by ID. > [card] [Update Payment Link](./update-v2) > > Update mutable fields on an existing link. > [card] [Delete Payment Link](./delete) > > Delete a link that has no payment history. > [!NOTE] > > All endpoints require authentication. See [Authentication](/api-reference/authentication). # List Source: https://docs.singapay.id/api-reference/payment-link/list https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/payment-link-manage/{account_id} Retrieves a paginated list of payment links for the specified account. # List payment methods Source: https://docs.singapay.id/api-reference/payment-link/list-payment-methods https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/payment-link-manage/payment-methods Retrieves the catalog of active payment methods available for payment link creation and configuration. # Show v1 (Legacy) Source: https://docs.singapay.id/api-reference/payment-link/show-v1-legacy https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/payment-link-manage/{account_id}/{payment_link_id} Retrieves the details of a single payment link within the specified account. # Show v2 Source: https://docs.singapay.id/api-reference/payment-link/show-v2 https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v2.0/payment-link/{link_id} Retrieves the details of a single payment link. Unlike v1 (scoped under `/{account_id}/{payment_link_id}`), v2 only takes the link id — the owning account is resolved and access-checked from the link itself. # Update v1 (Legacy) Source: https://docs.singapay.id/api-reference/payment-link/update-v1-legacy https://payment-b2b.singapay.id/api/docs/merchant-api.json put /api/v1.0/payment-link-manage/{account_id}/{payment_link_id} Updates an existing payment link within the specified account. Only mutable fields are accepted in the request body. # Update v2 Source: https://docs.singapay.id/api-reference/payment-link/update-v2 https://payment-b2b.singapay.id/api/docs/merchant-api.json put /api/v2.0/payment-link/update/{link_id} Updates an existing payment link. True partial update — any field omitted from the request body is left untouched (unlike v1, which recomputes several fields to their "not sent" defaults and silently clears them). Rejected outright with 422 if the link is already expired or already closed (status=closed), before any field is processed. See `UpdatePaymentLinkV2Request` for per-field behavior. # Generate Source: https://docs.singapay.id/api-reference/qris-money-in/generate https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v1.0/qris-dynamic/{account_id}/generate-qr Generates a new MPM dynamic QRIS for the specified account. The returned transaction has `status` = `open` and contains the QR payload in `qr_data`, which should be rendered as a QR code for the customer to scan. - `amount` must be within the minimum and maximum limits configured for the merchant. - `expired_at` is optional. When omitted, the QRIS expires **1 hour** after creation. - The account must be active. Managed sub accounts that have not completed KYB verification cannot generate QRIS. - The final payment status is delivered via callback to the merchant's registered callback URL, including `merchant_reff_no`. It can also be checked via the inquiry-status or show endpoint using the returned `id`. **Idempotency.** This endpoint is **not idempotent**. `merchant_reff_no` is stored as a free-form merchant reference and is **not** checked for uniqueness; sending the same request again (including with the same `merchant_reff_no`) creates a new, separate QRIS transaction. If the response to a generate request is lost (e.g. network timeout), first look up the transaction via `GET /api/v1.0/qris-dynamic/{account_id}` filtered by `created_at_from`/`created_at_to` and `amount`, and match `merchant_reff_no` on the returned items, before generating a new QRIS. An unpaid QRIS expires automatically at `expired_at` and does not result in any funds movement. This endpoint is rate limited per merchant; requests above the limit are rejected with HTTP 429. # Inquiry Status Source: https://docs.singapay.id/api-reference/qris-money-in/inquiry-status https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/qris-dynamic/{account_id}/inquiry-status/{id} Checks the current status of a single QRIS money-in transaction, identified by its numeric `id` (returned by the generate and list endpoints). Use `status_computed` and `is_expired` to determine whether the QRIS has been paid, is still payable, or has expired. Returns the same payload as `GET /api/v1.0/qris-dynamic/{account_id}/show/{id}`. # Overview Source: https://docs.singapay.id/api-reference/qris-money-in/introduction Generate dynamic QRIS codes for single fixed-amount transactions — Indonesia's standardized QR payment system accepted across all major e-wallets and banking apps. QRIS (Quick Response Code Indonesian Standard) is Indonesia's unified QR payment standard that lets customers pay using any compatible app — GoPay, OVO, Dana, ShopeePay, and mobile banking. Unlike Virtual Account or Payment Link, **each QRIS code is generated for one specific transaction and expires after a single payment**. > [card] Instant generation > > Generate a QR code in one API call with a fixed amount — display it immediately to the customer. > [card] All major apps > > Accepted by GoPay, OVO, Dana, ShopeePay, and all QRIS-compatible banking apps. > [card] Real-time confirmation > > Payment status updates instantly via the QRIS network — no polling delay. *** ## Payment flow ```mermaid theme={null} sequenceDiagram autonumber participant M as Merchant System participant S as SingaPay API participant C as Customer participant Q as QRIS Network M->>S: POST /qris-dynamic/{account_id}/generate-qr Note over M,S: Create QR with amount & expiry S-->>M: QRIS code string & QR image M->>C: Display QR code Note over M,C: App, website, or printed receipt C->>Q: Scan QR code Note over C,Q: Using GoPay, OVO, Dana, etc. C->>Q: Confirm payment (exact amount) Q->>S: Payment notification (real-time) S->>S: Update transaction status (open → paid) S-->>M: Webhook notification (optional) M->>S: GET /qris-dynamic/{account_id}/show/{id} Note over M,S: Verify final payment status ``` *** ## Key difference: one QR = one transaction > [!WARNING] > > Unlike Virtual Account or Payment Link, **each QRIS code is valid for one payment only**. Once paid — or once expired — the code cannot be reused. Generate a new QR code for every new transaction. > [card] Cannot do > > * Reuse the same QR code for multiple payments > * Accept partial payments > * Change the amount after generation > * Keep a QR code active indefinitely > [card] Must do > > * Generate a new QR code for each transaction > * Set the exact amount at creation time > * Monitor payment status in real-time > * Expire unused codes to prevent stale QRs *** ## Transaction status | Status | Description | | - | - | | `open` | QR code generated, awaiting customer payment. | | `paid` | Payment confirmed by the QRIS network. | | `expired` | QR code expired before payment was made. | | `settled` | Funds transferred to your account. | > [!NOTE] > > Only transactions with status `open` can be deleted. Paid or expired transactions cannot be removed. *** ## Important notes > [accordion] One-time use only > > Each QRIS code is single-use. After a customer completes payment, the QR code is automatically invalidated and cannot accept another payment. Always generate a fresh QR for the next customer or transaction. > [accordion] Fixed amount at generation > > The payment amount is set at QR creation time and cannot be changed. The customer must pay the exact amount — QRIS does not support partial or over-payments. > [accordion] Optional expiration > > You can set an optional expiry time when generating a QR code. After expiry, the code cannot be scanned or paid. Unset expiry means the code stays `open` indefinitely until paid or manually deleted. > [accordion] MDR fees > > Merchant Discount Rate (MDR) applies to all QRIS transactions. The fee percentage depends on your merchant category (MCC) and your agreement with Singapay. MDR details are visible in each transaction record. > [accordion] Settlement timeline > > QRIS settlements typically follow an **H+1 to H+2** schedule depending on the payment provider. Settlement timestamps are tracked in each transaction record. > [accordion] Data retention > > Transaction records are retained for **1 year**. Data older than 1 year is archived and may not be accessible via the API. *** ## Available endpoints > [card] [List QRIS Transactions](./list) > > Paginated list of all QRIS transactions for an account with filter support. > [card] [Show QRIS Transaction](./show) > > Retrieve a single transaction by its numeric ID. > [card] [Generate Dynamic QRIS](./generate) > > Create a new MPM dynamic QR code for a fixed-amount transaction. > [card] [Inquiry QRIS Status](./inquiry-status) > > Check whether a QRIS transaction is paid, still payable, or expired. > [!NOTE] > > All endpoints require authentication. See [Authentication](/api-reference/authentication). # List Source: https://docs.singapay.id/api-reference/qris-money-in/list https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/qris-dynamic/{account_id} Retrieve a paginated list of QRIS MPM money-in transactions (`mpm-static` and `mpm-dynamic`) for an account. Results are restricted to transactions created within the last 12 months and are ordered newest-first by default. Use the query parameters below to paginate, sort, and filter the result set; pagination details are returned in the response `meta.pagination` object. The following optional filters are available and may be combined: `reff_no` (partial match), `status`, `type`, `amount`, `amount_min`, `amount_max`, `total_amount`, `total_amount_min`, `total_amount_max`, `has_settle`, `created_at_from`/`created_at_to`, `expired_at_from`/`expired_at_to`, and `settle_at_from`/`settle_at_to`. All datetime filters accept the format `Y-m-d H:i:s` in **Asia/Jakarta (WIB, UTC+7)** time and define an inclusive range. **Finding a transaction when the generate response was lost.** `merchant_reff_no` is not available as a filter, but it is returned on every item. Query this endpoint with a narrow `created_at_from`/`created_at_to` window around the time of the generate request together with `amount`, then match `merchant_reff_no` on the returned items before deciding to generate a new QRIS. **Note on `status`.** The `status` filter matches the stored transaction status. A QRIS whose `expired_at` has passed may still be stored as `open` until it is processed; use `status_computed` / `is_expired` on each item to determine whether it can still be paid. # Show Source: https://docs.singapay.id/api-reference/qris-money-in/show https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/qris-dynamic/{account_id}/show/{id} Retrieves the details of a single QRIS money-in transaction within the specified account, identified by its numeric `id` (returned by the generate and list endpoints). Returns the same payload as `GET /api/v1.0/qris-dynamic/{account_id}/inquiry-status/{id}`. # Inquiry Merchant Source: https://docs.singapay.id/api-reference/qris-money-out/inquiry-merchant https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/qris/issuer/mpm/inquiry-merchant Decodes the provided MPM `qr_data`. If merchant information (tag 26) is absent, the endpoint will query the configured issuer vendor to resolve merchant/payment criteria. See `Response Code` for the full SP000–SP020 reference. # Inquiry Status Source: https://docs.singapay.id/api-reference/qris-money-out/inquiry-status https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/qris/status/{account_id} Retrieve the current status of a QRIS transaction for the specified account using `reference_number`, `type`, and `scope`. See `Response Code` for the full SP000–SP020 reference. # Overview Source: https://docs.singapay.id/api-reference/qris-money-out/introduction Send payments from your Singapay balance by scanning a merchant's QRIS code — powered by Indonesia's national payment switching networks. The QRIS Issuer (Money Out) API lets your platform act as an **issuer** — sending payments from your Singapay account to any QRIS MPM (Merchant Presented Mode) merchant. The customer scans the merchant's QR code, your system decodes it, confirms the merchant details, and initiates the credit payment through Singapay's switching network integration. > [!NOTE] > > This is a **Money Out** operation. Each payment debits funds from your Singapay account and credits the destination QRIS merchant via the supported switching network. > [card] Merchant lookup > > Decode any QRIS MPM code and retrieve verified merchant details before committing to a payment. > [card] Instant credit > > Initiate a payment credit transaction directly to the merchant via Indonesia's QRIS switching network. > [card] Status tracking > > Query the latest transaction status at any point after payment initiation. *** ## Recommended flow **1. Scan and decode QR code** Customer scans the merchant's QRIS MPM code. Your system captures the raw `qr_data` string from the QR code. **2. Inquiry merchant** Call **QRIS Issuer MPM — Inquiry Merchant** with the `qr_data`. Singapay decodes the QR, retrieves merchant details (name, NMID, category), and returns the verified merchant info. Present this to the customer for confirmation. **3. Initiate payment credit** Once the customer confirms, call **QRIS Issuer MPM — Payment Credit** with the confirmed amount and merchant details. A `reference_number` is returned to track the transaction. **4. Check transaction status** Use **QRIS — Inquiry Transaction Status** with the `reference_number` to verify the final transaction outcome — especially for pending or in-process payments. *** ## API overview | Method | Endpoint | Description | | :-: | - | - | | `POST` | `/api/v2.0/qris/issuer/mpm/inquiry-merchant` | Decode `qr_data` and retrieve verified QRIS merchant details. | | `POST` | `/api/v2.0/qris/issuer/mpm/payment-credit` | Initiate a payment credit to the QRIS merchant. | | `POST` | `/api/v2.0/qris/status/{account_id}` | Query the status of a QRIS transaction by `reference_number`. | All endpoints use `POST`, accept `application/json`, and require **OAuth 2.0 Bearer Token** authentication. *** ## Transaction status | Status | Description | | - | - | | `pending` | Payment initiated, awaiting confirmation from the switching network. | | `success` | Payment successfully credited to the merchant. | | `failed` | Payment failed — check the response code for the reason. | *** ## Important notes > [accordion] Always inquiry before payment > > Always call **Inquiry Merchant** before initiating a payment. This validates the QR code, retrieves the correct merchant details, and lets the customer confirm before funds are debited. > [accordion] Switching network support > > Singapay routes QRIS issuer payments through its supported switching networks. The routing is handled automatically based on the merchant's QRIS data. > [accordion] QR code format > > The `qr_data` field accepts the raw string decoded from the merchant's QR code — the full QRIS MPM payload. Do not modify or truncate the string before sending. > [accordion] Reference number for tracking > > Store the `reference_number` returned from the payment credit call. Use it with **Inquiry Transaction Status** to safely check the outcome and handle retries without creating duplicate transactions. > [accordion] Signature required > > Payment Credit and Inquiry Status endpoints require an additional `X-Signature` and `X-Timestamp` header. See [Authentication](/api-reference/authentication) for signing requirements. *** ## Available endpoints > [card] [QRIS Issuer MPM — Inquiry Merchant](./inquiry-merchant) > > Decode `qr_data` and retrieve verified merchant details from the QRIS switching network. > [card] [QRIS Issuer MPM — Payment Credit](./trigger-payment-credit) > > Initiate a payment credit to the destination QRIS merchant. > [card] [QRIS — Inquiry Transaction Status](./inquiry-status) > > Query the current status of a QRIS transaction by reference number. > [!NOTE] > > All endpoints require authentication. See [Authentication](/api-reference/authentication). # Trigger Payment Credit Source: https://docs.singapay.id/api-reference/qris-money-out/trigger-payment-credit https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/qris/issuer/mpm/payment-credit Initiates an issuer-side MPM payment (money-out) from the merchant account. The endpoint creates a pending `QrisTransaction`, performs ledger debit and statement entries, and enqueues the vendor dispatch job. See `Response Code` for the full SP000–SP020 reference; final settlement is performed asynchronously. **CRITICAL:** This is a money-out operation requiring **X-Signature** and **X-Timestamp** authentication per internal signing protocol. # Response Codes Source: https://docs.singapay.id/api-reference/references/response-codes Complete dictionary of Singapay API response codes (SP-codes) returned across all endpoints and webhooks. All Singapay API responses include a `response_code` field that indicates whether your **API request** was received and processed correctly by the server. > [!WARNING] > > **Response codes are not transaction statuses.** A `response_code` tells you the result of the *request itself* — whether the server accepted it, rejected it due to validation, or encountered an error. It does **not** tell you whether the underlying payment succeeded, is pending, or failed. To track the actual payment outcome, use the `transaction_status` object in the response body or wait for the [webhook callback](/api-reference/webhooks/introduction). See [Transaction Status](/api-reference/references/transaction-status) for the full lifecycle. For example, a disbursement request may return `response_code: "SP000"` (request accepted successfully) while the payment itself is still `"Initiated"` — the money has not moved yet. Conversely, a webhook may arrive with `response_code: "SP001"` to notify you that a previously accepted transaction has now failed at the provider. ## Response format ```json REST API (v2 endpoints) theme={null} { "response_code": "SP000", "response_message": "Successfully", "data": { ... } } ``` ```json Webhook callback theme={null} { "response_code": "SP000", "response_message": "Successfully", "event": "disbursement", "data": { ... } } ``` *** ## Response code dictionary Each code below describes a **request-level** outcome — not the state of the payment or transfer. ### Success | Code | Message | Description | | - | - | - | | `SP000` | Successfully | The request was accepted and processed. For transactional endpoints, this means the request was submitted — **not** that the payment is complete. Check `transaction_status` for the payment outcome. | ### Transaction request errors | Code | Message | Description | Recommended action | | - | - | - | - | | `SP001` | Transaction Failure | The transaction failed during processing. | Call the inquiry-status endpoint to confirm the final state. | | `SP002` | General Failure | An internal server error occurred. | Retry after a short delay; call inquiry-status if the issue persists. | | `SP003` | Insufficient Balance | The account does not have enough balance to complete the transaction. | Top up the account and retry. | | `SP004` | Duplicate Reference Number | A transaction with this `reference_number` already exists. | Use a unique reference number for each new transaction. | | `SP005` | Timeout | The upstream provider did not respond in time. | Call the inquiry-status endpoint — the transaction may still settle. | | `SP006` | Exceed Beneficiary Limit | The beneficiary has reached their daily or per-transaction limit. | Retry with a lower amount or try again the next business day. | | `SP007` | Exceed Account Limit | Your account has reached its transaction limit. | Contact Singapay support to review your limits. | ### Lookup errors | Code | Message | Description | Recommended action | | - | - | - | - | | `SP008` | Invalid Reference Number | The reference number does not match any transaction. | Verify the reference number and retry. | | `SP009` | Transaction Not Found | No transaction exists for the given ID. | Confirm the `transaction_id` is correct. | | `SP010` | Beneficiary Account Not Found | The destination bank account could not be found. | Verify the account number and bank code. | | `SP011` | Beneficiary Vendor Not Active | The payment vendor/channel is currently unavailable. | Try an alternative channel or retry later. | | `SP020` | Merchant Account Not Found | The specified merchant account does not exist. | Verify the `account_id` in the request. | ### Authentication & authorization errors | Code | Message | Description | Recommended action | | - | - | - | - | | `SP013` | Unauthorized | Invalid or expired access token. | Request a new token via [Access Token v1.1](https://docs.singapay.id/api-reference/security/access-token-v11). | | `SP015` | Forbidden | The token is valid but lacks permission for this action. | Verify account permissions in the merchant dashboard. | | `SP016` | Signature Invalid | The `X-Signature` header could not be verified. | Review [Security and signature validation](/api-reference/webhooks/security-and-signature). | | `SP017` | Unauthorized IP | The request originated from a non-whitelisted IP. | Add your server IP in the merchant dashboard, or contact support. | ### Request errors | Code | Message | Description | Recommended action | | - | - | - | - | | `SP012` | Bad Request | The request body is malformed or missing required fields. | Check the request against the endpoint schema. | | `SP014` | Not Found | The requested resource or endpoint does not exist. | Verify the URL path and resource ID. | | `SP018` | Validation Error | One or more fields failed validation. | Check the `data.errors` object for field-level details. | | `SP019` | General Error | An unclassified server-side error occurred. | Contact Singapay support with the `transaction_id` and timestamp. | *** ## HTTP status code mapping Singapay REST API endpoints also return standard HTTP status codes. Here is how they map to common scenarios: | HTTP Status | Meaning | Typical cause | | - | - | - | | `200` | OK | Request succeeded. | | `400` | Bad Request | Malformed body, missing fields, or transaction failure (v2 endpoints). | | `401` | Unauthorized | Invalid JWT, expired token, partner mismatch, or revoked credentials. | | `403` | Forbidden | IP not whitelisted, account access denied, or merchant frozen. | | `404` | Not Found | Resource (account, transaction, VA) does not exist. | | `422` | Unprocessable Entity | Validation error — usually a missing `X-PARTNER-ID` header or invalid field values. | | `500` | Internal Server Error | Unexpected server error. Retry or contact support. | > [!NOTE] > > **v2 endpoints** (Card, E-Wallet Native v2, Disbursement v2, QRIS Issuer) return both an HTTP status code **and** an `SP` response code in the body. Always check the `response_code` field for the definitive result. *** ## Handling response codes **1. Check the response code** Parse `response_code` from the JSON body. `SP000` means the **request** was accepted — proceed to check the `transaction_status` for the actual payment outcome. **2. Handle known errors** Match against the tables above. Errors like `SP003` (insufficient balance) or `SP004` (duplicate reference) have clear resolutions. **3. Handle known request errors** Match against the tables above. Errors like `SP003` (insufficient balance) or `SP004` (duplicate reference) have clear resolutions. **4. Don't confuse request success with payment success** `SP000` confirms the server accepted your request. The payment may still be `Initiated`, `Paying`, or `Pending`. Always read the `transaction_status` object or wait for the [webhook callback](/api-reference/webhooks/introduction) to determine the final payment outcome. See [Transaction Status](/api-reference/references/transaction-status) for the full lifecycle. **5. Use inquiry-status for uncertain outcomes** For `SP001`, `SP002`, and `SP005`, the transaction may still be in progress. Call the relevant inquiry-status endpoint before retrying. **6. Contact support for persistent errors** If `SP007`, `SP017`, or `SP019` persists, contact Singapay support with the full request and response payloads. > [!WARNING] > > **Never retry a transaction blindly after a failure.** Always call the inquiry-status endpoint first to confirm the final state. Retrying without checking can result in duplicate transfers. # Transaction Status Source: https://docs.singapay.id/api-reference/references/transaction-status Lifecycle of a Singapay transaction — status codes, transitions, and recommended handling for each state. Every Singapay transaction moves through a defined set of statuses. The `transaction_status` tracks the **actual state of the payment** — whether funds have moved, are in transit, or failed. > [!NOTE] > > **Transaction status vs. response code** — These are two different things. The [Response Code](/api-reference/references/response-codes) (`response_code` / `SP` code) tells you whether your *API request* was accepted by the server. The **transaction status** on this page tells you the *actual outcome of the payment*. A request can succeed (`SP000`) while the transaction is still `Initiated` or `Pending`. *** ## Status codes | Code | Status | Terminal? | Description | | :-: | - | :-: | - | | `00` | Success | Yes | Transaction completed successfully. Funds have been transferred. | | `01` | Initiated | No | The transaction has been created but the payment provider has not been called yet. | | `02` | Paying | No | The payment call is in progress. The provider is processing the transaction. | | `03` | Pending | No | The transaction is awaiting confirmation from the provider. This is a suspect state. | | `04` | Refunded | Yes | The transaction was reversed. Funds have been returned to the source. | | `05` | Canceled | Yes | The transaction was canceled before completion. | | `06` | Failed | Yes | The transaction failed. Check `failed_code` and `failed_reason` for details. | | `07` | Not Found | Yes | The transaction does not exist in the provider's system. | > [!NOTE] > > **Terminal** means the status will not change further. Non-terminal statuses may still transition to a final state — keep polling or wait for the webhook callback. *** ## Status lifecycle ```mermaid theme={null} stateDiagram-v2 [*] --> Initiated : Transaction created Initiated --> Paying : Provider called Paying --> Pending : Awaiting confirmation Paying --> Success : Provider confirmed Paying --> Failed : Provider rejected Pending --> Success : Confirmed Pending --> Failed : Rejected / Timeout Success --> Refunded : Reversal processed Initiated --> Canceled : Canceled by merchant Paying --> Canceled : Canceled before settlement Initiated --> NotFound : Not found at provider ``` *** ## Handling each status ### `00` — Success The transaction completed. Funds have been moved. * Update your records to mark the transaction as settled. * Reconcile against `balance_after` if provided in the webhook payload. ### `01` — Initiated The transaction exists but hasn't been sent to the provider yet. * **Wait.** The system will process the transaction automatically. * If the status doesn't change within a few minutes, call the inquiry-status endpoint. ### `02` — Paying The payment call is in progress with the upstream provider. * **Do not retry or create a new transaction.** The original may still succeed. * Poll the inquiry-status endpoint after 1–2 minutes. ### `03` — Pending (Suspect) The provider acknowledged the transaction but hasn't confirmed the final result. * **Do not retry or create a new transaction.** * Poll the inquiry-status endpoint every 2–5 minutes. * A webhook callback will fire when the final status is determined. > [!WARNING] > > **Pending ≠ Failed.** Transactions in `02` (Paying) or `03` (Pending) may still settle successfully. Creating a duplicate transaction can result in double charges or double transfers. ### `04` — Refunded The transaction was reversed after a successful payment. * Update your records to reflect the reversal. * Adjust the customer's balance or order status accordingly. ### `05` — Canceled The transaction was canceled before settlement. * No funds were moved. * You may create a new transaction with a new `reference_number` if needed. ### `06` — Failed The transaction could not be completed. * Check `failed_code` and `failed_reason` in the response/webhook for the specific cause. * Common reasons: invalid beneficiary account, insufficient balance, provider downtime. * You may create a new transaction with a new `reference_number` after resolving the issue. ### `07` — Not Found The transaction does not exist in the provider's system. * This typically means the transaction was never submitted or was lost in transit. * Create a new transaction with a new `reference_number`. *** ## Status by product Transaction statuses are consistent across products, but not every product uses every status. Here's which statuses apply to each product type: | Status | Disbursement | Virtual Account | QRIS | E-Wallet | Card | Subscription | | - | :-: | :-: | :-: | :-: | :-: | :-: | | `00` Success | Yes | Yes | Yes | Yes | Yes | Yes | | `01` Initiated | Yes | — | — | Yes | — | Yes | | `02` Paying | Yes | — | Yes | Yes | Yes | Yes | | `03` Pending | Yes | — | Yes | Yes | Yes | Yes | | `04` Refunded | Yes | — | — | — | Yes | — | | `05` Canceled | Yes | — | — | Yes | Yes | Yes | | `06` Failed | Yes | — | Yes | Yes | Yes | Yes | | `07` Not Found | Yes | — | — | — | — | — | > [!NOTE] > > Virtual Account transactions arrive as webhooks only after payment is confirmed, so you will typically only see status `paid` (`00` equivalent) in VA webhook callbacks. *** ## Polling best practices For non-terminal statuses (`01`, `02`, `03`), use the inquiry-status endpoint to check for updates: **1. Wait before first poll** Allow at least **30 seconds** after the initial API call before polling. **2. Use exponential backoff** Start with 30-second intervals, increasing to 2–5 minutes. Don't poll more than once per 30 seconds. **3. Set a timeout** If a transaction remains in a non-terminal status for more than **30 minutes**, flag it for manual review. **4. Prefer webhooks** Webhook callbacks are the most reliable way to receive final status. Use polling only as a fallback. *** ## Related * [Response Codes](/api-reference/references/response-codes) — full dictionary of `SP` response codes * [Webhook Overview](/api-reference/webhooks/introduction) — real-time status notifications * [Webhook Retry Mechanism](/api-reference/webhooks/retry-mechanism) — what happens when your endpoint is unreachable # Create payment code Source: https://docs.singapay.id/api-reference/retail-store/create-payment-code https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v1.0/retail-transactions/{account_id} Generates a native Retail Store payment code (Alfamart / Indomaret) the customer pays at the cashier. The amount must be within merchant configuration limits for the selected outlet. Retail access is pilot-gated per merchant. Payment confirmation arrives later as a POST callback to `callback_urls.transaction_notif_url` with `event = retail-transaction`. # Overview Source: https://docs.singapay.id/api-reference/retail-store/overview Generate one-time payment codes that customers pay in cash at Alfamart and Indomaret cashiers — each code recorded as a single fixed-amount Retail transaction. Retail Outlet lets customers who prefer cash pay at thousands of **Alfamart** and **Indomaret** stores across Indonesia. You create a payment code through the API, give it to the customer, and the customer shows it to the cashier and pays the exact amount. Similar to QRIS, **each payment code belongs to one transaction and can only be paid once**. > [!NOTE] > > Retail Outlet is currently offered to **selected merchants only**. To enable it for your merchant, contact your Singapay account manager. Create requests from merchants without access are rejected with `422`. > [card] Cash payments > > Accept cash from customers who don't have a bank account, e-wallet, or card. > [card] Nationwide coverage > > Customers pay at any Alfamart or Indomaret cashier — no app or registration needed. > [card] Webhook on payment > > Singapay notifies your `transaction_notif_url` as soon as the cashier confirms the payment. *** ## Payment flow ```mermaid theme={null} sequenceDiagram autonumber participant M as Merchant System participant S as SingaPay API participant C as Customer participant R as Retail Outlet M->>S: POST /retail-transactions/{account_id} Note over M,S: retail_code, amount, customer_name, expired_at S-->>M: payment_code, transaction_id (status: unpaid) M->>C: Show payment_code & payment instructions Note over M,C: Checkout page, email, or app C->>R: Show payment_code to the cashier C->>R: Pay the exact amount in cash R->>S: Payment confirmation S->>S: Update status (unpaid → paid) S-->>M: Webhook (event: retail-transaction) M->>S: GET /retail-transactions/{account_id}/{transaction_id} Note over M,S: Verify the final status (optional) ``` *** ## Key difference: one code = one transaction > [!WARNING] > > Unlike Virtual Account or Payment Link, **each payment code is valid for one payment only**. Once it is paid or expires, it cannot be used again. Create a new payment code for every new transaction. > [card] Cannot do > > * Reuse a payment code for another payment > * Accept partial payments or overpayments > * Change the amount or outlet after the code is created > * Create a code without an expiry time > [card] Must do > > * Create a new payment code for each transaction > * Set the exact amount and the outlet (`retail_code`) at creation > * Set `expired_at` to a time in the future > * Tell the customer which store to go to: Alfamart or Indomaret *** ## Supported outlets > [card] Alfamart > > `ALFAMART` > > Payment code can only be paid at Alfamart cashiers. > [card] Indomaret > > `INDOMARET` > > Payment code can only be paid at Indomaret cashiers. > [!NOTE] > > A payment code only works at the outlet you selected in `retail_code`. An Alfamart code cannot be paid at Indomaret, and an Indomaret code cannot be paid at Alfamart. *** ## Transaction status | Status | Description | | - | - | | `unpaid` | Payment code created and waiting for the customer to pay at the cashier. | | `paid` | The cashier confirmed the payment and funds were credited to your account. | | `expired` | `expired_at` passed before the customer paid. The code can no longer be paid. | | `failed` | The payment could not be completed. | > [!NOTE] > > Settlement is not a separate status. Check the `has_settle` and `settle_at` fields to see whether a `paid` transaction has been settled. *** ## Recommended flow **1. Create a payment code** Call **Create Payment Code** with `retail_code`, `amount`, `customer_name`, and `expired_at`. Send your own order ID in `merchant_reff_no` so you can match the transaction later. **2. Save the transaction** Store the `transaction_id` and `payment_code` from the response. You need `transaction_id` to look up the transaction later. **3. Give the code to the customer** Show the `payment_code`, the amount, the outlet (Alfamart or Indomaret), and the expiry time to the customer. **4. Customer pays at the cashier** The customer tells the cashier they want to make a payment, shows the payment code, and pays the exact amount in cash. **5. Receive the webhook** Singapay sends a `retail-transaction` webhook to your `transaction_notif_url` when the transaction becomes `paid`. Update the order on your side. **6. Verify the status (optional)** Call **Show Transaction** to confirm the latest status, for example if you did not receive the webhook. *** ## Important notes > [accordion] Amount limits > > By default, the amount must be between **IDR 15,000** and **IDR 2,500,000** per transaction. Your merchant may have different limits based on its configuration. If the amount is outside the limit, the request is rejected with `422` and a message showing the allowed min or max. > [accordion] Expiry time > > `expired_at` is **required** and must be a Unix timestamp in **milliseconds** (13 digits) set to a future time. After it passes, an `unpaid` transaction changes to `expired` and the code can no longer be paid. If you subscribe to the [Transaction Money-In Expiration Webhook](/api-reference/webhooks/transaction-moneyin-expiration), expired Retail transactions are included in it. > [accordion] Webhook notification > > When a transaction becomes `paid`, Singapay sends a POST request to your `transaction_notif_url` with `event = retail-transaction`. This URL is also used by other money-in products, so route requests by the `event` field. See [Shared Webhook Endpoints](/api-reference/webhooks/shared-endpoints) and verify every request as described in [Security and Signature Validation](/api-reference/webhooks/security-and-signature). > [accordion] No list or inquiry endpoint > > The API has two endpoints only: create and show. There is no separate inquiry-status endpoint — **Show Transaction** always returns the latest status. To browse or export Retail transactions, use the Singapay merchant dashboard. > [accordion] Fees and settlement > > A fee is charged per transaction and returned in `fees.amount`. The balance from a `paid` transaction follows your merchant's configured settlement method, the same as Virtual Account. Track settlement with the `has_settle` and `settle_at` fields. > [accordion] Timestamp format > > In API responses, `expired_at`, `processed_timestamp`, `post_timestamp`, and `settle_at` are Unix timestamps in **milliseconds**. `processed_timestamp` and `settle_at` stay `null` until the transaction is paid or settled. > [accordion] Rate limit > > The **Create Payment Code** endpoint is rate-limited per merchant. If you send too many requests, you will receive `429 Too Many Requests`. Wait before you try again. *** ## Available endpoints > [card] [Create Payment Code](./create-payment-code) > > Create a one-time Alfamart or Indomaret payment code for a fixed amount. > [card] [Show Transaction](./show-transaction) > > Get the details and latest status of a Retail transaction by its `transaction_id`. > [!NOTE] > > All endpoints require authentication. See [Authentication](/api-reference/authentication). # Show transaction Source: https://docs.singapay.id/api-reference/retail-store/show-transaction https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/retail-transactions/{account_id}/{transaction_id} Retrieves a single Retail Store transaction and its current status. There is no separate inquiry-status endpoint — the latest status is read from here. # Access Token v1.1 Source: https://docs.singapay.id/api-reference/security/access-token-v11 https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v1.1/access-token/b2b Exchanges merchant credentials for a JWT access token using the OAuth 2.0 client credentials grant. Authenticates with an HMAC-SHA512 signature (`X-Signature`) instead of a client secret. Use the returned `access_token` as the `Authorization: Bearer ` header on subsequent secured requests. # Cancel Plan Source: https://docs.singapay.id/api-reference/subscription-recurring/cancel-plan https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/recurring/plans/cancel/{id} Cancels an active subscription plan and stops future billing. # Create Plan Source: https://docs.singapay.id/api-reference/subscription-recurring/create-plan https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/recurring/plans Creates a recurring subscription plan and returns the plan details with its payment link. # Get Plan Source: https://docs.singapay.id/api-reference/subscription-recurring/get-plan https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v2.0/recurring/plans/{id} Retrieves a single subscription plan by its UUID. # Overview Source: https://docs.singapay.id/api-reference/subscription-recurring/introduction Create and manage recurring billing plans backed by tokenized card payments — with configurable retry policies and webhook notifications on every cycle. Subscription Merchant API v2.0 enables recurring billing via credit card. Create a plan, direct the customer through a **one-time card linking flow**, and Singapay automatically charges the saved card on every cycle — no customer action required after the initial setup. > [!NOTE] > > This is a **Money In** operation. Each cycle charge transfers funds from the customer's tokenized card to your Singapay Payment Gateway account. > [card] API Version > > v2.0 > [card] Base Path > > `/api/v2.0/recurring/plans` > [card] Auth > > Bearer Token (JWT) > [card] Channel > > Credit Card (recurring) *** ## Subscription lifecycle ```mermaid theme={null} sequenceDiagram autonumber participant C as Customer participant M as Merchant System participant S as SingaPay API participant PP as Payment Provider M->>S: POST /recurring/plans Note over M,S: Schedule, amount (or items), customer details S-->>M: Plan created + payment_link_url (status: pending_card_linking) M->>C: Redirect to payment_link_url C->>S: Enter card details (one-time card linking) S->>PP: Initial charge + card tokenization PP-->>S: Charge result + card token S->>S: Plan status → active S-->>M: Webhook: subscription.cycle.payment_success loop Each scheduled cycle S->>PP: Auto-charge (tokenized card, no customer action) PP-->>S: Charge result S-->>M: Webhook: payment_success or payment_failed Note over S,M: Retry block included on failure end ``` *** ## Plan status lifecycle | Status | Description | | - | - | | `pending_card_linking` | Plan created, awaiting customer to complete card linking via `payment_link_url`. | | `pending_payment` | Card linked, awaiting scheduled start (`schedule.start_time` is in the future). | | `active` | Subscription running — cycles auto-charged on schedule. | | `paused` | Merchant-initiated pause from the dashboard. No charges while paused. | | `suspended` | Auto-suspended after retries exhausted (when `failed_payment_action = stop_plan`). | | `cancelled` | Cancelled by merchant or auto-cancelled on hard failure during initial card linking. Terminal state. | | `completed` | All scheduled cycles charged (only for plans with `total_interval` set). | *** ## Initial card linking — auto-cancel on hard failure > [!WARNING] > > When a plan is created with `charge_immediately = true` and the customer's first card-linking attempt is **rejected by the issuer or acquirer**, the platform **auto-cancels the plan** immediately. > > There is no saved card to retry against, so retrying would never succeed. When an auto-cancel occurs: * The bill for that cycle moves to `cancelled` * The plan transitions from `pending_payment` / `pending_card_linking` directly to `cancelled` * The active payment link is expired — the customer cannot complete a charge against the cancelled plan * A `subscription.plan.status_changed` webhook fires with `plan.metadata.cancellation_reason = initial_linking_failed` > [!NOTE] > > Plans created with `charge_immediately = false` are **not** affected by this rule. To re-attempt after a hard failure, create a new plan. *** ## Amount vs. items A plan is either **amount-only** or **itemized** — never both. This is enforced on both Create and Update. > [card] Amount-only > > Send `amount`. The entire recurring charge is a single line item — simple and straightforward. > [card] Itemized > > Send `items[]`. The per-cycle charge is the sum of `quantity × unit_price` across all items. > [!WARNING] > > Sending both `amount` and `items` in the same request returns a `422` validation error. On Update, the patch shape must match the plan's existing type — mixing returns `409` with response code `SP102`. *** ## Retry policy When a cycle charge fails, Singapay automatically retries based on the plan's configured policy. | Field | Type / Range | Description | | - | - | - | | `retry_policy.max_attempts` | integer, 1–5 | Automatic retry attempts after the initial charge fails. | | `retry_policy.interval_days` | integer, 1–7 | Days to wait between consecutive retry attempts. | | `retry_policy.failed_payment_action` | `continue_plan` \| `stop_plan` | Behavior after retries exhausted. `continue_plan` keeps the subscription running on the next cycle; `stop_plan` suspends it. | *** ## Error reference > [accordion] HTTP status codes > > | Code | Description | > | - | - | > | `200` | Success (show, update, cancel) | > | `201` | Created (create plan) | > | `400` | Bad Request — validation or business rule error | > | `401` | Unauthorized — invalid or missing token | > | `404` | Plan or account not found | > | `409` | Plan cannot be updated or already cancelled | > | `422` | Validation error — missing field, amount/items conflict, etc. | > | `500` | Internal server error | > [accordion] Singapay response codes > > | Code | Description | HTTP Status | > | - | - | - | > | `SP000` | Success | 200 / 201 | > | `SP002` | General failure (internal error) | 500 | > | `SP020` | Merchant account not found | 404 | > | `SP100` | Subscription plan not found | 404 | > | `SP101` | Subscription plan already cancelled | 409 | > | `SP102` | Subscription plan cannot be updated in current state | 409 | *** ## Important notes > [accordion] Card-only channel > > Subscriptions run exclusively on credit card recurring. The initial card linking uses one-time 3DS; all subsequent cycle charges use the tokenized card silently — no customer action needed. > [accordion] Minimum amount > > The per-cycle charge must clear the card channel minimum. Plans below this floor are rejected on both Create and Update with a `422` validation error. > [accordion] Plan identifiers > > `subscription_id` is a globally unique merchant-supplied identifier across all plans for the merchant. `merchant_reff_no` is an optional, non-unique label for grouping and reporting — echoed back on every cycle webhook. > [accordion] Upgrade semantics (PATCH) > > A PATCH that changes `amount` or `items` triggers the **full upgrade flow** — the existing plan is closed and a new plan is created with `parent_plan_id` pointing at it, plus an optional proration and a fresh payment link. > > A PATCH that only changes `name`, `merchant_reff_no`, or `metadata` **patches the plan in place** without creating a new plan. > [accordion] IP whitelisting required > > All Merchant API routes require IP whitelisting. Ensure your server IP is registered for the merchant account before making any API calls. *** ## Available endpoints > [card] [Create Recurring Plan](./create-plan) > > Register a new plan. Returns a `payment_link_url` for the customer's one-time card linking. > [card] [Get Recurring Plan](./get-plan) > > Fetch current plan state — status, schedule progress, next payment date, retry policy, and lineage. > [card] [Update or Upgrade Plan](./update-plan) > > Patch cosmetic fields in place, or change amount / items to trigger the upgrade flow with a new plan and optional proration. > [card] [Cancel Plan](./cancel-plan) > > Stop a plan immediately. Active plans go through the lifecycle service; pending plans are cancelled outright. > [!NOTE] > > All endpoints require authentication. See [Authentication](/api-reference/authentication). *** ## Changelog | Date | Description | | - | - | | 2026-04-20 | Initial documentation — Subscription Merchant API v2.0 (create, show, update/upgrade, cancel) + Subscription Cycle webhook. | # Update Plan Source: https://docs.singapay.id/api-reference/subscription-recurring/update-plan https://payment-b2b.singapay.id/api/docs/merchant-api.json patch /api/v2.0/recurring/plans/{id} Patches a subscription plan in place, or upgrades/downgrades it to a new plan when `amount` or `items` change. # Create Source: https://docs.singapay.id/api-reference/virtual-account/create https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v1.0/virtual-accounts/{account_id} Creates a new virtual account for an active account. Amount rules depend on amount type (open or closed), kind (temporary or permanent), and merchant configuration limits. # Delete Source: https://docs.singapay.id/api-reference/virtual-account/delete https://payment-b2b.singapay.id/api/docs/merchant-api.json delete /api/v1.0/virtual-accounts/{account_id}/{virtual_account_id} Permanently deletes a virtual account from the specified account. Deletion is blocked if the virtual account has associated transactions. # Overview Source: https://docs.singapay.id/api-reference/virtual-account/introduction Create unique virtual account numbers for customers or transactions — each payment recorded as an independent VA Transaction. Virtual Account (VA) is a bank transfer payment method where each customer or transaction gets a unique account number to pay into. One Virtual Account can receive multiple payments over time, with each payment recorded as a separate **VA Transaction**. > [card] Unique per transaction > > Each VA has its own number — no payment collisions between customers or orders. > [card] Temporary or permanent > > Create one-time VAs that expire, or permanent VAs for recurring customers. > [card] Multi-bank support > > BRI, BNI, BCA, Maybank, Danamon, and more — customers pay via ATM or mobile banking. *** ## Payment flow ```mermaid theme={null} sequenceDiagram autonumber participant M as Merchant System participant S as SingaPay API participant C as Customer participant B as Bank Network M->>S: POST /virtual-accounts/{account_id} Note over M,S: Create VA with amount & expiry S-->>M: VA Number & details (e.g. 8890-1234-5678) M->>C: Share VA number Note over M,C: Invoice, email, or app notification C->>B: Transfer to VA number Note over C,B: ATM, mobile banking, internet banking B->>S: Payment notification S->>S: Create VA Transaction (pending → paid) S-->>M: Webhook notification (optional) M->>S: GET /va-transactions/{account_id} Note over M,S: Verify and track payment status ``` *** ## Virtual Account vs VA Transaction > [card] Virtual Account (Parent) > > **The payment instrument.** Defines how and where to pay. > > * Unique VA number per account/transaction > * Configured with fixed or open amount > * Can be temporary (with expiry) or permanent > * Controls max usage and validity period > [card] VA Transaction (Child) > > **The payment record.** Created every time a customer pays. > > * Individual payment records per transfer > * Linked to one Virtual Account > * Tracks status and settlement > * One VA → multiple transactions > [!NOTE] > > **Example:** VA `8890-1234-5678` receives 3 bank transfers on different days → 3 separate VA Transaction records are created, each with its own status, amount, and settlement data. *** ## VA types | Type | Expiry | Use case | | - | - | - | | **Temporary** | Yes — based on `expired_at` | One-time invoices, orders with deadlines | | **Permanent** | No | Recurring customers, standing payment instructions | > [!TIP] > > Use **temporary VAs** for order-based payments where you want the VA to stop accepting payment after a deadline. Use **permanent VAs** for customers who pay regularly on the same account number. *** ## Amount types | Type | Description | | - | - | | `closed` | Fixed amount — only accepts the exact configured amount | | `open` | Any amount — customer can transfer any value | *** ## Supported banks — comparison | Bank Code | Min (IDR) | Max (IDR) | Settlement | Sharia | | - | - | - | - | - | | **BCA** | 10,000 | 10,000,000\* | T+1 | — | | **BNI** | 10,000 | 250,000,000\* | T+1 | — | | **BRI** | 10,000 | 250,000,000\* | T+1 | — | | **MANDIRI** | 10,000 | 100,000,000\* | T+1 | — | | **PERMATA** | 10,000 | 50,000,000\* | T+1 | — | | **MAYBANK** | 10,000 | 250,000,000\* | T+1 | — | | **CIMB** | 10,000 | 50,000,000\* | T+1 | — | | **BSI** | 10,000 | 50,000,000\* | T+1 | ✓ Islamic | | **MUAMALAT** | 10,000 | 50,000,000\* | T+1 | ✓ Islamic | | **BNC** | 10,000 | 50,000,000\* | T+1 | — | | **OCBC** | 10,000 | 50,000,000\* | T+1 | — | | **DANAMON** | 10,000 | 50,000,000\* | T+1 | — | \* Maximum limits are configurable per merchant tier. Contact your account manager or customer service to discuss higher limits. ## Important notes > [accordion] One VA, multiple transactions > > A single Virtual Account can receive multiple payments over its lifetime. Each transfer is independently recorded as a VA Transaction — with its own timestamp, amount, and settlement status. > [accordion] Temporary VA expiry and usage limit > > Temporary VAs expire based on your `expired_at` setting. You can also set `max_usage` to limit how many times a VA can be paid — useful for one-time invoices or limited-slot registrations. > [accordion] Permanent VA for recurring payments > > Permanent VAs never expire and are ideal for recurring payments from the same customer — subscriptions, monthly invoices, or standing transfer instructions. > [accordion] Amount validation > > For `closed` VAs, Singapay validates that the transfer amount exactly matches the configured amount. Mismatched amounts are rejected by the bank network before reaching Singapay. > [accordion] Cannot delete a VA with transactions > > Once a VA has received at least one payment, it cannot be deleted. This preserves the integrity of all linked VA Transaction records. > [accordion] Tracking payments > > Use the VA Transaction API to list all payments received by a VA, filter by status or date range, and retrieve settlement details per transaction. *** ## Available endpoints > [card] [List Virtual Accounts](./list) > > Paginated list of VAs for an account. > [card] [Show Virtual Account](./show) > > Retrieve a single VA by ULID. > [card] [Create Virtual Account](./create) > > Generate a new VA with bank, amount type, and expiry configuration. > [card] [Update Virtual Account](./update) > > Update mutable fields on an existing VA. > [card] [Delete Virtual Account](./delete) > > Delete a VA that has no transactions. > [!NOTE] > > All endpoints require authentication. See [Authentication](/api-reference/authentication). # List Source: https://docs.singapay.id/api-reference/virtual-account/list https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/virtual-accounts/{account_id} Retrieves a paginated list of virtual accounts for the specified account. Results are restricted to virtual accounts created within the last 12 months. # Show Source: https://docs.singapay.id/api-reference/virtual-account/show https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/virtual-accounts/{account_id}/{virtual_account_id} Retrieves the details of a single virtual account within the specified account. # Update Source: https://docs.singapay.id/api-reference/virtual-account/update https://payment-b2b.singapay.id/api/docs/merchant-api.json put /api/v1.0/virtual-accounts/{account_id}/{virtual_account_id} Updates an existing virtual account within the specified account. Validation depends on amount type (open or closed) and kind (temporary accounts require expiration and max usage). Status cannot be changed for virtual accounts issued through certain payment methods; sending a different status for those returns 422. # Security and Signature Validation Source: https://docs.singapay.id/api-reference/webhooks/security-and-signature Verify SingaPay webhook authenticity using IP whitelisting and HMAC-SHA512 signature validation. Applies to all webhook types. All SingaPay webhooks use the same security model. Validate every incoming `POST` before processing the payload. ## Acknowledging webhooks Your endpoint must return an HTTP **2xx** response to acknowledge receipt. Return the response quickly and process the payload in a background job when possible. If your endpoint does not return a valid 2xx response, SingaPay retries delivery according to the rules in [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). ```json 200 OK — Success theme={null} { "status": "success" } ``` ```json 401 Unauthorized — Invalid Signature theme={null} { "status": "error", "message": "Invalid signature" } ``` ```json 500 Internal Server Error — Processing Error theme={null} { "status": "error", "message": "Failed to process webhook" } ``` > [!TIP] > > Process webhooks asynchronously — return `200 OK` immediately and handle the payload in a background job to avoid timeouts. *** ## Security mechanisms > [card] IP Whitelist > > Simplest approach. Restrict access to SingaPay's official IP addresses at the firewall or app level. > [card] Signature Validation > > Recommended. Cryptographically verify every request is authentic and untampered using HMAC-SHA512. > [card] Combined (Recommended) > > Maximum security. Layer IP whitelisting first (fast rejection), then validate signatures (integrity). | Approach | Best For | | - | - | | IP Whitelist only | Simple setup, testing environments | | Signature only | Higher security, good for testing signature logic | | **IP Whitelist + Signature** | **Production — industry best practice** | | IP + Signature + Timestamp validation | High-security requirements with replay attack protection | ### Option 1: IP Whitelist Configure your firewall or application to only accept requests from SingaPay's official IP addresses. Contact support or check your merchant dashboard for the official IP list. ```nginx Nginx theme={null} location /webhook/callback { allow 103.xxx.xxx.xxx; # Replace with actual IPs from SingaPay allow 103.xxx.xxx.xxx; deny all; proxy_pass http://your-backend; } ``` ```php PHP theme={null} 'error', 'message' => 'Access denied']); exit; } // Process webhook... ?> ``` ### Option 2: Signature Validation See [How to validate signature](#how-to-validate-signature) below. ### Option 3: Combined (maximum security) ```php PHP theme={null} ``` *** ## How to validate signature > [!NOTE] > > Signature validation is **optional** but **strongly recommended** for all production environments. The `X-Signature` header is an HMAC-SHA512 signature generated by SingaPay. The `ENDPOINT` value in the string to sign must match the **path and query string** of your configured webhook URL exactly (for example `/webhook/callback` or `/api/v1/webhooks/singapay`). ### Steps **1. Extract Headers** Pull these three values from the incoming request: * `X-Signature` — the signature to verify * `X-Timestamp` — Unix timestamp in seconds * `Authorization` — strip `"Bearer "` prefix to get the raw token **2. Get Your Client Secret** Retrieve your **Client Secret** from the merchant dashboard. This is your HMAC key. > [!WARNING] > > Never expose your Client Secret in client-side code or logs. Store it in environment variables or a secure vault. **3. Extract Endpoint Path** Include the full path with any query parameters. ```text theme={null} Full URL: https://yourdomain.com/webhook/callback?param=value Endpoint: /webhook/callback?param=value ``` **4. Normalize and Hash the Request Body** 1. Parse the raw JSON body 2. Sort all object keys **recursively and alphabetically** 3. Re-encode with `JSON_UNESCAPED_UNICODE` and `JSON_UNESCAPED_SLASHES` 4. Hash with **SHA-256** ```text theme={null} Original: {"status":200,"success":true,"data":{"transaction":{"reff_no":"123"}}} Sorted: {"data":{"transaction":{"reff_no":"123"}},"status":200,"success":true} SHA-256: 5f4dcc3b5aa765d61d8327deb882cf99... ``` **5. Build the String to Sign** Concatenate with `:` as the separator: ```text theme={null} StringToSign = METHOD:ENDPOINT:ACCESS_TOKEN:HASHED_BODY:TIMESTAMP Example: POST:/webhook/callback:a1b2c3d4e5f6...:5f4dcc3b...:1695711945 ``` **6. Generate the HMAC-SHA512 Signature** ```text theme={null} Calculated Signature = HMAC-SHA512(StringToSign, Client Secret) ``` **7. Compare Signatures (Constant-Time)** | Language | Function | | - | - | | PHP | `hash_equals()` | | Node.js | `crypto.timingSafeEqual()` | | Python | `hmac.compare_digest()` | ### Implementation examples ```php PHP theme={null} 'success']); } else { http_response_code(401); echo json_encode(['status' => 'error', 'message' => 'Invalid signature']); } ?> ``` ```python Python (Flask) theme={null} import hmac, hashlib, json, os from flask import Flask, request, jsonify app = Flask(__name__) def sort_dict_recursive(data): if isinstance(data, dict): return {k: sort_dict_recursive(v) for k, v in sorted(data.items())} elif isinstance(data, list): return [sort_dict_recursive(i) for i in data] return data def validate_webhook_signature(request_body, headers, client_secret, endpoint): received_signature = headers.get('X-Signature', '') timestamp = headers.get('X-Timestamp', '') access_token = headers.get('Authorization', '').replace('Bearer ', '') try: body_dict = json.loads(request_body) except json.JSONDecodeError: return False sorted_body = sort_dict_recursive(body_dict) normalized_json = json.dumps(sorted_body, ensure_ascii=False, separators=(',', ':')) hashed_body = hashlib.sha256(normalized_json.encode('utf-8')).hexdigest() string_to_sign = f"POST:{endpoint}:{access_token}:{hashed_body}:{timestamp}" calculated_sig = hmac.new( client_secret.encode('utf-8'), string_to_sign.encode('utf-8'), hashlib.sha512 ).hexdigest() return hmac.compare_digest(calculated_sig, received_signature) @app.route('/webhook/callback', methods=['POST']) def webhook_callback(): request_body = request.get_data(as_text=True) client_secret = os.environ['SINGAPAY_CLIENT_SECRET'] endpoint = '/webhook/callback' if validate_webhook_signature(request_body, dict(request.headers), client_secret, endpoint): return jsonify({'status': 'success'}), 200 return jsonify({'status': 'error', 'message': 'Invalid signature'}), 401 ``` ```javascript Node.js (Express) theme={null} const express = require('express'); const crypto = require('crypto'); const app = express(); app.use(express.json({ verify: (req, res, buf) => { req.rawBody = buf.toString('utf8'); } })); function sortObjectRecursive(obj) { if (typeof obj !== 'object' || obj === null) return obj; if (Array.isArray(obj)) return obj.map(sortObjectRecursive); return Object.keys(obj).sort().reduce((sorted, key) => { sorted[key] = sortObjectRecursive(obj[key]); return sorted; }, {}); } function validateWebhookSignature(requestBody, headers, clientSecret, endpoint) { const receivedSignature = headers['x-signature'] || ''; const timestamp = headers['x-timestamp'] || ''; const accessToken = (headers['authorization'] || '').replace('Bearer ', ''); let bodyObject; try { bodyObject = JSON.parse(requestBody); } catch (e) { return false; } const sortedBody = sortObjectRecursive(bodyObject); const normalizedJson = JSON.stringify(sortedBody); const hashedBody = crypto.createHash('sha256').update(normalizedJson).digest('hex'); const stringToSign = `POST:${endpoint}:${accessToken}:${hashedBody}:${timestamp}`; const calculatedSig = crypto.createHmac('sha512', clientSecret).update(stringToSign).digest('hex'); try { return crypto.timingSafeEqual( Buffer.from(calculatedSig), Buffer.from(receivedSignature) ); } catch { return false; } } app.post('/webhook/callback', (req, res) => { const clientSecret = process.env.SINGAPAY_CLIENT_SECRET; const endpoint = '/webhook/callback'; if (validateWebhookSignature(req.rawBody, req.headers, clientSecret, endpoint)) { res.status(200).json({ status: 'success' }); } else { res.status(401).json({ status: 'error', message: 'Invalid signature' }); } }); app.listen(3000); ``` ### Best practices and troubleshooting > [accordion] Do's > > * Always validate signatures before processing any webhook > * Use **constant-time comparison** (`hash_equals`, `timingSafeEqual`, `compare_digest`) to prevent timing attacks > * Validate `X-Timestamp` is within 5 minutes of current time to block replay attacks > * Use the **raw request body** for hashing — do not parse JSON first > * Store your Client Secret in environment variables or a secure vault > * Always use **HTTPS** for webhook endpoints > * Handle duplicate webhooks gracefully using stable IDs from the payload as idempotency keys > * Log all webhook requests (with signatures redacted) for audit purposes > [accordion] Common mistakes > > * Not sorting JSON keys before hashing (order matters) > * Using SHA-256 for the HMAC instead of SHA-512 (body = SHA-256; signature = SHA-512) > * Wrong separator in string to sign (must be `:`, not `_` or `-`) > * Using your API Key instead of your Client Secret > * Parsing JSON before hashing (always use the raw body) > * Using simple string comparison instead of constant-time comparison > * Wrong field order — must be `METHOD:ENDPOINT:TOKEN:HASH:TIMESTAMP` > * Forgetting to strip `"Bearer "` from the Authorization header > * Not including query parameters in the endpoint path > [accordion] Troubleshooting > > If signature validation fails, check in order: > > 1. **String to sign format** — `POST:ENDPOINT:ACCESS_TOKEN:HASHED_BODY:TIMESTAMP` > 2. **JSON normalization** — keys sorted recursively, correct encoding flags > 3. **Hash algorithms** — SHA-256 for body, SHA-512 for HMAC > 4. **HMAC key** — Client Secret, not API Key > 5. **Endpoint path** — exact match including query parameters > 6. **Timestamp** — valid Unix timestamp in seconds > 7. **Access token** — extracted from Authorization header, no `"Bearer "` prefix > 8. **Debug logging** — log `stringToSign`, `hashedBody`, `calculatedSignature` (dev only) *** ## Idempotency SingaPay may deliver the same webhook more than once if your endpoint returned a non-2xx response and a retry was scheduled. Use a stable identifier from the payload (such as `transaction_id`, `reff_no`, or `bill_number`) to detect duplicates and skip reprocessing. Return `200 OK` only after you have safely recorded the event (or confirmed it was already processed). # Banking Savings Source: https://docs.singapay.id/banking-savings Enable businesses and users to place account balances into savings and yield-generating products, allowing funds to earn returns while remaining accessible. **Key Features** * Flexible deposits and withdrawals * Yield and earnings management * Automatic interest accrual on eligible balances **Typical Use Cases** * Digital wallet savings balances * Corporate treasury and idle fund management * Yield-bearing accounts for platform users *** # Compliance Check Source: https://docs.singapay.id/compliance-check Compliance Check aggregates information from regulatory and high-risk data sources—including **PPATK** and **OJK** AML-related watchlists—to support suspicious transaction monitoring, high-risk customer identification, and regulatory compliance. *** ## **Available Services** | **Service** | **Description** | **Integration Method** | **Billing Model** | | - | - | - | - | | **Compliance Check** | Performs aggregated searches using name, bank account number, National ID (NIK), and address against PPATK and OJK high-risk lists, including DTTOT, PEP, online gambling indicators (Judol), Terrorism Financing Screening (TFS), and related watchlists. | API | Standard API response | | **High-Risk List** | Provides real-time blacklist and high-risk entity lookups. | API | Standard API response | | **Blacklist Risk Level** | Generates a risk level based on multidimensional credit and compliance data to support decision-making. | API | Standard API response | *** ## **Typical Use Cases** * AML compliance for financial institutions * Risk control for cross-border payments * Monitoring and blocking high-risk transactions *** # Consumer Loan Source: https://docs.singapay.id/consumer-loan Merchants can recommend Singapay's lending partners to customers seeking financing for purchases. After approval, the financing institution disburses funds directly to the merchant, enabling customers to complete purchases through installment financing. This solution is particularly suitable for **high-value, infrequent purchases**. **Key Features** * High financing limits * Real-time approval decisions * Installment repayment plans * Automatic repayment support *** ## **Customer Journey** 1. The merchant refers the customer to a Singapay lending partner. 2. The customer completes registration with the lending institution. 3. The customer submits: * Product information * Personal information\ through the merchant's website or application (via API or embedded H5 interface). 4. After approval, the lending institution pays the merchant directly. 5. The customer repays the financing provider according to the agreed repayment schedule. *** ## **Typical Use Cases** * Motorcycle financing * Smartphone installment purchases *** # Credit Feature & Scoring (Under Development) Source: https://docs.singapay.id/credit-feature-and-scoring By combining data from mobile phone usage, social connections, device behavior, purchasing power, educational background, tax records, and cross-platform activity, Singapay builds multidimensional customer profiles and predictive risk models. Powered by machine learning and localized datasets, these services provide accurate credit evaluation, fraud detection, and decision support for financial institutions, e-commerce businesses, digital wallets, and consumer lending platforms. *** ## **Available Services** | **Service** | **Description** | **Integration Method** | | :- | :- | :- | | **Phone Number Detection** | Analyzes mobile number status and associated relationships. | API | | **Multi-Platform Analysis** | Detects suspicious loan applications using cross-platform behavioral data. | API | | **Income Estimation** | Estimates a user's financial capacity and income level. | API | | **Fraud Insight Graph** | Uses machine learning to identify fraud patterns and generate fraud risk scores. | API | | **Social Email Detection** | Determines whether an email address is associated with social media platforms and related profiles. | API | | **Social Phone Detection** | Detects social platform registrations associated with a phone number. | API | | **Financial Assessment Level** | Evaluates an individual's financial capability. | API | | **Credit Rating Estimation** | Predicts an individual's credit rating based on behavioral and financial indicators. | API | | **Education Assessment** | Provides education-related insights and associated risk indicators. | API | | **Family Insights** | Generates household-level financial profiles using spending, credit, and behavioral data. | API | | **Personal Tax Insights** | Provides identity, taxation, and income-related information for risk management and compliance. | API | | **Fintech FinScore** | Credit scoring model optimized for fintech applications. | API | | **Bank FinScore** | Credit scoring model designed for banking institutions. | API | | **Credit Scoring X** | Produces credit scores using social media and income-related data. | API | | **Telco Score** | Customized credit score developed in collaboration with Indonesian telecommunications providers. | API | *** ## **Typical Use Cases** * Credit underwriting for consumer loans, cash loans, and microfinance * Credit assessment and limit management for Buy Now, Pay Later (BNPL) services * Risk evaluation for digital wallet and payment account onboarding * Detection of multi-platform borrowing and fraud attempts * High-risk transaction detection and customer segmentation in e-commerce *** # Digital Goods & Virtual Top-Ups Source: https://docs.singapay.id/digital-goods-and-virtual-top-ups Singapay supports digital top-ups and virtual product purchases across a variety of categories, including e-wallet reloads, gaming credits, digital vouchers, and entertainment-related products. The platform integrates with leading gaming publishers, e-wallet providers, and digital content ecosystems, enabling businesses to rapidly launch digital commerce services. *** ## **Supported Products** | **Product** | **Payment Type** | **Billing Model** | | :- | :- | :- | | **E-Money Top-Up** | Prepaid | Service fee included in purchase price | | **Game Top-Up** | Prepaid | Service fee included in purchase price | | **Game Voucher** | Prepaid | Service fee included in purchase price | | **Digital Products** | Prepaid | Service fee included in purchase price | *** ## **Typical Use Cases** * Marketing and promotional campaigns * E-commerce platforms * Gaming platforms * Digital content and entertainment platforms *** # Government & Social Insurance Services Source: https://docs.singapay.id/government-and-social-insurance-services Singapay enables payments for Indonesian government and social insurance programs, including healthcare and employment-related social security contributions. The platform supports key national services such as: * **BPJS Kesehatan (National Health Insurance)** * **BPJS Ketenagakerjaan (Employment Social Security)** These capabilities help businesses integrate essential public service payments into their financial ecosystems. *** ## **Supported Products** | **Product** | **Payment Type** | **Billing Model** | | :- | :- | :- | | **BPJS Kesehatan (Health Insurance)** | Postpaid | Bill amount plus service fee | | **BPJS Ketenagakerjaan (Employment Social Security)** | Postpaid | Bill amount plus service fee | *** ## **Typical Use Cases** * Digital wallets * Banks * Payment service providers * Lifestyle and public service applications *** # Credit Card Source: https://docs.singapay.id/guides/en/accept-payment/credit-card Accept Visa, Mastercard, and American Express payments from customers with a straightforward API — ideal for e-commerce, SaaS, and any scenario where customers prefer paying by card. *** ## Supported card channels `Visa`   `Mastercard`   `American Express` *** ## Transaction limits | Parameter | Value | | - | - | | Minimum transaction | IDR 10,000 | | Maximum transaction | IDR 999,999,999 | | Settlement | T+3 Business Days | | 3D Secure | Supported | | Currency | IDR | *** ## Key capabilities ✓ One-time charge — process a payment in a single API call. ✓ 3D Secure authentication to reduce fraud and chargebacks. ✓ Transaction cancellation for authorized but unsettled charges. ✓ Real-time status inquiry to confirm authorization, settlement, or decline. ✓ Subscription billing — see Subscription for recurring charge setup via card tokenization. *** ## How a card payment works **1. Customer enters card details** Your checkout page collects the card number, expiry, and CVV. These pass to SingaPay's secure tokenization layer — raw card data never touches your servers. **2. 3D Secure verification (if required)** For enrolled cards, the customer is redirected to their bank's verification page to authenticate with a one-time code or biometric. **3. Authorization and settlement** SingaPay submits the charge to the card network. On approval, the transaction is authorized immediately and settles within the standard cycle. **4. Webhook confirmation** Your server receives a webhook event confirming the outcome so you can update order status and trigger fulfilment automatically. *** # E-Wallet Source: https://docs.singapay.id/guides/en/accept-payment/e-wallet Let customers pay directly from their digital wallet. Native e-wallet integration keeps the checkout experience fast, familiar, and inside the apps your customers already use every day. *** ## What is native e-wallet integration? Unlike QRIS (where the customer scans a code), native e-wallet integration lets you initiate a payment request programmatically and redirect the customer straight into their wallet app to confirm. This is significantly smoother on mobile — one tap to confirm, payment done in seconds. *** ## How it works **1. Create a payment charge** Your backend calls the SingaPay API specifying the wallet type, amount, and customer identifier. SingaPay returns a deep link or redirect URL. **2. Redirect the customer** Direct the customer to the URL. On mobile it opens the wallet app directly. On desktop it shows a QR or link to authenticate. **3. Customer approves** The customer reviews the charge in their wallet app and confirms with PIN or biometric. **4. Confirmation and redirect** SingaPay confirms the payment, fires a webhook, and the customer is redirected back to your success page. *** ## Supported wallets | Wallet | Min (IDR) | Max (IDR) | Settlement | | - | - | - | - | | **OVO** | 1,000 | 20,000,000 | T+1 business days | | **ShopeePay** | 1,000 | 20,000,000 | T+1 business days | | **DANA** | 1,000 | 20,000,000 | T+1 business days | *** # Overview Source: https://docs.singapay.id/guides/en/accept-payment/overview Quickly start accepting payments through your website, mobile application, or a no-code integration. Singapay provides a comprehensive payment solution designed specifically for the Indonesian market by integrating multiple payment methods and payment service providers into a single easy-to-use platform. With only one integration, merchants gain access to a complete payment ecosystem, ensuring every transaction is processed smoothly and reliably. *** ## Why Choose Singapay for Payment Collection? * **Unified Payment Aggregation**\ Integrates more than 50 major local and international payment methods, including QRIS, e-wallets, virtual accounts, credit cards, and more. * **Fast and Transparent Settlement**\ Merchants can monitor transaction details and statuses in real time through the Dashboard or API. Early settlement services are also available to maximize cash flow efficiency. * **Recurring Payment Solution**\ Through a single API integration, merchants can link multiple banks and digital wallets to perform scheduled automatic debits, increasing payment success rates and recurring revenue. * **Intelligent Routing**\ Transaction requests are automatically routed to the most reliable payment provider, improving stability, increasing payment success rates, and reducing customer drop-offs. * **Fast, Secure, and Reliable Transactions**\ Built upon an ISO 27001-certified security framework and a production-proven infrastructure that delivers secure, real-time payment processing. *** ## **Core Payment Flow** This flowchart illustrates the end-to-end journey of a transaction, from the moment a merchant initiates a charge to the final payout. It breaks down how payments are created, processed securely through various payment methods, and ultimately settled into the merchant's balance for withdrawal. ![Flowchart Accept Money](https://mintcdn.com/singapay/lMQfsyCmybnSZ6ly/images/Flowchart_accept-money.png?fit=max\&auto=format\&n=lMQfsyCmybnSZ6ly\&q=85\&s=f2bfd32c5dc5ecc76b814ed559b09e3a) *** ## Available Payment Method Singapay aggregates Indonesia's leading payment methods into a unified platform, supporting **24/7 availability**, **high-value transactions**, and **real-time settlement**. | **Payment Method** | **Supported Channels** | **Supported Access** | | - | - | - | | **QRIS** | Indonesia, China, Singapore, Malaysia, Thailand, with Japan, South Korea, Vietnam, and Philippines under development | Dashboard, [API](https://docs.singapay.id/api-reference/qris-money-in/introduction), Mobile App (under development) | | **Virtual Account (VA)** | BCA, Mandiri, BRI, BNI, CIMB, Maybank, Danamon, BSI, Permata, OCBC | Dashboard, [API](https://docs.singapay.id/api-reference/virtual-account/introduction), Mobile App (under development) | | **E-Wallet** | GoPay, DANA, OVO, ShopeePay | Dashboard, [API](https://docs.singapay.id/api-reference/e-wallet-money-in/introduction), Mobile App (under development) | | **Credit Card** | Visa, Mastercard, JCB, American Express, UnionPay (under development) | Dashboard, [API](https://docs.singapay.id/api-reference/card-money-in/introduction) | | **Direct Debit** | BCA, Mandiri, BRI, BNI, CIMB, Danamon | Under development | | **Convenience Store** | Alfamart Group (Alfamart, Alfamidi, Lawson, DAN+DAN) and Indomaret (under development) | Under development | | **Buy Now Pay Later (BNPL)** | Kredivo, Akulaku, Indodana (under development) | Under development | | **Crypto Wallet** | USDT (major networks), USDC (major networks) | Dashboard, API (under development), Mobile App (under development) | *Limits and settlement times are available in the corresponding product documentation.* *** ## Quick Comparison | Method | Customer action | Best for | Settlement | Early Settlement | | - | - | - | - | - | | **Virtual Account** | Bank transfer via app, internet banking, or ATM | B2B invoicing, recurring billing, high-value transactions | T+1 Days | Available | | **QRIS** | Scan QR code with any QRIS-certified app | In-person POS, in-app payments, printed invoices | T+1 Days | Available | | **Credit Card** | Enter card number, CVV, expiry + 3DS confirmation | E-commerce, international customers, high-value orders | T+3 Days | Unavailable | | **E-Wallet** | Confirm payment inside wallet app (1 tap) | Mobile-first users, fast checkout, digital products | T+1 Days | Available | | **Subscription** | One-time authorisation, then fully automatic | SaaS, memberships, recurring services | T+1\~3 Days | Unavailable | *** ## Typical Use Cases > [accordion] Fintech Platforms > > Customer loan repayments and overdue collections. > [accordion] E-Commerce > > Customers pay using local Indonesian methods such as GoPay, OVO, DANA, or Virtual Accounts. > [accordion] SaaS Providers > > Collect subscription payments from customers across multiple countries without maintaining local payment infrastructure. > [accordion] International Businesses > > Chinese and global companies entering Southeast Asia can quickly integrate into Indonesia's local payment ecosystem. *** # Payment Link Source: https://docs.singapay.id/guides/en/accept-payment/payment-link Merchants can accept payments without building their own checkout page by simply generating a payment link that have all payment methods available in Singapay. *** ## What Can Payment Link Do? The payment link may be: * Shared via messaging applications or email * Embedded into merchant websites * Embedded into mobile applications Customers simply open the link and complete the payment. Payment links support customization including: * Single-use, multiple-use, or unlimited-use links * Fixed or open payment amounts * Configurable payment methods * Custom visual branding and page elements *** ## **Typical Use Cases** * Sales through WhatsApp or Instagram * Remote payments for education, healthcare, and consulting services * Small businesses without dedicated development teams *** # QRIS Source: https://docs.singapay.id/guides/en/accept-payment/qris Let customers pay by scanning a QR code with any banking or e-wallet app in Indonesia. One QR code, every app — that's the power of the national QRIS standard. *** ## What is QRIS? QRIS (Quick Response Code Indonesian Standard) is a unified QR payment standard regulated by Bank Indonesia. Any QRIS-certified app can scan and pay any QRIS code — meaning a QR generated by SingaPay works for customers using BCA Mobile, Mandiri, GoPay, OVO, DANA, ShopeePay, and dozens of others, with no extra configuration on your end. SingaPay generates **MPM Dynamic QRIS** — Merchant Presented Mode, Dynamic. Each QR code is generated fresh per transaction and encodes the exact payment amount, eliminating any risk of customer input errors. *** ## Transaction limits | Parameter | Value | | - | - | | Minimum transaction | IDR 1,000 | | Maximum transaction | IDR 10,000,000 (per Bank Indonesia QRIS regulation) | | Settlement | T+1 Business Days | | QR type | MPM Dynamic | | Currency | IDR | *** ## Why use QRIS? ✓ Works with every QRIS-certified app — one code covers every customer regardless of bank or wallet. ✓ Payment amount is fixed inside the QR — no manual entry, no room for mistakes. ✓ Real-time payment confirmation the moment the customer's app confirms. ✓ Flexible display: in-person screens, printed receipts, invoices, or in-app. *** ## How it works **1. Generate a QR code** Your system calls the SingaPay API with the transaction amount. A raw `qr_string` is returned. **2. Render and display** Convert the `qr_string` into a scannable image using any standard QR library and display it to your customer. **3. Customer scans and confirms** The customer opens their preferred app, scans the QR, reviews the amount, and confirms payment in a few seconds. **4. Payment confirmed, QR consumed** SingaPay confirms the payment, credits your balance, fires a webhook, and marks the QR as used. It cannot be reused. > [!WARNING] > > Each dynamic QRIS code is **single-use**. Once a customer pays or the code expires, it becomes invalid. Always generate a new `qr_string` for each transaction. *** # Settlement Source: https://docs.singapay.id/guides/en/accept-payment/settlement Singapay offers two settlement options designed for different cash flow requirements. *** ## Normal Settlement Uses the standard settlement cycle for each payment method, typically **T+1 (next business day)**, although some methods may require longer. This is the default settlement option for all merchants. Suitable for businesses with stable cash flow that do not require accelerated fund availability. *** ## Early Settlement Accelerates settlement beyond the standard processing cycle, enabling **same-day (T+0)** or near-instant fund availability depending on the payment method. Availability and eligible transaction amounts may vary by payment channel. Transactions exceeding eligible limits will continue to follow the normal settlement cycle. Ideal for businesses seeking faster liquidity for operational expenses or reducing end-of-day cash flow gaps. | **Settlement Type** | **Processing Time** | **Availability** | **Additional Fee** | | - | - | - | - | | **Normal Settlement** | T+1 to T+4 depending on payment method | All supported payment methods | None | | **Early Settlement** | Same-day (T+0) or near real-time depending on payment method | Selected payment methods only | May apply | *** ## **Typical Use Cases** * FinTech lenders recycling repayment funds into new loans * High-volume merchants seeking faster cash turnover * E-commerce sellers paying suppliers sooner and improving working capital *** # Subscription Source: https://docs.singapay.id/guides/en/accept-payment/subscription Charge customers automatically on a recurring schedule — weekly, monthly, or any cycle you define. SingaPay supports subscription billing via Credit Card and GoPay, so you tokenize once and let the platform handle the rest. *** ## What is subscription billing? Subscription billing lets you collect recurring payments without requiring customers to approve each individual charge. On the first transaction, the customer provides their card details or authorizes their GoPay wallet. From that point, SingaPay charges automatically on your defined schedule — daily, weekly, monthly, or custom intervals. This is essential for SaaS platforms, membership sites, insurance premiums, and any business built on predictable recurring revenue. Singapay supports two recurring payment models: **A. Plan-Based Subscription Model** Merchants create billing plans, while customers review and authorize their payment methods through a Singapay-hosted page. Singapay automatically executes scheduled recurring charges according to the configured plan. **Features include:** * No-code integration * Custom billing intervals * Introductory discounts * Free trial periods * Plan upgrades and downgrades * Automatic retry for failed payments * Payment reminders **B. Token-Based Authorization Model** Customers authorize and bind their payment methods through Singapay. After authorization, Singapay returns an authorization token that merchants can use to initiate future charges independently. **Features include:** * Flexible billing amounts * Custom billing schedules * Long authorization validity periods * High transaction limits | Model | Supported Payment Methods | Access | | - | - | - | | Plan-Based Subscription | Direct Debit (under development), E-Wallet (under development), Credit Card | Dashboard, API | | Token-Based Authorization | Direct Debit (under development), E-Wallet (under development), Credit Card (under development) | API | *The available model depends on the merchant's business scenario. Fees, limits, and settlement details are provided separately.* *** ## **Typical Use Cases** * Consumer lending and installment repayments * Video and streaming subscriptions * SaaS monthly or annual billing * Insurance premium collection *** # Virtual Account Source: https://docs.singapay.id/guides/en/accept-payment/virtual-account Give each customer a unique bank account number to transfer money to. SingaPay automatically detects the incoming payment, reconciles it, and credits your account balance — no manual work required. *** ## What is a Virtual Account? A Virtual Account (VA) is a virtual bank account number that sits in front of your real bank account. Customers transfer money to it exactly as they would any regular bank transfer — via mobile banking, internet banking, or ATM. SingaPay instantly identifies each incoming transfer, reconciles it to the correct account and transaction, and credits the funds in real time. Because every VA number is unique, you always know exactly who paid, how much, and when — even at high volumes. *** ## VA configuration options Every VA you create is defined along two dimensions: ### By lifetime | Type | How it works | Best for | | - | - | - | | **Permanent** | The VA number never expires and can receive multiple payments indefinitely. | Recurring customers, subscription top-ups, dedicated payment addresses | | **Temporary** | Expires after a set time. Can also cap the number of accepted payments (1–255) before auto-expiring. | One-time invoices, time-sensitive checkout windows | ### By amount type | Type | How it works | Best for | | - | - | - | | **Closed** | Accepts only the exact amount specified. Any other amount is rejected by the bank. | Fixed invoices, specific order totals | | **Open** | Accepts any amount within a min–max range you define. | Top-ups, wallet reloads, donations | *** ## How the payment flow works **1. Create a Virtual Account** Call the SingaPay API with the bank code, VA type, amount, and optional expiry. A unique VA number is returned to display to your customer. **2. Customer makes the transfer** The customer pays via their bank app, internet banking, or ATM — exactly like a regular bank transfer. No app download or extra setup needed. **3. SingaPay confirms the payment** The moment the transfer arrives, SingaPay validates the amount (for closed-type VAs), records the transaction, and credits your account balance in real time. **4. Your system is notified** A webhook fires to your configured endpoint so you can update order status, send a receipt, or trigger fulfilment automatically. *** ## Supported banks — comparison | Bank Code | Min (IDR) | Max (IDR) | Settlement | Sharia | | - | - | - | - | - | | **BCA** | 10,000 | 10,000,000\* | T+1 | — | | **BNI** | 10,000 | 250,000,000\* | T+1 | — | | **BRI** | 10,000 | 250,000,000\* | T+1 | — | | **MANDIRI** | 10,000 | 100,000,000\* | T+1 | — | | **PERMATA** | 10,000 | 50,000,000\* | T+1 | — | | **MAYBANK** | 10,000 | 250,000,000\* | T+1 | — | | **CIMB** | 10,000 | 50,000,000\* | T+1 | — | | **BSI** | 10,000 | 250,000,000\* | T+1 | ✓ | | **MUAMALAT** | 10,000 | 250,000,000\* | T+1 | ✓ | | **BNC** | 10,000 | 250,000,000\* | T+1 | — | | **OCBC** | 10,000 | 250,000,000\* | T+1 | — | | **DANAMON** | 10,000 | 250,000,000\* | T+1 | — | \* Maximum limits are configurable per merchant tier. Contact your account manager or customer service to discuss higher limits. > [!NOTE] > > Always include your own internal reference ID in the `merchant_reff_no` field when creating a VA. This ties every SingaPay transaction record back to your own order system, making reconciliation effortless. *** # Introduction Source: https://docs.singapay.id/guides/en/getting-started/overview # Welcome to SingaPay 👋 SingaPay is a payment infrastructure platform built for businesses in Indonesia. Whether you're collecting payments from customers or sending funds to partners, SingaPay gives you a single integration point — reliable, programmable, and ready to scale. *** ## What is SingaPay? SingaPay is a B2B payment gateway that removes the complexity of dealing with multiple banks, digital wallets, and payment rails separately. Instead of negotiating contracts with each bank or wallet provider individually, you connect once to SingaPay and immediately have access to a complete suite of payment products — all managed through one dashboard and one API. We handle the infrastructure, the reconciliation, and the bank relationships. Your team focuses on building the product experience, not managing payment plumbing. *** ## What can you do with SingaPay? > [card] Accept Payments > > Virtual Accounts, QRIS, Credit Card, E-Wallets, and Subscription billing — all in one integration. > [card] Send Money > > Disburse to any local bank account or e-wallet in Indonesia — payroll, refunds, supplier payments, and more. > [card] Sub-accounts > > Organize your operations by business unit, brand, or partner under a single merchant credential. > [card] Reports > > Full transaction history, balance statements, and reconciliation data — available via API or dashboard. *** ## Key highlights ✓ One integration covers multiple bank Virtual Accounts, QRIS, Credit Card, and e-wallets — no separate contracts needed per channel. ✓ Real-time payment confirmation with automated reconciliation. Every transaction is recorded the moment it happens. ✓ Outbound transfers to 100+ Indonesian banks and e-wallets, available around the clock. ✓ Subscription billing for recurring charges via Credit Card and E-Wallet. ✓ Sub-account structure to cleanly separate funds and transaction history across your business units or customers. ✓ Detailed reports exportable from the dashboard or queryable via API for seamless reconciliation. *** ## How it all connects Every payment product in SingaPay is anchored to an **Account**. When a customer makes a payment — through a Virtual Account number, a QRIS scan, or a checkout page — the funds are automatically credited to the associated account balance. From there, you can monitor your balance, pull reports, or push funds out via disbursement. Webhook notifications keep your system informed in real time, so you're never polling for status updates. *** # Required Documents Source: https://docs.singapay.id/guides/en/getting-started/required-documents Before going live with SingaPay, your business needs to pass a verification process. This page covers what to prepare so onboarding goes as smoothly as possible. *** ## Why we verify your business As a licensed payment service provider, SingaPay is required by Bank Indonesia to verify the identity and legitimacy of every merchant we onboard. This protects both your business and your customers, and ensures that SingaPay remains a trusted and compliant platform. *** ## Documents required for all business types | Document | Description | | - | - | | **NIB (Nomor Induk Berusaha)** | Your company's business registration number issued by the OSS system. | | **NPWP** | Company tax identification number. Must match the registered business name. | | **KTP (Director)** | National ID card of the company director or authorised signatory. | | **Company deed (Akta Pendirian)** | The company's deed of establishment and any amendments. | | **SK Kemenkumham** | Ministry of Law and Human Rights ratification letter for the company deed. | | **Settlement bank account** | A corporate bank account in the company's name for receiving settlements. Personal accounts are not accepted. | *** ## Additional documents (may be requested) * Business licence specific to your industry (e.g. SIUP, OJK licence for fintech) * Proof of address for your registered business location * Website or application URL where payments will be integrated * Sample screenshots or description of the customer payment flow > [!NOTE] > > You can access the **sandbox environment** and begin building your integration immediately after account creation — before document verification is complete. Documents are only required when activating your production account. *** ## Verification timeline Document review typically takes **1–3 working days** from submission. Our compliance team may follow up for additional information, so submitting complete documents upfront helps speed up the process. Your dedicated account manager will guide you through every step. *** ## Getting started To begin the onboarding process, reach out to our team at [cs@singapay.id](mailto:cs@singapay.id). Once your merchant profile is created, your account manager will send you the full document submission form. *** # Your Dashboard Source: https://docs.singapay.id/guides/en/getting-started/your-dashboard Once your SingaPay merchant account is created, your dashboard is the central place to monitor transactions, manage accounts, configure settings, and pull reports — all without touching the API. *** ## Sandbox Mode vs. Production Mode Your dashboard operates in two distinct modes. Understanding the difference is essential before you start creating any transactions. > [card] 🧪 Sandbox Mode > > A safe sandbox environment where all transactions use virtual funds. Nothing here touches real money or real bank accounts. Use it to explore features, build your integration, and run end-to-end tests before going production. > [card] 🟢 Production Mode > > Your production environment. All transactions here involve real money and real customers. Production Mode becomes available only after your merchant account has been fully verified and activated. > [!NOTE] > > When you switch between modes, the toggle only applies to your own dashboard session — your team members' modes are unaffected. Switching back to Sandbox Mode from Production Mode will never erase your production transaction history. *** ## How to switch modes **1. Click your business name** Find your business name in the bottom-left corner of the dashboard, under your logo. **2. Toggle the mode** Click **Switch to Sandbox Mode** or **Switch to Production Mode** as needed. The current mode is always shown in the bottom-left corner. **3. Confirm the mode indicator** A label in the top-left corner tab will always clearly show whether you are in Sandbox or Production Mode. *** ## Your business and profile details To view or update your business information, navigate to **Profile**. The details you submitted during onboarding are displayed here. If you need to update core business information (such as company name or settlement bank account), contact your account manager or email [cs@singapay.id](mailto:cs@singapay.id). *** ## Managing your team SingaPay supports multiple dashboard users under a single merchant account. You can invite team members and assign roles that control what each person can see and do — for example, giving your finance team read-only access to reports without access to API credentials. To add a team member, go to **Management → Team Management** and send an invitation by email. *** ## API credentials Your `client_id` and `client_secret` are generated in the dashboard under **Developer Tools → Credentials**. Keep your `client_secret` private — treat it like a password. If you suspect it has been compromised, you can rotate your HMAC Validation Key from the same settings page. > [!WARNING] > > Never expose your API credentials in front-end code, mobile apps, or public repositories. All API calls should originate from your backend server. Sandbox Mode and Production Mode credentials are completely separate — never use Sandbox credentials in a production environment. *** # Reporting Source: https://docs.singapay.id/guides/en/reports/Reporting Every transaction on SingaPay is recorded, timestamped, and queryable. Pull the data your finance team needs — by account, date range, and product type — from the dashboard or directly via API. *** ## What's available > [card] Balance Statement > > A running ledger of your account balance — credits from payments, debits from disbursements and fees. > [card] Transaction History > > A paginated record of all incoming and outgoing transactions across all products, filterable by account and date. > [card] Reconciliation > > Match SingaPay records to your internal order system, cross-reference settlements, and flag discrepancies. *** ## How to access reports ### Via the dashboard Log in to the SingaPay merchant dashboard, navigate to **Reports**, and filter by date range, account, product type, and transaction status. Export any view to CSV for offline processing in your accounting software or data warehouse. ### Via the API All transaction and disbursement records are queryable via paginated API endpoints. This makes it straightforward to build automated reconciliation pipelines — pulling yesterday's transactions, comparing them against your internal order system, and flagging any discrepancies automatically. > [!NOTE] > > Settlement reports are generated automatically after each settlement cycle and accessible from the dashboard immediately. For custom reporting periods or formats, contact your account manager. *** # Statement Source: https://docs.singapay.id/guides/en/reports/balance-statement A real-time ledger of your SingaPay account balance — every credit, debit, and fee recorded in the order they happened. Available at both merchant level and per sub-account. *** ## What is a balance statement? A balance statement is a chronological record of every movement in your SingaPay balance. Each entry shows the transaction type, amount, running balance, and a timestamp. Think of it as your SingaPay bank statement — a complete audit trail of where every rupiah came from and where it went. *** ## What's included | Entry type | Description | | - | - | | **Payment received** | Funds credited from a completed customer payment (VA, QRIS, card, e-wallet). | | **Disbursement sent** | Funds debited when you initiate a bank transfer or e-wallet pay out. | | **Fee deducted** | SingaPay transaction and processing fees applied per transaction. | | **Settlement transferred** | Net funds transferred to your nominated bank account on the settlement cycle. | | **Refund issued** | Funds returned to a customer and debited from your balance. | *** ## Two levels of visibility * **Merchant-level:** The aggregate balance across all sub-accounts owned by your merchant profile. * **Account-level:** The individual balance for a specific sub-account, including its own pending funds. *** ## Exporting balance statements Navigate to **Statement** in the dashboard. Select the date range and account, then export to CSV. For automated exports, use the Balance Statement API endpoint to pull entries programmatically on any schedule. *** # Reconciliation Source: https://docs.singapay.id/guides/en/reports/reconciliation Reconciliation is the process of matching SingaPay transaction records to your own internal order system — confirming that every payment received is accounted for, and every settlement transfer matches your bank statement. *** ## The reconciliation flow **1. Pull SingaPay transaction history** Use the Transaction History API or dashboard export to pull all completed transactions for the period. Filter by account and product type as needed. **2. Match against your internal orders** Use the `merchant_reff_no` field — your internal order or reference ID — to link each SingaPay record to your own order management system. Every transaction you create should carry this reference. **3. Cross-reference the settlement report** Download your settlement report for the same period. Confirm the net transferred amount (gross payments minus fees) matches what landed in your bank account. **4. Flag and investigate discrepancies** Any transaction in SingaPay not matched to an internal order — or any settlement amount that differs from your bank statement — should be flagged and reviewed. Contact [cs@singapay.id](mailto:cs@singapay.id) with the transaction ID for assistance. *** ## Best practices ✓ Always set `merchant_reff_no` when creating any transaction — this is your primary reconciliation key and is returned in every API response and webhook payload. ✓ Run reconciliation daily for high-volume operations, or at minimum at the end of each settlement cycle. ✓ Use per-account transaction history if you operate sub-accounts, so you get a clean view per business unit. ✓ Never rely solely on webhook events for reconciliation — always back them up with a daily scheduled pull of the transaction history API. ✓ Store SingaPay transaction IDs alongside your own order records so you can look up any transaction instantly when investigating a discrepancy. *** ## Settlement vs. transaction timing It's important to understand the difference between when a payment is *confirmed* and when funds *arrive in your bank account*. A customer payment may be confirmed in real time, but the net settlement to your bank account follows the standard T+1 or T+3 cycle depending on the payment method. Your balance statement shows both the credit (when it hit your SingaPay balance) and the settlement transfer (when it left SingaPay for your bank). *** > [!NOTE] > > If you spot a discrepancy between your SingaPay settlement report and your bank statement, always check whether the settlement cycle spans two calendar periods — some transactions confirmed late in the day may settle in the next batch. Contact our team at [cs@singapay.id](mailto:cs@singapay.id) for discrepancy investigations. *** # Transaction History Source: https://docs.singapay.id/guides/en/reports/transaction-history A complete, filterable log of every transaction processed through your SingaPay accounts — incoming payments and outgoing disbursements, across all products and all sub-accounts. *** ## What's in the transaction history? Every time a payment is created, confirmed, expired, or cancelled — or a disbursement is initiated or settled — a transaction record is written. Each record includes the transaction ID, amount, product type, account, status, timestamp, and your internal reference number (`merchant_reff_no`) if provided. *** ## Filter options | Filter | Options | | - | - | | **Date range** | Any custom date and time window | | **Account** | All accounts or a specific sub-account | | **Product type** | Virtual Account, QRIS, Credit Card, E-Wallet, Subscription, Disbursement | | **Direction** | Money in (payments received) or Money out (disbursements) | | **Status** | Pending, Paid / Success, Expired, Cancelled, Failed | *** ## Transaction statuses | Status | What it means | | - | - | | **Pending** | Created and waiting for the customer to pay. | | **Success** | Payment confirmed. Funds credited to your balance. | | **Failed** | Payment attempted but declined by the bank, wallet, or card network. | | **Cancelled** | Cancelled by the customer or via API before completion. | | **Refund** | Dispute payment which the fund will be returned to or from account balance. | *** ## Accessing transaction history In the dashboard, navigate to **Reporting → Transaction History**, apply your filters, and export to CSV. Via the API, use the paginated transaction history endpoints — results sorted by creation time. *** # Bank Coverage Source: https://docs.singapay.id/guides/en/send-money/bank-coverage-and-limit Send money from your SingaPay balance to any bank account in Indonesia. With 100+ supported banks available 24/7, your disbursements reach recipients wherever they bank. *** ## How bank disbursement works Provide the destination bank code, account number, account holder name, and amount. SingaPay validates the details, deducts the amount from your balance, and initiates the transfer. You can also validate the recipient's account before sending using SingaPay's **account validation API** — reducing the risk of failed or misdirected transfers. *** ## Transaction limits | Parameter | Value | | - | - | | Minimum per transaction | IDR 10,000 | | Maximum per transaction | IDR 250,000,000 (configurable per merchant tier) | | Processing hours | 24 hours / 7 days | | Settlement to recipient | Real-time | *** ## Supported bank channel | Swift Code | Bank Code | Full Name | Short Name | | - | - | - | - | | BRINIDJA | 002 | Bank Rakyat Indonesia | BRI | | IBBKIDJA | 016 | Bank Maybank Indonesia | Maybank | | BNINIDJA | 009 | Bank Negara Indonesia | BNI | | BDINIDJA | 011 | Bank Danamon | Danamon | | CENAIDJA | 014 | Bank Central Asia | BCA | | BMRIIDJA | 008 | Bank Mandiri | Mandiri | | BPIAIDJA | 047 | Bank Resona | Bank Resona | | CTCBIDJA | 949 | Bank Chinatrust Indonesia | Bank Chinatrust | | PINBIDJA | 019 | Bank Panin | Bank Panin | | BUMIIDJA | 485 | Bank MNC Internasional | Bank MNC | | DBSBIDJA | 046 | Bank DBS Indonesia | Bank DBS | | PDKSIDJ1 | 122 | BPD Kalimantan Selatan | Bank Kalsel | | PDWRIDJ1 | 135 | BPD Sulawesi Tenggara | Bank Sultra | | SCBLIDJX | 050 | Standard Charted Bank | Standard Charted | | ABALIDBS | 129 | BPD Bali | Bank Bali | | PDJGIDJ1 | 113 | BPD Jawa Tengah | Bank Jateng | | SYJBIDJ1 | 425 | Bank BJB Syariah | BJB Syariah | | PDWGIDJ1 | 134 | BPD Sulawesi Tengah | Bank Sulteng | | MEDHIDS1 | 151 | Bank Mestika Dharma | Bank Mestika | | BKCHIDJA | 069 | Bank of China Hongkong | Bank Hongkong | | PDJBIDJA | 110 | Bank Jawa Barat Dan Banten | Bank BJB | | SBJKIDJA | 153 | Bank Sinarmas | Bank Sinarmas | | ANZBIDJX | 061 | Bank ANZ Indonesia | Bank Anz | | ARTGIDJA | 037 | Bank Artha Graha International | Artha Graha | | BBUKIDJA | 441 | Bank Bukopin | Bank Bukopin | | BBAIIDJA | 076 | Bank Bumi Arta | Bank Bumi Artha | | BCIAIDJA | 054 | Bank Capital Indonesia | Bank Capital | | SYCAIDJ1 | 536 | Bank Central Asia Syariah | BCA Syariah | | BICNIDJA | 950 | Bank Commonwealth | Bank Commonwealth | | BDKIIDJ1 | 111 | Bank DKI | Bank DKI | | GNESIDJA | 161 | Bank Ganesha | Bank Ganesha | | ICBKIDJA | 164 | Bank ICBC Indonesia | Bank ICBC | | IAPTIDJA | 513 | Bank Ina Perdania | Bank Ina | | BIDXIDJA | 555 | Bank Index Selindo | Bank Index | | MASDIDJ1 | 157 | Bank Maspion Indonesia | Bank Maspion | | MAYAIDJA | 097 | Bank Mayapada International | Bank Mayapada | | MAYOIDJA | 553 | Bank Mayora | Bank Mayora | | MEGAIDJA | 426 | Bank Mega | Bank Mega | | BMSEIDJA | 548 | Bank Multi Arta Sentosa | Multi Arta | | LFIBIDJ1 | 503 | Bank Nationalnobu | Bank Nobu | | BOTKIDJX | 042 | Bank MUFG | Bank MUFG | | BDIPIDJ1 | 523 | Bank Sahabat Sampoerna | Bank Sampoerna | | SDOBIDJ1 | 521 | Bank Syariah Bukopin | Bukopin Syariah | | BUTGIDJ1 | 506 | Bank Syariah Mega | Mega Syariah | | SUNIIDJA | 213 | Bank Tabungan Pensiunan Nasional (BTPN) | Bank BTPN | | BBIJIDJA | 023 | Bank UOB Indonesia | Bank UOB | | VICTIDJ1 | 566 | Bank Victoria Internasional | Bank Victoria | | PDBKIDJ1 | 133 | BPD Bengkulu | Bank Bengkulu | | PDYKIDJ1 | 112 | BPD Daerah Istimewa Yogyakarta | Bank DIY | | PDJMIDJ1 | 115 | BPD Jambi | Bank Jambi | | PDJTIDJ1 | 114 | BPD Jawa Timur | Bank Jatim | | PDKBIDJ1 | 123 | BPD Kalimantan Barat | Bank Kalbar | | PDKGIDJ1 | 125 | BPD Kalimantan Tengah | Bank Kalteng | | PDLPIDJ1 | 121 | BPD Lampung | Bank Lampung | | PDMLIDJ1 | 131 | BPD Maluku Dan Malut | Bank Maluku Malut | | PDNBIDJ1 | 128 | BPD Nusa Tenggara Barat | Bank NTB | | PDIJIDJ1 | 132 | BPD Papua | Bank Papua | | PDWUIDJ1 | 127 | BPD Sulut | Bank Sulut | | BSSPIDSP | 120 | BPD Sumsel Dan Babel | Bank Sulsel Babel | | PDSUIDJ1 | 117 | BPD Sumut | Bank Sumut | | CITIIDJX | 031 | Citibank | Citibank | | HSBCIDJA | 087 | HSBC Indonesia | HSBC | | ALOBIDJA | 567 | Allo Bank Indonesia | Allo Bank | | BSMDIDJA | 451 | Bank Syariah Indonesia | BSI | | BNIAIDJA | 022 | CIMB Niaga | CIMB | | BBBAIDJA | 013 | Bank Permata | PERMATA | | MUABIDJA | 147 | Bank Muamalat Indonesia | MUAMALAT | | NISPIDJA | 028 | OCBC Indonesia | OCBC | | MEEKIDJ1 | 152 | Bank Shinhan Indonesia | Bank Shinhan | | SIHBIDJ1 | 564 | Mandiri Taspen Pos | Bank Mandiri Taspen | | AWANIDJA | 167 | Bank QNB Indonesia | Bank QNB | | PDBBIDJ1 | 137 | BPD Banten | Bank Banten | | CICTIDJA | 095 | Bank JTrust Indonesia | Bank JTrust | | PUBAIDJ1 | 547 | BTPN Syariah | BTPN Syariah | | BSDRIDJA | 212 | Bank Woori Saudara Indonesia 1906 | Bank Woori Saudara | | LMANIDJ1 | 526 | Bank Oke Indonesia | Bank Oke | | NETBIDJA | 947 | Bank Aladin Syariah | Bank Aladin Syariah | | IBKOIDJA | 945 | Bank IBK Indonesia | Bank IBK | | SSPIIDJA | 535 | Bank Seabank Indonesia | Bank Seabank | | BBLUIDJA | 501 | Bank BCA DIGITAL | Blu (BCA Digital) | | JAGBIDJA | 542 | Bank Jago | Bank Jago | | BUSTIDJ1 | 459 | Krom Bank Indonesia | Krom Bank | | HNBNIDJA | 484 | Bank Hana (Line) | Bank Hana (Line) | | PDRIIDJA | 119 | BPD RIAU | BPD Riau | | PDKTIDJ1 | 124 | BPD KALIMANTAN TIMUR DAN KALIMANTAN UTARA | BPD Kaltim dan Kaltara | | PDNTIDJA | 130 | BPD NUSA TENGGARA TIMUR | BPD NTT | | PDWSIDJA | 126 | BANK SULSELBAR | Bank Sulselbar | | FAMAIDJ1 | 562 | Superbank Indonesia | Superbank | | BTANIDJA | 200 | Bank Tabungan Negara (BTN) | BTN | | LOMAIDJ1 | 531 | PT. BANK AMAR INDONESIA | Bank Amar | | SYACIDJ1 | 116 | PT. BANK ACEH SYARIAH | Bank Aceh Syariah | | AGTBIDJA | 494 | BANK RAYA INDONESIA | Bank Raya | | JSABIDJ1 | 472 | Bank Jasa Jakarta | Jasa Jakarta | | SYBTIDJ1 | 200 | Bank Tabungan Negara UUS (BTN Syariah) | BTN Syariah | | MCORIDJA | 036 | China Construction Bank | China Construction Bank | | SYNAIDJ1 | 022 | CIMB Niaga Syariah | CIMB Niaga Syariah | | NUPAIDJ6 | 145 | Bank Nusantara Parahyangan | Bank Nusantara Parahyangan | | BKIDIDJA | 146 | Bank of India | Bank of India | | ARFAIDJ1 | 517 | Panin Dubai Syariah | Panin Dubai Syariah | | SYBBIDJ1 | 013 | Permata Syariah | Permata Syariah | | RABOIDJA | 089 | Rabobank Indonesia | Rabobank Indonesia | | INDOIDJA | 498 | Bank SBI Indonesia | Bank SBI Indonesia | | SWAGIDJ1 | 405 | Victoria Syariah | Victoria Syariah | | SYSBIDJ1 | 118 | Nagari Syariah | Nagari Syariah | | | 688 | BPR Karyajatnika Sadaya | BPR Karyajatnika Sadaya | | CNBAIDJ1 | 559 | Centratama Nasional Bank | Centratama Nasional Bank | | YUDBIDJ1 | 490 | Bank Neo Commerce (BNC) | BNC | *** # Bulk Disbursement Source: https://docs.singapay.id/guides/en/send-money/bulk-disbursement Execute large-scale payouts through Excel uploads or API integration, replacing manual internet banking operations. *** ## **Supported Features** * Manual approval workflow * Scheduled execution * Account name verification * Intelligent routing *** ## **Typical Use Cases** * **Consumer Lending** Bulk loan disbursement after approval. * **Payroll** Mass salary payments to employees. * **Marketplace Settlement** Distribute earnings to merchants and partners. * **E-Commerce Refunds** Process large volumes of customer refunds efficiently. *** # E-Wallet Source: https://docs.singapay.id/guides/en/send-money/e-wallet Top up GoPay, OVO, DANA, and ShopeePay wallets directly from your SingaPay balance — the fastest way to disburse rewards, refunds, or incentives to customers who prefer digital wallets. *** ## Supported wallets `GoPay`   `OVO`   `DANA`   `ShopeePay` *** ## Transaction limits | Wallet | Min (IDR) | Max (IDR) | Settlement | | - | - | - | - | | **GoPay** | 1,000 | 20,000,000 | Real-time | | **OVO** | 10,000 | 20,000,000 | Real-time | | **DANA** | 1,000 | 20,000,000 | Real-time | | **ShopeePay** | 1,000 | 20,000,000 | Real-time | *** ## Common use cases * **Cashback & rewards:** Distribute loyalty points or promotional cashback directly into a customer's preferred wallet. * **Gig worker payouts:** Pay drivers, couriers, or freelancers who primarily use e-wallet platforms. * **Refunds:** Issue refunds instantly to the wallet a customer used for their original purchase. * **Incentive campaigns:** Run promotional disbursements — vouchers, referral bonuses, survey rewards — at scale. *** ## How it works Provide the recipient's registered mobile number (their wallet identifier), the wallet type, and the amount. SingaPay validates the account and credits the wallet balance in real time. You can verify the wallet account is active before sending to avoid failed disbursements. > [!NOTE] > > E-wallet pay outs settle **instantly** — recipients see the top-up in their balance within seconds. This makes them ideal for time-sensitive scenarios like instant refunds or real-time reward distribution. *** # Fraud Protection System Source: https://docs.singapay.id/guides/en/send-money/fraud-protection-system There are two major fraud categories that pose significant risks to merchant funds: **1. Identity Theft** Fraudsters impersonate legitimate individuals using stolen personal information and identities to: * Make unauthorized purchases * Open fraudulent accounts * Conduct illegal financial activities **2. Account Takeover (ATO)** Fraudsters gain unauthorized access to legitimate user accounts and use stored payment methods to: * Make purchases * Transfer funds * Withdraw balances Drawing upon years of fintech experience in: * Cybersecurity * Anti-fraud systems * Cross-account verification technology Singapay provides: * Account KYC verification * Suspicious transaction detection * Risk-control interventions * Security configuration tools to significantly reduce payment fraud risk. *** ## **Fraud Protection Capabilities** | **Capability** | **Fraud Type Mitigated** | **API Payouts** | **Dashboard Payouts** | | - | - | - | - | | E-Wallet Account Verification | Identity Theft | Supported | Under Development | | Bank Account Verification | Identity Theft | Under Development | Under Development | | KTP Verification (Dukcapil) | Identity Theft | Under Development | N/A | | Transaction Risk Control | Identity Theft, Account Takeover | Supported | Supported | | Whitelist & Blacklist Management | Account Takeover | Supported | Supported | | Account-Level API Token Management | Account Takeover | Supported | N/A | | Payment Password & Two-Factor Authentication (2FA) | Account Takeover | N/A | Supported | | User & Permission Management | Account Takeover | N/A | Supported | *Additional identity and risk services are available in the Identity & Risk product suite.* *** ## **Typical Use Cases** **High-Risk E-Commerce** * Detection of suspicious orders * Promotion abuse prevention * Fake transaction prevention **FinTech Platforms** * Identification of suspicious borrowers * Prevention of identity fraud * Account takeover detection *** # Overview Source: https://docs.singapay.id/guides/en/send-money/overview Disburse funds effortlessly through Indonesia's major payment channels with minimal operational complexity and real-time delivery. Singapay is designed to simplify and optimize your payout operations through a comprehensive suite of payment capabilities, allowing businesses to manage fund disbursement with greater efficiency, confidence, and scalability. *** ## **Why Choose Singapay for Payouts?** **Extensive Payout Coverage** Supports fund transfers to more than 100 banks and e-wallets, enabling businesses to reach recipients throughout Indonesia. **Flexible and Easy-to-Use Solutions** Provides both: * Ready-to-use no-code solutions through Dashboard * Flexible API integration for highly customized business workflows **Real-Time and High-Value Payout Capability** Supports: * 24/7 instant transfers * Large-value disbursements exceeding traditional banking limits Ideal for businesses requiring both speed and scale. **End-to-End Security Protection** Built-in security controls include: * Multi-layer fraud detection * Transaction behavior analysis * Recipient risk assessment * Transaction limit controls * Real-time risk monitoring These controls help prevent: * Fraudulent transactions * Account compromise * Mistaken transfers * Unauthorized payouts **Intelligent Routing** Even when a bank or clearing network is experiencing maintenance or service disruption, Singapay can automatically route transactions through alternative available channels to maximize payout success rates. *** ## **Core Payout Flow** 1. Merchant funds the account balance (via Dashboard or API). 2. Merchant creates a payout transaction (via Dashboard or API). 3. Merchant balance is deducted. 4. Internal finance approval is performed (for Dashboard batch payouts). 5. Singapay conducts internal review (when cross-border settlement is involved). 6. Singapay executes the payout. 7. Recipient receives the funds in real time. *** ## Quick comparison | Method | Destination | Min (IDR) | Max (IDR) | Speed | Access Interface | | - | - | - | - | - | - | | **Bank Disbursement** | 100+ local banks | 10,000 | 250,000,000\* | Instant | API, Mobile App (Under Development) | | **E-Wallet Pay Out** | Gopay, Dana, OVO, ShopeePay | 1,000\~10,000 | 10,000,000 | Instant | Dashboard, API, Mobile App (Under Development) | | **QRIS Transfer** | Indonesian banks and wallets connected through the QRIS standard | 100 | 10,000,000 | Instant | Dashboard, API, Mobile App (Under Development) | | **Cross-Border Bank Transfer** | Global banks connected through SWIFT | 10,000 | 250,000,000\* | 5 working days | Dashboard (Under Development), API (Under Development) | | **Crypto Wallet Transfer** | USDT (major networks), USDC (major networks) | 10,000 | 250,000,000\* | 2 working days | Dashboard (Under Development), API (Under Development), Mobile App (Under Development) | \* Maximum limits are configurable per merchant tier. *** ## Typical Use Cases **FinTech** * Loan disbursement to borrowers * Profit distribution to investors **Cross-Border Trade** * Payments to overseas suppliers * Distributor settlements * Partner payouts **Marketing and Affiliate Programs** * Commission payments * Referral incentives * KOL and influencer rewards **Cryptocurrency Platforms** * Fiat withdrawal payouts to users *** ## Before you send ✓ Ensure your SingaPay balance has sufficient funds to cover the disbursement amount plus applicable fees. ✓ Use the account validation API to verify a recipient's bank account before sending — this reduces the risk of failed transfers. ✓ Add your server IP to the IP whitelist under **Credentials → IP Address Configuration** — required for balance inquiry and disbursement API calls. ✓ Always include your internal reference ID `merchant_reff_no` on every transfer to simplify reconciliation. *** # Overview Source: https://docs.singapay.id/guides/en/sub-account/Overview SingaPay lets you create and manage multiple accounts under a single merchant credential. Each account has its own balance, transaction history, and payment instruments — cleanly separated, centrally managed. *** ## What is a sub-account? Businesses can create and manage multiple sub-accounts to achieve both **financial isolation** and **centralized administration** across different operations, merchants, stores, or partners. Each sub-account supports independent management of: * Account balance * Payment collection * Settlements and payouts * Transaction history * Billing records * User access permissions * API token permissions Sub-accounts may represent: * Business divisions * Marketplace merchants * Business partners * Sellers * Suppliers * Branch offices * Drivers * Investors Currently, Singapay supports **two types of sub-accounts**: | **Feature** | **Owned Sub-Account** | **Managed Sub-Account** | | - | - | - | | **Definition** | Represents a sub-account belonging to your own organization or internal business unit. | Represents a third-party merchant account that you manage or collect payments on behalf of individual company or business company. | | **Typical Scenario** | Used when the platform operates multiple internal business units and needs separate balances. | Used when the platform operates on behalf of merchants or enables merchants to receive payments directly. | | **Verification Requirement** | Available immediately after creation; no additional verification required. | Can be created after the platform completes the merchant's KYB verification. | | **Visibility** | Invisible to end users unless explicitly invited. | Invited merchants can access and manage their own funds while the platform retains administrative control. | | **Customer Information Displayed During Payment** | The Master Account information is displayed to customers. | The corresponding Sub-Account information is displayed to customers. | | **Invoice Recipient** | Invoices are issued to the Master Account. | Invoices are issued directly to the Sub-Account. | | **Webhook Configuration** | Inherits the Master Account's webhook configuration automatically. | Can manage its own webhook settings independently through the Dashboard, while the Master Account may also configure them via API. | *** ## Account lifecycle | State | What it means | | :- | :- | | **Active** | Fully operational. Payment instruments can be created and payments are accepted. | | **Inactive** | Paused. No new payments accepted, but existing records are retained. | *** ## **Typical Use Cases** * **Marketplace Platforms** Create independent financial accounts for each seller while maintaining centralized platform management. * **Franchise and Retail Chains** Allow each store or branch to independently manage revenue and transactions. * **SaaS Platforms** Provide enterprise customers with dedicated account structures under a shared platform. * **Channel Partners and Agents** Enable independent settlement and fund management for distributors and business partners. *** # Balance Transfer Source: https://docs.singapay.id/guides/en/sub-account/balance-transfer Supports real-time fund transfers between Master Accounts and Sub-Accounts, improving internal treasury management and operational efficiency. **Supported Features** * Automatic fund sweeping * Revenue sharing and balance allocation * Instant internal transfers * Complete transfer history and audit trails *** ## **Typical Use Cases** * **Marketplace Revenue Distribution** Transfer platform earnings or settlements to merchant accounts. * **Internal Treasury Operations** Move funds across departments or business units. * **Corporate Group Cash Management** Centralize or redistribute liquidity among subsidiaries. * **Retail Chains** Aggregate funds from multiple store locations into a central account. *** # Instant Business Loan Source: https://docs.singapay.id/instant-business-loan Provide small and medium-sized enterprises (SMEs) with rapid access to working capital, improving liquidity and supporting business growth. **Key Features** * Online application process * Intelligent credit assessment * Fast loan approval and disbursement * Automated repayment mechanisms **Typical Use Cases** * **E-Commerce Sellers** Finance inventory purchases during peak sales seasons. * **Restaurant Owners** Obtain financing based on historical transaction volumes and business performance. *** # KYC Suite Source: https://docs.singapay.id/kyc-suite The KYC Suite enables businesses to validate government-issued identity documents and verify customer information for onboarding and compliance purposes. Supported capabilities include: * Automated identity recognition * Real-name verification * High-risk identity detection *** ## **Available Services** | **Service** | **Description** | **Integration Method** | **Billing Model** | | - | - | - | - | | **Dukcapil Verification** | Verifies identity authenticity by matching name, date of birth, facial data, and official government records. | API | Per API call | | **OCR KTP Check** | Extracts text from identity cards and converts it into structured digital data. | [API](https://docs.singapay.id/api-reference/ocr/ocr-ktp-check) | Per API call | | **Liveness Detection** | Confirms that the user is physically present and not using spoofed images or recordings. | SDK, H5, API | Per API call | | **Face Comparison** | Compares a live facial image against the photo stored on an identity document. | [API](https://docs.singapay.id/api-reference/face-comparison/face-comparison) | Per API call | | **ID Forgery Check** | Assess whether a photo of an Indonesian ID card (KTP) is a forged photo (photocopy, photograph of the original, edited image, or false information detected). | [API](https://docs.singapay.id/api-reference/id-forgery-check/id-forgery-check) | Per API call | *** ## **Typical Use Cases** * Customer onboarding with real-name verification * Financial account opening * High-risk customer screening *** # Lending Monetization Source: https://docs.singapay.id/lending-monetization Merchants can refer users to lending institutions partnered with Singapay for online cash loan applications. Once approved, the lending partner disburses funds directly to the user's designated account. The program supports multiple commercial models, including: * Fixed referral fees per application * Fixed fees per successful loan disbursement * Revenue-sharing arrangements for co-lending partnerships *** ## **Customer Journey** 1. The merchant refers users to a Singapay lending partner. 2. The user registers with the lending institution. 3. The lending institution issues channel-specific promotional vouchers or incentives. 4. The user submits a loan application through: * The merchant's website * The merchant's mobile application (via API or embedded H5 page) * Or directly through the lending partner's own application. 5. Upon approval, the lending institution disburses funds directly to the user's designated account. 6. The user completes repayment according to the lender's repayment process. *** ## **Typical Use Cases** * Consumer loan referrals on e-commerce platforms * SME financing referrals through SaaS platforms * Traffic monetization for digital platforms * Credit service integrations for digital wallets *** # Overview Source: https://docs.singapay.id/overview \*Our financial service features are under development. *** **Increase Revenue Through Integrated Financial Services** Singapay provides a diverse range of embedded financial capabilities that enable businesses to expand their financial offerings, improve customer conversion, and create new revenue streams. By integrating with financial institutions, lending partners, and risk management services, businesses can rapidly offer consumer financing, business loans, and cash management solutions. **How Singapay Financial Services Help Your Business** * Generate returns on idle balances without sacrificing liquidity. * Access flexible credit facilities and financing based on historical transaction performance. * Monetize user traffic through embedded lending and loan referral programs. * Increase purchase conversion and merchant revenue through consumer financing and Buy Now, Pay Later (BNPL) solutions. *** # Overview Source: https://docs.singapay.id/overview-1 **Enterprise-Grade Identity Verification and Risk Management** The Singapay API Platform provides enterprise-level identity verification and risk management capabilities to help businesses reduce fraud, strengthen compliance, and improve operational security. The platform supports: * Identity verification * Account validation * Liveness detection * Suspicious transaction detection * Anti-Money Laundering (AML) compliance screening Detailed API specifications are available in the API documentation. *** ## **Why Choose Singapay Identity & Risk Services?** Backed by over **10 years of fintech experience**, Singapay combines machine learning models, anti-fraud strategies, and localized data sources to help businesses improve user conversion while minimizing fraud and regulatory risks. Key advantages include: * Access to multiple Indonesian data sources, including **Dukcapil**, banks, and e-wallet providers. * Comprehensive identity verification capabilities such as: * Real-name verification * Liveness detection * Facial comparison * Account ownership verification * Multiple integration methods, including **API**, **SDK**, and **embedded H5 interfaces**, enabling rapid deployment and large-scale implementation. * Flexible pricing models and stable service-level commitments suitable for financial institutions, e-commerce platforms, digital wallets, and international businesses. * Strong local regulatory expertise supporting **KYC**, **AML**, and other compliance requirements. *** # Overview Source: https://docs.singapay.id/overview-2 SingaPay isn't just for collecting money. You can also push funds outward — to bank accounts and e-wallets across Indonesia — directly from your SingaPay balance, any time of day. *** ## Available pay out products > [card] Bank Disbursement > > Send funds to any of 100+ local Indonesian banks. Real-time via BI-FAST, 24/7 including weekends and public holidays. > [card] E-Wallet Pay Out > > Top up GoPay, OVO, DANA, and ShopeePay wallet in real time — the fastest way to disburse rewards, refunds, or incentives. *** ## Quick comparison | Method | Destination | Min (IDR) | Max (IDR) | Speed | Hours | | - | - | - | - | - | - | | **Bank Disbursement** | 100+ local banks | 10,000 | 250,000,000\* | Real-time (BI-FAST) / Same-day (SKN) | 24/7 | | **GoPay Pay Out** | GoPay | 1,000 | 10,000,000 | Instant | 24/7 | | **OVO Pay Out** | OVO | 10,000 | 10,000,000 | Instant | 24/7 | | **DANA Pay Out** | DANA | 1,000 | 10,000,000 | Instant | 24/7 | | **ShopeePay Pay Out** | ShopeePay | 1,000 | 10,000,000 | Instant | 24/7 | \* Maximum limits are configurable per merchant tier. *** ## Pay out scenarios > [accordion] Monthly payroll > > Distribute salaries to employees across any Indonesian bank. Upload a batch of transfers with account numbers and amounts — SingaPay processes them all via BI-FAST for real-time arrival. > > **→ Use: Bank Disbursement** > [accordion] Marketplace seller payouts > > At settlement time, route each seller's earnings directly to their registered bank account in a single API call per sub-account. No spreadsheets, no manual transfers. > > **→ Use: Bank Disbursement** > [accordion] Instant cashback rewards > > Distribute promotional cashback or loyalty bonuses directly to a customer's GoPay or OVO wallet. Funds appear in their wallet within seconds — no bank account details needed. > > **→ Use: E-Wallet Pay Out** > [accordion] Customer refunds > > When an order is cancelled, push the refund directly to the customer's bank account or preferred e-wallet without waiting for a settlement cycle. > > **→ Use: Bank Disbursement or E-Wallet Pay Out** *** ## Before you send * ✓ Ensure your SingaPay balance has sufficient funds to cover the disbursement amount plus applicable fees. * ✓ Use the account validation API to verify a recipient's bank account before sending — this reduces the risk of failed transfers. * ✓ Add your server IP to the IP whitelist under **Credentials → IP Address Configuration** — required for balance inquiry and disbursement API calls. * ✓ Always include your internal reference ID `merchant_reff_no` on every transfer to simplify reconciliation. *** > [card] [Bank Coverage & Limits](#32-bank-coverage-transaction-limits) > > See all 100+ supported banks and transfer details. > [card] [E-Wallet Pay Out](#33-e-wallet-pay-out) > > Send money directly to GoPay, OVO, DANA, and ShopeePay wallets. *** # Recipient Verification Source: https://docs.singapay.id/recipient-verification Recipient Verification validates the authenticity and ownership of bank accounts or e-wallets before funds are transferred, reducing payout errors and fraud risks. Supported capabilities include: * Account name matching * Recipient risk assessment * Detection of suspicious beneficiary accounts *** ## **Available Services** | **Service** | **Description** | **Integration Method** | **Billing Model** | | - | - | - | - | | **E-Wallet Account Verification** | Verifies whether a mobile number is linked to a valid e-wallet account and returns a name-matching confidence score. | [API](https://docs.singapay.id/api-reference/e-wallet/e-wallet-name-verification) | Standard API response | | **Bank Account Verification** | Verifies whether a bank account exists and returns a name-matching confidence score. | [API](https://docs.singapay.id/api-reference/bank/bank-name-verification) | Standard API response | *** ## **Typical Use Cases** * Withdrawal approval workflows * Risk assessment before payouts * Beneficiary identity verification *** # Telecommunications & Internet Services Source: https://docs.singapay.id/telecommunications-and-internet-services Singapay enables users to purchase mobile airtime, mobile data packages, pay postpaid mobile bills, and settle broadband or television subscriptions through Indonesia's leading telecommunications providers. Supported operators include: * Telkomsel * Indosat * XL * Smartfren * Tri The platform supports both prepaid and postpaid scenarios, serving consumers as well as enterprise platforms with recurring digital service needs. *** ## **Supported Products** | **Product** | **Payment Type** | **Billing Model** | | :- | :- | :- | | **Pulsa (Mobile Airtime Top-Up)** | Prepaid | Service fee included in purchase price | | **Postpaid Mobile Bill (Pulsa Pascabayar)** | Postpaid | Bill amount plus service fee | | **Mobile Data Package (Paket Data)** | Prepaid | Service fee included in purchase price | | **Internet & TV Services** | Postpaid | Bill amount plus service fee | *** ## **Typical Use Cases** * Digital wallets * E-commerce platforms * SaaS platforms * Digital lifestyle applications *** # Retail Outlet Source: https://docs.singapay.id/untitled-page The Retail Outlet payment method allows customers without a bank account or digital wallet to complete purchases using cash or alternative payment methods at major retail chains and convenience stores across Indonesia, such as **Indomaret** and **Alfamart**. *** ## How It Works 1. **Generate Code:** When a customer selects the Retail Outlet payment option at checkout, your system calls the Singapay API to generate a unique **Payment Code** (payment code / booking code) mapped to the transaction or through payment link. 2. **Customer Payment:** The customer visits any participating retail outlet (e.g., Indomaret or Alfamart), presents the payment code to the cashier, and pays the exact amount in cash or via the store's accepted counters. 3. **Real-Time Notification:** Once the payment is successfully processed at the store, Singapay immediately notifies your server via a webhook, and the transaction status is updated to settled. *** ## Key Features * **Expanded Reach:** Cater to unbanked customers or users who prefer paying with cash over physical or digital banking channels. * **Widespread Coverage:** Integrated seamlessly with thousands of popular retail store outlets nationwide. * **Automated Reconciliation:** Real-time callbacks and webhook integration eliminate manual checks and streamline bookkeeping. *** # Utilities Source: https://docs.singapay.id/utilities Singapay provides payment capabilities for essential public utility services in Indonesia, including electricity, water supply, and residential service fees. Supported services cover high-frequency consumer needs such as **PLN electricity**, **PDAM water utilities**, and **housing or property-related payments**, enabling businesses to quickly integrate local bill payment functionality. *** ## **Supported Products** | **Product** | **Payment Type** | **Billing Model** | | :- | :- | :- | | **PLN Token** | Prepaid electricity token purchase | Service fee included in purchase price | | **PLN Bill (Tagihan PLN)** | Postpaid electricity bill payment | Bill amount plus service fee | | **PLN Non-Taglis** | Non-billing electricity services | Bill amount plus service fee | | **PDAM Water Bill** | Postpaid | Bill amount plus service fee | | **Residential Services** | Postpaid | Bill amount plus service fee | *** ## **Typical Use Cases** * Digital wallet bill payment centers * E-commerce convenience services * Payment aggregation and bill management platforms * Residential communities and property management applications *** # List account transfers Source: https://docs.singapay.id/api-reference/account-transfer/list-account-transfers https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/account-transfer/{account_id} Returns a paginated list of account transfers where the given account is either the remitter or the beneficiary. Limited to records within the last year. Optional filters: `transaction_id` (partial match) and `status` (`success`, `pending`, `failed`). # Show account transfer detail Source: https://docs.singapay.id/api-reference/account-transfer/show-account-transfer-detail https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/account-transfer/{account_id}/{transaction_id} Returns the details of a single account transfer. The given account must be either the remitter or the beneficiary of the transaction. # Transfer between accounts (PG or cross-channel) Source: https://docs.singapay.id/api-reference/account-transfer/transfer-between-accounts-pg-or-cross-channel https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v1.0/account-transfer/{account_id}/transfer Transfers funds from the given PG account (remitter) to a beneficiary under the same merchant. Compatible-extend contract: omit `beneficiary_channel` (or set `PG`) and pass `beneficiary_account_number` for intra-PG movement; set `beneficiary_channel=KYC` to credit the merchant KYC credit-pool. `BILLER` is reserved. Requires request signature headers (`verify.signature-internal`). Idempotency: send an optional `merchant_ref_no` unique per merchant. If a value already used by the same merchant is submitted again, the original transfer is returned (HTTP 200) and no new movement is created — regardless of which of the merchant's accounts is the remitter. If `merchant_ref_no` is omitted or empty, the platform auto-generates a unique reference (format `AM--`) and returns it in the response. # Create account Source: https://docs.singapay.id/api-reference/accounts/create-account https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v1.0/accounts Create a new sub account under the calling merchant. `account_type` is required — choose between an `owned`/`personal_managed` sub account (created active, no KYB — `personal_managed` behaves the same as `owned`) and a `business_managed` sub account (created inactive and requiring BOSS KYB approval before it can transact). The calling merchant's own primary dashboard login is always granted access to the new account automatically. `invite_members` is optional — pass additional member emails to grant them access too; if omitted, only the primary merchant has access. For a `business_managed` sub account, `data.kyb_onboarding_url` carries a link to forward to the sub-merchant so they can self-submit their KYB data (individual/company is chosen on that onboarding page itself). Save this URL, as it becomes `null` once KYB is verified; it can also be re-fetched anytime via `GET /accounts/{id}` or `GET /accounts` while KYB is still pending. # Get account Source: https://docs.singapay.id/api-reference/accounts/get-account https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/accounts/{id} This feature is designed to provide detailed information regarding the details of a virtual account. It allows users to retrieve and view comprehensive data on a specific virtual account. For managed sub accounts, `data.kyb_onboarding_url` carries the account's current active KYB self-onboarding link, or `null` once KYB is fully verified. # Overview Source: https://docs.singapay.id/api-reference/accounts/introduction Manage sub-level accounts within the Singapay Payment Gateway — create, update, and organize account hierarchies with full operational control. Accounts in the Singapay Payment Gateway are designed to manage sub-level accounts efficiently. You can create, modify, and oversee subordinate accounts to delegate responsibilities, organize account hierarchies, and maintain operational control across your Singapay ecosystem. ## What you can do > [card] Create Accounts > > Register new sub-accounts under your merchant and attach them to specific credentials or integrations. > [card] Retrieve Accounts > > List all accounts or fetch a single account by ULID to check its details and current status. > [card] Update Status > > Activate or deactivate accounts at any time using the update status endpoint. ## Account status | Status | Description | | - | - | | `active` | Account is operational and can process transactions. | | `inactive` | Account is disabled and cannot process transactions. | ## Available endpoints > [card] [List Accounts](./list-accounts) > > Paginated list of accounts for the authenticated merchant. > [card] [Create Account](./create-account) > > Register a new sub-account under your merchant. > [card] [Get Account](./get-account) > > Retrieve a single account by ULID. > [card] [Update Account Status](./update-account-status) > > Activate or deactivate an account. > [!NOTE] > > All endpoints require authentication. See [Authentication](/api-reference/authentication). # List accounts Source: https://docs.singapay.id/api-reference/accounts/list-accounts https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/accounts This feature is designed to provide detailed information regarding the list of virtual accounts. It allows users to retrieve and view comprehensive data on all virtual accounts associated with their main account. Each managed sub account row carries its own `kyb_onboarding_url` so its current active KYB self-onboarding link can be read directly from the list without a separate call per account. # Update Source: https://docs.singapay.id/api-reference/accounts/update https://payment-b2b.singapay.id/api/docs/merchant-api.json patch /api/v1.0/accounts/update/{id} Update an account. All fields are optional, but at least one of `name`, `status`, `invite_members` must be provided. Optionally, provide `invite_members` (array of emails) to replace the account's team member list entirely — omitting the field leaves the current members unchanged. Note: a `managed` sub account cannot be set to `active` until its BOSS KYB verification is approved — attempting to do so returns 403. # Authentication Source: https://docs.singapay.id/api-reference/authentication Authenticate SingaPay Payment Gateway REST API requests using OAuth 2.0 client credentials, Bearer tokens, and required headers. All REST API endpoints require authentication before you can call them. Webhook callbacks use a separate [HMAC signature scheme](/api-reference/webhooks/security-and-signature). *** ## Obtain an access token Request a JWT access token using your **Client ID** and **Client Secret** from the merchant dashboard. Request a token using **`POST /api/v1.1/access-token/b2b`**, listed under **Security** in the API reference sidebar (OpenAPI-generated endpoint page). > [!NOTE] > > You can also use `POST /api/v1.0/access-token/b2b` on older integrations. ### Token request headers | Header | Value | | - | - | | `Authorization` | `Basic {base64(client_id:client_secret)}` | | `X-PARTNER-ID` | Your API key (Partner ID) | | `Content-Type` | `application/x-www-form-urlencoded` or `application/json` | ### Token request body | Field | Value | | - | - | | `grant_type` | `client_credentials` | The response includes a Bearer token and expiry time. Request a new token before the current one expires. *** ## Authenticated API requests Include these headers on every REST API call after you obtain a token: | Header | Description | | - | - | | `Authorization` | `Bearer {access_token}` | | `X-PARTNER-ID` | Your API key from the merchant dashboard | | `Content-Type` | `application/json` (unless the endpoint specifies otherwise) | ```http theme={null} Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... X-PARTNER-ID: b3ed7d4b-a96c-6c08-b3c7-12c3124242d9 Content-Type: application/json ``` *** ## Signed requests (selected endpoints) Some money-out operations require additional headers for request signing: | Header | Description | | - | - | | `X-Signature` | HMAC-SHA512 signature of the request | | `X-Timestamp` | Unix timestamp in seconds | Endpoints that typically require signing include: * Disbursement transfer (`POST /api/v2.0/disbursement/transfer`) * QRIS issuer payment credit and related money-out flows * E-Wallet trigger top-up (`POST /api/v2.0/ewallet/trigger-topup`) Refer to the OpenAPI reference for each endpoint to confirm required headers. See [Building the X-Signature Header](/api-reference/building-x-signature) for the full signing formula, required headers, and code examples in PHP, Node.js, and Python. *** ## IP whitelist Merchant API routes may require your server IP to be registered on the merchant account before requests are accepted. Configure allowed IPs in the merchant dashboard before going to production. > [!WARNING] > > **IP Whitelist Required** — Ensure your server IP is registered for the merchant account before making API requests from production systems. *** ## Environments | Environment | Base URL | | - | - | | Sandbox | `https://sandbox-payment-b2b.singapay.id` | | Production | `https://payment-b2b.singapay.id` | Use Sandbox for development and testing. No real money moves in Sandbox. # Generate OAuth access token Source: https://docs.singapay.id/api-reference/authentication/generate-oauth-access-token https://biller-b2b.singapay.id/docs post /api/v1.0/access-token/b2b Authenticate using client credentials (Basic Auth) and obtain a JWT access token for subsequent API calls. Basic Authentication automatically generates a string encoded in Base64 format by combining the client_id and client_secret with a colon separator. # Get Access Token Source: https://docs.singapay.id/api-reference/authentication/get-access-token https://core.singapay.id/identity-verification/docs/swagger.json post /api/v1/kyc/auth/get-auth-token Sign `{client_id}:{timestamp}` with your `client_secret` using HMAC-SHA256 and send the hex digest as `signature`. On success you receive a Bearer token. `timestamp` must be within 5 minutes of our server clock. Your account must have KYC access enabled. If it does not, this call returns HTTP 401 with `error=FEATURE_NOT_ENABLED`. Contact support to enable access. # Get Account Balance Source: https://docs.singapay.id/api-reference/balance-inquiry/get-account-balance https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/balance-inquiry/{account_id} Retrieve the balance snapshot (held, available, pending and total) for a single account belonging to the authenticated merchant. # Get Merchant Balance Source: https://docs.singapay.id/api-reference/balance-inquiry/get-merchant-balance https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/balance-inquiry Retrieve the aggregated balance snapshot (held, available, pending and total) for the authenticated merchant. # Overview Source: https://docs.singapay.id/api-reference/balance-inquiry/introduction Check real-time balance for your merchant account or any sub-account within the Singapay Payment Gateway. The Balance Inquiry API lets you retrieve up-to-date balance information — either at the merchant level (aggregate across all accounts) or for a specific sub-account by ULID. Use this to monitor available funds before initiating disbursements or top-ups. ## What you can do > [card] Merchant Balance > > Retrieve the aggregate balance for the authenticated merchant across all sub-accounts. > [card] Account Balance > > Retrieve the balance for a single sub-account by its ULID. ## Available endpoints > [card] [Inquiry Merchant Balance](./get-merchant-balance) > > Returns aggregate balance for the authenticated merchant. > [card] [Inquiry Account Balance](./get-account-balance) > > Returns balance for one account by ULID. > [!NOTE] > > All endpoints require authentication. See [Authentication](/api-reference/authentication). # Bank Name Verification Source: https://docs.singapay.id/api-reference/bank/bank-name-verification https://core.singapay.id/identity-verification/docs/swagger.json post /api/v1/kyc/bank/verify Looks up the registered holder name on the bank for the given account number and compares it with the `name` you send. A completed check is billed (`pricing=PAID`), including when the account is not found. Validation errors and service failures are not billed (`pricing=FREE`). This feature must be enabled on your account. If it is not, the API returns `UNAUTHORIZED`. ### Outcomes | Result | Response | |---|---| | Account found | `code=SUCCESS`, `data.status="found"`, `pricing=PAID` | | No account at this bank | `code=SUCCESS`, `data.status="not found"`, `suggestion=reject`, `pricing=PAID` | | Temporary service issue | `code=SERVER_ERROR`, `pricing=FREE` | | Invalid request (account, bank, name, or `request_id`) | `code=CLIENT_ERROR`, `pricing=FREE` | | Same `request_id` with a different body | `code=DUPLICATE_REFERENCE`, `pricing=FREE` | | Missing token, feature not enabled, or IP not allowlisted | `code=UNAUTHORIZED`, `pricing=FREE` | | Prepaid balance too low | `code=INSUFFICIENT_BALANCE`, `pricing=FREE` | ### Account numbers You may include spaces, dashes, dots, or underscores. We ignore those characters. After that, the number must be 6–20 digits. ### Bank codes `bank_code` is a 3-digit Indonesian clearing code from the supported-banks list in the dashboard. Values such as `2` or `14` are accepted and padded to `002` / `014`. An unknown or disabled code returns `CLIENT_ERROR` (not `not found`). ### Idempotency Use a unique `request_id` for each new check (UUID v4 is recommended). Repeating the same `request_id` with the same body returns the original result and is billed once — unless the previous attempt did not complete, in which case the check runs again. A different body with the same `request_id` returns `DUPLICATE_REFERENCE`. # Building the X-Signature Header Source: https://docs.singapay.id/api-reference/building-x-signature Construct the HMAC-SHA512 X-Signature header for the access token endpoint and for signed money-out API requests. Some endpoints require a request signature for authentication, sent as the `X-Signature` header. There are **two different signature schemes**, used in two different situations. Both use **HMAC-SHA512**, but the string being signed is different — read the section relevant to the endpoint you're calling. > [!NOTE] > > This page covers signatures you generate for **outbound** requests to the SingaPay API. To validate signatures SingaPay sends you on **inbound** webhook callbacks, see [Security and Signature Validation](/api-reference/webhooks/security-and-signature). | Scheme | Used for | Signed with | | - | - | - | | [Access Token Signature](#1-access-token-signature) | Obtaining a Bearer access token (`POST /api/v1.1/access-token/b2b`) | Your `client_secret` | | [Request Signature](#2-request-signature) | Authenticating individual requests to money-out endpoints (Disbursement, Account Transfer, E-Wallet Top Up, etc.) | Your `client_secret` | *** ## 1. Access Token Signature Used only when calling `POST /api/v1.1/access-token/b2b` to obtain a Bearer token. ### Formula ```text theme={null} payload = "{client_id}_{client_secret}_{YYYYMMDD}" X-Signature = HMAC-SHA512(payload, client_secret) // lowercase hex digest ``` > [!NOTE] > > `YYYYMMDD` is the **current server date** (UTC+7 / Asia/Jakarta), e.g. `20260727`. The signature is only valid for that calendar day. ### Required headers | Header | Description | | - | - | | `X-PARTNER-ID` | Your merchant API key | | `X-CLIENT-ID` | Your `client_id` | | `X-Signature` | Signature computed as above | ### Request body ```json theme={null} { "grant_type": "client_credentials" } ``` ### Examples ```php PHP theme={null} $clientId = 'your_client_id'; $clientSecret = 'your_client_secret'; $currentDate = date('Ymd'); // e.g. 20260727 $payload = "{$clientId}_{$clientSecret}_{$currentDate}"; $signature = hash_hmac('sha512', $payload, $clientSecret); // Headers: // X-PARTNER-ID: your_api_key // X-CLIENT-ID: your_client_id // X-Signature: <$signature> ``` ```javascript Node.js theme={null} const crypto = require('crypto'); const clientId = 'your_client_id'; const clientSecret = 'your_client_secret'; const currentDate = new Date().toISOString().slice(0, 10).replace(/-/g, ''); // YYYYMMDD (Asia/Jakarta date) const payload = `${clientId}_${clientSecret}_${currentDate}`; const signature = crypto.createHmac('sha512', clientSecret).update(payload).digest('hex'); ``` ```python Python theme={null} import hmac import hashlib from datetime import datetime client_id = 'your_client_id' client_secret = 'your_client_secret' current_date = datetime.now().strftime('%Y%m%d') # Asia/Jakarta date payload = f'{client_id}_{client_secret}_{current_date}' signature = hmac.new(client_secret.encode(), payload.encode(), hashlib.sha512).hexdigest() ``` Use the returned `access_token` as `Authorization: Bearer ` on subsequent requests. *** ## 2. Request Signature Used for money-out endpoints that require per-request signing, e.g.: * `POST /api/v2.0/disbursement/transfer` * `POST /api/v2.0/ewallet/trigger-topup` * Account Transfer endpoints **1. Normalize the request body** Sort all object keys **recursively and alphabetically**. **2. Hash the normalized body** Hash the normalized JSON with **SHA-256** to get `hashed_body` (hex digest). **3. Build the string to sign** ```text theme={null} string_to_sign = "{METHOD}:{ENDPOINT}:{ACCESS_TOKEN}:{hashed_body}:{TIMESTAMP}" ``` **4. Sign it** ```text theme={null} X-Signature = HMAC-SHA512(string_to_sign, client_secret) // lowercase hex digest ``` Where: * `METHOD` — HTTP method in uppercase, e.g. `POST`. * `ENDPOINT` — the request path **including query string**, e.g. `/api/v2.0/disbursement/transfer`. Do not include the domain. * `ACCESS_TOKEN` — the Bearer token obtained from the access-token endpoint (without the `Bearer ` prefix). * `TIMESTAMP` — current Unix timestamp in **seconds** (not milliseconds), sent as a string. ### Required headers | Header | Description | | - | - | | `X-PARTNER-ID` | Your merchant API key | | `Authorization` | `Bearer ` | | `X-Timestamp` | Unix timestamp (seconds) used in the signature | | `X-Signature` | Signature computed as above | > [!WARNING] > > Regenerate the signature for **every request** — the timestamp and body are always part of the signed string, so a signature cannot be reused across requests or replayed after it expires. ### Examples ```php PHP theme={null} $method = 'POST'; $endpoint = '/api/v2.0/disbursement/transfer'; // path + query string, no domain $accessToken = 'your_bearer_token'; $secretKey = 'your_client_secret'; $timestamp = (string) time(); // 1. Normalize body (recursive key sort) function sortRecursive(array &$arr): void { ksort($arr, SORT_STRING); foreach ($arr as &$value) { if (is_array($value)) { sortRecursive($value); } } } $body = [ 'account_number' => '1234567890', 'amount' => 100000, 'bank_code' => 'BCA', ]; sortRecursive($body); $normalizedJson = json_encode($body, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); // 2. Hash body $hashedBody = hash('sha256', $normalizedJson); // 3. Build string to sign $stringToSign = "{$method}:{$endpoint}:{$accessToken}:{$hashedBody}:{$timestamp}"; // 4. Sign $signature = hash_hmac('sha512', $stringToSign, $secretKey); // Headers: // X-PARTNER-ID: your_api_key // Authorization: Bearer your_bearer_token // X-Timestamp: <$timestamp> // X-Signature: <$signature> ``` ```javascript Node.js theme={null} const crypto = require('crypto'); function sortKeysRecursive(obj) { if (Array.isArray(obj)) return obj.map(sortKeysRecursive); if (obj !== null && typeof obj === 'object') { return Object.keys(obj).sort().reduce((acc, key) => { acc[key] = sortKeysRecursive(obj[key]); return acc; }, {}); } return obj; } const method = 'POST'; const endpoint = '/api/v2.0/disbursement/transfer'; const accessToken = 'your_bearer_token'; const secretKey = 'your_client_secret'; const timestamp = Math.floor(Date.now() / 1000).toString(); const body = { account_number: '1234567890', amount: 100000, bank_code: 'BCA' }; const normalizedJson = JSON.stringify(sortKeysRecursive(body)); const hashedBody = crypto.createHash('sha256').update(normalizedJson).digest('hex'); const stringToSign = `${method}:${endpoint}:${accessToken}:${hashedBody}:${timestamp}`; const signature = crypto.createHmac('sha512', secretKey).update(stringToSign).digest('hex'); ``` ```python Python theme={null} import hashlib import hmac import json import time def sort_keys_recursive(obj): if isinstance(obj, list): return [sort_keys_recursive(v) for v in obj] if isinstance(obj, dict): return {k: sort_keys_recursive(obj[k]) for k in sorted(obj.keys())} return obj method = 'POST' endpoint = '/api/v2.0/disbursement/transfer' access_token = 'your_bearer_token' secret_key = 'your_client_secret' timestamp = str(int(time.time())) body = {'account_number': '1234567890', 'amount': 100000, 'bank_code': 'BCA'} normalized_json = json.dumps(sort_keys_recursive(body), separators=(',', ':'), ensure_ascii=False) hashed_body = hashlib.sha256(normalized_json.encode()).hexdigest() string_to_sign = f'{method}:{endpoint}:{access_token}:{hashed_body}:{timestamp}' signature = hmac.new(secret_key.encode(), string_to_sign.encode(), hashlib.sha512).hexdigest() ``` *** ## Common mistakes | Symptom | Likely cause | | - | - | | Signature always invalid | `ENDPOINT` doesn't match the exact request path (including query string) sent to the server | | Signature valid on retry but not first try | Body was modified/reformatted between signing and sending (e.g. number vs. string, key order, extra whitespace) | | Signature works for GET but not POST/PUT | `METHOD` not uppercase, or body normalization skipped for empty body | | Intermittent 401 | Timestamp too old — requests are only accepted within a limited time window from `X-Timestamp`; generate a fresh signature right before sending | | Works locally, fails in production | Client secret or client ID mismatch, or numeric fields serialized differently (e.g. `100000` vs `"100000.00"`) across environments | > [accordion] Best practices > > * Never log or expose your `client_secret` in client-side code, logs, or version control. > * Always use HTTPS. > * Generate the signature immediately before sending the request — don't reuse an old signature/timestamp pair. # Cancel Source: https://docs.singapay.id/api-reference/cardless-withdrawal/cancel https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v1.0/cardless-withdrawals/cancel Cancels an `open` withdrawal and restores the debited amount to the account balance. Only withdrawals currently in `open` status can be canceled. The target account and transaction reference are specified in the request body, not in the URL path. See `Response Code` for SP000–SP020 definitions and merchant actions. # Create Source: https://docs.singapay.id/api-reference/cardless-withdrawal/create https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v1.0/cardless-withdrawals/create Initiates a cardless withdrawal, debits the account, and returns an OTP for ATM cash collection. Only fixed denominations (multiples of 50,000) are accepted. The target account is specified in the request body (`account_id`), not in the URL path. This endpoint is rate-limited. See `Response Code` for SP000–SP020 definitions and merchant actions. **CRITICAL:** This is a money-out operation requiring **X-Signature** and **X-Timestamp** authentication. # Overview Source: https://docs.singapay.id/api-reference/cardless-withdrawal/introduction Enable customers to withdraw cash from ATMs without a card — using an OTP issued by SingaPay and the customer's registered phone number. Cardless Withdrawal lets your customers withdraw cash at supported ATMs without a physical card. Your platform requests a withdrawal on behalf of the customer, SingaPay locks the merchant balance and issues an OTP, and the customer redeems it at the ATM using their phone number and OTP code. > [!NOTE] > > This is a **Money Out** operation. Each successful withdrawal debits funds from your Singapay Payment Gateway merchant balance. > [card] No card required > > Customers withdraw using only their phone number and a one-time OTP — no physical card needed. > [card] Balance locked on issuance > > Merchant balance is locked immediately when the OTP is generated — guaranteeing funds are available at ATM redemption. > [card] Auto-reverse on failure > > If the OTP expires or the ATM rejects the transaction, SingaPay automatically reverses the locked balance back to the merchant. *** ## Withdrawal Flow ```mermaid theme={null} sequenceDiagram participant C as Customer participant M as Merchant System participant S as SingaPay API participant A as ATM C->>M: Request withdrawal (bank type, amount, CustID/phone number) M->>M: Validate request M->>S: POST /cardless-withdrawals/{account_id} Note over M,S: bank_type, amount, cust_id S->>S: Lock merchant balance, generate OTP & expired_at (status: OPEN) S-->>M: OTP, CustID, expired_at M->>C: Forward OTP, CustID, expired_at & withdrawal instructions C->>A: Select cardless menu, input CustID + OTP A->>S: Validate CustID + OTP alt Success — Data Valid A->>C: Dispense cash A->>S: Withdrawal success notification S->>S: Status: OPEN → SUCCESS S-->>M: Webhook callback (SUCCESS) M->>C: Notify withdrawal successful else Failed / Expired — Invalid data or OTP expired A->>S: Withdrawal failed / expired notification S->>S: Reverse merchant balance S->>S: Status: OPEN → FAILED / EXPIRED S-->>M: Webhook callback (FAILED / EXPIRED) M->>C: Notify failure (FAILED / EXPIRED) M->>M: Refund customer internal balance (if applicable) end ``` *** ## Transaction Status | Status | Description | | - | - | | `OPEN` | OTP issued and active — awaiting customer ATM input. Merchant balance is locked. | | `SUCCESS` | Cash dispensed at ATM. Funds deducted from merchant balance. | | `FAILED` | ATM rejected the transaction — invalid OTP or CustID. Merchant balance reversed. | | `EXPIRED` | OTP expired before ATM redemption. Merchant balance automatically reversed. | *** ## Recommended Flow **1. Customer initiates withdrawal** Customer submits a cardless withdrawal request on your platform — providing the desired amount and their registered phone number (CustID). **2. Request OTP from SingaPay** Call **Create Cardless Withdrawal** with the bank type, amount, and CustID. SingaPay locks the merchant balance and returns an OTP with an expiry time. **3. Deliver credentials to customer** Forward the OTP, CustID, and expiry time to the customer along with ATM usage instructions. **4. Customer redeems at ATM** Customer visits the supported ATM, selects the cardless withdrawal menu, and enters their CustID and OTP. **5. Receive webhook notification** SingaPay sends a webhook callback to your system with the final transaction status — `SUCCESS`, `FAILED`, or `EXPIRED`. **6. Verify status (optional)** Call **Show Cardless Withdrawal** or **List Cardless Withdrawals** to confirm the final status and reconcile your records. *** ## Important Notes > [accordion] Balance locked on OTP issuance > > The merchant balance is locked the moment a withdrawal request is created. If the transaction fails or expires, SingaPay automatically reverses the locked amount back to the merchant balance — no manual action required. > [accordion] OTP expiry > > Each OTP has a fixed expiry defined by the `expired_at` field returned in the API response. Customers must redeem the OTP at an ATM before this timestamp. Expired transactions cannot be re-used — create a new withdrawal request instead. > [accordion] Supported ATM banks > > Only ATMs from the bank specified in the `bank_type` parameter can process the withdrawal. Ensure customers are directed to the correct ATM network. > [accordion] Cancellation > > Only transactions with status `OPEN` can be cancelled. Once a transaction reaches `SUCCESS`, `FAILED`, or `EXPIRED`, it cannot be cancelled. > [accordion] Customer internal balance > > If your platform maintains an internal customer balance, remember to refund it when a transaction results in `FAILED` or `EXPIRED` — SingaPay reverses the merchant balance, but internal platform balance adjustments are the merchant's responsibility. *** ## Available Endpoints > [card] [Create Cardless Withdrawal](./create) > > Initiate a withdrawal request and receive the OTP and CustID credentials to deliver to the customer. > [card] [List Cardless Withdrawals](./list) > > Retrieve a paginated list of all cardless withdrawal transactions for an account. > [card] [Show Cardless Withdrawal](./show-detail) > > Get detailed information about a specific cardless withdrawal transaction. > [card] [Cancel Cardless Withdrawal](./cancel) > > Cancel an `OPEN` cardless withdrawal transaction before it is redeemed at an ATM. > [!NOTE] > > All endpoints require authentication. See [Authentication](/api-reference/authentication). # List Source: https://docs.singapay.id/api-reference/cardless-withdrawal/list https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/cardless-withdrawals/transaction/{account_id} Returns a paginated list of cardless withdrawals for the account, limited to the last 12 months. Results are sorted newest-first, 25 records per page. Unlike the show endpoint, list records do not include the related `account` object. # Show Detail Source: https://docs.singapay.id/api-reference/cardless-withdrawal/show-detail https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/cardless-withdrawals/transaction/{account_id}/{reference_number} Retrieves full details of a single cardless withdrawal including status, fee breakdown, and balance impact. Lookup is by the merchant-supplied `reference_number`, not the platform `transaction_id`. # Inquiry Status Source: https://docs.singapay.id/api-reference/e-wallet-money-out/inquiry-status https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/ewallet/{account_id}/inquiry-status Retrieves the current status of a previously initiated e-wallet transfer. This endpoint looks up the transaction by reference number and returns detailed status information. For transactions still in Pending status, the endpoint may query the e-wallet provider for updated status information. Status codes include 00 (Success), 03 (Pending), and 06 (Failed). Network timeouts during provider status checks will result in error code SP005. # E-Wallet Name Verification Source: https://docs.singapay.id/api-reference/e-wallet/e-wallet-name-verification https://core.singapay.id/identity-verification/docs/swagger.json post /api/v1/kyc/ewallet/verify Looks up the registered holder name on the e-wallet for the given phone number and compares it with the `name` you send. A completed check is billed (`pricing=PAID`), including when the account is not found. Validation errors and service failures are not billed (`pricing=FREE`). ### Outcomes | Result | Response | |---|---| | Account found with a registered name | `code=SUCCESS`, `data.status="found with kyc"`, `pricing=PAID` | | Account found, holder has not completed KYC | `code=SUCCESS`, `data.status="found without kyc"`, `similarity=0`, `suggestion=review`, `pricing=PAID` | | No account for this phone | `code=SUCCESS`, `data.status="not found"`, `suggestion=reject`, `pricing=PAID` | | Temporary service issue | `code=SERVER_ERROR`, `pricing=FREE` | | Invalid request (phone, name, wallet, or `request_id`) | `code=CLIENT_ERROR`, `pricing=FREE` | | Same `request_id` with a different body | `code=DUPLICATE_REFERENCE`, `pricing=FREE` | | Missing token, or IP not allowlisted | `code=UNAUTHORIZED`, `pricing=FREE` | | Prepaid balance too low | `code=INSUFFICIENT_BALANCE`, `pricing=FREE` | ### Phone numbers Send Indonesian numbers as `08…` or `62…` (9–13 digits). Do not include spaces or a `+` prefix. ### Idempotency Use a unique `request_id` for each new check (UUID v4 is recommended). Repeating the same `request_id` with the same body returns the original result and is billed once. A different body with the same `request_id` returns `DUPLICATE_REFERENCE`. # Face Comparison Source: https://docs.singapay.id/api-reference/face-comparison/face-comparison https://core.singapay.id/identity-verification/docs/swagger.json post /api/v1/kyc/face-comparison Compares `first_image` with `second_image` and returns a similarity score plus bounding boxes. A scored comparison (`SUCCESS`) and billed detection outcomes (`FACE_NOT_FOUND`, `FIRST_FACE_NOT_FOUND`, `SECOND_FACE_NOT_FOUND`, `MULTIPLE_FACES_DETECTED`) are billed (`pricing=PAID`). Validation errors and service failures are not billed (`pricing=FREE`). This feature must be enabled on your account. If it is not, the API returns `UNAUTHORIZED`. ### Outcomes | Result | Response | |---|---| | Faces compared | `code=SUCCESS`, `data.first_face` / `data.second_face` bounding boxes, `data.similarity`, `pricing=PAID` | | No face / multiple faces | `code` is the vendor detection code, `pricing=PAID` (no `data`) | | Face quality rejected by vendor | `code=CLIENT_ERROR`, `pricing=FREE` | | Temporary service issue | `code=SERVER_ERROR`, `pricing=FREE` | | Invalid images or `request_id` | `code=CLIENT_ERROR`, `pricing=FREE` | | Same `request_id` with different images | `code=DUPLICATE_REFERENCE`, `pricing=FREE` | | Missing token, feature not enabled, or IP not allowlisted | `code=UNAUTHORIZED`, `pricing=FREE` | | Prepaid balance too low | `code=INSUFFICIENT_BALANCE`, `pricing=FREE` | ### Images JPEG and PNG only, 5 MB or smaller per file. Send them either as: - `application/json` — `first_image` and `second_image` are raw base64 (no line breaks, no `data:image/…` prefix) - `multipart/form-data` — `request_id` as a text field, `first_image` and `second_image` as file parts (the same field names) Do not mix the two encodings in one request. ### Idempotency Use a unique `request_id` for each new comparison (UUID v4 is recommended). Repeating the same `request_id` with the same images returns the original result and is billed once — unless the previous attempt did not complete, in which case the comparison runs again. Different images with the same `request_id` return `DUPLICATE_REFERENCE`. # Get Transaction Detail Source: https://docs.singapay.id/api-reference/general/get-transaction-detail https://biller-b2b.singapay.id/docs post /api/v1/detail-bill-transaction Retrieve the full detail of a specific bill transaction by its transaction ID. # Inquiry Balance Source: https://docs.singapay.id/api-reference/general/inquiry-balance https://biller-b2b.singapay.id/docs post /api/v1/check-balance Retrieve the current deposit balance for the authenticated merchant. # List Transactions Source: https://docs.singapay.id/api-reference/general/list-transactions https://biller-b2b.singapay.id/docs post /api/v1/list-bill-transaction Retrieve a paginated list of bill transactions for the authenticated merchant. Supports filtering by transaction ID, customer ID, status, and date range. # Reset Customer ID Source: https://docs.singapay.id/api-reference/general/reset-customer-id https://biller-b2b.singapay.id/docs post /api/v1/reset-customer-id This API is intended solely for the development team to perform repeated tests in the development environment. Because of limitations on customer IDs in the dev server, the API can reset any customer ID that becomes unusable due to fraud detection mechanisms or other restrictions. # ID Forgery Check Source: https://docs.singapay.id/api-reference/id-forgery-check/id-forgery-check https://core.singapay.id/identity-verification/docs/swagger.json post /api/v1/kyc/id-forgery-check Assesses whether a photo of an Indonesian ID card (KTP) is a forgery / presentation-attack (photocopy, photograph of the original, edited image, or failed information checks). A completed assessment is billed (`pricing=PAID`), including when `data.is_forged` is `TRUE`. Validation failures and service failures are not billed (`pricing=FREE`). This feature must be enabled on your account. If it is not, the API returns `UNAUTHORIZED`. ### Outcomes | Result | Response | |---|---| | Assessment completed | `code=SUCCESS`, `data.is_forged` / `data.reason`, `pricing=PAID` | | Missing `request_id` / image, both `image_url` and `image_base64`, or wrong image format | `code=CLIENT_ERROR`, `pricing=FREE` (HTTP 400) | | Image exceeds 8MB | `code=CLIENT_ERROR`, `pricing=FREE` (HTTP 413) | | Temporary service issue | `code=SERVER_ERROR`, `pricing=FREE` | | Same `request_id` reused after a **completed** check | `code=DUPLICATE_REFERENCE`, `pricing=FREE` (HTTP 409) | | Same `request_id` reused after a **failed** attempt | Retried for real: the image you send this time is what actually gets processed and (if it succeeds) billed | | Missing token, feature not enabled, or IP not allowlisted | `code=UNAUTHORIZED`, `pricing=FREE` | | Prepaid balance too low | `code=INSUFFICIENT_BALANCE`, `pricing=FREE` | ### Images JPEG and PNG only, 8 MB or smaller. Send the photo either as: - `application/json` — `request_id` plus exactly one of `image_url` (HTTPS URL fetched by the engine) or `image_base64` (raw base64, no line breaks, no `data:image/…` prefix) - `multipart/form-data` — `request_id` as a text field, `image` as a file part Do not mix the two encodings in one request. ### `data.reason` mapping | `is_forged` | `reason` | |---|---| | `FALSE` | `PASS` | | `TRUE` | Known labels joined with `"; "` — photocopy, photograph of the original, edited, format validation failed, consistency check failed. Empty string when the engine returned no mapped codes. | Vendor warning codes are never returned to merchants. ### Idempotency Use a unique `request_id` for each new check (UUID v4 is recommended). Reusing a `request_id` that already resolved to a **completed** check always returns `DUPLICATE_REFERENCE`. Reusing a `request_id` whose prior attempt **failed** retries for real. # Introduction Source: https://docs.singapay.id/api-reference/introduction Explore comprehensive information about Singapay Payment Gateway API, including endpoints, request methods, parameters, and response formats. Explore comprehensive information about the Singapay Payment Gateway API, including endpoints, request methods, parameters, and response formats. Learn how to integrate and utilize the API to enhance your payment processing capabilities. *** ## API Information The current stable release of the Singapay Payment Gateway API. All endpoints and request formats documented here reflect this version. > [card] Product > > Singapay Payment Gateway > [card] Latest Version > > `v1.0` — Stable *** ## Endpoints > [card] [Sandbox](https://sandbox-payment-b2b.singapay.id) > > `https://sandbox-payment-b2b.singapay.id` > [card] [Production](https://payment-b2b.singapay.id) > > `https://payment-b2b.singapay.id` > [!NOTE] > > Use the **Sandbox** environment for development and testing. No real transactions are processed. > [!WARNING] > > Only use the **Production** endpoint for live transactions. Make sure your integration is fully tested in Sandbox first. *** ## Version Control | Version | Date | Description | Author | | - | - | - | - | | `v1.0` | 25 Apr 2024 | Baseline version | Singapay | # OCR KTP Check Source: https://docs.singapay.id/api-reference/ocr/ocr-ktp-check https://core.singapay.id/identity-verification/docs/swagger.json post /api/v1/kyc/ocr-ktp-verify Reads the fields printed on an Indonesian KTP (ID card) from an uploaded photo. A completed extraction is billed (`pricing=PAID`). Validation failures, an image the OCR engine cannot read as an ID card, and service failures are not billed (`pricing=FREE`). This feature must be enabled on your account. If it is not, the API returns `UNAUTHORIZED`. ### Outcomes | Result | Response | |---|---| | Extraction succeeded | `code=SUCCESS`, `pricing=PAID` | | Image isn't a recognizable ID card (per the OCR engine) | `code=CLIENT_ERROR`, `pricing=FREE` | | Extracted `id_number` isn't a valid 16-digit NIK | `code=CLIENT_ERROR`, `pricing=FREE` | | Missing `request_id` / `image`, or wrong image format | `code=CLIENT_ERROR`, `pricing=FREE` (HTTP 400) | | Image exceeds 8MB | `code=CLIENT_ERROR`, `pricing=FREE` (HTTP 413) | | Temporary service issue | `code=SERVER_ERROR`, `pricing=FREE` | | Same `request_id` reused after a **completed** extraction | `code=DUPLICATE_REFERENCE`, `pricing=FREE` (HTTP 409) — always, regardless of what image you send this time | | Same `request_id` reused after a **failed** attempt | Retried for real: the image you send this time is what actually gets processed and (if it succeeds) billed | | Missing token, feature not enabled, or IP not allowlisted | `code=UNAUTHORIZED`, `pricing=FREE` | | Prepaid balance too low | `code=INSUFFICIENT_BALANCE`, `pricing=FREE` | ### Image requirements JPEG or PNG only (checked against the actual bytes, not just the declared `Content-Type`), 8MB maximum. ### Idempotency Use a unique `request_id` for each new extraction (UUID v4 is recommended). Reusing a `request_id` that already resolved to a **completed** extraction always returns `DUPLICATE_REFERENCE`, regardless of what image you send this time — mint a new `request_id` for every extraction attempt. Reusing a `request_id` whose prior attempt **failed** retries for real — the image you send this time is what actually gets processed and (if it succeeds) billed. # Overview Source: https://docs.singapay.id/api-reference/payment-link-history/introduction Track, monitor, and reconcile every payment received through your Payment Links — each recorded as an individual Payment Link History. Every time a customer completes a payment through a Payment Link URL, Singapay creates a **Payment Link History** record. This API lets you list, filter, and inspect those records for reconciliation, reporting, and customer support. > [card] Per-payment records > > Every payment through a link creates its own history entry with status, amount, and method. > [card] Full fee breakdown > > Each record shows vendor fee, platform margin, and net amount received. > [card] Filterable & searchable > > Query by reference number, method, status, amount, or date range. *** ## Relationship with Payment Link A Payment Link is the **parent** — the reusable URL and its configuration. Each time a customer pays through it, a Payment Link History **child** record is created. > [!NOTE] > > **Example:** Payment Link `https://singapay.com/b2b/INV-2024-001` > > | History | Amount | Method | Date | > | - | - | - | - | > | #1 | IDR 500,000 | VA BRI | Jan 1 | > | #2 | IDR 500,000 | QRIS | Jan 2 | > | #3 | IDR 500,000 | GoPay | Jan 3 | > > One Payment Link → multiple independent history records. *** ## Transaction lifecycle **1. Customer opens the link** Customer accesses the Payment Link URL and views the payment page with item details. **2. Selects a payment method** Customer chooses from the available methods configured for that link (VA, QRIS, or E-Wallet). **3. History record created** A Payment Link History record is created immediately with status `pending`. **4. Customer completes payment** Customer pays via the selected method. The bank or payment provider sends a notification to Singapay. **5. Processing and reconciliation** Singapay validates the payment and reconciles the transaction. Status updates to `paid`. **6. Settlement** Funds are settled to your account (bank or Singapay Balance) based on your configured settlement method. *** ## Payment status | Status | Description | | - | - | | `pending` | History record created, awaiting payment from customer. | | `paid` | Payment confirmed and reconciled by Singapay. | | `settled` | Funds transferred to your account. | *** ## Important notes > [accordion] Multiple payment methods per link > > A single Payment Link can receive payments via different methods (VA, QRIS, E-Wallet). Each payment is recorded as a separate history entry regardless of method used. > [accordion] Customer information capture > > If customer detail collection is enabled on the Payment Link, name, email, and phone are captured and stored in each history record. > [accordion] Fee breakdown per transaction > > Every history record includes the payment method used, vendor fee, platform margin, and net amount received — ready for accounting reconciliation. > [accordion] QRIS special handling > > For QRIS payments, additional MDR (Merchant Discount Rate) information is recorded in the history entry alongside standard fields. > [accordion] Filtering and search > > Query histories by `reff_no`, `status`, `payment_method_name`, `amount`, date ranges (`created_at_from` / `created_at_to`), and settlement dates. Default sort is newest first. > [accordion] Data retention > > History records are retained for **1 year**. Data older than 1 year is archived and may not be accessible via the API. *** ## Available endpoints > [card] [List Payment Link Histories](./list) > > Paginated list of history records for an account with full filter support. > [card] [Show Payment Link History](./show) > > Retrieve a single history record by ID. > [!NOTE] > > All endpoints require authentication. See [Authentication](/api-reference/authentication). # List Source: https://docs.singapay.id/api-reference/payment-link-history/list https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/payment-link-histories/{account_id} Retrieve a paginated list of payment link transactions for an account. Each entry represents a single payment attempt made against one of the account's payment links. Results are restricted to transactions created within the last 12 months and are ordered newest-first by default. Use the query parameters to paginate, sort, and filter the result set; pagination details are returned in the response `meta` object. The following optional filters are available and may be combined: `reff_no`, `status`, `payment_method_name`, `payment_method_value`, `amount`, `amount_min`, `amount_max`, `has_settle`, `created_at_from`/`created_at_to`, `payment_date_from`/`payment_date_to`, `processed_timestamp_from`/`processed_timestamp_to`, and `settle_at_from`/`settle_at_to`. Date filters accept ISO 8601 values and define an inclusive range. # Show Source: https://docs.singapay.id/api-reference/payment-link-history/show https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/payment-link-histories/{account_id}/{history_id} Retrieve the full detail of a single payment link transaction belonging to an account. The response includes the related payment link and payment method when available. The `history_id` path parameter is the numeric transaction id returned as `id` by the list endpoint. A `404` response is returned when no matching transaction exists for the specified account. # Create v1 (Legacy) Source: https://docs.singapay.id/api-reference/payment-link/create-v1-legacy https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v1.0/payment-link-manage/{account_id} Creates a new payment link for an active account. The account must exist and be in active status. # Create v2 Source: https://docs.singapay.id/api-reference/payment-link/create-v2 https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/payment-link/{account_id} Creates a new payment link for an active account. Simplified body compared to v1 — several fields (`title`, `is_multiple_payment`, `is_unlimited_usage`, `redirect_url_enabled`) are no longer accepted and are derived automatically instead. See `CreatePaymentLinkV2Request` for the full set of derivation rules. # Delete Source: https://docs.singapay.id/api-reference/payment-link/delete https://payment-b2b.singapay.id/api/docs/merchant-api.json delete /api/v1.0/payment-link-manage/{account_id}/{payment_link_id} Permanently deletes a payment link from the specified account. Deletion is blocked if the link has associated payment histories. # Overview Source: https://docs.singapay.id/api-reference/payment-link/introduction Create shareable payment URLs that accept multiple payments over time, across VA, QRIS, and E-Wallet — all tracked as individual Payment Link Histories. Payment Link lets you generate a single reusable URL that customers can use to complete payments. Each payment made through the link is recorded separately as a **Payment Link History**, giving you a clean audit trail per transaction. > [card] Reusable URL > > One link can receive unlimited payments, each tracked independently. > [card] Multi-method > > Supports VA (BRI, BNI, BCA, Maybank, Danamon), QRIS, and E-Wallet. > [card] Shareable > > Send via WhatsApp, email, or SMS — no redirect flow needed. *** ## Payment Link flow ```mermaid theme={null} sequenceDiagram autonumber participant M as Merchant System participant S as SingaPay API participant C as Customer participant P as Payment Provider M->>S: POST /payment-link-manage/{account_id} Note over M,S: Create link with items & amount S-->>M: Payment URL (e.g. singapay.com/b2b/INV-001) M->>C: Share payment URL Note over M,C: WhatsApp, email, or SMS C->>S: Open payment page C->>S: Select payment method (VA / QRIS / E-Wallet) C->>P: Complete payment P->>S: Payment notification S->>S: Create Payment Link History (pending → paid) S-->>M: Webhook notification (optional) M->>S: GET /payment-link-histories/{account_id} Note over M,S: Track all payments ``` *** ## Payment Link vs Payment Link History Understanding the parent-child relationship is key to using this API correctly. > [card] Payment Link (Parent) > > **Reusable and configurable.** Defines what is being paid for. > > * Reusable payment URL > * Contains items and pricing > * Optional payment method whitelist > * Configurable usage limit and expiration > [card] Payment Link History (Child) > > **Per-payment record.** Created every time a customer pays. > > * Individual payment records > * Each has its own payment method > * Tracks status and settlement > * One link → multiple histories > [!NOTE] > > **Example:** Payment Link `INV-001` receives 3 payments via VA BRI, QRIS, and GoPay → 3 separate Payment Link History records are created, each with its own status and settlement data. *** ## Important notes > [accordion] One link, multiple payments > > A single Payment Link can receive multiple payments over its lifetime. Each payment is independently tracked as a Payment Link History record — including its own payment method, status, and settlement info. > [accordion] Payment method whitelist > > You can restrict which payment methods are available per link. For example, allow only VA BRI and QRIS, and hide E-Wallet options entirely. > [accordion] Customer detail collection > > Optionally require customers to submit their name, email, and phone number before proceeding to payment — useful for invoicing and event registrations. > [accordion] Usage limit and expiration > > Control how many times a link can be used with `max_usage`, and set an optional `expired_at` to prevent payments after a certain date. > [accordion] Cannot delete a link with histories > > Once a Payment Link has received at least one payment, it cannot be deleted. This preserves the integrity of your transaction history. > [accordion] Item details > > Include an itemized breakdown (name, quantity, unit price) in each link for better customer experience and cleaner accounting records. *** ## Use cases > [card] Invoicing > > Send payment links to customers for invoice payments via email or WhatsApp — no checkout page needed. > [card] E-Commerce checkout > > Use as a lightweight checkout alternative without a complex frontend integration. > [card] Donations & crowdfunding > > Accept contributions from multiple donors using a single persistent link. > [card] Event registration > > Collect payments for event tickets with usage limits to cap the number of attendees. *** ## Available endpoints > [card] [List Payment Links](./list) > > Paginated list of payment links for an account. > [card] [List Available Payment Methods](./list-payment-methods) > > Active methods that support payment links. > [card] [Create Payment Link](./create-v2) > > Generate a new payment link with items and configuration. > [card] [Show Payment Link](./show-v2) > > Retrieve a single payment link by ID. > [card] [Update Payment Link](./update-v2) > > Update mutable fields on an existing link. > [card] [Delete Payment Link](./delete) > > Delete a link that has no payment history. > [!NOTE] > > All endpoints require authentication. See [Authentication](/api-reference/authentication). # List Source: https://docs.singapay.id/api-reference/payment-link/list https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/payment-link-manage/{account_id} Retrieves a paginated list of payment links for the specified account. # List payment methods Source: https://docs.singapay.id/api-reference/payment-link/list-payment-methods https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/payment-link-manage/payment-methods Retrieves the catalog of active payment methods available for payment link creation and configuration. # Show v1 (Legacy) Source: https://docs.singapay.id/api-reference/payment-link/show-v1-legacy https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/payment-link-manage/{account_id}/{payment_link_id} Retrieves the details of a single payment link within the specified account. # Show v2 Source: https://docs.singapay.id/api-reference/payment-link/show-v2 https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v2.0/payment-link/{link_id} Retrieves the details of a single payment link. Unlike v1 (scoped under `/{account_id}/{payment_link_id}`), v2 only takes the link id — the owning account is resolved and access-checked from the link itself. # Update v1 (Legacy) Source: https://docs.singapay.id/api-reference/payment-link/update-v1-legacy https://payment-b2b.singapay.id/api/docs/merchant-api.json put /api/v1.0/payment-link-manage/{account_id}/{payment_link_id} Updates an existing payment link within the specified account. Only mutable fields are accepted in the request body. # Update v2 Source: https://docs.singapay.id/api-reference/payment-link/update-v2 https://payment-b2b.singapay.id/api/docs/merchant-api.json put /api/v2.0/payment-link/update/{link_id} Updates an existing payment link. True partial update — any field omitted from the request body is left untouched (unlike v1, which recomputes several fields to their "not sent" defaults and silently clears them). Rejected outright with 422 if the link is already expired or already closed (status=closed), before any field is processed. See `UpdatePaymentLinkV2Request` for per-field behavior. # Inquiry Postpaid (Legacy) Source: https://docs.singapay.id/api-reference/postpaid-v1/inquiry-postpaid-legacy https://biller-b2b.singapay.id/docs post /api/v1/postpaid/inquiry Perform a bill inquiry for postpaid products. The command field determines the product category. Returns bill details and a reference number for subsequent payment. # Payment Postpaid (Legacy) Source: https://docs.singapay.id/api-reference/postpaid-v1/payment-postpaid-legacy https://biller-b2b.singapay.id/docs post /api/v1/postpaid/payment Process a postpaid bill payment using a reference number obtained from a prior inquiry. Requires the merchant credential password for authorization. # Inquiry Postpaid (v2) Source: https://docs.singapay.id/api-reference/postpaid-v2/inquiry-postpaid-v2 https://biller-b2b.singapay.id/docs post /api/v2/postpaid/inquiry Perform a bill inquiry for postpaid products (V2). The command field determines the product category. Returns bill details including late fees and a reference number for subsequent payment. # Payment Postpaid (v2) Source: https://docs.singapay.id/api-reference/postpaid-v2/payment-postpaid-v2 https://biller-b2b.singapay.id/docs post /api/v2/postpaid/payment Process a postpaid bill payment using a reference number obtained from a prior inquiry (V2). Requires the merchant credential password for authorization. # Inquiry Prepaid (Legacy) Source: https://docs.singapay.id/api-reference/prepaid-v1/inquiry-prepaid-legacy https://biller-b2b.singapay.id/docs post /api/v1/prepaid/inquiry Perform a prepaid product inquiry. Currently supports PLN Token (plntok). Returns product details and a reference number for subsequent payment. # Payment Prepaid (Legacy) Source: https://docs.singapay.id/api-reference/prepaid-v1/payment-prepaid-legacy https://biller-b2b.singapay.id/docs post /api/v1/prepaid/payment Process a prepaid product payment. Supports Pulsa, Paket Data, and PLN Token. Pulsa and Paket Data support direct payment without prior inquiry. PLN Token requires a prior inquiry and reference_number. # Get Parameters Game Topup Source: https://docs.singapay.id/api-reference/prepaid-v2/get-parameters-game-topup https://biller-b2b.singapay.id/docs post /api/v2/prepaid/get-parameter-game-topup Retrieve the required parameters (e.g., server ID, username, platform) for a specific game topup product category. Use this before performing a game topup inquiry. # Payment Prepaid (v2) Source: https://docs.singapay.id/api-reference/prepaid-v2/payment-prepaid-v2 https://biller-b2b.singapay.id/docs post /api/v2/prepaid/payment Process a prepaid product payment. Supports Pulsa, Paket Data, PLN Token, Game Topup, and Voucher Game. Some products (pulsa, data, vouchg) support direct payment without prior inquiry. # Prepaid Inquiry (v2) Source: https://docs.singapay.id/api-reference/prepaid-v2/prepaid-inquiry-v2 https://biller-b2b.singapay.id/docs post /api/v2/prepaid/inquiry Perform a prepaid product inquiry. Supports PLN Token (plntok) and Game Topup (topupg). Returns product details and a reference number for subsequent payment. # Overview Source: https://docs.singapay.id/api-reference/qris-money-in/introduction Generate dynamic QRIS codes for single fixed-amount transactions — Indonesia's standardized QR payment system accepted across all major e-wallets and banking apps. QRIS (Quick Response Code Indonesian Standard) is Indonesia's unified QR payment standard that lets customers pay using any compatible app — GoPay, OVO, Dana, ShopeePay, and mobile banking. Unlike Virtual Account or Payment Link, **each QRIS code is generated for one specific transaction and expires after a single payment**. > [card] Instant generation > > Generate a QR code in one API call with a fixed amount — display it immediately to the customer. > [card] All major apps > > Accepted by GoPay, OVO, Dana, ShopeePay, and all QRIS-compatible banking apps. > [card] Real-time confirmation > > Payment status updates instantly via the QRIS network — no polling delay. *** ## Payment flow ```mermaid theme={null} sequenceDiagram autonumber participant M as Merchant System participant S as SingaPay API participant C as Customer participant Q as QRIS Network M->>S: POST /qris-dynamic/{account_id}/generate-qr Note over M,S: Create QR with amount & expiry S-->>M: QRIS code string & QR image M->>C: Display QR code Note over M,C: App, website, or printed receipt C->>Q: Scan QR code Note over C,Q: Using GoPay, OVO, Dana, etc. C->>Q: Confirm payment (exact amount) Q->>S: Payment notification (real-time) S->>S: Update transaction status (open → paid) S-->>M: Webhook notification (optional) M->>S: GET /qris-dynamic/{account_id}/show/{id} Note over M,S: Verify final payment status ``` *** ## Key difference: one QR = one transaction > [!WARNING] > > Unlike Virtual Account or Payment Link, **each QRIS code is valid for one payment only**. Once paid — or once expired — the code cannot be reused. Generate a new QR code for every new transaction. > [card] Cannot do > > * Reuse the same QR code for multiple payments > * Accept partial payments > * Change the amount after generation > * Keep a QR code active indefinitely > [card] Must do > > * Generate a new QR code for each transaction > * Set the exact amount at creation time > * Monitor payment status in real-time > * Expire unused codes to prevent stale QRs *** ## Transaction status | Status | Description | | - | - | | `open` | QR code generated, awaiting customer payment. | | `paid` | Payment confirmed by the QRIS network. | | `expired` | QR code expired before payment was made. | | `settled` | Funds transferred to your account. | > [!NOTE] > > Only transactions with status `open` can be deleted. Paid or expired transactions cannot be removed. *** ## Important notes > [accordion] One-time use only > > Each QRIS code is single-use. After a customer completes payment, the QR code is automatically invalidated and cannot accept another payment. Always generate a fresh QR for the next customer or transaction. > [accordion] Fixed amount at generation > > The payment amount is set at QR creation time and cannot be changed. The customer must pay the exact amount — QRIS does not support partial or over-payments. > [accordion] Optional expiration > > You can set an optional expiry time when generating a QR code. After expiry, the code cannot be scanned or paid. Unset expiry means the code stays `open` indefinitely until paid or manually deleted. > [accordion] MDR fees > > Merchant Discount Rate (MDR) applies to all QRIS transactions. The fee percentage depends on your merchant category (MCC) and your agreement with Singapay. MDR details are visible in each transaction record. > [accordion] Settlement timeline > > QRIS settlements typically follow an **H+1 to H+2** schedule depending on the payment provider. Settlement timestamps are tracked in each transaction record. > [accordion] Data retention > > Transaction records are retained for **1 year**. Data older than 1 year is archived and may not be accessible via the API. *** ## Available endpoints > [card] [List QRIS Transactions](./list) > > Paginated list of all QRIS transactions for an account with filter support. > [card] [Show QRIS Transaction](./show) > > Retrieve a single transaction by its numeric ID. > [card] [Generate Dynamic QRIS](./generate) > > Create a new MPM dynamic QR code for a fixed-amount transaction. > [card] [Inquiry QRIS Status](./inquiry-status) > > Check whether a QRIS transaction is paid, still payable, or expired. > [!NOTE] > > All endpoints require authentication. See [Authentication](/api-reference/authentication). # List Source: https://docs.singapay.id/api-reference/qris-money-in/list https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/qris-dynamic/{account_id} Retrieve a paginated list of QRIS MPM money-in transactions (`mpm-static` and `mpm-dynamic`) for an account. Results are restricted to transactions created within the last 12 months and are ordered newest-first by default. Use the query parameters below to paginate, sort, and filter the result set; pagination details are returned in the response `meta.pagination` object. The following optional filters are available and may be combined: `reff_no` (partial match), `status`, `type`, `amount`, `amount_min`, `amount_max`, `total_amount`, `total_amount_min`, `total_amount_max`, `has_settle`, `created_at_from`/`created_at_to`, `expired_at_from`/`expired_at_to`, and `settle_at_from`/`settle_at_to`. All datetime filters accept the format `Y-m-d H:i:s` in **Asia/Jakarta (WIB, UTC+7)** time and define an inclusive range. **Finding a transaction when the generate response was lost.** `merchant_reff_no` is not available as a filter, but it is returned on every item. Query this endpoint with a narrow `created_at_from`/`created_at_to` window around the time of the generate request together with `amount`, then match `merchant_reff_no` on the returned items before deciding to generate a new QRIS. **Note on `status`.** The `status` filter matches the stored transaction status. A QRIS whose `expired_at` has passed may still be stored as `open` until it is processed; use `status_computed` / `is_expired` on each item to determine whether it can still be paid. # Show Source: https://docs.singapay.id/api-reference/qris-money-in/show https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/qris-dynamic/{account_id}/show/{id} Retrieves the details of a single QRIS money-in transaction within the specified account, identified by its numeric `id` (returned by the generate and list endpoints). Returns the same payload as `GET /api/v1.0/qris-dynamic/{account_id}/inquiry-status/{id}`. # Response Codes Source: https://docs.singapay.id/api-reference/references/response-codes Complete dictionary of Singapay API response codes (SP-codes) returned across all endpoints and webhooks. All Singapay API responses include a `response_code` field that indicates whether your **API request** was received and processed correctly by the server. > [!WARNING] > > **Response codes are not transaction statuses.** A `response_code` tells you the result of the *request itself* — whether the server accepted it, rejected it due to validation, or encountered an error. It does **not** tell you whether the underlying payment succeeded, is pending, or failed. To track the actual payment outcome, use the `transaction_status` object in the response body or wait for the [webhook callback](/api-reference/webhooks/introduction). See [Transaction Status](/api-reference/references/transaction-status) for the full lifecycle. For example, a disbursement request may return `response_code: "SP000"` (request accepted successfully) while the payment itself is still `"Initiated"` — the money has not moved yet. Conversely, a webhook may arrive with `response_code: "SP001"` to notify you that a previously accepted transaction has now failed at the provider. ## Response format ```json REST API (v2 endpoints) theme={null} { "response_code": "SP000", "response_message": "Successfully", "data": { ... } } ``` ```json Webhook callback theme={null} { "response_code": "SP000", "response_message": "Successfully", "event": "disbursement", "data": { ... } } ``` *** ## Response code dictionary Each code below describes a **request-level** outcome — not the state of the payment or transfer. ### Success | Code | Message | Description | | - | - | - | | `SP000` | Successfully | The request was accepted and processed. For transactional endpoints, this means the request was submitted — **not** that the payment is complete. Check `transaction_status` for the payment outcome. | ### Transaction request errors | Code | Message | Description | Recommended action | | - | - | - | - | | `SP001` | Transaction Failure | The transaction failed during processing. | Call the inquiry-status endpoint to confirm the final state. | | `SP002` | General Failure | An internal server error occurred. | Retry after a short delay; call inquiry-status if the issue persists. | | `SP003` | Insufficient Balance | The account does not have enough balance to complete the transaction. | Top up the account and retry. | | `SP004` | Duplicate Reference Number | A transaction with this `reference_number` already exists. | Use a unique reference number for each new transaction. | | `SP005` | Timeout | The upstream provider did not respond in time. | Call the inquiry-status endpoint — the transaction may still settle. | | `SP006` | Exceed Beneficiary Limit | The beneficiary has reached their daily or per-transaction limit. | Retry with a lower amount or try again the next business day. | | `SP007` | Exceed Account Limit | Your account has reached its transaction limit. | Contact Singapay support to review your limits. | ### Lookup errors | Code | Message | Description | Recommended action | | - | - | - | - | | `SP008` | Invalid Reference Number | The reference number does not match any transaction. | Verify the reference number and retry. | | `SP009` | Transaction Not Found | No transaction exists for the given ID. | Confirm the `transaction_id` is correct. | | `SP010` | Beneficiary Account Not Found | The destination bank account could not be found. | Verify the account number and bank code. | | `SP011` | Beneficiary Vendor Not Active | The payment vendor/channel is currently unavailable. | Try an alternative channel or retry later. | | `SP020` | Merchant Account Not Found | The specified merchant account does not exist. | Verify the `account_id` in the request. | ### Authentication & authorization errors | Code | Message | Description | Recommended action | | - | - | - | - | | `SP013` | Unauthorized | Invalid or expired access token. | Request a new token via [Access Token v1.1](https://docs.singapay.id/api-reference/security/access-token-v11). | | `SP015` | Forbidden | The token is valid but lacks permission for this action. | Verify account permissions in the merchant dashboard. | | `SP016` | Signature Invalid | The `X-Signature` header could not be verified. | Review [Security and signature validation](/api-reference/webhooks/security-and-signature). | | `SP017` | Unauthorized IP | The request originated from a non-whitelisted IP. | Add your server IP in the merchant dashboard, or contact support. | ### Request errors | Code | Message | Description | Recommended action | | - | - | - | - | | `SP012` | Bad Request | The request body is malformed or missing required fields. | Check the request against the endpoint schema. | | `SP014` | Not Found | The requested resource or endpoint does not exist. | Verify the URL path and resource ID. | | `SP018` | Validation Error | One or more fields failed validation. | Check the `data.errors` object for field-level details. | | `SP019` | General Error | An unclassified server-side error occurred. | Contact Singapay support with the `transaction_id` and timestamp. | *** ## HTTP status code mapping Singapay REST API endpoints also return standard HTTP status codes. Here is how they map to common scenarios: | HTTP Status | Meaning | Typical cause | | - | - | - | | `200` | OK | Request succeeded. | | `400` | Bad Request | Malformed body, missing fields, or transaction failure (v2 endpoints). | | `401` | Unauthorized | Invalid JWT, expired token, partner mismatch, or revoked credentials. | | `403` | Forbidden | IP not whitelisted, account access denied, or merchant frozen. | | `404` | Not Found | Resource (account, transaction, VA) does not exist. | | `422` | Unprocessable Entity | Validation error — usually a missing `X-PARTNER-ID` header or invalid field values. | | `500` | Internal Server Error | Unexpected server error. Retry or contact support. | > [!NOTE] > > **v2 endpoints** (Card, E-Wallet Native v2, Disbursement v2, QRIS Issuer) return both an HTTP status code **and** an `SP` response code in the body. Always check the `response_code` field for the definitive result. *** ## Handling response codes **1. Check the response code** Parse `response_code` from the JSON body. `SP000` means the **request** was accepted — proceed to check the `transaction_status` for the actual payment outcome. **2. Handle known errors** Match against the tables above. Errors like `SP003` (insufficient balance) or `SP004` (duplicate reference) have clear resolutions. **3. Handle known request errors** Match against the tables above. Errors like `SP003` (insufficient balance) or `SP004` (duplicate reference) have clear resolutions. **4. Don't confuse request success with payment success** `SP000` confirms the server accepted your request. The payment may still be `Initiated`, `Paying`, or `Pending`. Always read the `transaction_status` object or wait for the [webhook callback](/api-reference/webhooks/introduction) to determine the final payment outcome. See [Transaction Status](/api-reference/references/transaction-status) for the full lifecycle. **5. Use inquiry-status for uncertain outcomes** For `SP001`, `SP002`, and `SP005`, the transaction may still be in progress. Call the relevant inquiry-status endpoint before retrying. **6. Contact support for persistent errors** If `SP007`, `SP017`, or `SP019` persists, contact Singapay support with the full request and response payloads. > [!WARNING] > > **Never retry a transaction blindly after a failure.** Always call the inquiry-status endpoint first to confirm the final state. Retrying without checking can result in duplicate transfers. # Transaction Status Source: https://docs.singapay.id/api-reference/references/transaction-status Lifecycle of a Singapay transaction — status codes, transitions, and recommended handling for each state. Every Singapay transaction moves through a defined set of statuses. The `transaction_status` tracks the **actual state of the payment** — whether funds have moved, are in transit, or failed. > [!NOTE] > > **Transaction status vs. response code** — These are two different things. The [Response Code](/api-reference/references/response-codes) (`response_code` / `SP` code) tells you whether your *API request* was accepted by the server. The **transaction status** on this page tells you the *actual outcome of the payment*. A request can succeed (`SP000`) while the transaction is still `Initiated` or `Pending`. *** ## Status codes | Code | Status | Terminal? | Description | | :-: | - | :-: | - | | `00` | Success | Yes | Transaction completed successfully. Funds have been transferred. | | `01` | Initiated | No | The transaction has been created but the payment provider has not been called yet. | | `02` | Paying | No | The payment call is in progress. The provider is processing the transaction. | | `03` | Pending | No | The transaction is awaiting confirmation from the provider. This is a suspect state. | | `04` | Refunded | Yes | The transaction was reversed. Funds have been returned to the source. | | `05` | Canceled | Yes | The transaction was canceled before completion. | | `06` | Failed | Yes | The transaction failed. Check `failed_code` and `failed_reason` for details. | | `07` | Not Found | Yes | The transaction does not exist in the provider's system. | > [!NOTE] > > **Terminal** means the status will not change further. Non-terminal statuses may still transition to a final state — keep polling or wait for the webhook callback. *** ## Status lifecycle ```mermaid theme={null} stateDiagram-v2 [*] --> Initiated : Transaction created Initiated --> Paying : Provider called Paying --> Pending : Awaiting confirmation Paying --> Success : Provider confirmed Paying --> Failed : Provider rejected Pending --> Success : Confirmed Pending --> Failed : Rejected / Timeout Success --> Refunded : Reversal processed Initiated --> Canceled : Canceled by merchant Paying --> Canceled : Canceled before settlement Initiated --> NotFound : Not found at provider ``` *** ## Handling each status ### `00` — Success The transaction completed. Funds have been moved. * Update your records to mark the transaction as settled. * Reconcile against `balance_after` if provided in the webhook payload. ### `01` — Initiated The transaction exists but hasn't been sent to the provider yet. * **Wait.** The system will process the transaction automatically. * If the status doesn't change within a few minutes, call the inquiry-status endpoint. ### `02` — Paying The payment call is in progress with the upstream provider. * **Do not retry or create a new transaction.** The original may still succeed. * Poll the inquiry-status endpoint after 1–2 minutes. ### `03` — Pending (Suspect) The provider acknowledged the transaction but hasn't confirmed the final result. * **Do not retry or create a new transaction.** * Poll the inquiry-status endpoint every 2–5 minutes. * A webhook callback will fire when the final status is determined. > [!WARNING] > > **Pending ≠ Failed.** Transactions in `02` (Paying) or `03` (Pending) may still settle successfully. Creating a duplicate transaction can result in double charges or double transfers. ### `04` — Refunded The transaction was reversed after a successful payment. * Update your records to reflect the reversal. * Adjust the customer's balance or order status accordingly. ### `05` — Canceled The transaction was canceled before settlement. * No funds were moved. * You may create a new transaction with a new `reference_number` if needed. ### `06` — Failed The transaction could not be completed. * Check `failed_code` and `failed_reason` in the response/webhook for the specific cause. * Common reasons: invalid beneficiary account, insufficient balance, provider downtime. * You may create a new transaction with a new `reference_number` after resolving the issue. ### `07` — Not Found The transaction does not exist in the provider's system. * This typically means the transaction was never submitted or was lost in transit. * Create a new transaction with a new `reference_number`. *** ## Status by product Transaction statuses are consistent across products, but not every product uses every status. Here's which statuses apply to each product type: | Status | Disbursement | Virtual Account | QRIS | E-Wallet | Card | Subscription | | - | :-: | :-: | :-: | :-: | :-: | :-: | | `00` Success | Yes | Yes | Yes | Yes | Yes | Yes | | `01` Initiated | Yes | — | — | Yes | — | Yes | | `02` Paying | Yes | — | Yes | Yes | Yes | Yes | | `03` Pending | Yes | — | Yes | Yes | Yes | Yes | | `04` Refunded | Yes | — | — | — | Yes | — | | `05` Canceled | Yes | — | — | Yes | Yes | Yes | | `06` Failed | Yes | — | Yes | Yes | Yes | Yes | | `07` Not Found | Yes | — | — | — | — | — | > [!NOTE] > > Virtual Account transactions arrive as webhooks only after payment is confirmed, so you will typically only see status `paid` (`00` equivalent) in VA webhook callbacks. *** ## Polling best practices For non-terminal statuses (`01`, `02`, `03`), use the inquiry-status endpoint to check for updates: **1. Wait before first poll** Allow at least **30 seconds** after the initial API call before polling. **2. Use exponential backoff** Start with 30-second intervals, increasing to 2–5 minutes. Don't poll more than once per 30 seconds. **3. Set a timeout** If a transaction remains in a non-terminal status for more than **30 minutes**, flag it for manual review. **4. Prefer webhooks** Webhook callbacks are the most reliable way to receive final status. Use polling only as a fallback. *** ## Related * [Response Codes](/api-reference/references/response-codes) — full dictionary of `SP` response codes * [Webhook Overview](/api-reference/webhooks/introduction) — real-time status notifications * [Webhook Retry Mechanism](/api-reference/webhooks/retry-mechanism) — what happens when your endpoint is unreachable # Access Token v1.1 Source: https://docs.singapay.id/api-reference/security/access-token-v11 https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v1.1/access-token/b2b Exchanges merchant credentials for a JWT access token using the OAuth 2.0 client credentials grant. Authenticates with an HMAC-SHA512 signature (`X-Signature`) instead of a client secret. Use the returned `access_token` as the `Authorization: Bearer ` header on subsequent secured requests. # Get List Source: https://docs.singapay.id/api-reference/settlement-transaction/get-list https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/settlement-transactions/{identifier} Retrieve a paginated list of the transactions included in a settlement belonging to the authenticated merchant. The settlement is looked up by its numeric id (`settlements.id`) **or** its reference number (`settlements.reference_no`); it must have status `completed` and belong to the merchant, otherwise the endpoint responds with `404`. Each item summarises one underlying money-in transaction (VA, QRIS, Payment Link, or E-Wallet). Optional filters: `transaction_type` and `is_refunded`. # List Source: https://docs.singapay.id/api-reference/statements/list https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/statements/{account_id} Paginated account statements filtered by **`processed_timestamp`** between `start_date` and `end_date` (defaults: current calendar month). Only rows created within the last **year**; **25** per page. Response includes top-level **`additional_info`** with resolved `start_date` / `end_date` (`Y-m-d`) and top-level **`pagination`** (camelCase keys) — not nested under `meta`. # Show Source: https://docs.singapay.id/api-reference/statements/show https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/statements/{account_id}/{statement_id} The second path parameter is matched against **`statements.transaction_id`** (business transaction id string — same column used across VA/disbursement/… statement rows). # Overview Source: https://docs.singapay.id/api-reference/va-transaction/introduction Track, monitor, and reconcile every bank transfer received through your Virtual Accounts — each recorded as an individual VA Transaction. Every time a customer transfers funds to a Virtual Account number, Singapay creates a **VA Transaction** record. This API lets you list, filter, and inspect those records for reconciliation, settlement tracking, and customer support. > [card] Per-payment records > > Every bank transfer to a VA creates its own transaction entry with status, amount, and timing. > [card] Full fee breakdown > > Each record shows vendor fee, platform margin, and net amount received — ready for accounting. > [card] Query by VA number > > Retrieve all transactions for a specific VA number directly, without filtering by account. *** ## Relationship with Virtual Account A Virtual Account is the **parent** — the unique payment instrument with a VA number. Every time a customer pays into it, a VA Transaction **child** record is created. > [!NOTE] > > **Example:** VA `8890-1234-5678` (Permanent VA for Customer A) > > | Transaction | Amount | Date | > | - | - | - | > | #1 | IDR 500,000 | Jan 1 | > | #2 | IDR 750,000 | Jan 15 | > | #3 | IDR 300,000 | Feb 1 | > > One Virtual Account → multiple independent transaction records over time. *** ## Transaction lifecycle **1. Payment received** Customer transfers funds to the VA number via ATM, mobile banking, or internet banking. The bank sends a payment notification to Singapay. **2. Transaction created** A VA Transaction record is created immediately with status `unpaid`. **3. Processing** Singapay validates the payment amount, checks for duplicates, and verifies all payment details. **4. Reconciliation** The transaction is reconciled by the finance system. Status updates to `paid`. **5. Settlement** Funds are settled to your account (bank or Singapay Balance) based on your configured settlement method. *** ## Transaction status | Status | Description | | - | - | | `unpaid` | Payment notification received, pending validation. | | `paid` | Payment validated and reconciled by Singapay. | | `settled` | Funds transferred to your account. | *** ## Important notes > [accordion] Query by VA number > > Beyond listing all transactions for an account, you can query transactions directly by VA number using the dedicated endpoint — useful when you have the VA number from a customer inquiry but not the internal ULID. > [accordion] Status tracking > > Monitor each transaction through its full lifecycle: `unpaid` → `paid` → `settled`. Use webhook notifications to get real-time updates instead of polling. > [accordion] Fee breakdown per transaction > > Every transaction record includes the vendor fee, platform margin, and net amount received — broken down clearly for accounting and reconciliation purposes. > [accordion] Webhook notifications > > Configure webhooks to receive real-time `va-transaction` events the moment a payment is confirmed — no need to poll the API. See the [Webhook documentation](/api-reference/webhooks/introduction) for setup details. > [accordion] Filtering and search > > Query transactions by `transaction_id`, `va_number`, `status`, `amount` range, settlement status, or timestamp ranges (`post_timestamp`, `processed_timestamp`, `settle_at`). Default sort is newest first. > [accordion] Data retention > > Transaction records are retained for **1 year**. Data older than 1 year is archived and may not be accessible via the API. *** ## Available endpoints > [card] [List VA Transactions](./list) > > Paginated list of all VA transactions for an account with full filter support. > [card] [Get VA Transaction Detail](./show) > > Retrieve a single transaction by its business `transaction_id`. > [card] [List by VA Number](./list-by-va-number) > > All transactions for a specific VA number, bypassing account-level filtering. > [!NOTE] > > All endpoints require authentication. See [Authentication](/api-reference/authentication). # List Source: https://docs.singapay.id/api-reference/va-transaction/list https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/va-transactions/{account_id} Retrieve a paginated list of Virtual Account money-in transactions for an account. Each entry represents a single payment a customer made into one of the account's Virtual Accounts. Results are restricted to transactions created within the last 12 months and are ordered newest-first by default. Use the query parameters below to paginate, sort, and filter the result set; pagination details are returned in the response `meta` object. The following optional filters are available and may be combined: `transaction_id` (partial match), `merchant_reff_no` (partial match), `va_number` (exact match), `status`, `amount`, `amount_min`, `amount_max`, `has_settle`, `post_timestamp_from`/`post_timestamp_to`, `processed_timestamp_from`/`processed_timestamp_to`, and `settle_at_from`/`settle_at_to`. All timestamp filters accept a Unix timestamp in **milliseconds** and define an inclusive range. # List by VA number Source: https://docs.singapay.id/api-reference/va-transaction/list-by-va-number https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/va-transactions/{account_id}/detail-by-va-number/{va_number} Retrieve a paginated list of money-in transactions for a single Virtual Account, identified by its **VA number** rather than by transaction id. This is the convenient way to pull the full payment history of one specific Virtual Account. Results are restricted to transactions created within the last 12 months and are ordered newest-first by default (`per_page` defaults to 50). The VA number is fixed by the path; all other filters behave exactly as on the List endpoint. The following optional filters are available and may be combined: `transaction_id` (partial match), `merchant_reff_no` (partial match), `status`, `amount`, `amount_min`, `amount_max`, `has_settle`, `post_timestamp_from`/`post_timestamp_to`, `processed_timestamp_from`/`processed_timestamp_to`, and `settle_at_from`/`settle_at_to`. All timestamp filters accept a Unix timestamp in **milliseconds** and define an inclusive range. # Show Source: https://docs.singapay.id/api-reference/va-transaction/show https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/va-transactions/{account_id}/{transaction_id} Retrieve a single Virtual Account money-in transaction by its business transaction id. The `transaction_id` path parameter is the **business** identifier (`va_transactions.transaction_id`) returned by the List endpoints — not the numeric database primary key. The transaction must belong to a Virtual Account under the supplied `account_id`, and that account must belong to the authenticated merchant. # Create Source: https://docs.singapay.id/api-reference/virtual-account/create https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v1.0/virtual-accounts/{account_id} Creates a new virtual account for an active account. Amount rules depend on amount type (open or closed), kind (temporary or permanent), and merchant configuration limits. # Delete Source: https://docs.singapay.id/api-reference/virtual-account/delete https://payment-b2b.singapay.id/api/docs/merchant-api.json delete /api/v1.0/virtual-accounts/{account_id}/{virtual_account_id} Permanently deletes a virtual account from the specified account. Deletion is blocked if the virtual account has associated transactions. # Overview Source: https://docs.singapay.id/api-reference/virtual-account/introduction Create unique virtual account numbers for customers or transactions — each payment recorded as an independent VA Transaction. Virtual Account (VA) is a bank transfer payment method where each customer or transaction gets a unique account number to pay into. One Virtual Account can receive multiple payments over time, with each payment recorded as a separate **VA Transaction**. > [card] Unique per transaction > > Each VA has its own number — no payment collisions between customers or orders. > [card] Temporary or permanent > > Create one-time VAs that expire, or permanent VAs for recurring customers. > [card] Multi-bank support > > BRI, BNI, BCA, Maybank, Danamon, and more — customers pay via ATM or mobile banking. *** ## Payment flow ```mermaid theme={null} sequenceDiagram autonumber participant M as Merchant System participant S as SingaPay API participant C as Customer participant B as Bank Network M->>S: POST /virtual-accounts/{account_id} Note over M,S: Create VA with amount & expiry S-->>M: VA Number & details (e.g. 8890-1234-5678) M->>C: Share VA number Note over M,C: Invoice, email, or app notification C->>B: Transfer to VA number Note over C,B: ATM, mobile banking, internet banking B->>S: Payment notification S->>S: Create VA Transaction (pending → paid) S-->>M: Webhook notification (optional) M->>S: GET /va-transactions/{account_id} Note over M,S: Verify and track payment status ``` *** ## Virtual Account vs VA Transaction > [card] Virtual Account (Parent) > > **The payment instrument.** Defines how and where to pay. > > * Unique VA number per account/transaction > * Configured with fixed or open amount > * Can be temporary (with expiry) or permanent > * Controls max usage and validity period > [card] VA Transaction (Child) > > **The payment record.** Created every time a customer pays. > > * Individual payment records per transfer > * Linked to one Virtual Account > * Tracks status and settlement > * One VA → multiple transactions > [!NOTE] > > **Example:** VA `8890-1234-5678` receives 3 bank transfers on different days → 3 separate VA Transaction records are created, each with its own status, amount, and settlement data. *** ## VA types | Type | Expiry | Use case | | - | - | - | | **Temporary** | Yes — based on `expired_at` | One-time invoices, orders with deadlines | | **Permanent** | No | Recurring customers, standing payment instructions | > [!TIP] > > Use **temporary VAs** for order-based payments where you want the VA to stop accepting payment after a deadline. Use **permanent VAs** for customers who pay regularly on the same account number. *** ## Amount types | Type | Description | | - | - | | `closed` | Fixed amount — only accepts the exact configured amount | | `open` | Any amount — customer can transfer any value | *** ## Supported banks — comparison | Bank Code | Min (IDR) | Max (IDR) | Settlement | Sharia | | - | - | - | - | - | | **BCA** | 10,000 | 10,000,000\* | T+1 | — | | **BNI** | 10,000 | 250,000,000\* | T+1 | — | | **BRI** | 10,000 | 250,000,000\* | T+1 | — | | **MANDIRI** | 10,000 | 100,000,000\* | T+1 | — | | **PERMATA** | 10,000 | 50,000,000\* | T+1 | — | | **MAYBANK** | 10,000 | 250,000,000\* | T+1 | — | | **CIMB** | 10,000 | 50,000,000\* | T+1 | — | | **BSI** | 10,000 | 50,000,000\* | T+1 | ✓ Islamic | | **MUAMALAT** | 10,000 | 50,000,000\* | T+1 | ✓ Islamic | | **BNC** | 10,000 | 50,000,000\* | T+1 | — | | **OCBC** | 10,000 | 50,000,000\* | T+1 | — | | **DANAMON** | 10,000 | 50,000,000\* | T+1 | — | \* Maximum limits are configurable per merchant tier. Contact your account manager or customer service to discuss higher limits. ## Important notes > [accordion] One VA, multiple transactions > > A single Virtual Account can receive multiple payments over its lifetime. Each transfer is independently recorded as a VA Transaction — with its own timestamp, amount, and settlement status. > [accordion] Temporary VA expiry and usage limit > > Temporary VAs expire based on your `expired_at` setting. You can also set `max_usage` to limit how many times a VA can be paid — useful for one-time invoices or limited-slot registrations. > [accordion] Permanent VA for recurring payments > > Permanent VAs never expire and are ideal for recurring payments from the same customer — subscriptions, monthly invoices, or standing transfer instructions. > [accordion] Amount validation > > For `closed` VAs, Singapay validates that the transfer amount exactly matches the configured amount. Mismatched amounts are rejected by the bank network before reaching Singapay. > [accordion] Cannot delete a VA with transactions > > Once a VA has received at least one payment, it cannot be deleted. This preserves the integrity of all linked VA Transaction records. > [accordion] Tracking payments > > Use the VA Transaction API to list all payments received by a VA, filter by status or date range, and retrieve settlement details per transaction. *** ## Available endpoints > [card] [List Virtual Accounts](./list) > > Paginated list of VAs for an account. > [card] [Show Virtual Account](./show) > > Retrieve a single VA by ULID. > [card] [Create Virtual Account](./create) > > Generate a new VA with bank, amount type, and expiry configuration. > [card] [Update Virtual Account](./update) > > Update mutable fields on an existing VA. > [card] [Delete Virtual Account](./delete) > > Delete a VA that has no transactions. > [!NOTE] > > All endpoints require authentication. See [Authentication](/api-reference/authentication). # List Source: https://docs.singapay.id/api-reference/virtual-account/list https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/virtual-accounts/{account_id} Retrieves a paginated list of virtual accounts for the specified account. Results are restricted to virtual accounts created within the last 12 months. # Show Source: https://docs.singapay.id/api-reference/virtual-account/show https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/virtual-accounts/{account_id}/{virtual_account_id} Retrieves the details of a single virtual account within the specified account. # Update Source: https://docs.singapay.id/api-reference/virtual-account/update https://payment-b2b.singapay.id/api/docs/merchant-api.json put /api/v1.0/virtual-accounts/{account_id}/{virtual_account_id} Updates an existing virtual account within the specified account. Validation depends on amount type (open or closed) and kind (temporary accounts require expiration and max usage). Status cannot be changed for virtual accounts issued through certain payment methods; sending a different status for those returns 422. # Disbursement Webhook Source: https://docs.singapay.id/api-reference/webhooks/disbursement-transaction Real-time notifications for disbursement (money out) transactions processed through the SingaPay platform. Monitor transaction statuses and keep your system in sync. > [!NOTE] > > **Money Out Operation** — This webhook fires when funds are transferred from your SingaPay account to a beneficiary's bank account. ## Information | Method | Path | Format | Authentication | | - | - | - | - | | POST | `https://your-webhook-url/callback` | json | HMAC SHA512 Signature | SingaPay sends a `POST` request to your configured `disbursement_notif_url` when a disbursement transaction is successfully processed or fails. > [!NOTE] > > This webhook may share a callback URL with other event types. See [Shared webhook endpoints](/api-reference/webhooks/shared-endpoints) for routing by `event` value. *** ## Request Details ### Headers | Field | Value | Type | Mandatory | Description | | - | - | - | :-: | - | | `Content-Type` | `application/json` | Alphabetic | Yes | Specifies JSON format for the request body | | `User-Agent` | `SingaPaymentGateway/1.0` | Alphabetic | Yes | Identifies the source of the webhook | | `Accept` | `application/json` | Alphabetic | Yes | Expected response format | | `X-PARTNER-ID` | — | Alphanumeric | Yes | Your API Key from the merchant dashboard | | `X-Signature` | — | Alphanumeric | Yes | HMAC SHA512 signature (128 chars) for request verification | | `X-Timestamp` | — | Numeric | Yes | Unix timestamp in **seconds** when the request was sent | | `Authorization` | `Bearer ` | Alphanumeric | Yes | JWT bearer token; also used as component in the signature | > [!NOTE] > > All signature-related headers (`X-Signature`, `X-Timestamp`, `Authorization`) are always included when your merchant account has API credentials configured. Extract the access token from the `Authorization` header and use it as-is in the string to sign. See [How to Validate Signature](#how-to-validate-signature) below. *** ### Body Parameters **response\_code** `string` *required* Response code. See [Appendix 01 — Response Codes](#01-response-codes). Example: `SP000` **response\_message** `string` *required* Human-readable response message. Example: `Successfully` **event** `string` *required* Transaction type identifier. Always `"disbursement"` for bank transfer. Use this to distinguish from `"ewallet-topup"` and `"qris-issuer"` on the shared URL. **data** `object` *required* Response payload object. **data fields** **transaction\_id** `string` *required* System-generated transaction ID. Example: `"1512220251105174015668"` **reference\_number** `string` *required* Your unique merchant reference number. Example: `"123456789123"` **transaction\_status** `object` *required* Transaction status object. See [Appendix 02 — Transaction Status](#02-transaction-status). **transaction\_status fields** **code** `string` *required* Status code. E.g. `"00"`, `"01"`, `"06"` **desc** `string` *required* Status description. E.g. `"Success"`, `"Initiated"`, `"Failed"` **post\_timestamp** `string` *required* Transaction creation time in Unix **milliseconds**. Example: `"1762339215000"` **processed\_timestamp** `string` Processing completion time in Unix **milliseconds**. Empty string if the transaction failed. **bank** `object` *required* Beneficiary bank information. **bank fields** **code** `string` *required* Bank Swift or number code. E.g. `"002"`, `"BRINIDJA"` **name** `string` *required* Bank name. E.g. `"BRI"`, `"BNI"`, `"DANAMON"` **account\_name** `string` Beneficiary account holder name. `null` if the account inquiry failed. **account\_number** `string` *required* Beneficiary bank account number. Example: `"521398319083210"` **gross\_amount** `object` *required* Total amount including fees. **gross\_amount fields** **currency** `string` *required* ISO 4217 currency code. Example: `"IDR"` **value** `string` *required* Amount value. Example: `"50000"` **fee** `object` *required* Transfer fee details. **fee fields** **currency** `string` *required* ISO 4217 currency code. **value** `string` *required* Fee amount. Example: `"3000"` **net\_amount** `object` *required* Amount received by the beneficiary (`gross_amount − fee`). **net\_amount fields** **currency** `string` *required* ISO 4217 currency code. **value** `string` *required* Net amount value. Example: `"47000"` **balance\_after** `object` *required* Your account balance after the transaction. Both fields are `null` for failed transactions. **balance\_after fields** **currency** `string` ISO 4217 currency code. `null` if failed. **value** `string` Balance value. `null` if failed. Example: `"777000"` **notes** `string` Transaction notes from the original request. Example: `"bayar pajak"` **failed\_code** `string` Error code. Only present when the transaction status is failed. Example: `"SP003"` **failed\_reason** `string` Human-readable error message. Only present when the transaction status is failed. Example: `"INSUFFICIENT BALANCE"` *** ### Payload Examples ```json Success theme={null} { "response_code": "SP000", "response_message": "Successfully", "event": "disbursement", "data": { "transaction_id": "101222025122910292195055674", "reference_number": "11111111118", "transaction_status": { "code": "00", "desc": "Success" }, "post_timestamp": "1766978961000", "processed_timestamp": "1766978962000", "bank": { "code": "002", "name": "BRI", "account_name": "Dummy Test Account Internal", "account_number": "11111111118" }, "gross_amount": { "currency": "IDR", "value": "12504.00" }, "fee": { "currency": "IDR", "value": "2500" }, "net_amount": { "currency": "IDR", "value": "10004.00" }, "balance_after": { "currency": "IDR", "value": "829988" }, "notes": "test transfer" } } ``` ```json Failed theme={null} { "response_code": "SP001", "response_message": "Transaction Failure", "event": "disbursement", "data": { "transaction_id": "121222025122617513896515436", "reference_number": "333", "transaction_status": { "code": "06", "desc": "Failed" }, "post_timestamp": "1766746298000", "processed_timestamp": "", "bank": { "code": "002", "name": "BRI", "account_name": "", "account_number": "091701064838533" }, "gross_amount": { "currency": "IDR", "value": "12501.00" }, "fee": { "currency": "IDR", "value": "2500" }, "net_amount": { "currency": "IDR", "value": "10001.00" }, "balance_after": { "currency": "IDR", "value": "0" }, "notes": "test transfer", "failed_reason": "Transaction Failure : Invalid beneficiary account: Account inactive", "failed_code": "SP001" } } ``` *** *** ## Security and responses Return HTTP `200` promptly after validating the request. For retry behavior, see [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). Verify every webhook using [Security and signature validation](/api-reference/webhooks/security-and-signature). Use your configured callback path when building `StringToSign`. Handle duplicate deliveries idempotently using stable identifiers from the payload (for example `transaction_id` or `reff_no`). *** ## Disbursement-Specific Notes ### Idempotency Each `reference_number` can only be used once per account. If you retry with the same `reference_number`, you'll receive the existing transaction status rather than creating a duplicate transfer. ```php Detecting Duplicate Webhooks theme={null} $referenceNumber = $payload['data']['reference_number']; // Check if already processed $existingTransaction = findTransactionByReference($referenceNumber); if ($existingTransaction) { // Already processed — return 200 without re-processing http_response_code(200); exit; } processNewDisbursement($payload); ``` ### Timestamp Formats > [!WARNING] > > Disbursement webhooks use **two different timestamp formats**. Don't mix them up. | Field | Format | Example | Notes | | - | - | - | - | | `X-Timestamp` header | Unix seconds | `1695711945` | Used for signature validation | | `post_timestamp` (body) | Unix milliseconds | `1762339215000` | Divide by 1000 to convert | | `processed_timestamp` (body) | Unix milliseconds | `1762339215672` | Empty string if transaction failed | ```php Converting millisecond timestamps theme={null} // Convert to DateTime $postTimestamp = $payload['data']['post_timestamp']; // "1762339215000" $date = new DateTime(); $date->setTimestamp((int)($postTimestamp / 1000)); // Or with Carbon (Laravel) $date = \Carbon\Carbon::createFromTimestampMs($postTimestamp); ``` ### Balance Reconciliation The `balance_after` field shows your account balance after each transaction. For failed transactions, both `currency` and `value` are `null` — no balance change occurred. ```php Balance Consistency Check theme={null} if ($payload['data']['transaction_status']['code'] === '00') { $balanceAfter = (float)$payload['data']['balance_after']['value']; $grossAmount = (float)$payload['data']['gross_amount']['value']; $expectedBalance = $previousBalance - $grossAmount; if (abs($balanceAfter - $expectedBalance) > 0.01) { // Balance mismatch — log for investigation logBalanceDiscrepancy($transactionId, $expectedBalance, $balanceAfter); } } ``` *** ## Appendix ### 01: Response Codes | Code | Message | Description | Action | | - | - | - | - | | `SP000` | Successfully | Success | Check inquiry status | | `SP001` | Transaction Failure | Failed transaction | Check inquiry status | | `SP002` | General Failure | Internal server error | Check inquiry status | | `SP003` | Insufficient Balance | Account balance too low | Check inquiry status | | `SP004` | Duplicate Reference Number | Reference already used | — | | `SP005` | Timeout | Gateway timeout | Check inquiry status | | `SP006` | Exceed Beneficiary Limit | Beneficiary amount limit reached | Check inquiry status | | `SP007` | Exceed Account Limit | Account transaction limit reached | Contact IT Support | | `SP008` | Invalid Reference Number | Reference does not exist | — | | `SP009` | Transaction Not Found | Transaction not found | — | | `SP010` | Beneficiary Account Not Found | Account not found | — | | `SP011` | Beneficiary Vendor Not Active | Vendor not active | — | | `SP012` | Bad Request | Bad request | — | | `SP013` | Unauthorized | Unauthorized | — | | `SP014` | Not Found | Not found | — | | `SP015` | Forbidden | Forbidden | — | | `SP016` | Signature Invalid | Signature invalid | — | | `SP017` | Unauthorized IP | IP not authorized | Contact IT Support | | `SP018` | Validation Error | Payload validation error | — | | `SP019` | General Error | General error | Contact IT Support | | `SP020` | Merchant Account Not Found | Merchant account not found | — | ### 02: Transaction Status | Code | Status | Notes | | :-: | - | - | | `00` | Success | Transaction completed successfully | | `01` | Initiated | Payment call not yet received; retry is possible | | `02` | Paying | Pending/Suspect — retry status check in a few minutes; awaiting final callback | | `03` | Pending | Pending/Suspect — retry status check in a few minutes; awaiting final callback | | `04` | Refunded | Reversal transaction | | `05` | Canceled | Create a new transaction | | `06` | Failed | Transaction failed | | `07` | Not Found | Create a new transaction | # E-Wallet Native Webhook Source: https://docs.singapay.id/api-reference/webhooks/ewallet-moneyin Real-time notifications when a customer successfully pays via e-wallet (GoPay, OVO, ShopeePay, etc.) through your checkout session. Update your order status and fulfill transactions promptly. > [!NOTE] > > **Money In Operation** — This webhook fires when a customer completes an e-wallet payment, transferring funds into your SingaPay account. ## Information | Method | Path | Format | Authentication | | - | - | - | - | | POST | `https://your-webhook-url/callback` | json | HMAC SHA512 Signature | SingaPay sends a `POST` request to your configured `transaction_notif_url` when a customer completes payment via e-wallet native checkout. > [!NOTE] > > This webhook may share a callback URL with other event types. See [Shared webhook endpoints](/api-reference/webhooks/shared-endpoints) for routing by `event` value. *** ## Request Details ### Headers | Field | Value | Type | Mandatory | Description | | - | - | - | :-: | - | | `Content-Type` | `application/json` | Alphabetic | Yes | Specifies JSON format for the request body | | `User-Agent` | `SingaPaymentGateway/1.0` | Alphabetic | Yes | Identifies the source of the webhook | | `Accept` | `application/json` | Alphabetic | Yes | Expected response format | | `X-PARTNER-ID` | — | Alphanumeric | Yes | Your API Key from the merchant dashboard | | `X-Signature` | — | Alphanumeric | Yes | HMAC SHA512 signature (128 chars) for request verification | | `X-Timestamp` | — | Numeric | Yes | Unix timestamp in **seconds** when the request was sent | | `Authorization` | `Bearer ` | Alphanumeric | Yes | System-generated random bearer token; used as a component in the signature | > [!NOTE] > > The `Authorization` token for e-wallet webhooks is a **randomly generated string** — not a user access token. This webhook is triggered by a payment notification (system event), not a user action. Extract the token as-is and use it in the string to sign. See [How to Validate Signature](#how-to-validate-signature) below. *** ### Body Parameters **status** `number` *required* HTTP Status Code. Example: `200` **success** `boolean` *required* Indicates if the transaction was successful. Example: `true` **event** `string` *required* Event type identifier. Always `"ewallet-native-transaction"` for this webhook. **timestamp** `string` *required* Event timestamp in format `"d M Y H:i:s"`. Example: `"26 Dec 2025 13:35:45"` **data** `object` *required* Container for transaction, customer, and payment details. **data fields** **transaction** `object` *required* Transaction details. **transaction fields** **id** `integer` *required* Unique transaction ID. Example: `42` **reff\_no** `string` *required* Merchant reference number used during checkout creation. Example: `"INV-2026-001"` **merchant\_reff\_no** `string` Optional merchant reference number for tracing. Example: `"INV-2026-001"` **type** `string` *required* Transaction type. Always `"ewallet"`. **ewallet\_vendor** `string` *required* E-wallet vendor code. Example: `"GOPAY"`, `"OVO"`, `"SHOPEEPAY"` **status** `string` *required* Transaction status. Always `"paid"` for this webhook. **amount** `object` *required* **Net** transaction amount after fees — credited to your balance. **amount fields** **value** `number` *required* Net amount value. Example: `95000` **currency** `string` *required* ISO 4217 currency code. Example: `"IDR"` **total\_amount** `object` *required* **Gross** transaction amount — what the customer actually paid. **total\_amount fields** **value** `number` *required* Total amount value. Example: `100000` **currency** `string` *required* ISO 4217 currency code. Example: `"IDR"` **post\_timestamp** `string` *required* Timestamp when the transaction record was last updated. Example: `"26 Dec 2025 13:35:43"` **processed\_timestamp** `string` *required* Timestamp when the payment was confirmed and processed. Example: `"26 Dec 2025 13:35:45"` **customer** `object` *required* Customer details provided during checkout. All fields are optional depending on checkout creation data. **customer fields** **name** `string` Customer name. Example: `"John Doe"` **email** `string` Customer email address. Example: `"john@example.com"` **phone** `string` Customer phone number. Example: `"081234567890"` **payment** `object` *required* Payment method details. **payment fields** **method** `string` *required* Payment method. Always `"ewallet"`. **vendor** `string` *required* E-wallet vendor code — same as `transaction.ewallet_vendor`. Example: `"GOPAY"` **additional\_info** `object` *required* E-wallet specific payment information. **additional\_info fields** **payment\_event\_id** `number` *required* Internal payment event ID for traceability. Example: `1042` **vendor\_reference\_no** `string` Reference number from the e-wallet vendor. May be `null` depending on the provider's API response. *** ### Payload Example ```json Success theme={null} { "status": 200, "success": true, "event": "ewallet-native-transaction", "timestamp": "26 Dec 2025 13:35:45", "data": { "transaction": { "id": 42, "reff_no": "INV-2026-001", "merchant_reff_no": "INV-2026-001", "type": "ewallet", "ewallet_vendor": "GOPAY", "status": "paid", "amount": { "value": 95000, "currency": "IDR" }, "total_amount": { "value": 100000, "currency": "IDR" }, "post_timestamp": "26 Dec 2025 13:35:43", "processed_timestamp": "26 Dec 2025 13:35:45" }, "customer": { "name": "John Doe", "email": "john@example.com", "phone": "081234567890" }, "payment": { "method": "ewallet", "vendor": "GOPAY", "additional_info": { "payment_event_id": 1042, "vendor_reference_no": "PAY-XYZ-12345" } } } } ``` *** *** ## Security and responses Return HTTP `200` promptly after validating the request. For retry behavior, see [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). Verify every webhook using [Security and signature validation](/api-reference/webhooks/security-and-signature). Use your configured callback path when building `StringToSign`. Handle duplicate deliveries idempotently using stable identifiers from the payload (for example `transaction_id` or `reff_no`). *** ## E-Wallet Specific Notes > [accordion] amount vs total\_amount > > `total_amount` is the **gross amount the customer paid**. `amount` is the **net amount after fees** — this is what gets credited to your balance. Always use `total_amount` for display to the customer and `amount` for reconciliation. > [accordion] vendor\_reference\_no may be null > > The `vendor_reference_no` field may be `null` depending on the e-wallet provider's API response. Always handle `null` gracefully in your code — don't assume it's always populated. > [accordion] Customer fields are optional > > All `customer` fields (`name`, `email`, `phone`) are optional and depend on the data provided during checkout creation. Your handler should not assume any of these are present. > [accordion] Timestamp format & timezone > > Both `post_timestamp` and `processed_timestamp` use the format `"d M Y H:i:s"` (e.g. `"26 Dec 2025 13:35:45"`) in **Asia/Jakarta (WIB)** timezone — not UTC. # E-Wallet Top Up Webhook Source: https://docs.singapay.id/api-reference/webhooks/ewallet-moneyout Real-time notifications when an E-Wallet Top Up (money out) transaction completes or fails. Track success and failure outcomes for e-wallet disbursement via the shared disbursement_notif_url. > [!NOTE] > > **Money Out Operation** — This webhook fires when an E-Wallet Top Up transaction is completed (success or failed), transferring funds from your SingaPay account to a customer's e-wallet. ## Information | Method | Path | Format | Authentication | | - | - | - | - | | POST | `https://your-webhook-url/callback` | json | HMAC SHA512 Signature | SingaPay sends a `POST` request to your configured `disbursement_notif_url` when an E-Wallet Top Up transaction is completed (success or failed). > [!NOTE] > > This webhook may share a callback URL with other event types. See [Shared webhook endpoints](/api-reference/webhooks/shared-endpoints) for routing by `event` value. *** ## Request Details ### Headers | Field | Value | Type | Mandatory | Description | | - | - | - | :-: | - | | `Content-Type` | `application/json` | Alphabetic | Yes | Specifies JSON format for the request body | | `User-Agent` | `SingaPaymentGateway/1.0` | Alphabetic | Yes | Identifies the source of the webhook | | `Accept` | `application/json` | Alphabetic | Yes | Expected response format | | `X-PARTNER-ID` | — | Alphanumeric | Yes | Your API Key from the merchant dashboard | | `X-Signature` | — | Alphanumeric | Yes | HMAC SHA512 signature (128 chars) for request verification | | `X-Timestamp` | — | Numeric | Yes | Unix timestamp in **seconds** when the request was sent | | `Authorization` | `Bearer ` | Alphanumeric | Yes | JWT bearer token; also used as component in the signature | > [!NOTE] > > All signature-related headers (`X-Signature`, `X-Timestamp`, `Authorization`) are always included when your merchant account has API credentials configured. Extract the access token from the `Authorization` header and use it as-is in the string to sign. See [How to Validate Signature](#how-to-validate-signature) below. *** ### Body Parameters **response\_code** `string` *required* Response code. See [Appendix 01 — Response Codes](#01-response-codes). Example: `SP000` **response\_message** `string` *required* Human-readable response message. Example: `Successfully` **event** `string` *required* Transaction type identifier. Always `"ewallet-topup"` for this webhook. Use this to distinguish from `"disbursement"` and `"qris-issuer"` on the shared URL. **data** `object` *required* Response payload object. **data fields** **transaction\_id** `string` *required* System-generated transaction ID. Example: `"EW1512220251105174015668"` **reference\_number** `string` *required* Your unique merchant reference number. Example: `"REF123456789"` **notes** `string` Transaction notes from the original request. Example: `"topup OVO pelanggan"` **transaction\_status** `object` *required* Transaction status object. See [Appendix 02 — Transaction Status](#02-transaction-status). **transaction\_status fields** **code** `string` *required* Status code. `"00"` = Success, `"06"` = Failed **desc** `string` *required* Status description. E.g. `"Success"`, `"Failed"` **post\_timestamp** `string` *required* Transaction creation time in Unix **milliseconds**. Example: `"1766978961000"` **processed\_timestamp** `string` Processing completion time in Unix **milliseconds**. Empty string if the transaction failed. **ewallet** `object` *required* E-wallet beneficiary information. **ewallet fields** **code** `string` *required* E-wallet provider code. E.g. `"OVO"`, `"DANA"`, `"GOPAY"`, `"LINKAJA"`, `"SHOPEEPAY"` **customer\_number** `string` *required* Customer's e-wallet phone number or account number. Example: `"08123456789"` **customer\_name** `string` Customer's name on the e-wallet. `null` if account inquiry is not available. **gross\_amount** `object` *required* Total amount deducted from your merchant balance (net + fee). **gross\_amount fields** **currency** `string` *required* ISO 4217 currency code. Example: `"IDR"` **value** `string` *required* Gross amount value. Example: `"50000.00"` **fee** `object` *required* Admin fee charged for this transaction. **fee fields** **currency** `string` *required* ISO 4217 currency code. **value** `string` *required* Fee amount. Example: `"2500.00"` **net\_amount** `object` *required* Net amount received by the customer (`gross_amount − fee`). **net\_amount fields** **currency** `string` *required* ISO 4217 currency code. **value** `string` *required* Net amount value. Example: `"47500.00"` **balance\_after** `object` *required* Your merchant account balance after the transaction. **balance\_after fields** **currency** `string` ISO 4217 currency code. Empty string if unavailable. **value** `string` Balance value. Empty string if unavailable. Example: `"750000"` **failed\_code** `string` Error code. Only present when the transaction failed. Example: `"CONNECTION_ERROR"` **failed\_reason** `string` Human-readable error description. Only present when the transaction failed. Example: `"Connection timeout to vendor"` *** ### Payload Examples ```json Success theme={null} { "response_code": "SP000", "response_message": "Successfully", "event": "ewallet-topup", "data": { "transaction_id": "EW101222025122910292195055674", "reference_number": "REF-EWALLET-001", "notes": "topup OVO pelanggan", "transaction_status": { "code": "00", "desc": "Success" }, "post_timestamp": "1766978961000", "processed_timestamp": "1766978962000", "ewallet": { "code": "OVO", "customer_number": "08123456789", "customer_name": "Budi Santoso" }, "gross_amount": { "currency": "IDR", "value": "50000.00" }, "fee": { "currency": "IDR", "value": "2500.00" }, "net_amount": { "currency": "IDR", "value": "47500.00" }, "balance_after": { "currency": "IDR", "value": "750000" } } } ``` ```json Failed theme={null} { "response_code": "SP001", "response_message": "Transaction Failure", "event": "ewallet-topup", "data": { "transaction_id": "EW121222025122617513896515436", "reference_number": "REF-EWALLET-002", "notes": "topup DANA pelanggan", "transaction_status": { "code": "06", "desc": "Failed" }, "post_timestamp": "1766978900000", "processed_timestamp": "", "ewallet": { "code": "DANA", "customer_number": "08198765432", "customer_name": null }, "gross_amount": { "currency": "IDR", "value": "100000.00" }, "fee": { "currency": "IDR", "value": "2500.00" }, "net_amount": { "currency": "IDR", "value": "97500.00" }, "balance_after": { "currency": "IDR", "value": "850000" }, "failed_code": "CONNECTION_ERROR", "failed_reason": "Connection timeout to vendor" } } ``` *** *** ## Security and responses Return HTTP `200` promptly after validating the request. For retry behavior, see [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). Verify every webhook using [Security and signature validation](/api-reference/webhooks/security-and-signature). Use your configured callback path when building `StringToSign`. Handle duplicate deliveries idempotently using stable identifiers from the payload (for example `transaction_id` or `reff_no`). *** ## E-Wallet Top Up specific notes ### Idempotency Each `reference_number` can only be used once per account. If you retry with the same `reference_number`, you'll receive the existing transaction status rather than creating a duplicate top up. ```php Detecting Duplicate Webhooks theme={null} $referenceNumber = $payload['data']['reference_number']; $existingTransaction = findTransactionByReference($referenceNumber); if ($existingTransaction) { // Already processed — return 200 without re-processing http_response_code(200); exit; } processEwalletTopUp($payload); ``` ### Timestamp Formats > [!WARNING] > > E-Wallet Top Up webhooks use **two different timestamp formats**. Don't mix them up. | Field | Format | Example | Notes | | - | - | - | - | | `X-Timestamp` header | Unix seconds | `1695711945` | Used for signature validation | | `post_timestamp` (body) | Unix milliseconds | `1766978961000` | Divide by 1000 to convert | | `processed_timestamp` (body) | Unix milliseconds | `1766978962000` | Empty string if transaction failed | When validating signatures, always use the **X-Timestamp header value** (in seconds), not the timestamps from the request body (which are in milliseconds). ```php Converting millisecond timestamps theme={null} // Convert to DateTime $postTimestamp = $payload['data']['post_timestamp']; // "1766978961000" $date = new DateTime(); $date->setTimestamp((int)($postTimestamp / 1000)); // Or with Carbon (Laravel) $date = \Carbon\Carbon::createFromTimestampMs($postTimestamp); ``` ### Balance Refund on Failure When an E-Wallet Top Up fails, SingaPay **automatically refunds** the full `gross_amount` (net + fee) back to your merchant balance. You do not need to request a manual refund — the balance is restored immediately upon failure detection. The `balance_after` field reflects the post-refund balance. ### Balance Tracking The `balance_after` field shows your account balance after the transaction: * For **successful** transactions: remaining balance after deduction * For **failed** transactions: balance after automatic refund (balance is restored) * Use this to verify balance consistency with your system * All amounts are in IDR (Indonesian Rupiah) *** ## Appendix ### 01: Response Codes | Code | Message | Description | Action | | - | - | - | - | | `SP000` | Successfully | Success | Check inquiry status | | `SP001` | Transaction Failure | Failed transaction | Check inquiry status | | `SP002` | General Failure | Internal server error | Check inquiry status | | `SP003` | Insufficient Balance | Account balance too low | Check inquiry status | | `SP004` | Duplicate Reference Number | Reference already used | — | | `SP005` | Timeout | Gateway timeout | Check inquiry status | | `SP006` | Exceed Beneficiary Limit | Beneficiary amount limit reached | Check inquiry status | | `SP007` | Exceed Account Limit | Account transaction limit reached | Contact IT Support | | `SP008` | Invalid Reference Number | Reference does not exist | — | | `SP009` | Transaction Not Found | Transaction not found | — | | `SP010` | Beneficiary Account Not Found | Account not found | — | | `SP011` | Beneficiary Vendor Not Active | Vendor not active | — | | `SP012` | Bad Request | Bad request | — | | `SP013` | Unauthorized | Unauthorized | — | | `SP014` | Not Found | Not found | — | | `SP015` | Forbidden | Forbidden | — | | `SP016` | Signature Invalid | Signature invalid | — | | `SP017` | Unauthorized IP | IP not authorized | Contact IT Support | | `SP018` | Validation Error | Payload validation error | — | | `SP019` | General Error | General error | Contact IT Support | | `SP020` | Merchant Account Not Found | Merchant account not found | — | ### 02: Transaction Status | Code | Status | Notes | | :-: | - | - | | `00` | Success | Transaction completed successfully | | `01` | Initiated | Payment call not yet received; retry is possible | | `02` | Paying | Pending/Suspect — retry status check in a few minutes; awaiting final callback | | `03` | Pending | Pending/Suspect — retry status check in a few minutes; awaiting final callback | | `04` | Refunded | Reversal transaction | | `05` | Canceled | Create a new transaction | | `06` | Failed | Transaction failed | | `07` | Not Found | Create a new transaction | # Overview Source: https://docs.singapay.id/api-reference/webhooks/introduction Receive real-time notifications for transaction and account events via webhooks. Webhooks allow Singapay to push real-time notifications to your server whenever an event occurs — such as a transaction status change, disbursement completion, or product expiration. Instead of polling the API, your endpoint receives an HTTP `POST` request the moment something happens. ## How it works When an event is triggered, Singapay sends a `POST` request to the webhook URL you have configured in your merchant dashboard. Your server must respond with HTTP `200 OK` to acknowledge receipt. ## Retry mechanism If your endpoint does not return HTTP `200 OK`, SingaPay automatically retries delivery. See [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism) for status-specific rules, intervals, and failure notifications. ## Webhook categories Webhooks are grouped by event type: **Money In** * Virtual Account Transaction * QRIS Acquirer Transaction * Payment Link Transaction * E-Wallet Native Transaction * Subscription Cycle **Money Out** * Disbursement Transaction * E-Wallet Top Up Transaction * QRIS Issuer Transaction **Optional** * Sub-Account KYB Verification * Sub-Account KYB Verification * Payment Link Inquiry * Product Expiration * Transaction Money-In Expiration ## Best practices * Always validate the webhook payload before processing. * Return `200 OK` as quickly as possible — offload heavy processing to a background job. * Handle duplicate deliveries idempotently, since retries may deliver the same event more than once. * Log all incoming webhook payloads for debugging and reconciliation. # Payment Link Webhook Source: https://docs.singapay.id/api-reference/webhooks/payment-link Real-time notifications when a payment is completed through a payment link. Includes transaction details, customer information, and payment method used. > [!NOTE] > > **Money In Operation** — This webhook fires when a customer completes a payment via a Payment Link, transferring funds into your SingaPay account. ## Information | Method | Path | Format | Authentication | | - | - | - | - | | POST | `https://your-webhook-url/callback` | json | HMAC SHA512 Signature | SingaPay sends a `POST` request to your configured `transaction_notif_url` when a Payment Link transaction is successfully completed. For optional view and expiry notifications (when someone opens a link), see [Payment Link Inquiry](/api-reference/webhooks/payment-link-inquiry). > [!NOTE] > > This webhook may share a callback URL with other event types. See [Shared webhook endpoints](/api-reference/webhooks/shared-endpoints) for routing by `event` value. *** ## Request Details ### Headers | Field | Value | Type | Mandatory | Description | | - | - | - | :-: | - | | `Content-Type` | `application/json` | Alphabetic | Yes | Specifies JSON format for the request body | | `X-PARTNER-ID` | — | Alphanumeric | Yes | Your API Key from the merchant dashboard. Example: `b3ed7d4b-a96c-6c08-b3c7-12c3124242d9` | *** ### Body Parameters **status** `number` *required* HTTP Status Code. Example: `200` **success** `boolean` *required* `true` for 2xx responses, `false` for 4xx–5xx. **data** `object` *required* Container for transaction, customer, and payment details. **data fields** **transaction** `object` *required* Transaction details. **transaction fields** **reff\_no** `string` *required* Unique transaction reference number (26 chars). Example: `"18917720251110094037705"` **type** `string` *required* Transaction type. Always `"pl"` for Payment Link. **status** `string` *required* Transaction status. See [Transaction Status Codes](#transaction-status-codes). Example: `"paid"` **amount** `object` *required* Transaction amount details. **amount fields** **value** `string` *required* Transaction amount. Example: `"10000.00"` **currency** `string` *required* ISO 4217 currency code. Example: `"IDR"` **tip** `mixed` Tip amount if any. `null` if no tip was added. **post\_timestamp** `string` *required* Transaction post time. Example: `"10 Nov 2025 09:46:38"` **processed\_timestamp** `string` *required* Transaction processed time. Example: `"10 Nov 2025 09:46:38"` **customer** `object` *required* Customer details. **customer fields** **id** `mixed` Customer unique ID. `null` if the customer is not registered. **name** `string` *required* Customer full name. Example: `"Mohammad Zulkifli Katili"` **email** `string` *required* Customer email address. Example: `"mohzulkilfikatili@gmail.com"` **phone** `string` *required* Customer phone number. Example: `"082291501085"` **payment** `object` *required* Payment method details. **payment fields** **method** `string` *required* Payment method. Always `"payment_link"`. **additional\_info** `object` *required* Payment Link-specific information. **additional\_info fields** **payment\_link** `object` *required* Payment link metadata. **payment\_link fields** **id** `number` *required* Payment link ID. Example: `189` **reff\_no** `string` *required* Payment link reference number. Example: `"PL20251105160923690b1443a67e9"` **title** `string` *required* Payment link title. Example: `"tes"` **payment\_date** `string` *required* Payment completion datetime (ISO 8601). Example: `"2025-11-05T09:09:49.000000Z"` **payment\_url** `string` *required* Full payment link URL. **status** `string` *required* Payment link status. Example: `"open"` **required\_customer\_detail** `boolean` *required* Whether customer details are required at checkout. Example: `true` **max\_usage** `number` *required* Maximum number of times the link can be used. Example: `1000` **current\_usage** `number` *required* Current number of times the link has been used. Example: `4` **expired\_at** `string` Payment link expiration datetime. `null` if no expiry is set. **total\_amount** `string` *required* Payment link total amount. Example: `"10000.00"` **account\_id** `number` *required* Account ID associated with the payment link. Example: `35` **created\_at** `string` *required* Creation datetime (ISO 8601). Example: `"2025-11-05T09:09:49.000000Z"` **updated\_at** `string` *required* Last updated datetime (ISO 8601). Example: `"2025-11-10T02:46:38.000000Z"` *** ### Payload Examples ```json Success theme={null} { "status": 200, "success": true, "data": { "transaction": { "reff_no": "18917720251110094037705", "type": "pl", "status": "paid", "amount": { "value": "10000.00", "currency": "IDR" }, "tip": null, "post_timestamp": "10 Nov 2025 09:46:38", "processed_timestamp": "10 Nov 2025 09:46:38" }, "customer": { "id": null, "name": "Mohammad Zulkifli Katili", "email": "mohzulkilfikatili@gmail.com", "phone": "082291501085" }, "payment": { "method": "payment_link", "additional_info": { "payment_link": { "id": 189, "reff_no": "PL20251105160923690b1443a67e9", "title": "tes", "payment_date": "2025-11-05T09:09:49.000000Z", "payment_url": "https://sandbox-paymentlink.singapay.id/b2b/PL20251105160923690b1443a67e9", "status": "open", "required_customer_detail": true, "max_usage": 1000, "current_usage": 4, "expired_at": null, "total_amount": "10000.00", "account_id": 35, "created_at": "2025-11-05T09:09:49.000000Z", "updated_at": "2025-11-10T02:46:38.000000Z" } } } } } ``` ```json Unauthorized (401) theme={null} { "status": 401, "success": false, "error": { "code": 401, "message": "Unauthorized partner, please sign in" } } ``` *** ## Transaction Status Codes | Status | Description | | :-: | - | | `paid` | Payment completed successfully | | `pending` | Payment is pending | | `expired` | Payment link has expired | | `failed` | Payment has failed | *** ## Event Description This webhook fires when a payment is successfully completed through a payment link. The payload covers: > [card] Transaction Details > > Reference number, type, status, amount, and timestamps. > [card] Customer Info > > Name, email, and phone number of the paying customer. > [card] Payment Link Metadata > > Usage count, expiry, status, URL, and creation timestamps. > [card] Payment Method > > Method used (`payment_link`) and all associated additional info. *** *** ## Security and responses Return HTTP `200` promptly after validating the request. For retry behavior, see [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). Verify every webhook using [Security and signature validation](/api-reference/webhooks/security-and-signature). Use your configured callback path when building `StringToSign`. Handle duplicate deliveries idempotently using stable identifiers from the payload (for example `transaction_id` or `reff_no`). # Payment Link Inquiry Webhook Source: https://docs.singapay.id/api-reference/webhooks/payment-link-inquiry Optional real-time notifications when someone opens or views a payment link, or when an inquiry session expires. Track engagement and conversion without affecting payment link functionality. > [!NOTE] > > **Optional webhook** — This webhook is completely optional. Payment links work normally without it. Configure `payment_link_inquiry_notif_url` only if you need view or expiry notifications. For completed payments, use the [Payment Link Transaction](/api-reference/webhooks/payment-link) webhook instead. ## Information | Method | Path | Format | Authentication | | - | - | - | - | | POST | `https://your-webhook-url/callback` | json | HMAC SHA512 Signature | SingaPay sends a `POST` request to your configured `payment_link_inquiry_notif_url` when: * A customer opens or views a payment link (`payment_link.inquiry`) * A payment link history record expires (`payment_link.inquiry.expired`) > [!NOTE] > > **Separate URL:** Unlike money-in transaction webhooks on `transaction_notif_url`, inquiry events use a dedicated `payment_link_inquiry_notif_url`. If this URL is not configured, no inquiry webhooks are sent. For batch product expiration, see [Product Expiration](/api-reference/webhooks/product-expiration). For batch unpaid transaction expiration, see [Transaction Money-In Expiration](/api-reference/webhooks/transaction-moneyin-expiration). *** ## Request Details ### Headers | Field | Value | Type | Mandatory | Description | | - | - | - | :-: | - | | `Content-Type` | `application/json` | Alphabetic | Yes | Specifies JSON format for the request body | | `User-Agent` | `SingaPaymentGateway/1.0` | Alphabetic | Yes | Identifies the source of the webhook | | `Accept` | `application/json` | Alphabetic | Yes | Expected response format | | `X-PARTNER-ID` | — | Alphanumeric | Yes | Your API Key from the merchant dashboard | | `X-Signature` | — | Alphanumeric | Yes | HMAC SHA512 signature (128 chars) for request verification | | `X-Timestamp` | — | Numeric | Yes | Unix timestamp in **seconds** when the request was sent | | `Authorization` | `Bearer ` | Alphanumeric | Yes | System-generated random bearer token; used as a component in the signature | > [!NOTE] > > The `Authorization` token is a **randomly generated string** — not a user access token. This webhook is triggered by a system event (link opened or session expired), not a user API call. Extract the token as-is and use it in the string to sign. See [How to Validate Signature](#how-to-validate-signature) below. *** ### Body Parameters **status** `number` *required* HTTP status code. Example: `200` **success** `boolean` *required* Indicates whether the webhook was sent successfully. Example: `true` **event** `string` *required* Event type identifier. `payment_link.inquiry` when a link is opened; `payment_link.inquiry.expired` when a history session expires. **timestamp** `string` *required* Event timestamp in format `"d M Y H:i:s"`. Example: `"26 Dec 2025 13:35:45"` **data** `object` *required* Container for payment link and history details. **data fields** **payment\_link\_history** `object` *required* Current payment link history (this inquiry or transaction attempt). **payment\_link\_history fields** **id** `number` *required* Payment link history ID. Example: `12345` **reff\_no** `string` *required* Unique reference for this history. Example: `"PLH-20251226-ABC123"` **status** `string` *required* History status. E.g. `"pending"`, `"expired"`, `"paid"`, `"failed"` **amount** `object` *required* Transaction amount for this attempt. **amount fields** **value** `number` *required* Amount value. Example: `50000` **currency** `string` *required* ISO 4217 currency code. Example: `"IDR"` **vendor\_fee** `number` Vendor fee. `null` if not calculated yet. **our\_margin** `number` Platform margin. `null` if not calculated yet. **net\_amount** `number` Net amount. `null` if not calculated yet. **payment\_method\_name** `string` Selected payment method name. E.g. `"QRIS"`. `null` if not selected. **payment\_method\_value** `string` Payment method value. E.g. `"qris"`. `null` if not selected. **payment\_method\_additional** `object` Additional payment method info. `null` if none. **customer\_name** `string` Customer name. `null` if not provided yet. **customer\_email** `string` Customer email. `null` if not provided yet. **customer\_phone** `string` Customer phone. `null` if not provided yet. **ip\_address** `string` Customer IP address. Example: `"103.123.45.67"` **expired\_at** `string` History expiration time. Example: `"2025-12-26 14:35:45"` **created\_at** `string` *required* History creation time. **updated\_at** `string` *required* History last update time. **payment\_link** `object` *required* Parent payment link details (shared across inquiries). **payment\_link fields** **id** `number` *required* Payment link ID. Example: `678` **reff\_no** `string` *required* Payment link reference number. Example: `"PL-20251220-XYZ789"` **title** `string` *required* Payment link title. Example: `"Donasi Amal"` **description** `string` Payment link description. `null` if none. **status** `string` *required* Payment link status. Example: `"active"` **total\_amount** `object` *required* Payment link amount. **total\_amount fields** **value** `number` *required* Amount value. Example: `50000` **currency** `string` *required* ISO 4217 currency code. Example: `"IDR"` **max\_usage** `number` Maximum usage limit. `null` if unlimited. **current\_usage** `number` *required* Current usage count. Example: `25` **payment\_url** `string` *required* Full payment link URL. **required\_customer\_detail** `boolean` *required* Whether customer details are required at checkout. **expired\_at** `string` Payment link expiration. `null` if no expiry. **created\_at** `string` *required* Payment link creation time. **updated\_at** `string` *required* Payment link last update time. *** ### Payload Examples ```json Inquiry theme={null} { "status": 200, "success": true, "event": "payment_link.inquiry", "timestamp": "26 Dec 2025 13:35:45", "data": { "payment_link_history": { "id": 12345, "reff_no": "PLH-20251226-ABC123", "status": "pending", "amount": { "value": 50000, "currency": "IDR" }, "vendor_fee": null, "our_margin": null, "net_amount": null, "payment_method_name": null, "payment_method_value": null, "payment_method_additional": null, "customer_name": null, "customer_email": null, "customer_phone": null, "ip_address": "103.123.45.67", "expired_at": "2025-12-26 14:35:45", "created_at": "2025-12-26 13:35:45", "updated_at": "2025-12-26 13:35:45" }, "payment_link": { "id": 678, "reff_no": "PL-20251220-XYZ789", "title": "Donasi Amal", "description": "Donasi untuk kegiatan sosial", "status": "active", "total_amount": { "value": 50000, "currency": "IDR" }, "max_usage": 100, "current_usage": 25, "payment_url": "https://pay.singapay.id/pl/abc123", "required_customer_detail": true, "expired_at": "2025-12-31 23:59:59", "created_at": "2025-12-20 10:00:00", "updated_at": "2025-12-26 13:35:45" } } } ``` ```json Expired theme={null} { "status": 200, "success": true, "event": "payment_link.inquiry.expired", "timestamp": "26 Dec 2025 14:35:45", "data": { "payment_link_history": { "id": 12345, "reff_no": "PLH-20251226-ABC123", "status": "expired", "amount": { "value": 50000, "currency": "IDR" }, "vendor_fee": null, "our_margin": null, "net_amount": null, "payment_method_name": null, "payment_method_value": null, "payment_method_additional": null, "customer_name": null, "customer_email": null, "customer_phone": null, "ip_address": "103.123.45.67", "expired_at": "2025-12-26 14:35:45", "created_at": "2025-12-26 13:35:45", "updated_at": "2025-12-26 14:35:45" }, "payment_link": { "id": 678, "reff_no": "PL-20251220-XYZ789", "title": "Donasi Amal", "description": "Donasi untuk kegiatan sosial", "status": "active", "total_amount": { "value": 50000, "currency": "IDR" }, "max_usage": 100, "current_usage": 25, "payment_url": "https://pay.singapay.id/pl/abc123", "required_customer_detail": true, "expired_at": "2025-12-31 23:59:59", "created_at": "2025-12-20 10:00:00", "updated_at": "2025-12-26 14:35:45" } } } ``` *** *** ## Security and responses Return HTTP `200` promptly after validating the request. For retry behavior, see [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). Verify every webhook using [Security and signature validation](/api-reference/webhooks/security-and-signature). Use your configured callback path when building `StringToSign`. Handle duplicate deliveries idempotently using stable identifiers from the payload (for example `transaction_id` or `reff_no`). *** ## Payment Link Inquiry specific notes ### When to use this webhook > [card] Use when > > * Track views and engagement on payment links > * Monitor conversion (views vs completed payments) > * Alert when high-value links are accessed > * Detect abandonment when inquiry sessions expire > * Trigger follow-up when email was captured but payment was not completed > [card] Skip when > > * You only need completed payment notifications ([Payment Link Transaction](/api-reference/webhooks/payment-link)) > * You do not need view or inquiry tracking > * Simple payment links without analytics requirements ### Event types | Event | When it fires | | - | - | | `payment_link.inquiry` | Customer opens or views the payment link; creates a `payment_link_history` with status `pending` | | `payment_link.inquiry.expired` | Inquiry session timeout reached; `payment_link_history` status becomes `expired` | ### Data structure The payload contains two objects: 1. **`payment_link_history`** — This inquiry or payment attempt (unique per link open) 2. **`payment_link`** — Parent link configuration and usage counters (`current_usage` / `max_usage`) ```php Handle inquiry and expired events theme={null} = $maxUsage * 0.9) { sendAlert('Payment link is 90% full'); } } if ($payload['event'] === 'payment_link.inquiry.expired') { $historyReffNo = $payload['data']['payment_link_history']['reff_no']; logAbandonedPayment($historyReffNo); $email = $payload['data']['payment_link_history']['customer_email'] ?? null; if ($email !== null) { sendFollowUpEmail($email); } } ?> ``` ### Customer data handling Customer fields in `payment_link_history` may be `null` on initial inquiry and populated after the customer submits the form or selects a payment method. Always check for `null`: ```php theme={null} $customerName = $payload['data']['payment_link_history']['customer_name'] ?? 'Unknown'; $customerEmail = $payload['data']['payment_link_history']['customer_email']; if ($customerEmail !== null) { sendEmail($customerEmail, 'Thank you for viewing our payment link'); } $paymentMethod = $payload['data']['payment_link_history']['payment_method_name']; if ($paymentMethod !== null) { trackMethodSelection($paymentMethod); } ``` ### Timestamp format > [!WARNING] > > This webhook uses **human-readable datetime strings**, not Unix timestamps in the body. | Field | Format | Example | | - | - | - | | `timestamp` (root) | `d M Y H:i:s` | `26 Dec 2025 13:35:45` | | `payment_link_history.*_at` | `Y-m-d H:i:s` | `2025-12-26 13:35:45` | | `payment_link.*_at` | `Y-m-d H:i:s` | `2025-12-20 10:00:00` | For signature validation, use **`X-Timestamp`** (Unix seconds in the header), not the body `timestamp` field. ```php Parse body timestamps theme={null} $timestamp = $payload['timestamp']; // "26 Dec 2025 13:35:45" $date = DateTime::createFromFormat('d M Y H:i:s', $timestamp); // Carbon (Laravel) $date = \Carbon\Carbon::createFromFormat('d M Y H:i:s', $timestamp); ``` ### Access token format The `Authorization` header contains a **random system-generated token**, not a user JWT: ``` Authorization: Bearer a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6 ``` Extract it normally and include it in the string to sign. Validation uses your Client Secret as the HMAC key. ### Idempotency Use `payment_link_history.reff_no` to detect duplicate deliveries: ```php theme={null} $historyReffNo = $payload['data']['payment_link_history']['reff_no']; if (findInquiryByReffNo($historyReffNo)) { http_response_code(200); exit; } processNewInquiry($payload); ``` ### Usage tracking ```php theme={null} $paymentLink = $payload['data']['payment_link']; $currentUsage = $paymentLink['current_usage']; $maxUsage = $paymentLink['max_usage']; if ($maxUsage !== null) { $usagePercentage = ($currentUsage / $maxUsage) * 100; if ($usagePercentage >= 90) { sendAlert("Payment link '{$paymentLink['title']}' is at {$usagePercentage}% capacity"); } if ($currentUsage >= $maxUsage) { sendAlert("Payment link '{$paymentLink['title']}' has reached maximum usage"); } } ``` ### Expiration handling Both the payment link and individual history sessions can expire: ```php theme={null} $paymentLinkExpiredAt = $payload['data']['payment_link']['expired_at']; if ($paymentLinkExpiredAt !== null) { $expiryDate = DateTime::createFromFormat('Y-m-d H:i:s', $paymentLinkExpiredAt); if ($expiryDate < new DateTime()) { logExpiredLink($payload['data']['payment_link']['id']); } } $historyExpiredAt = $payload['data']['payment_link_history']['expired_at']; // When the current inquiry session will expire ``` # Product Expiration Webhook Source: https://docs.singapay.id/api-reference/webhooks/product-expiration Optional batch notifications when payment links, virtual accounts, or QRIS transactions expire. Track and clean up expired products in a single webhook call, or query product status via API for real-time updates. > [!NOTE] > > **Optional webhook** — This webhook is completely optional. Products expire normally without it. Configure `product_expiration_notif_url` only if you need batch expiration notifications for **products** (links, VAs, QR codes). For expired **unpaid transaction attempts**, see [Transaction Money-In Expiration](/api-reference/webhooks/transaction-moneyin-expiration). ## Information | Method | Path | Format | Authentication | | - | - | - | - | | POST | `https://your-webhook-url/callback` | json | HMAC SHA512 Signature | SingaPay sends a `POST` request to your configured `product_expiration_notif_url` when payment products reach their expiration time. Unlike transaction webhooks, this is a **batch notification** that can include multiple expired products in a single call. > [!NOTE] > > **Batch notification:** One webhook may contain expired Payment Links, Virtual Accounts, and QRIS transactions together. Arrays can be empty when no products of that type expired. If `product_expiration_notif_url` is not configured, no expiration webhooks are sent. *** ## Request Details ### Headers | Field | Value | Type | Mandatory | Description | | - | - | - | :-: | - | | `Content-Type` | `application/json` | Alphabetic | Yes | Specifies JSON format for the request body | | `User-Agent` | `SingaPaymentGateway/1.0` | Alphabetic | Yes | Identifies the source of the webhook | | `Accept` | `application/json` | Alphabetic | Yes | Expected response format | | `X-PARTNER-ID` | — | Alphanumeric | Yes | Your API Key from the merchant dashboard | | `X-Signature` | — | Alphanumeric | Yes | HMAC SHA512 signature (128 chars) for request verification | | `X-Timestamp` | — | Numeric | Yes | Unix timestamp in **seconds** when the request was sent | | `Authorization` | `Bearer ` | Alphanumeric | Yes | System-generated random bearer token; used as a component in the signature | > [!NOTE] > > The `Authorization` token is a **randomly generated string** — not a user access token. This webhook is triggered by the system's scheduled expiration checker, not a user API call. Extract the token as-is and use it in the string to sign. See [How to Validate Signature](#how-to-validate-signature) below. *** ### Body Parameters **status** `number` *required* HTTP status code. Example: `200` **success** `boolean` *required* Indicates whether the webhook was sent successfully. Example: `true` **event** `string` *required* Event type identifier. Always `"product_expiration"` for this webhook. **timestamp** `string` *required* Event timestamp in format `"d M Y H:i:s"`. Example: `"26 Dec 2025 14:00:00"` **merchant** `object` *required* Merchant information. **merchant fields** **id** `number` *required* Merchant ID. Example: `123` **name** `string` *required* Merchant name. Example: `"PT Example Indonesia"` **data** `object` *required* Container for expired products. Each array is always present and may be empty. **data fields** **payment\_links** `array` *required* Expired payment links. **payment\_links item fields** **id** `number` *required* Payment link ID. **reff\_no** `string` *required* Payment link reference number. **title** `string` *required* Payment link title. **status** `string` *required* Status. Should be `"expired"`. **expired\_at** `string` *required* Expiration datetime (`Y-m-d H:i:s`). **virtual\_accounts** `array` *required* Expired virtual accounts. **virtual\_accounts item fields** **id** `number` *required* Virtual account ID. **reff\_no** `string` *required* VA reference number. **virtual\_account\_number** `string` *required* Virtual account number (16 digits). **status** `string` *required* Status. Should be `"expired"`. **expired\_at** `string` *required* Expiration datetime (`Y-m-d H:i:s`). **qris\_transactions** `array` *required* Expired QRIS transactions. **qris\_transactions item fields** **id** `number` *required* QRIS transaction ID. **reff\_no** `string` *required* QRIS reference number. **nmid** `string` *required* NMID (merchant identifier for QRIS). **status** `string` *required* Status. Should be `"expired"`. **expired\_at** `string` *required* Expiration datetime (`Y-m-d H:i:s`). **summary** `object` *required* Summary counts for the batch. **summary fields** **total\_expired** `number` *required* Total count of all expired products. **payment\_links\_count** `number` *required* Count of expired payment links. **virtual\_accounts\_count** `number` *required* Count of expired virtual accounts. **qris\_transactions\_count** `number` *required* Count of expired QRIS transactions. *** ### Payload Examples ```json Batch — Multiple Types theme={null} { "status": 200, "success": true, "event": "product_expiration", "timestamp": "26 Dec 2025 14:00:00", "merchant": { "id": 123, "name": "PT Example Indonesia" }, "data": { "payment_links": [ { "id": 456, "reff_no": "PL-20251220-XYZ789", "title": "Donasi Amal", "status": "expired", "expired_at": "2025-12-26 14:00:00" }, { "id": 457, "reff_no": "PL-20251221-ABC123", "title": "Pembayaran Tagihan", "status": "expired", "expired_at": "2025-12-26 14:00:00" } ], "virtual_accounts": [ { "id": 789, "reff_no": "VA-20251226-ABC123", "virtual_account_number": "7872955146576837", "status": "expired", "expired_at": "2025-12-26 14:00:00" }, { "id": 790, "reff_no": "VA-20251226-DEF456", "virtual_account_number": "7872955146576838", "status": "expired", "expired_at": "2025-12-26 14:00:00" }, { "id": 791, "reff_no": "VA-20251226-GHI789", "virtual_account_number": "7872955146576839", "status": "expired", "expired_at": "2025-12-26 14:00:00" } ], "qris_transactions": [ { "id": 321, "reff_no": "QRIS-20251226-DEF456", "nmid": "ID1234567890123", "status": "expired", "expired_at": "2025-12-26 14:00:00" } ] }, "summary": { "total_expired": 6, "payment_links_count": 2, "virtual_accounts_count": 3, "qris_transactions_count": 1 } } ``` ```json Single Type — Virtual Accounts Only theme={null} { "status": 200, "success": true, "event": "product_expiration", "timestamp": "26 Dec 2025 14:00:00", "merchant": { "id": 123, "name": "PT Example Indonesia" }, "data": { "payment_links": [], "virtual_accounts": [ { "id": 789, "reff_no": "VA-20251226-ABC123", "virtual_account_number": "7872955146576837", "status": "expired", "expired_at": "2025-12-26 14:00:00" } ], "qris_transactions": [] }, "summary": { "total_expired": 1, "payment_links_count": 0, "virtual_accounts_count": 1, "qris_transactions_count": 0 } } ``` *** *** ## Security and responses Return HTTP `200` promptly after validating the request. For retry behavior, see [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). Verify every webhook using [Security and signature validation](/api-reference/webhooks/security-and-signature). Use your configured callback path when building `StringToSign`. Handle duplicate deliveries idempotently using stable identifiers from the payload (for example `transaction_id` or `reff_no`). *** ## Product expiration specific notes ### When to use this webhook > [card] Use when > > * Automated cleanup of expired products in your system > * Customer notifications for expired payment links or VAs > * Expiration analytics and operational reporting > * Trigger re-engagement flows (new links, new VAs) > * Alert operations on high expiration volumes > [card] Skip when > > * You poll product status via API on demand > * Manual monitoring is sufficient > * You need real-time expiration handling (use product APIs or individual webhooks) ### Batch notification This webhook is unique: it batches multiple expired products into one call. * **Multiple product types** — Payment Links, Virtual Accounts, and QRIS in one payload * **Multiple items per type** — Each array can contain many records * **Scheduled execution** — Triggered by a system cron job, not real-time * **Efficient** — Fewer webhook calls than one notification per product > [!WARNING] > > Do not rely on this webhook for real-time expiration. There may be a delay between expiration and notification. For immediate handling, poll product status via API. ### Processing batch webhooks ```php Process all expired products theme={null} 100) { alertHighExpirationRate($totalExpired); } http_response_code(200); echo json_encode(['status' => 'success']); ?> ``` ### Product types included | Array | Product | Key fields | Typical action | | - | - | - | - | | `data.payment_links` | Payment link pages | `id`, `reff_no`, `title`, `expired_at` | Resend or create new links | | `data.virtual_accounts` | Temporary and permanent VAs | `id`, `reff_no`, `virtual_account_number`, `expired_at` | Archive VA numbers, notify customers | | `data.qris_transactions` | QRIS payment transactions | `id`, `reff_no`, `nmid`, `expired_at` | Update lifecycle status | ### Simplified payload The webhook sends **minimal fields** per product to keep batch payloads manageable. The following are **not** included: * Amount, currency, payment URL, usage counts * Bank code (VAs), QR string (QRIS) * Created or updated timestamps Use `id` or `reff_no` to fetch full details via the product API when needed. ### Timestamp format | Field | Format | Example | | - | - | - | | `timestamp` (root) | `d M Y H:i:s` | `26 Dec 2025 14:00:00` | | `expired_at` (per product) | `Y-m-d H:i:s` | `2025-12-26 14:00:00` | For signature validation, use **`X-Timestamp`** (Unix seconds in the header), not the body `timestamp` field. ```php Parse timestamps theme={null} $timestamp = $payload['timestamp']; $date = DateTime::createFromFormat('d M Y H:i:s', $timestamp); $expiredAt = $payload['data']['payment_links'][0]['expired_at'] ?? null; if ($expiredAt) { $expiry = DateTime::createFromFormat('Y-m-d H:i:s', $expiredAt); } ``` ### Access token format The `Authorization` header contains a **random system-generated token**, not a user JWT. Extract it normally and include it in the string to sign. ### Idempotency Use a batch-level identifier to avoid reprocessing the same scheduled run: ```php theme={null} $webhookId = $payload['event'] . '_' . $payload['merchant']['id'] . '_' . strtotime($payload['timestamp']); if (isWebhookProcessed($webhookId)) { http_response_code(200); exit; } processExpirationBatch($payload); markWebhookProcessed($webhookId); ``` ### Summary statistics ```php theme={null} $summary = $payload['summary']; logExpirationBatch([ 'total' => $summary['total_expired'], 'payment_links' => $summary['payment_links_count'], 'vas' => $summary['virtual_accounts_count'], 'qris' => $summary['qris_transactions_count'], 'timestamp' => $payload['timestamp'], ]); if ($summary['total_expired'] > 50) { sendAlert("High expiration rate: {$summary['total_expired']} products expired"); } if ($summary['payment_links_count'] > $summary['total_expired'] * 0.7) { alertTeam('Most expirations are payment links — review expiration settings'); } ``` ### Scheduling and timing * Triggered by a **system cron job** (typically hourly or daily — confirm schedule with SingaPay support) * Batches all products that expired since the last check * Not real-time — plan for a delay between expiration and notification ### Use cases **Automated cleanup** — Archive expired VAs and remove them from active lists. **Customer re-engagement** — Follow up when payment links expire; issue new links where appropriate. **Analytics** — Generate expiration reports using `summary` counts by product type. **Operations monitoring** — Alert when `total_expired` exceeds historical averages. # QRIS Acquirer Webhook Source: https://docs.singapay.id/api-reference/webhooks/qris-acquirer Real-time notifications for QRIS payment transactions processed through the SingaPay platform. Monitor payment events and keep your system in sync instantly. > [!NOTE] > > **Money In Operation** — This webhook fires when a customer completes a QRIS payment, transferring funds into your SingaPay account. ## Information | Method | Path | Format | Authentication | | - | - | - | - | | POST | `https://your-webhook-url/callback` | json | HMAC SHA512 Signature | SingaPay sends a `POST` request to your configured `transaction_notif_url` when a QRIS transaction is successfully processed. > [!NOTE] > > This webhook may share a callback URL with other event types. See [Shared webhook endpoints](/api-reference/webhooks/shared-endpoints) for routing by `event` value. *** ## Request Details ### Headers | Field | Value | Type | Mandatory | Description | | - | - | - | :-: | - | | `Content-Type` | `application/json` | Alphabetic | Yes | Specifies JSON format for the request body | | `User-Agent` | `SingaPaymentGateway/1.0` | Alphabetic | Yes | Identifies the source of the webhook | | `Accept` | `application/json` | Alphabetic | Yes | Expected response format | | `X-PARTNER-ID` | — | Alphanumeric | Yes | Your API Key from the merchant dashboard | | `X-Signature` | — | Alphanumeric | Yes | HMAC SHA512 signature (128 chars) for request verification | | `X-Timestamp` | — | Numeric | Yes | Unix timestamp in **seconds** when the request was sent | | `Authorization` | `Bearer ` | Alphanumeric | Yes | System-generated random bearer token; used as a component in the signature | > [!NOTE] > > The `Authorization` token for QRIS webhooks is a **randomly generated string** — not a user access token. This webhook is triggered by a bank payment notification (system event), not a user action. Extract the token as-is from the header and use it in the string to sign. See [How to Validate Signature](#how-to-validate-signature) below. *** ### Body Parameters **status** `number` *required* HTTP Status Code. Example: `200` **success** `boolean` *required* Indicates if the transaction was successful. Example: `true` **event** `string` *required* Event type identifier. Always `"qris-acquirer-transaction"` for this webhook. **timestamp** `string` *required* Event timestamp in format `"d M Y H:i:s"`. Example: `"26 Dec 2025 13:31:59"` **data** `object` *required* Container for transaction, customer, and payment details. **data fields** **transaction** `object` *required* Transaction details. **transaction fields** **id** `integer` *required* Unique transaction ID. Example: `42` **reff\_no** `string` *required* Unique transaction reference number (28 chars). Example: `"6601K62BH34X445J046C4W5249E6"` **merchant\_reff\_no** `string` Optional merchant reference number for tracing. Example: `"INV-2026-001"` **type** `string` *required* Transaction type. Always `"qris"` for QRIS transactions. **status** `string` *required* Transaction status. Always `"paid"` for this webhook. **amount** `object` *required* Base transaction amount before tip. **amount fields** **value** `number` *required* Base transaction amount. Example: `1000123` **currency** `string` *required* ISO 4217 currency code. Example: `"IDR"` **tip** `object` *required* Tip amount details. **tip fields** **value** `number` *required* Tip amount. `0` if no tip. Example: `0` **currency** `string` *required* ISO 4217 currency code. Example: `"IDR"` **total\_amount** `object` *required* Total amount including tip (`amount + tip`). **total\_amount fields** **value** `number` *required* Total transaction amount. Example: `1000123` **currency** `string` *required* ISO 4217 currency code. Example: `"IDR"` **post\_timestamp** `string` *required* Transaction post time. Example: `"26 Dec 2025 13:31:59"` **processed\_timestamp** `string` *required* Transaction processed time. Example: `"26 Dec 2025 13:31:59"` **customer** `object` *required* Customer details. **customer fields** **id** `string` *required* Customer unique ID (26 chars). Example: `"01K2KVRQQP45234X9T3YWG1FKT"` **name** `string` *required* Customer full name. Example: `"Moh. Zulkifli Katili"` **email** `string` *required* Customer email address. Example: `"tes@gmail.com"` **phone** `string` *required* Customer phone number. Example: `"08123993201"` **payment** `object` *required* Payment method details. **payment fields** **method** `string` *required* Payment method. Always `"qris"`. **additional\_info** `object` *required* QRIS-specific payment information. **additional\_info fields** **qr\_string** `string` *required* Raw QRIS string data used for payment. Example: `"00020101021226570015ID.SINGAPAY.WWW..."` **payment\_event\_id** `number` *required* Internal payment event ID for tracking. Example: `12345` *** ### Payload Example ```json Success theme={null} { "status": 200, "success": true, "event": "qris-acquirer-transaction", "timestamp": "26 Dec 2025 13:31:59", "data": { "transaction": { "id": 42, "reff_no": "6601K62BH34X445J046C4W5249E6", "merchant_reff_no": "INV-2026-001", "type": "qris", "status": "paid", "amount": { "value": 1000123, "currency": "IDR" }, "tip": { "value": 0, "currency": "IDR" }, "total_amount": { "value": 1000123, "currency": "IDR" }, "post_timestamp": "26 Dec 2025 13:31:59", "processed_timestamp": "26 Dec 2025 13:31:59" }, "customer": { "id": "01K2KVRQQP45234X9T3YWG1FKT", "name": "Moh. Zulkifli Katili", "email": "tes@gmail.com", "phone": "08123993201" }, "payment": { "method": "qris", "additional_info": { "qr_string": "00020101021226570015ID.SINGAPAY.WWW01110508140001102122183098102390303UMI51440014ID.CO.QRIS.WWW02157434441747371980303UMI520472315303360540710001235802ID5916PT TARSIUS TAHIR6009Tangerang6105544786253051017588683110703C0108286601K62BH34X445J046C4W5249E663045FC6", "payment_event_id": 12345 } } } } ``` *** *** ## Security and responses Return HTTP `200` promptly after validating the request. For retry behavior, see [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). Verify every webhook using [Security and signature validation](/api-reference/webhooks/security-and-signature). Use your configured callback path when building `StringToSign`. Handle duplicate deliveries idempotently using stable identifiers from the payload (for example `transaction_id` or `reff_no`). # QRIS Issuer Webhook Source: https://docs.singapay.id/api-reference/webhooks/qris-issuer Real-time notifications when a QRIS Issuer (money out) transaction completes or fails. Track success and failure outcomes for QRIS issuer payments via the shared disbursement_notif_url. > [!NOTE] > > **Money Out Operation** — This webhook fires when a QRIS Issuer transaction is completed (success or failed), transferring funds from your SingaPay account to a merchant via QRIS. ## Information | Method | Path | Format | Authentication | | - | - | - | - | | POST | `https://your-webhook-url/callback` | json | HMAC SHA512 Signature | SingaPay sends a `POST` request to your configured `disbursement_notif_url` when a QRIS Issuer transaction is completed (success or failed). > [!NOTE] > > This webhook may share a callback URL with other event types. See [Shared webhook endpoints](/api-reference/webhooks/shared-endpoints) for routing by `event` value. *** ## Request Details ### Headers | Field | Value | Type | Mandatory | Description | | - | - | - | :-: | - | | `Content-Type` | `application/json` | Alphabetic | Yes | Specifies JSON format for the request body | | `User-Agent` | `SingaPaymentGateway/1.0` | Alphabetic | Yes | Identifies the source of the webhook | | `Accept` | `application/json` | Alphabetic | Yes | Expected response format | | `X-PARTNER-ID` | — | Alphanumeric | Yes | Your API Key from the merchant dashboard | | `X-Signature` | — | Alphanumeric | Conditional | HMAC SHA512 signature (128 chars). Included when signature security is enabled | | `X-Timestamp` | — | Numeric | Conditional | Unix timestamp in **seconds**. Included when signature security is enabled | | `Authorization` | `Bearer ` | Alphanumeric | Conditional | JWT bearer token; included when signature security is enabled | > [!NOTE] > > Signature-related headers (`X-Signature`, `X-Timestamp`, `Authorization`) are included when your merchant account has API credentials configured and signature security is enabled. When enabled, extract the access token from the `Authorization` header and use it as-is in the string to sign. See [How to Validate Signature](#how-to-validate-signature) below. *** ### Body Parameters **response\_code** `string` *required* Response code. See [Appendix 01 — Response Codes](#01-response-codes). Example: `SP000` **response\_message** `string` *required* Human-readable response message. Example: `Successful` **event** `string` *required* Transaction type identifier. Always `"qris-issuer"` for this webhook. Use this to distinguish from `"disbursement"` and `"ewallet-topup"` on the shared URL. **data** `object` *required* Response payload object. **data fields** **transaction\_id** `string` *required* System-generated transaction ID. Example: `"112220251111135424691"` **reference\_number** `string` *required* Your unique merchant reference number. Example: `"123456789123"` **transaction\_status** `object` *required* Transaction status object. See [Appendix 02 — Transaction Status](#02-transaction-status). **transaction\_status fields** **code** `string` *required* Status code. E.g. `"00"` (Success), `"06"` (Failed) **desc** `string` *required* Status description. E.g. `"Success"`, `"Failed"` **post\_timestamp** `string` *required* Transaction creation time in Unix **milliseconds**. Example: `"1762844064000"` **processed\_timestamp** `string` Processing completion time in Unix **milliseconds**. Empty string if the transaction failed. **qr\_data** `string` *required* The raw EMVCo string encoded in the QR code image. **type** `string` *required* QR code type. E.g. `"mpm"`, `"cpm"`, `"mpm-dynamic"`, `"mpm-static"` **scope** `string` *required* QR code scope. E.g. `"issuer"`, `"acquirer"` **gross\_amount** `object` *required* Total amount including fees. **gross\_amount fields** **currency** `string` *required* ISO 4217 currency code. Example: `"IDR"` **value** `string` *required* Gross amount value. Example: `"21500.00"` **fee** `object` *required* Transfer fee details. **fee fields** **name** `string` Fee description. Example: `"Transfer Fee"` **currency** `string` *required* ISO 4217 currency code. **value** `string` *required* Fee amount. Example: `"500.00"` **net\_amount** `object` *required* Amount paid to the merchant (`gross_amount − fee`). **net\_amount fields** **currency** `string` *required* ISO 4217 currency code. **value** `string` *required* Net amount value. Example: `"21000.00"` **balance\_after** `object` *required* Your account balance after the transaction. Both fields are `null` for failed transactions. **balance\_after fields** **currency** `string` ISO 4217 currency code. `null` if failed. **value** `string` Balance value. `null` if failed. Example: `"120000.00"` **rrn** `string` Retrieval Reference Number issued by the QRIS switching network. Used for reconciliation with the acquirer/switcher. Empty string if the transaction failed. Example: `"9f3kd82p1a77"` **failed\_code** `string` Error code. Only present when the transaction failed. Example: `"CONNECTION_ERROR"` **failed\_reason** `string` Human-readable error description. Only present when the transaction failed. Example: `"Connection timeout to vendor"` *** ### Payload Examples ```json Success theme={null} { "response_code": "SP000", "response_message": "Successfully", "event": "qris-issuer", "data": { "transaction_id": "912042026071011453372901847", "reference_number": "INVQR-20260710-00931", "transaction_status": { "code": "00", "desc": "Success" }, "post_timestamp": "1783650123000", "processed_timestamp": "1783650124512", "qr_data": "00020101021226620015ID.SINGAPAY.WWW0118936011122334450002021035224094080303UME51440014ID.CO.QRIS.WWW02153559174130998870303UME5204601153033605405150005802ID5903eos6005DEPOK6105746786221051017730486640703C0163044A21", "type": "mpm-dynamic", "scope": "issuer", "gross_amount": { "currency": "IDR", "value": "50750" }, "fee": { "currency": "IDR", "value": "750" }, "net_amount": { "currency": "IDR", "value": "50000" }, "balance_after": { "currency": "IDR", "value": "184320450.00" }, "rrn": "9f3kd82p1a77" } } ``` ```json Failed theme={null} { "response_code": "SP001", "response_message": "Transaction Failure", "event": "qris-issuer", "data": { "transaction_id": "912042026071011453372901848", "reference_number": "INVQR-20260710-00932", "transaction_status": { "code": "06", "desc": "Failed" }, "post_timestamp": "1783650321000", "processed_timestamp": "", "qr_data": "00020101021226620015ID.SINGAPAY.WWW0118936011122334450002021035224094080303UME51440014ID.CO.QRIS.WWW02153559174130998870303UME5204601153033605405150005802ID5903eos6005DEPOK6105746786221051017730486640703C0163044A21", "type": "mpm-dynamic", "scope": "issuer", "gross_amount": { "currency": "IDR", "value": "50750" }, "fee": { "currency": "IDR", "value": "750" }, "net_amount": { "currency": "IDR", "value": "50000" }, "balance_after": { "currency": null, "value": null }, "rrn": "", "failed_code": "CONNECTION_ERROR", "failed_reason": "Connection timeout to vendor" } } ``` *** *** ## Security and responses Return HTTP `200` promptly after validating the request. For retry behavior, see [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). Verify every webhook using [Security and signature validation](/api-reference/webhooks/security-and-signature). Use your configured callback path when building `StringToSign`. Handle duplicate deliveries idempotently using stable identifiers from the payload (for example `transaction_id` or `reff_no`). *** ## QRIS Issuer specific notes ### Idempotency Each `reference_number` can only be used once per account. If you retry with the same `reference_number`, you'll receive the existing transaction status rather than creating a duplicate payment. ```php Detecting Duplicate Webhooks theme={null} $referenceNumber = $payload['data']['reference_number']; $existingTransaction = findTransactionByReference($referenceNumber); if ($existingTransaction) { // Already processed — return 200 without re-processing http_response_code(200); exit; } processQrisIssuerPayment($payload); ``` ### Timestamp Formats > [!WARNING] > > QRIS Issuer webhooks use **two different timestamp formats**. Don't mix them up. | Field | Format | Example | Notes | | - | - | - | - | | `X-Timestamp` header | Unix seconds | `1695711945` | Used for signature validation | | `post_timestamp` (body) | Unix milliseconds | `1762844064000` | Divide by 1000 to convert | | `processed_timestamp` (body) | Unix milliseconds | `1762844065000` | Empty string if transaction failed | When validating signatures, always use the **X-Timestamp header value** (in seconds), not the timestamps from the request body (which are in milliseconds). ```php Converting millisecond timestamps theme={null} $postTimestamp = $payload['data']['post_timestamp']; // "1762844064000" $date = new DateTime(); $date->setTimestamp((int)($postTimestamp / 1000)); // Or with Carbon (Laravel) $date = \Carbon\Carbon::createFromTimestampMs($postTimestamp); ``` ### Balance Tracking The `balance_after` field shows your account balance after the transaction: * For **successful** transactions: remaining balance after deduction * For **failed** transactions: both `currency` and `value` are `null` (no balance change) * Use this to verify balance consistency with your system * All amounts are in IDR (Indonesian Rupiah) ```php Balance Consistency Check theme={null} if ($payload['data']['transaction_status']['code'] === '00') { $balanceAfter = (float)$payload['data']['balance_after']['value']; $grossAmount = (float)$payload['data']['gross_amount']['value']; $expectedBalance = $previousBalance - $grossAmount; if (abs($balanceAfter - $expectedBalance) > 0.01) { logBalanceDiscrepancy($transactionId, $expectedBalance, $balanceAfter); } } ``` *** ## Appendix ### 01: Response Codes | Code | Message | Description | Action | | - | - | - | - | | `SP000` | Successfully | Success | Check inquiry status | | `SP001` | Transaction Failure | Failed transaction | Check inquiry status | | `SP002` | General Failure | Internal server error | Check inquiry status | | `SP003` | Insufficient Balance | Account balance too low | Check inquiry status | | `SP004` | Duplicate Reference Number | Reference already used | — | | `SP005` | Timeout | Gateway timeout | Check inquiry status | | `SP006` | Exceed Beneficiary Limit | Beneficiary amount limit reached | Check inquiry status | | `SP007` | Exceed Account Limit | Account transaction limit reached | Contact IT Support | | `SP008` | Invalid Reference Number | Reference does not exist | — | | `SP009` | Transaction Not Found | Transaction not found | — | | `SP010` | Beneficiary Account Not Found | Account not found | — | | `SP011` | Beneficiary Vendor Not Active | Vendor not active | — | | `SP012` | Bad Request | Bad request | — | | `SP013` | Unauthorized | Unauthorized | — | | `SP014` | Not Found | Not found | — | | `SP015` | Forbidden | Forbidden | — | | `SP016` | Signature Invalid | Signature invalid | — | | `SP017` | Unauthorized IP | IP not authorized | Contact IT Support | | `SP018` | Validation Error | Payload validation error | — | | `SP019` | General Error | General error | Contact IT Support | | `SP020` | Merchant Account Not Found | Merchant account not found | — | ### 02: Transaction Status | Code | Status | Notes | | :-: | - | - | | `00` | Success | Transaction completed successfully | | `01` | Initiated | Payment call not yet received; retry is possible | | `02` | Paying | Pending/Suspect — retry status check in a few minutes; awaiting final callback | | `03` | Pending | Pending/Suspect — retry status check in a few minutes; awaiting final callback | | `04` | Refunded | Reversal transaction | | `05` | Canceled | Create a new transaction | | `06` | Failed | Transaction failed | | `07` | Not Found | Create a new transaction | # Webhook Retry Mechanism Source: https://docs.singapay.id/api-reference/webhooks/retry-mechanism Singapay automatically retries failed webhook deliveries to ensure reliable communication between our system and your server. When Singapay sends a webhook to your endpoint and does not receive a valid response, the system will automatically retry the delivery. Retries are designed to handle temporary disruptions such as timeouts, server downtime, or connection errors. > [!NOTE] > > Each retry is performed with a **1-minute interval** between attempts. If all retries are exhausted, a failure notification will be sent to your registered merchant email. ## Retry Rules by HTTP Status The number of retry attempts depends on the HTTP response status returned by your endpoint. | HTTP Status / Condition | Handler | Max Retries | Description | | - | - | - | - | | `500` Internal Server Error | `handleFailedHttpResponse()` | 1 | Your server encountered an internal error. | | `503` Service Unavailable | `handleFailedHttpResponse()` | 4 | Your server is temporarily unreachable. | | `400` / `404` Bad Request / Not Found | `handleFailedHttpResponse()` | 2 | Endpoint may be incorrect or temporarily unavailable. | | `307` / `308` Temporary / Permanent Redirect | `retryRedirect()` | 5 | Redirects are followed up to 5 times. | | `301` / `302` / `303` Redirect | `handleFailedHttpResponse()` | 0 | Redirects are **not** followed — update your endpoint URL. | | Exception (cURL error, timeout, DNS) | `catch(Exception $e)` | 1 | Connection-level failures. | | Other (default) | `handleFailedHttpResponse()` | 5 | All other status codes not listed above. | > [!WARNING] > > Redirects via `301`, `302`, or `303` will **not** be followed and receive **zero retries**. Make sure your webhook URL points directly to the correct endpoint. ## Retry Interval > [card] Interval Between Retries > > Each retry attempt is made **1 minute** after the previous one. Retries stop once the maximum limit for that status code is reached. > [card] Retry Cache TTL > > Retry counts are stored in cache with a **15-minute TTL**. All attempts are logged to our database for auditing. ## Example: HTTP 503 Retry Flow Here's what happens when your endpoint consistently returns `503`: **1. Attempt #1** Singapay sends the webhook. Your server responds `503`. System schedules a retry in 1 minute. **2. Attempt #2** First retry. Still `503`. Another retry scheduled in 1 minute. **3. Attempt #3** Second retry. Still `503`. Another retry scheduled. **4. Attempt #4 (Final)** Third and final retry. Still `503`. No more retries. Failure logged and notification email sent. > [!NOTE] > > Total maximum delivery time for a `503` scenario: approximately **4 minutes** across all attempts. ## What Happens After All Retries Fail If the webhook cannot be delivered after all retry attempts: 1. The failure is **logged in the database** and visible via the Callback menu on your merchant dashboard. 2. A **failure notification email** is sent to your registered merchant email address. ## Best Practices > [card] Return 2xx > > Always respond with an HTTP status between `200–299` to acknowledge receipt. > [card] Stay Available > > Keep your webhook endpoint stable and publicly accessible at all times. > [card] Avoid Redirects > > Do not use redirect URLs (`301–308`) as your webhook endpoint. > [!TIP] > > Process webhooks asynchronously — return `200 OK` immediately and handle the payload in a background job to avoid timeouts. # Security and Signature Validation Source: https://docs.singapay.id/api-reference/webhooks/security-and-signature Verify SingaPay webhook authenticity using IP whitelisting and HMAC-SHA512 signature validation. Applies to all webhook types. All SingaPay webhooks use the same security model. Validate every incoming `POST` before processing the payload. ## Acknowledging webhooks Your endpoint must return an HTTP **2xx** response to acknowledge receipt. Return the response quickly and process the payload in a background job when possible. If your endpoint does not return a valid 2xx response, SingaPay retries delivery according to the rules in [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). ```json 200 OK — Success theme={null} { "status": "success" } ``` ```json 401 Unauthorized — Invalid Signature theme={null} { "status": "error", "message": "Invalid signature" } ``` ```json 500 Internal Server Error — Processing Error theme={null} { "status": "error", "message": "Failed to process webhook" } ``` > [!TIP] > > Process webhooks asynchronously — return `200 OK` immediately and handle the payload in a background job to avoid timeouts. *** ## Security mechanisms > [card] IP Whitelist > > Simplest approach. Restrict access to SingaPay's official IP addresses at the firewall or app level. > [card] Signature Validation > > Recommended. Cryptographically verify every request is authentic and untampered using HMAC-SHA512. > [card] Combined (Recommended) > > Maximum security. Layer IP whitelisting first (fast rejection), then validate signatures (integrity). | Approach | Best For | | - | - | | IP Whitelist only | Simple setup, testing environments | | Signature only | Higher security, good for testing signature logic | | **IP Whitelist + Signature** | **Production — industry best practice** | | IP + Signature + Timestamp validation | High-security requirements with replay attack protection | ### Option 1: IP Whitelist Configure your firewall or application to only accept requests from SingaPay's official IP addresses. Contact support or check your merchant dashboard for the official IP list. ```nginx Nginx theme={null} location /webhook/callback { allow 103.xxx.xxx.xxx; # Replace with actual IPs from SingaPay allow 103.xxx.xxx.xxx; deny all; proxy_pass http://your-backend; } ``` ```php PHP theme={null} 'error', 'message' => 'Access denied']); exit; } // Process webhook... ?> ``` ### Option 2: Signature Validation See [How to validate signature](#how-to-validate-signature) below. ### Option 3: Combined (maximum security) ```php PHP theme={null} ``` *** ## How to validate signature > [!NOTE] > > Signature validation is **optional** but **strongly recommended** for all production environments. The `X-Signature` header is an HMAC-SHA512 signature generated by SingaPay. The `ENDPOINT` value in the string to sign must match the **path and query string** of your configured webhook URL exactly (for example `/webhook/callback` or `/api/v1/webhooks/singapay`). ### Steps **1. Extract Headers** Pull these three values from the incoming request: * `X-Signature` — the signature to verify * `X-Timestamp` — Unix timestamp in seconds * `Authorization` — strip `"Bearer "` prefix to get the raw token **2. Get Your Client Secret** Retrieve your **Client Secret** from the merchant dashboard. This is your HMAC key. > [!WARNING] > > Never expose your Client Secret in client-side code or logs. Store it in environment variables or a secure vault. **3. Extract Endpoint Path** Include the full path with any query parameters. ```text theme={null} Full URL: https://yourdomain.com/webhook/callback?param=value Endpoint: /webhook/callback?param=value ``` **4. Normalize and Hash the Request Body** 1. Parse the raw JSON body 2. Sort all object keys **recursively and alphabetically** 3. Re-encode with `JSON_UNESCAPED_UNICODE` and `JSON_UNESCAPED_SLASHES` 4. Hash with **SHA-256** ```text theme={null} Original: {"status":200,"success":true,"data":{"transaction":{"reff_no":"123"}}} Sorted: {"data":{"transaction":{"reff_no":"123"}},"status":200,"success":true} SHA-256: 5f4dcc3b5aa765d61d8327deb882cf99... ``` **5. Build the String to Sign** Concatenate with `:` as the separator: ```text theme={null} StringToSign = METHOD:ENDPOINT:ACCESS_TOKEN:HASHED_BODY:TIMESTAMP Example: POST:/webhook/callback:a1b2c3d4e5f6...:5f4dcc3b...:1695711945 ``` **6. Generate the HMAC-SHA512 Signature** ```text theme={null} Calculated Signature = HMAC-SHA512(StringToSign, Client Secret) ``` **7. Compare Signatures (Constant-Time)** | Language | Function | | - | - | | PHP | `hash_equals()` | | Node.js | `crypto.timingSafeEqual()` | | Python | `hmac.compare_digest()` | ### Implementation examples ```php PHP theme={null} 'success']); } else { http_response_code(401); echo json_encode(['status' => 'error', 'message' => 'Invalid signature']); } ?> ``` ```python Python (Flask) theme={null} import hmac, hashlib, json, os from flask import Flask, request, jsonify app = Flask(__name__) def sort_dict_recursive(data): if isinstance(data, dict): return {k: sort_dict_recursive(v) for k, v in sorted(data.items())} elif isinstance(data, list): return [sort_dict_recursive(i) for i in data] return data def validate_webhook_signature(request_body, headers, client_secret, endpoint): received_signature = headers.get('X-Signature', '') timestamp = headers.get('X-Timestamp', '') access_token = headers.get('Authorization', '').replace('Bearer ', '') try: body_dict = json.loads(request_body) except json.JSONDecodeError: return False sorted_body = sort_dict_recursive(body_dict) normalized_json = json.dumps(sorted_body, ensure_ascii=False, separators=(',', ':')) hashed_body = hashlib.sha256(normalized_json.encode('utf-8')).hexdigest() string_to_sign = f"POST:{endpoint}:{access_token}:{hashed_body}:{timestamp}" calculated_sig = hmac.new( client_secret.encode('utf-8'), string_to_sign.encode('utf-8'), hashlib.sha512 ).hexdigest() return hmac.compare_digest(calculated_sig, received_signature) @app.route('/webhook/callback', methods=['POST']) def webhook_callback(): request_body = request.get_data(as_text=True) client_secret = os.environ['SINGAPAY_CLIENT_SECRET'] endpoint = '/webhook/callback' if validate_webhook_signature(request_body, dict(request.headers), client_secret, endpoint): return jsonify({'status': 'success'}), 200 return jsonify({'status': 'error', 'message': 'Invalid signature'}), 401 ``` ```javascript Node.js (Express) theme={null} const express = require('express'); const crypto = require('crypto'); const app = express(); app.use(express.json({ verify: (req, res, buf) => { req.rawBody = buf.toString('utf8'); } })); function sortObjectRecursive(obj) { if (typeof obj !== 'object' || obj === null) return obj; if (Array.isArray(obj)) return obj.map(sortObjectRecursive); return Object.keys(obj).sort().reduce((sorted, key) => { sorted[key] = sortObjectRecursive(obj[key]); return sorted; }, {}); } function validateWebhookSignature(requestBody, headers, clientSecret, endpoint) { const receivedSignature = headers['x-signature'] || ''; const timestamp = headers['x-timestamp'] || ''; const accessToken = (headers['authorization'] || '').replace('Bearer ', ''); let bodyObject; try { bodyObject = JSON.parse(requestBody); } catch (e) { return false; } const sortedBody = sortObjectRecursive(bodyObject); const normalizedJson = JSON.stringify(sortedBody); const hashedBody = crypto.createHash('sha256').update(normalizedJson).digest('hex'); const stringToSign = `POST:${endpoint}:${accessToken}:${hashedBody}:${timestamp}`; const calculatedSig = crypto.createHmac('sha512', clientSecret).update(stringToSign).digest('hex'); try { return crypto.timingSafeEqual( Buffer.from(calculatedSig), Buffer.from(receivedSignature) ); } catch { return false; } } app.post('/webhook/callback', (req, res) => { const clientSecret = process.env.SINGAPAY_CLIENT_SECRET; const endpoint = '/webhook/callback'; if (validateWebhookSignature(req.rawBody, req.headers, clientSecret, endpoint)) { res.status(200).json({ status: 'success' }); } else { res.status(401).json({ status: 'error', message: 'Invalid signature' }); } }); app.listen(3000); ``` ### Best practices and troubleshooting > [accordion] Do's > > * Always validate signatures before processing any webhook > * Use **constant-time comparison** (`hash_equals`, `timingSafeEqual`, `compare_digest`) to prevent timing attacks > * Validate `X-Timestamp` is within 5 minutes of current time to block replay attacks > * Use the **raw request body** for hashing — do not parse JSON first > * Store your Client Secret in environment variables or a secure vault > * Always use **HTTPS** for webhook endpoints > * Handle duplicate webhooks gracefully using stable IDs from the payload as idempotency keys > * Log all webhook requests (with signatures redacted) for audit purposes > [accordion] Common mistakes > > * Not sorting JSON keys before hashing (order matters) > * Using SHA-256 for the HMAC instead of SHA-512 (body = SHA-256; signature = SHA-512) > * Wrong separator in string to sign (must be `:`, not `_` or `-`) > * Using your API Key instead of your Client Secret > * Parsing JSON before hashing (always use the raw body) > * Using simple string comparison instead of constant-time comparison > * Wrong field order — must be `METHOD:ENDPOINT:TOKEN:HASH:TIMESTAMP` > * Forgetting to strip `"Bearer "` from the Authorization header > * Not including query parameters in the endpoint path > [accordion] Troubleshooting > > If signature validation fails, check in order: > > 1. **String to sign format** — `POST:ENDPOINT:ACCESS_TOKEN:HASHED_BODY:TIMESTAMP` > 2. **JSON normalization** — keys sorted recursively, correct encoding flags > 3. **Hash algorithms** — SHA-256 for body, SHA-512 for HMAC > 4. **HMAC key** — Client Secret, not API Key > 5. **Endpoint path** — exact match including query parameters > 6. **Timestamp** — valid Unix timestamp in seconds > 7. **Access token** — extracted from Authorization header, no `"Bearer "` prefix > 8. **Debug logging** — log `stringToSign`, `hashedBody`, `calculatedSignature` (dev only) *** ## Idempotency SingaPay may deliver the same webhook more than once if your endpoint returned a non-2xx response and a retry was scheduled. Use a stable identifier from the payload (such as `transaction_id`, `reff_no`, or `bill_number`) to detect duplicates and skip reprocessing. Return `200 OK` only after you have safely recorded the event (or confirmed it was already processed). # Settlement Notification Webhook Source: https://docs.singapay.id/api-reference/webhooks/settlement Real-time notifications when a settlement batch is completed, or when an individual settled transaction is refunded or has its refund cancelled. Keep your books in sync with what SingaPay has actually paid out. > [!NOTE] > > **Accounting Operation** — This webhook fires on settlement lifecycle events (completion, refund, refund cancellation). It reports money movements between your `pending_balance`, `available_balance`, and your bank account. ## Information | Method | Path | Format | Authentication | | - | - | - | - | | POST | `https://your-webhook-url/callback` | json | HMAC SHA512 Signature | SingaPay sends a `POST` request to your configured `settlement_notif_url` whenever a settlement batch reaches a final state, or when a settled transaction is refunded / has its refund cancelled. > [!NOTE] > > This webhook may share a callback URL with other event types. Always route by the `event` value in the body. See [Shared webhook endpoints](/api-reference/webhooks/shared-endpoints). *** ## Events This single webhook covers three settlement events, distinguished by the `event` field: | `event` | Fired when | `data` contains | | - | - | - | | `settlement.completed` | A settlement batch is completed — either a sequential settlement is **approved** by Finance, or a **parallel (auto) settlement** is created by the scheduler. | `settlement`, `total_transactions` | | `settlement.refunded` | A single settled transaction is **refunded** back from your balance (settlement method `balance` / `auto-balance` only). | `settlement`, `refund` | | `settlement.refund_cancelled` | A previous refund is **cancelled** and the balance is restored. | `settlement`, `refund` | > [!NOTE] > > Settlement currently supports **money-in** transactions only (Virtual Account, QRIS, Payment Link, E-Wallet). Refund events apply only to settlements using the `balance` or `auto-balance` method. *** ## Request Details ### Headers | Field | Value | Type | Mandatory | Description | | - | - | - | :-: | - | | `Content-Type` | `application/json` | Alphabetic | Yes | Specifies JSON format for the request body | | `User-Agent` | `SingaPaymentGateway/1.0` | Alphabetic | Yes | Identifies the source of the webhook | | `Accept` | `application/json` | Alphabetic | Yes | Expected response format | | `X-PARTNER-ID` | — | Alphanumeric | Yes | Your API Key from the merchant dashboard | | `X-Signature` | — | Alphanumeric | Yes | HMAC SHA512 signature (128 chars) for request verification | | `X-Timestamp` | — | Numeric | Yes | Unix timestamp in **seconds** when the request was sent | | `Authorization` | `Bearer ` | Alphanumeric | Yes | System-generated random bearer token; used as a component in the signature | > [!NOTE] > > The `Authorization` token for settlement webhooks is a **randomly generated string** — not a user access token. Settlement events are triggered by an admin approval, a scheduler, or a refund action (system events), not a user request. Extract the token as-is and use it in the string to sign. See [Security and signature validation](/api-reference/webhooks/security-and-signature). *** ### Body Parameters — common envelope Every settlement webhook shares the same top-level envelope: **status** `number` *required* HTTP Status Code. Always `200`. **success** `boolean` *required* Indicates a successful event. Always `true`. **event** `string` *required* Event type identifier. One of `"settlement.completed"`, `"settlement.refunded"`, `"settlement.refund_cancelled"`. **timestamp** `string` *required* Event timestamp in format `"d M Y H:i:s"`. Example: `"18 Jun 2026 10:00:00"` **data** `object` *required* Container for the settlement details (and, for refund events, the refund details). *** ### `data.settlement` (present on all events) **settlement** `object` *required* The settlement batch the event relates to. **settlement fields** **id** `integer` *required* Unique settlement ID. Example: `1234` **reference\_no** `string` *required* Settlement reference number. Format `SETTLEMENT-{merchant_id}-{uniqid}`. Example: `"SETTLEMENT-1-ABC123"` **title** `string` *required* Human-readable batch title. Example: `"Settlement Acme (01 Jun 2026 - 17 Jun 2026)"` **status** `string` *required* Settlement status. `"completed"` for completed settlements. **settlement\_type** `string` *required* Transaction scope of the batch. One of `"ALL"`, `"VA"`, `"QRIS"`, `"EWALLET"`. **settlement\_method** `string` *required* How funds were moved. One of `"balance"`, `"bank-account"`, `"auto-balance"`, `"e-wallet"`. **is\_auto\_created** `boolean` *required* `true` if this batch was created automatically by parallel (auto) settlement; `false` for sequential settlements approved by Finance. **start\_date** `string` *required* Start of the transaction date range covered. Format `"d M Y H:i:s"`. **end\_date** `string` *required* End of the transaction date range covered. Format `"d M Y H:i:s"`. **amount** `number` *required* Total **net** amount of the settled transactions. Example: `1000000` **total\_admin\_fee** `number` *required* Sum of admin fees across the batch. Example: `5000` **total\_vendor\_fee** `number` *required* Sum of payment-vendor fees across the batch. Example: `3000` **total\_our\_margin** `number` *required* Sum of SingaPay margin across the batch. Example: `2000` **settlement\_fee** `number` *required* Settlement transfer fee. Non-zero only for the `bank-account` method; `0` for all other methods. **total\_to\_transfer** `number` *required* Net amount transferred: `amount - settlement_fee`. Example: `1000000` **total\_refunded** `number` *required* Accumulated net amount that has been refunded from this settlement. Example: `0` **currency** `string` *required* ISO 4217 currency code. Always `"IDR"`. **transfer\_status** `string` Bank transfer status for the `bank-account` method: `"pending"`, `"success"`, or `"failed"`. `null` for all other methods. **approved\_by** `string` Who completed the settlement. The approver's name for sequential settlements, or `"SYSTEM"` for auto settlements. **approved\_at** `string` Timestamp the settlement was completed. Format `"d M Y H:i:s"`. **recipient** `object` *required* Destination bank account (populated only for the `bank-account` method; otherwise all fields are `null`). **recipient fields** **bank\_code** `string` Recipient bank code. Example: `"BRI"` **account\_number** `string` Recipient account number. **account\_name** `string` Recipient account holder name. *** ### `data.total_transactions` (`settlement.completed` only) **total\_transactions** `integer` *required* Number of transactions included in the completed settlement batch. Example: `5` *** ### `data.refund` (`settlement.refunded` & `settlement.refund_cancelled` only) **refund** `object` *required* Details of the individual transaction that was refunded or had its refund cancelled. **refund fields** **settlement\_detail\_id** `integer` *required* ID of the settlement detail row (the transaction's line within the batch). Example: `987` **transaction\_type** `string` *required* Class name of the underlying transaction. One of `"VATransaction"`, `"QrisTransaction"`, `"PaymentLinkHistory"`, `"EwalletTransaction"`, `"PaymentLinkingTransaction"`. **transaction\_id** `integer` *required* ID of the underlying transaction. Example: `42` **transaction\_reff** `string` *required* Reference of the underlying transaction. Example: `"INV-2026-001"` **account\_id** `integer` Account the balance movement applied to. May be `null`. **net\_amount** `object` *required* Net amount deducted (refund) or restored (refund cancelled). **net\_amount fields** **value** `number` *required* Net amount value. Example: `95000` **currency** `string` *required* ISO 4217 currency code. Always `"IDR"`. **is\_refunded** `boolean` *required* `true` once the detail has been refunded. Remains `true` even after a refund is cancelled. **is\_refund\_cancelled** `boolean` *required* `true` if the refund has been cancelled. `false` for an active refund. **refunded\_by** `string` Admin who performed the refund. May be `null`. **refunded\_at** `string` Timestamp the refund was performed. Format `"d M Y H:i:s"`. May be `null`. **refund\_cancelled\_by** `string` Admin who cancelled the refund. `null` for `settlement.refunded`. **refund\_cancelled\_at** `string` Timestamp the refund was cancelled. Format `"d M Y H:i:s"`. `null` for `settlement.refunded`. **actor** `string` The admin who triggered this specific event (refunder or canceller). May be `null`. *** ### Payload Examples ```json settlement.completed theme={null} { "status": 200, "success": true, "event": "settlement.completed", "timestamp": "18 Jun 2026 10:00:00", "data": { "settlement": { "id": 1234, "reference_no": "SETTLEMENT-1-ABC123", "title": "Settlement Acme (01 Jun 2026 - 17 Jun 2026)", "status": "completed", "settlement_type": "ALL", "settlement_method": "balance", "is_auto_created": false, "start_date": "01 Jun 2026 00:00:00", "end_date": "17 Jun 2026 23:59:59", "amount": 1000000, "total_admin_fee": 5000, "total_vendor_fee": 3000, "total_our_margin": 2000, "settlement_fee": 0, "total_to_transfer": 1000000, "total_refunded": 0, "currency": "IDR", "transfer_status": null, "approved_by": "Jane Finance", "approved_at": "18 Jun 2026 10:00:00", "recipient": { "bank_code": null, "account_number": null, "account_name": null } }, "total_transactions": 5 } } ``` ```json settlement.completed (bank-account) theme={null} { "status": 200, "success": true, "event": "settlement.completed", "timestamp": "18 Jun 2026 10:05:00", "data": { "settlement": { "id": 1240, "reference_no": "SETTLEMENT-1-XYZ789", "title": "Settlement Acme (17 Jun 2026 - 17 Jun 2026)", "status": "completed", "settlement_type": "VA", "settlement_method": "bank-account", "is_auto_created": false, "start_date": "17 Jun 2026 00:00:00", "end_date": "17 Jun 2026 23:59:59", "amount": 2000000, "total_admin_fee": 10000, "total_vendor_fee": 6000, "total_our_margin": 4000, "settlement_fee": 13000, "total_to_transfer": 1987000, "total_refunded": 0, "currency": "IDR", "transfer_status": "success", "approved_by": "Jane Finance", "approved_at": "18 Jun 2026 10:05:00", "recipient": { "bank_code": "BRI", "account_number": "1234567890", "account_name": "PT Acme Indonesia" } }, "total_transactions": 8 } } ``` ```json settlement.refunded theme={null} { "status": 200, "success": true, "event": "settlement.refunded", "timestamp": "19 Jun 2026 09:30:00", "data": { "settlement": { "id": 1234, "reference_no": "SETTLEMENT-1-ABC123", "title": "Settlement Acme (01 Jun 2026 - 17 Jun 2026)", "status": "completed", "settlement_type": "ALL", "settlement_method": "balance", "is_auto_created": false, "start_date": "01 Jun 2026 00:00:00", "end_date": "17 Jun 2026 23:59:59", "amount": 1000000, "total_admin_fee": 5000, "total_vendor_fee": 3000, "total_our_margin": 2000, "settlement_fee": 0, "total_to_transfer": 1000000, "total_refunded": 95000, "currency": "IDR", "transfer_status": null, "approved_by": "Jane Finance", "approved_at": "18 Jun 2026 10:00:00", "recipient": { "bank_code": null, "account_number": null, "account_name": null } }, "refund": { "settlement_detail_id": 987, "transaction_type": "VATransaction", "transaction_id": 42, "transaction_reff": "INV-2026-001", "account_id": 7, "net_amount": { "value": 95000, "currency": "IDR" }, "is_refunded": true, "is_refund_cancelled": false, "refunded_by": "Bob Admin", "refunded_at": "19 Jun 2026 09:30:00", "refund_cancelled_by": null, "refund_cancelled_at": null, "actor": "Bob Admin" } } } ``` ```json settlement.refund_cancelled theme={null} { "status": 200, "success": true, "event": "settlement.refund_cancelled", "timestamp": "19 Jun 2026 11:00:00", "data": { "settlement": { "id": 1234, "reference_no": "SETTLEMENT-1-ABC123", "title": "Settlement Acme (01 Jun 2026 - 17 Jun 2026)", "status": "completed", "settlement_type": "ALL", "settlement_method": "balance", "is_auto_created": false, "start_date": "01 Jun 2026 00:00:00", "end_date": "17 Jun 2026 23:59:59", "amount": 1000000, "total_admin_fee": 5000, "total_vendor_fee": 3000, "total_our_margin": 2000, "settlement_fee": 0, "total_to_transfer": 1000000, "total_refunded": 0, "currency": "IDR", "transfer_status": null, "approved_by": "Jane Finance", "approved_at": "18 Jun 2026 10:00:00", "recipient": { "bank_code": null, "account_number": null, "account_name": null } }, "refund": { "settlement_detail_id": 987, "transaction_type": "VATransaction", "transaction_id": 42, "transaction_reff": "INV-2026-001", "account_id": 7, "net_amount": { "value": 95000, "currency": "IDR" }, "is_refunded": true, "is_refund_cancelled": true, "refunded_by": "Bob Admin", "refunded_at": "19 Jun 2026 09:30:00", "refund_cancelled_by": "Bob Admin", "refund_cancelled_at": "19 Jun 2026 11:00:00", "actor": "Bob Admin" } } } ``` *** ## Security and responses Return HTTP `200` promptly after validating the request. For retry behavior, see [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). Verify every webhook using [Security and signature validation](/api-reference/webhooks/security-and-signature). Use your configured `settlement_notif_url` path when building `StringToSign`. Handle duplicate deliveries idempotently using stable identifiers from the payload — for `settlement.completed` use `data.settlement.reference_no`; for refund events combine `data.settlement.reference_no` with `data.refund.settlement_detail_id` (and the `event`). *** ## Settlement Specific Notes > [accordion] One callback URL, three events > > All three events are delivered to the same `settlement_notif_url`. Always branch on the `event` field. A `settlement.completed` payload has `total_transactions`; refund events have a `refund` object instead. > [accordion] Sequential vs auto settlement > > `is_auto_created = false` means a sequential settlement approved by Finance (`approved_by` is the approver's name). `is_auto_created = true` means a parallel auto settlement created by the scheduler (`approved_by = "SYSTEM"`). Both arrive as `settlement.completed`. > [accordion] amount vs total\_to\_transfer > > `amount` is the total net amount of the settled transactions. `total_to_transfer` is what was actually moved out — `amount - settlement_fee`. The `settlement_fee` is only non-zero for the `bank-account` method. > [accordion] Refunds only for balance methods > > `settlement.refunded` and `settlement.refund_cancelled` fire only for settlements using the `balance` or `auto-balance` method. Refund deducts (and cancel restores) the transaction's **net amount** from your `available_balance` — fees are not refunded. > [accordion] Refund state via flags > > Track refund state with `is_refunded` and `is_refund_cancelled`. An active refund is `is_refunded=true, is_refund_cancelled=false`. A cancelled refund is `is_refunded=true, is_refund_cancelled=true` — note `is_refunded` stays `true`. > [accordion] Nullable fields > > `transfer_status` and the `recipient.*` fields are populated only for the `bank-account` method and are `null` for all other methods. Actor fields (`refunded_by`, `refund_cancelled_by`, `actor`) and `account_id` may be `null`. Handle `null` gracefully. > [accordion] Timestamp format & timezone > > All timestamps (`timestamp`, `approved_at`, `start_date`, `end_date`, `refunded_at`, `refund_cancelled_at`) use the format `"d M Y H:i:s"` (e.g. `"18 Jun 2026 10:00:00"`) in **Asia/Jakarta (WIB)** timezone — not UTC. # Shared Webhook Endpoints Source: https://docs.singapay.id/api-reference/webhooks/shared-endpoints Route SingaPay webhooks when multiple event types share the same callback URL. Covers transaction_notif_url (money in) and disbursement_notif_url (money out). Some webhook types share a single callback URL configured in your merchant dashboard. Use the top-level `event` field in the JSON body to route each payload to the correct handler. *** ## Money In — `transaction_notif_url` SingaPay delivers these money-in events to the same `transaction_notif_url`: | `event` value | Webhook documentation | | - | - | | `va-transaction` | [Virtual Account Transaction](/api-reference/webhooks/va-transaction) | | `qris-acquirer-transaction` | [QRIS Acquirer Transaction](/api-reference/webhooks/qris-acquirer) | | `payment-link-transaction` | [Payment Link Transaction](/api-reference/webhooks/payment-link) | | `ewallet-native-transaction` | [E-Wallet Native Transaction](/api-reference/webhooks/ewallet-moneyin) | > [!NOTE] > > [Subscription Cycle](/api-reference/webhooks/subscription) uses a **dedicated** `subscription_cycle_notif_url`, not `transaction_notif_url`. ### Routing example ```php PHP theme={null} 'success']); ``` *** ## Money Out — `disbursement_notif_url` SingaPay delivers these money-out events to the same `disbursement_notif_url`: | `event` value | Webhook documentation | | - | - | | `disbursement` | [Disbursement Transaction](/api-reference/webhooks/disbursement-transaction) | | `ewallet-topup` | [E-Wallet Top Up Transaction](/api-reference/webhooks/ewallet-moneyout) | | `qris-issuer` | [QRIS Issuer Transaction](/api-reference/webhooks/qris-issuer) | You can also distinguish payloads using nested fields such as `data.bank`, `data.ewallet`, or `data.qr_data` when present. ### Routing example ```php PHP theme={null} 'success']); ``` *** ## Dedicated URLs (not shared) | Dashboard field | Used for | | - | - | | `subscription_cycle_notif_url` | [Subscription Cycle](/api-reference/webhooks/subscription) | | `kyb_notif_url` | [Sub-Account KYB Verification](/api-reference/webhooks/sub-account-kyb) | | `payment_link_inquiry_notif_url` | [Payment Link Inquiry](/api-reference/webhooks/payment-link-inquiry) | | `product_expiration_notif_url` | [Product Expiration](/api-reference/webhooks/product-expiration) | | `transaction_expiration_notif_url` | [Transaction Money-In Expiration](/api-reference/webhooks/transaction-moneyin-expiration) | Validate and acknowledge all webhooks using [Security and signature validation](/api-reference/webhooks/security-and-signature). # Sub-Account KYB Verification Webhook Source: https://docs.singapay.id/api-reference/webhooks/sub-account-kyb Real-time notifications when a managed sub-account's KYB (Know Your Business) submission is approved or rejected by our verification team. > [!NOTE] > > **Sub-Account Operation** — This webhook fires on KYB review outcomes for your **managed sub-accounts** (`business_managed`). It does not apply to your own merchant-level KYB, or to `owned`/`personal_managed` sub-accounts (which never require KYB). ## Information | Method | Path | Format | Authentication | | - | - | - | - | | POST | `https://your-webhook-url/callback` | json | HMAC SHA512 Signature | SingaPay sends a `POST` request to your configured `kyb_notif_url` whenever a managed sub-account's KYB submission finishes review — either approved, or rejected at one of the review stages. *** ## Events This single webhook covers two events, distinguished by the `event` field: | `event` | Fired when | `data` contains | | - | - | - | | `kyb.approved` | The sub-account passes **all** review stages (Document → DTTOT → Blacklist) and becomes `active`. | `account`, `verified_at` | | `kyb.rejected` | **Any** review stage (Document, DTTOT, or Blacklist) rejects the submission. | `account`, `stage`, `reason`, `rejected_at` | > [!NOTE] > > KYB review runs through three sequential stages: **Document Check → DTTOT Check → Blacklist Check**. `kyb.rejected` can fire at any of the three — you will receive a **separate webhook call for each rejection**, not just one at the end. `kyb.approved` fires only once, after the final stage passes. *** ## Request Details ### Headers | Field | Value | Type | Mandatory | Description | | - | - | - | :-: | - | | `Content-Type` | `application/json` | Alphabetic | Yes | Specifies JSON format for the request body | | `User-Agent` | `SingaPaymentGateway/1.0` | Alphabetic | Yes | Identifies the source of the webhook | | `Accept` | `application/json` | Alphabetic | Yes | Expected response format | | `X-PARTNER-ID` | — | Alphanumeric | Yes | Your API Key from the merchant dashboard | | `X-Signature` | — | Alphanumeric | Yes | HMAC SHA512 signature (128 chars) for request verification | | `X-Timestamp` | — | Numeric | Yes | Unix timestamp in **seconds** when the request was sent | | `Authorization` | `Bearer ` | Alphanumeric | Yes | System-generated random bearer token; used as a component in the signature | > [!NOTE] > > The `Authorization` token for KYB webhooks is a **randomly generated string** — not a user access token. KYB review outcomes are triggered by an internal reviewer action, not a merchant request. Extract the token as-is and use it in the string to sign. See [Security and signature validation](/api-reference/webhooks/security-and-signature). *** ### Body Parameters — common envelope Every KYB webhook shares the same top-level envelope: **status** `number` *required* HTTP Status Code. Always `200`. **success** `boolean` *required* Indicates a successful event. Always `true`. **event** `string` *required* Event type identifier. One of `"kyb.approved"`, `"kyb.rejected"`. **timestamp** `string` *required* Event timestamp in format `"d M Y H:i:s"`. Example: `"28 Aug 2026 14:33:55"` **data** `object` *required* Container for the account details (and, for rejections, the rejection details). *** ### `data.account` (present on all events) **account** `object` *required* The sub-account the event relates to. Shape is identical to the `Account` object returned by [`GET /accounts/{id}`](/api-reference). **account fields** **id** `string` *required* Account ULID. Example: `"01K946KF851RK7FX075GJHBVKF"` **account\_number** `string` Account number. May be `null`. **name** `string` *required* Account name. **status** `string` *required* `"active"` or `"inactive"`. **account\_type** `string` *required* Always `"business_managed"` in the context of this webhook. **kyb\_status** `string` One of `"kyb_waiting_document"`, `"kyb_in_review"`, `"kyb_rejected"`, `"kyb_verified"`. **kyb\_rejection\_reason** `string` The currently outstanding rejection reason. `null` unless `kyb_status` is `"kyb_rejected"`. **business\_type** `string` `"individual"` or `"company"`. `null` until the sub-merchant makes this choice during onboarding. **legal\_name** `string` Legal company name (`business_type = "company"`) or the primary owner's full name (`business_type = "individual"`). `null` until `kyb_status = "kyb_verified"`. **brand\_name** `string` Business/brand name. `null` until `kyb_status = "kyb_verified"`. **kyb\_onboarding\_url** `string` The sub-merchant's self-onboarding link. Stays active (and identical) across reject → resubmit cycles; becomes `null` once `kyb_status = "kyb_verified"` (the link is revoked). **invite\_members** `string[]` Email addresses of your dashboard members who have access to this sub-account. *** ### `data.verified_at` (`kyb.approved` only) **verified\_at** `string` *required* Timestamp the final review stage was approved. Format `"d M Y H:i:s"`. *** ### `data.stage`, `data.reason`, `data.rejected_at` (`kyb.rejected` only) **stage** `string` *required* Which review stage rejected the submission. One of `"document"`, `"dttot"`, `"blacklist"`. **reason** `string` *required* Free-text reason written by the reviewer. Not a structured error code — read it directly to determine what needs correcting. **rejected\_at** `string` *required* Timestamp the rejection was recorded. Format `"d M Y H:i:s"`. *** ### Payload Examples ```json kyb.approved theme={null} { "status": 200, "success": true, "event": "kyb.approved", "timestamp": "28 Aug 2026 14:33:55", "data": { "account": { "id": "01K946KF851RK7FX075GJHBVKF", "account_number": "000000000123", "name": "SingaPay Demo Store", "status": "active", "account_type": "business_managed", "kyb_status": "kyb_verified", "kyb_rejection_reason": null, "business_type": "company", "legal_name": "PT SingaPay Demo Indonesia", "brand_name": "SingaPay Demo Store", "kyb_onboarding_url": null, "invite_members": ["owner@merchant.com"] }, "verified_at": "28 Aug 2026 14:33:55" } } ``` ```json kyb.rejected theme={null} { "status": 200, "success": true, "event": "kyb.rejected", "timestamp": "28 Aug 2026 14:35:12", "data": { "account": { "id": "01K946KF851RK7FX075GJHBVKF", "account_number": "000000000123", "name": "SingaPay Demo Store", "status": "inactive", "account_type": "business_managed", "kyb_status": "kyb_rejected", "kyb_rejection_reason": "KTP tidak terbaca / dokumen buram", "business_type": "company", "legal_name": null, "brand_name": null, "kyb_onboarding_url": "https://sandbox-payment-b2b.singapay.id/kyb/0b0e5ad5957a7c2de066c2cde97e91089b605aae9afeba3398ff871cd1e99d54", "invite_members": ["owner@merchant.com"] }, "stage": "document", "reason": "KTP tidak terbaca / dokumen buram", "rejected_at": "28 Aug 2026 14:35:12" } } ``` *** ## Security and responses Return HTTP `200` promptly after validating the request. For retry behavior, see [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). Verify every webhook using [Security and signature validation](/api-reference/webhooks/security-and-signature). Use your configured `kyb_notif_url` path when building `StringToSign`. Handle duplicate deliveries idempotently using `data.account.id` combined with the `event` (and, for rejections, `data.stage`) as a stable identifier. *** ## Sub-Account KYB Specific Notes > [accordion] Dedicated callback URL > > `kyb_notif_url` is a dedicated field — it does not share a callback URL with any other webhook type. Configure it separately in your dashboard under **Settings → Credentials → Webhook & Notification URLs**. > [accordion] Multiple rejections per sub-account > > Review runs through three sequential stages. If a sub-merchant is rejected, corrects the issue, and resubmits, and is rejected again at a later stage, you will receive a **new** `kyb.rejected` webhook for that stage — each rejection in the account's history triggers its own call. > [accordion] The onboarding link survives rejection > > `kyb_onboarding_url` stays the same across reject → resubmit cycles — no new link is generated on rejection. The sub-merchant reopens the same URL to fix and resubmit their data. The link is only revoked (becomes `null`) once `kyb_status` reaches `kyb_verified`. > [accordion] kyb\_status alone doesn't tell you why > > `kyb_status = "kyb_rejected"` tells you a rejection is outstanding, but the specific reason lives in `kyb_rejection_reason` — a **free-text string** written by a human reviewer, not a structured per-field error code. If you need to know exactly which document or field was flagged, parse the reason text or direct your sub-merchant to read it carefully before resubmitting. > [accordion] legal\_name and brand\_name are null until verified > > Both fields only populate once `kyb_status = "kyb_verified"` — they are `null` throughout `kyb_waiting_document`, `kyb_in_review`, and `kyb_rejected`, including in the `kyb.rejected` payload itself. > [accordion] Timestamp format & timezone > > All timestamps (`timestamp`, `verified_at`, `rejected_at`) use the format `"d M Y H:i:s"` (e.g. `"28 Aug 2026 14:33:55"`) in **Asia/Jakarta (WIB)** timezone — not UTC. # Subscription Cycle Webhook Source: https://docs.singapay.id/api-reference/webhooks/subscription Real-time notifications for every recurring billing attempt (success, failure, retry) and plan status transitions. Keep your subscription state in sync with SingaPay. > [!NOTE] > > **Dedicated URL** — Unlike `transaction_notif_url` which is shared across VA, QRIS, Payment Link, and E-Wallet events, the `subscription_cycle_notif_url` is exclusively for subscription events. Configure it separately in the merchant dashboard. ## Information | Method | Path | Format | Authentication | | - | - | - | - | | POST | `https://your-webhook-url/callback` | json | HMAC SHA512 Signature | This webhook fires whenever one of the following happens on any subscription plan: * A cycle charge **succeeds** — initial charge after card linking, every recurring cycle, or a successful retry * A cycle charge **fails** — initial attempt and every retry attempt are delivered separately * The plan **status changes** — e.g. `suspended` after retries exhausted, `completed` after the last cycle, or `cancelled` (including system-initiated auto-cancel for `charge_immediately = true` plans rejected by the issuer) The `event` field distinguishes between them. *** ## Events | Event | When it fires | `success` field | | - | - | :-: | | `subscription.cycle.payment_success` | A cycle bill is paid (initial, recurring, or successful retry) | `true` | | `subscription.cycle.payment_failed` | A cycle bill attempt fails — fired on every attempt including each retry | `true` (HTTP `200`) | | `subscription.plan.status_changed` | The plan transitions to `suspended`, `cancelled`, or `completed` | `true` | > [!NOTE] > > `success: true` on `payment_failed` events indicates the webhook itself was emitted successfully — **not** that the charge succeeded. Always check the `event` field to determine the actual outcome. *** ## Request Details ### Headers | Field | Value | Type | Mandatory | Description | | - | - | - | :-: | - | | `Content-Type` | `application/json` | Alphabetic | Yes | Specifies JSON format for the request body | | `User-Agent` | `SingaPaymentGateway/1.0` | Alphabetic | Yes | Identifies the source of the webhook | | `Accept` | `application/json` | Alphabetic | Yes | Expected response format | | `X-PARTNER-ID` | — | Alphanumeric | Yes | Your API Key from the merchant dashboard | | `X-Signature` | — | Alphanumeric | Yes | HMAC SHA512 signature (128 chars) for request verification | | `X-Timestamp` | — | Numeric | Yes | Unix timestamp in **seconds** when the request was sent | | `Authorization` | `Bearer ` | Alphanumeric | Yes | System-generated random bearer token; used as a component in the signature | > [!NOTE] > > The `Authorization` token is a **randomly generated string** — not a user access token. Extract it as-is and use it in the string to sign. The signing scheme is identical to other SingaPay webhooks. See [How to Validate Signature](#security--signature-validation) below. *** ## Body Parameters — Payment Success / Failed These two events share the same body shape. The only difference is the `event` value and, on failure, whether `bill.retry` indicates more attempts are coming. **status** `number` *required* HTTP-style status code. Always `200`. **success** `boolean` *required* Always `true` — indicates the webhook was emitted successfully, **not** the charge outcome. **event** `string` *required* `"subscription.cycle.payment_success"` or `"subscription.cycle.payment_failed"`. **timestamp** `string` *required* Event timestamp in format `"d M Y H:i:s"`. Example: `"01 May 2026 00:00:15"` **data** `object` *required* Event payload. **data fields** **plan** `object` *required* Snapshot of the subscription plan at the time of the event. **plan fields** **id** `string` *required* Subscription Plan ID (26-char ULID). Example: `"01JAB3CD4E5F6G7H8J9K0M1N2"` **subscription\_id** `string` *required* Globally unique merchant-supplied plan reference. Example: `"PLAN-20260420-001"` **merchant\_reff\_no** `string` Merchant-side reference label echoed from plan creation. `null` if not set. **name** `string` *required* Plan display name. Example: `"Premium Monthly"` **amount** `number` *required* Per-cycle charge amount. Example: `150000` **currency** `string` *required* ISO 4217 currency code. Example: `"IDR"` **status** `string` *required* Current plan status. Example: `"active"` **parent\_plan\_id** `string` ID of the previous plan superseded via upgrade. `null` if not an upgrade. **retry\_policy** `object` *required* Plan-level retry policy. **retry\_policy fields** **max\_attempts** `integer` *required* Max retry attempts after the initial charge fails. Example: `3` **interval\_days** `integer` *required* Days between consecutive retries. Example: `3` **failed\_payment\_action** `string` *required* `"continue_plan"` or `"stop_plan"`. **bill** `object` *required* The specific cycle bill this event relates to. **bill fields** **id** `integer` *required* Internal bill ID. Example: `12345` **bill\_number** `string` *required* Human-readable bill number — also used as the webhook `reff_no` and idempotency key. Example: `"SUBBILL-202605-0001"` **status** `string` *required* `"pending"` | `"processing"` | `"paid"` | `"failed"` **total\_amount** `number` *required* Charge amount for this bill. Example: `150000` **currency** `string` *required* ISO 4217 currency code. Always `"IDR"` today. **due\_date** `string` Cycle due date (ISO 8601). Example: `"2026-05-01T00:00:00+07:00"` **paid\_date** `string` Paid timestamp (ISO 8601). `null` on `payment_failed`. **failure\_reason** `string` Human-readable failure reason. Present on `payment_failed`. Example: `"card_declined"` **payment\_reference** `string` Provider-side reference for this charge. Example: `"IONPAYTEST01202604201200000001"` **retry** `object` *required* Per-bill retry state combining the plan policy with the live attempt counter. **retry fields** **attempt** `integer` *required* How many retry attempts have been made so far. `0` on the initial attempt. **max\_attempts** `integer` *required* Max retry attempts (mirrors `plan.retry_policy.max_attempts`). **attempts\_remaining** `integer` *required* `max_attempts - attempt`, clamped to `0`. **max\_attempts\_reached** `boolean` *required* `true` when no more retries will fire. **interval\_days** `integer` *required* Days between retries. **failed\_payment\_action** `string` *required* `"continue_plan"` or `"stop_plan"`. **next\_retry\_at** `string` Next retry timestamp (ISO 8601). `null` when no more retries are scheduled. **last\_attempt\_at** `string` Most recent retry attempt timestamp (ISO 8601). **history** `array` *required* Chronological list of retry attempts on this bill. **history item fields** **attempt** `integer` *required* Retry sequence number (1-indexed). **status** `string` *required* `"pending"` | `"processing"` | `"paid"` | `"failed"` **retry\_date** `string` When this retry was executed (ISO 8601). **next\_retry\_date** `string` When the next retry is scheduled (ISO 8601). **failure\_reason** `string` Reason this particular retry failed. **cycle** `object` The cycle this bill belongs to. **cycle fields** **id** `integer` *required* Internal cycle ID. Example: `7890` **cycle\_number** `integer` *required* 1-indexed cycle number within the plan. Example: `3` **status** `string` *required* `"pending"` | `"paid"` | `"failed"` | `"skipped"` **period\_start** `string` Cycle period start (ISO 8601). **period\_end** `string` Cycle period end (ISO 8601). *** ### Payload Examples — Payment Events ```json payment_success (Cycle 3, first attempt) theme={null} { "status": 200, "success": true, "event": "subscription.cycle.payment_success", "timestamp": "01 May 2026 00:00:15", "data": { "plan": { "id": "01JAB3CD4E5F6G7H8J9K0M1N2", "subscription_id": "PLAN-20260420-001", "merchant_reff_no": "SUB-CUST-ACME-001", "name": "Premium Monthly", "amount": 150000, "currency": "IDR", "status": "active", "parent_plan_id": null, "retry_policy": { "max_attempts": 3, "interval_days": 3, "failed_payment_action": "continue_plan" } }, "bill": { "id": 12345, "bill_number": "SUBBILL-202605-0001", "status": "paid", "total_amount": 150000, "currency": "IDR", "due_date": "2026-05-01T00:00:00+07:00", "paid_date": "2026-05-01T00:00:15+07:00", "failure_reason": null, "payment_reference": "IONPAYTEST01202605010000000001", "retry": { "attempt": 0, "max_attempts": 3, "attempts_remaining": 3, "max_attempts_reached": false, "interval_days": 3, "failed_payment_action": "continue_plan", "next_retry_at": null, "last_attempt_at": null, "history": [] } }, "cycle": { "id": 7890, "cycle_number": 3, "status": "paid", "period_start": "2026-05-01T00:00:00+07:00", "period_end": "2026-06-01T00:00:00+07:00" } } } ``` ```json payment_failed (retry coming) theme={null} { "status": 200, "success": true, "event": "subscription.cycle.payment_failed", "timestamp": "01 May 2026 00:00:20", "data": { "plan": { "id": "01JAB3CD4E5F6G7H8J9K0M1N2", "subscription_id": "PLAN-20260420-001", "merchant_reff_no": "SUB-CUST-ACME-001", "name": "Premium Monthly", "amount": 150000, "currency": "IDR", "status": "active", "parent_plan_id": null, "retry_policy": { "max_attempts": 3, "interval_days": 3, "failed_payment_action": "continue_plan" } }, "bill": { "id": 12346, "bill_number": "SUBBILL-202605-0002", "status": "failed", "total_amount": 150000, "currency": "IDR", "due_date": "2026-05-01T00:00:00+07:00", "paid_date": null, "failure_reason": "card_declined", "payment_reference": "IONPAYTEST01202605010000000002", "retry": { "attempt": 1, "max_attempts": 3, "attempts_remaining": 2, "max_attempts_reached": false, "interval_days": 3, "failed_payment_action": "continue_plan", "next_retry_at": "2026-05-04T00:00:00+07:00", "last_attempt_at": "2026-05-01T00:00:20+07:00", "history": [ { "attempt": 1, "status": "failed", "retry_date": "2026-05-01T00:00:20+07:00", "next_retry_date": "2026-05-04T00:00:00+07:00", "failure_reason": "card_declined" } ] } }, "cycle": { "id": 7891, "cycle_number": 4, "status": "pending", "period_start": "2026-05-01T00:00:00+07:00", "period_end": "2026-06-01T00:00:00+07:00" } } } ``` ```json payment_failed (retries exhausted) theme={null} { "status": 200, "success": true, "event": "subscription.cycle.payment_failed", "timestamp": "07 May 2026 00:00:20", "data": { "plan": { "...": "..." }, "bill": { "id": 12346, "bill_number": "SUBBILL-202605-0002", "status": "failed", "total_amount": 150000, "currency": "IDR", "failure_reason": "card_declined", "retry": { "attempt": 3, "max_attempts": 3, "attempts_remaining": 0, "max_attempts_reached": true, "interval_days": 3, "failed_payment_action": "stop_plan", "next_retry_at": null, "last_attempt_at": "2026-05-07T00:00:20+07:00", "history": [ { "attempt": 1, "status": "failed", "retry_date": "2026-05-01T00:00:20+07:00", "failure_reason": "card_declined" }, { "attempt": 2, "status": "failed", "retry_date": "2026-05-04T00:00:20+07:00", "failure_reason": "card_declined" }, { "attempt": 3, "status": "failed", "retry_date": "2026-05-07T00:00:20+07:00", "failure_reason": "card_declined" } ] } } } } ``` > [!WARNING] > > When `bill.retry.max_attempts_reached` is `true` and `failed_payment_action` is `"stop_plan"`, expect a subsequent `subscription.plan.status_changed` event with `plan.status: "suspended"` to arrive shortly after. *** ## Body Parameters — Plan Status Changed Fires when the plan transitions to `suspended`, `cancelled`, or `completed`. **status** `number` *required* Always `200`. **success** `boolean` *required* Always `true`. **event** `string` *required* `"subscription.plan.status_changed"` **timestamp** `string` *required* Event timestamp in format `"d M Y H:i:s"`. Example: `"07 May 2026 00:05:00"` **data** `object` *required* **data fields** **plan** `object` *required* Plan snapshot — same shape as the `plan` block in payment events above. `plan.status` reflects the **new** status. **previous\_status** `string` *required* Status the plan was in before the transition. Example: `"active"` ### Payload Example — Plan Status Changed ```json Plan suspended after retries exhausted theme={null} { "status": 200, "success": true, "event": "subscription.plan.status_changed", "timestamp": "07 May 2026 00:05:00", "data": { "plan": { "id": "01JAB3CD4E5F6G7H8J9K0M1N2", "subscription_id": "PLAN-20260420-001", "merchant_reff_no": "SUB-CUST-ACME-001", "name": "Premium Monthly", "amount": 150000, "currency": "IDR", "status": "suspended", "parent_plan_id": null, "retry_policy": { "max_attempts": 3, "interval_days": 3, "failed_payment_action": "stop_plan" } }, "previous_status": "active" } } ``` *** ## Security and responses Return HTTP `200` promptly after validating the request. For retry behavior, see [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). Verify every webhook using [Security and signature validation](/api-reference/webhooks/security-and-signature). Use your configured callback path when building `StringToSign`. Handle duplicate deliveries idempotently using stable identifiers from the payload (for example `transaction_id` or `reff_no`). *** ## Idempotency Use `bill.bill_number` as your primary idempotency key when storing successful deliveries. The same bill number may arrive more than once if your endpoint returned a non-2xx response and SingaPay retried the webhook delivery. For failed charge retries, the `bill_number` stays the same but `bill.retry.attempt` increments. Use the compound key `(bill_number, retry.attempt)` if you need per-attempt idempotency. *** ## Important Notes > [accordion] One event per attempt > > Every retry attempt emits its own `subscription.cycle.payment_failed` (or `payment_success` on the attempt that finally clears). Monitor `bill.retry.attempts_remaining` to know whether another automatic attempt is coming. > [accordion] Plan status events are separate > > When retries are exhausted with `failed_payment_action: stop_plan`, expect a `payment_failed` event followed shortly by a `plan.status_changed` event with `plan.status: "suspended"`. These are two distinct webhook deliveries. > [accordion] Plan lineage after upgrades > > After a PATCH upgrade, the new plan has a different `plan.id` but the same `plan.subscription_id` and `plan.merchant_reff_no`. The old plan's ID is available on `plan.parent_plan_id` for reconciliation. > [accordion] merchant\_reff\_no is optional > > If you didn't set `merchant_reff_no` at plan creation, it will be `null` on every cycle webhook. Set it during plan creation to have it echoed back reliably for your own tracking. > [accordion] Currency is always IDR > > `bill.currency` is always `"IDR"` today — card recurring runs in IDR only. # Transaction Money-In Expiration Webhook Source: https://docs.singapay.id/api-reference/webhooks/transaction-moneyin-expiration Optional batch notifications when unpaid money-in transactions expire. Track expired payment link histories, virtual account transactions, and QRIS histories in a single webhook call to improve collection and abandonment monitoring. > [!NOTE] > > **Optional webhook** — This webhook is completely optional. Unpaid transactions expire normally without it. Configure `transaction_expiration_notif_url` only if you need batch expiration notifications for **unpaid transaction attempts**. For expired **products** (payment links, VAs, QRIS codes), see [Product Expiration](/api-reference/webhooks/product-expiration). ## Information | Method | Path | Format | Authentication | | - | - | - | - | | POST | `https://your-webhook-url/callback` | json | HMAC SHA512 Signature | SingaPay sends a `POST` request to your configured `transaction_expiration_notif_url` when money-in transactions expire before payment is completed. This is a **batch notification** that can include multiple expired transaction records in a single call. > [!NOTE] > > **Batch notification:** One webhook may contain expired Payment Link Histories, Virtual Account Transactions, and QRIS Histories together. Arrays can be empty when no transactions of that type expired. If `transaction_expiration_notif_url` is not configured, no transaction expiration webhooks are sent. *** ## Request Details ### Headers | Field | Value | Type | Mandatory | Description | | - | - | - | :-: | - | | `Content-Type` | `application/json` | Alphabetic | Yes | Specifies JSON format for the request body | | `User-Agent` | `SingaPaymentGateway/1.0` | Alphabetic | Yes | Identifies the source of the webhook | | `Accept` | `application/json` | Alphabetic | Yes | Expected response format | | `X-PARTNER-ID` | — | Alphanumeric | Yes | Your API Key from the merchant dashboard | | `X-Signature` | — | Alphanumeric | Yes | HMAC SHA512 signature (128 chars) for request verification | | `X-Timestamp` | — | Numeric | Yes | Unix timestamp in **seconds** when the request was sent | | `Authorization` | `Bearer ` | Alphanumeric | Yes | System-generated random bearer token; used as a component in the signature | > [!NOTE] > > The `Authorization` token is a **randomly generated string** — not a user access token. This webhook is triggered by the system's scheduled expiration checker, not a user API call. Extract the token as-is and use it in the string to sign. See [How to Validate Signature](#how-to-validate-signature) below. *** ### Body Parameters **status** `number` *required* HTTP status code. Example: `200` **success** `boolean` *required* Indicates whether the webhook was sent successfully. Example: `true` **event** `string` *required* Event type identifier. Always `"transaction_expiration"` for this webhook. **timestamp** `string` *required* Event timestamp in format `"d M Y H:i:s"`. Example: `"26 Dec 2025 14:00:00"` **merchant** `object` *required* Merchant information. **merchant fields** **id** `number` *required* Merchant ID. Example: `123` **name** `string` *required* Merchant name. Example: `"PT Example Indonesia"` **data** `object` *required* Container for expired transactions. Each array is always present and may be empty. **data fields** **payment\_link\_histories** `array` *required* Expired payment link histories (unpaid payment attempts). **payment\_link\_histories item fields** **id** `number` *required* Payment link history ID. **reff\_no** `string` *required* History reference number. **payment\_link\_id** `number` *required* Parent payment link ID. **status** `string` *required* Status. Should be `"expired"`. **expired\_at** `string` *required* Expiration datetime (`Y-m-d H:i:s`). **virtual\_account\_transactions** `array` *required* Expired virtual account transactions (unpaid). **virtual\_account\_transactions item fields** **id** `number` *required* VA transaction ID. **reff\_no** `string` *required* Transaction reference number. **virtual\_account\_id** `number` *required* Parent virtual account ID. **status** `string` *required* Status. Should be `"expired"`. **expired\_at** `string` *required* Expiration datetime (`Y-m-d H:i:s`). **qris\_histories** `array` *required* Expired QRIS histories (unpaid payment attempts). **qris\_histories item fields** **id** `number` *required* QRIS history ID. **reff\_no** `string` *required* History reference number. **qris\_transaction\_id** `number` *required* Parent QRIS transaction ID. **status** `string` *required* Status. Should be `"expired"`. **expired\_at** `string` *required* Expiration datetime (`Y-m-d H:i:s`). **summary** `object` *required* Summary counts for the batch. **summary fields** **total\_expired** `number` *required* Total count of all expired transactions. **payment\_link\_histories\_count** `number` *required* Count of expired payment link histories. **virtual\_account\_transactions\_count** `number` *required* Count of expired VA transactions. **qris\_histories\_count** `number` *required* Count of expired QRIS histories. *** ### Payload Examples ```json Batch — Multiple Types theme={null} { "status": 200, "success": true, "event": "transaction_expiration", "timestamp": "26 Dec 2025 14:00:00", "merchant": { "id": 123, "name": "PT Example Indonesia" }, "data": { "payment_link_histories": [ { "id": 456, "reff_no": "PLH-20251226-ABC123", "payment_link_id": 789, "status": "expired", "expired_at": "2025-12-26 14:00:00" }, { "id": 457, "reff_no": "PLH-20251226-DEF456", "payment_link_id": 790, "status": "expired", "expired_at": "2025-12-26 14:00:00" } ], "virtual_account_transactions": [ { "id": 321, "reff_no": "VAT-20251226-GHI789", "virtual_account_id": 654, "status": "expired", "expired_at": "2025-12-26 14:00:00" }, { "id": 322, "reff_no": "VAT-20251226-JKL012", "virtual_account_id": 655, "status": "expired", "expired_at": "2025-12-26 14:00:00" }, { "id": 323, "reff_no": "VAT-20251226-MNO345", "virtual_account_id": 656, "status": "expired", "expired_at": "2025-12-26 14:00:00" } ], "qris_histories": [ { "id": 987, "reff_no": "QRH-20251226-PQR678", "qris_transaction_id": 246, "status": "expired", "expired_at": "2025-12-26 14:00:00" } ] }, "summary": { "total_expired": 6, "payment_link_histories_count": 2, "virtual_account_transactions_count": 3, "qris_histories_count": 1 } } ``` ```json Single Type — VA Transactions Only theme={null} { "status": 200, "success": true, "event": "transaction_expiration", "timestamp": "26 Dec 2025 14:00:00", "merchant": { "id": 123, "name": "PT Example Indonesia" }, "data": { "payment_link_histories": [], "virtual_account_transactions": [ { "id": 321, "reff_no": "VAT-20251226-GHI789", "virtual_account_id": 654, "status": "expired", "expired_at": "2025-12-26 14:00:00" } ], "qris_histories": [] }, "summary": { "total_expired": 1, "payment_link_histories_count": 0, "virtual_account_transactions_count": 1, "qris_histories_count": 0 } } ``` *** *** ## Security and responses Return HTTP `200` promptly after validating the request. For retry behavior, see [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). Verify every webhook using [Security and signature validation](/api-reference/webhooks/security-and-signature). Use your configured callback path when building `StringToSign`. Handle duplicate deliveries idempotently using stable identifiers from the payload (for example `transaction_id` or `reff_no`). *** ## Transaction money-in expiration specific notes ### When to use this webhook > [card] Use when > > * Track unpaid invoices and abandoned payment attempts > * Automated follow-up and remarketing for expired sessions > * Conversion and abandonment analytics > * Alert collections on high expiration volumes > [card] Skip when > > * You poll transaction status via API on demand > * You only need product-level expiration ([Product Expiration](/api-reference/webhooks/product-expiration)) > * Manual monitoring is sufficient ### Transaction vs product expiration > [!WARNING] > > This webhook is **not** the same as [Product Expiration](/api-reference/webhooks/product-expiration). Understanding the difference is essential. | Aspect | Transaction expiration (this webhook) | [Product expiration](/api-reference/webhooks/product-expiration) | | - | - | - | | What expires | Unpaid transaction attempts / records | Payment products themselves | | Payment link | Payment link **history** (one attempt) | Payment link (the product/page) | | Virtual account | VA **transaction** (one unpaid txn) | Virtual account (the VA number) | | QRIS | QRIS **history** (one attempt) | QRIS transaction (the QR product) | | Use case | Abandoned payments, follow-up reminders | Product cleanup, inventory management | | Reusability | Parent product can still be reused | Product is expired and cannot be reused | **Example timeline:** 1. Customer opens a payment link at 10:00 — creates a **payment link history** (expires 10:30 if unpaid). 2. At 10:30 — **this webhook** reports the expired history; the payment link itself remains active. 3. Customer opens the same link at 11:00 — a **new** history is created. 4. End of day — payment link product expires — **[Product Expiration](/api-reference/webhooks/product-expiration)** fires; the link can no longer accept new attempts. For a single session expiring when a customer views a link, you may also receive [Payment Link Inquiry](/api-reference/webhooks/payment-link-inquiry) (`payment_link.inquiry.expired`). ### Batch notification * Multiple transaction types in one payload * Scheduled cron execution (not real-time) * Empty arrays are normal when a type had no expirations ```php Process batch theme={null} 100) { alertHighAbandonmentRate($payload['summary']['total_expired']); } http_response_code(200); echo json_encode(['status' => 'success']); ?> ``` ### Transaction types included | Array | Record type | Parent ID field | Note | | - | - | - | - | | `data.payment_link_histories` | Unpaid payment link attempt | `payment_link_id` | Parent link stays active | | `data.virtual_account_transactions` | Unpaid VA transaction | `virtual_account_id` | Parent VA stays active | | `data.qris_histories` | Unpaid QRIS attempt | `qris_transaction_id` | Parent QRIS may stay active | Use parent IDs to fetch full product details via API and send new payment attempts on the same product. ```php Fetch parent payment link theme={null} $plHistory = $payload['data']['payment_link_histories'][0]; $paymentLink = fetchPaymentLinkAPI($plHistory['payment_link_id']); sendReminderEmail( getCustomerEmail($plHistory['reff_no']), $paymentLink['payment_url'], 'Your previous payment session expired. Click here to pay again!' ); ``` ### Simplified payload Minimal fields per transaction to keep batch payloads small. **Not** included: amount, currency, customer details, payment method, VA number, QR string, created/updated timestamps. Query by `id`, `reff_no`, or parent product ID via API when you need full details. ### Timestamp format | Field | Format | Example | | - | - | - | | `timestamp` (root) | `d M Y H:i:s` | `26 Dec 2025 14:00:00` | | `expired_at` (per item) | `Y-m-d H:i:s` | `2025-12-26 14:00:00` | For signature validation, use **`X-Timestamp`** (Unix seconds in the header). ### Idempotency ```php theme={null} $webhookId = $payload['event'] . '_' . $payload['merchant']['id'] . '_' . strtotime($payload['timestamp']); if (isWebhookProcessed($webhookId)) { http_response_code(200); exit; } processTransactionExpirationBatch($payload); markWebhookProcessed($webhookId); ``` ### Summary statistics ```php theme={null} $summary = $payload['summary']; logTransactionExpirationBatch([ 'total' => $summary['total_expired'], 'payment_link_histories' => $summary['payment_link_histories_count'], 'va_transactions' => $summary['virtual_account_transactions_count'], 'qris_histories' => $summary['qris_histories_count'], ]); if ($summary['total_expired'] > 50) { sendAlert("High abandonment rate: {$summary['total_expired']} transactions expired"); } ``` ### Scheduling and timing Triggered by a **system cron job** (frequency varies — confirm with SingaPay support). Not real-time; allow delay between expiration and notification. For immediate handling, poll via API or use individual transaction webhooks. ### Recommended practices * **Use both optional expiration webhooks** — transaction expiration for abandonment; product expiration for inventory cleanup. * **Set sensible session timeouts** — e.g. 15–30 minutes for payment links, longer for VA invoices, shorter for in-store QRIS. * **Limit remarketing frequency** — avoid spamming customers who abandon repeatedly. * **Correlate with success webhooks** — compare expired vs paid volumes to tune expiry settings and UX. # Virtual Account Webhook Source: https://docs.singapay.id/api-reference/webhooks/va-transaction Real-time notifications for Virtual Account transactions processed through the SingaPay platform. Monitor payment events and keep your system in sync instantly. > [!NOTE] > > **Money In Operation** — This webhook fires when a customer completes a Virtual Account payment, transferring funds into your SingaPay account. ## Information | Method | Path | Format | Authentication | | - | - | - | - | | POST | `https://your-webhook-url/callback` | json | HMAC SHA512 Signature | SingaPay sends a `POST` request to your configured `transaction_notif_url` when a Virtual Account transaction is successfully processed. > [!NOTE] > > This webhook may share a callback URL with other event types. See [Shared webhook endpoints](/api-reference/webhooks/shared-endpoints) for routing by `event` value. *** ## Request Details ### Headers | Field | Value | Type | Mandatory | Description | | - | - | - | :-: | - | | `Content-Type` | `application/json` | Alphabetic | Yes | Specifies JSON format for the request body | | `User-Agent` | `SingaPaymentGateway/1.0` | Alphabetic | Yes | Identifies the source of the webhook | | `Accept` | `application/json` | Alphabetic | Yes | Expected response format | | `X-PARTNER-ID` | — | Alphanumeric | Yes | Your API Key from the merchant dashboard | | `X-Signature` | — | Alphanumeric | Yes | HMAC SHA512 signature (128 chars) for request verification | | `X-Timestamp` | — | Numeric | Yes | Unix timestamp in **seconds** when the request was sent | | `Authorization` | `Bearer ` | Alphanumeric | Yes | System-generated random bearer token; used as a component in the signature | > [!NOTE] > > The `Authorization` token for VA webhooks is a **randomly generated string** — not a user access token. This is because the webhook is triggered by a bank payment notification (system event), not a user action. Extract it as-is from the header and use it in the string to sign. See [How to Validate Signature](#how-to-validate-signature) below. *** ### Body Parameters **status** `number` *required* HTTP Status Code. Example: `200` **success** `boolean` *required* Indicates if the transaction was successful. Example: `true` **event** `string` *required* Event type identifier. Always `"va-transaction"` for this webhook. **timestamp** `string` *required* Event timestamp in format `"d M Y H:i:s"`. Example: `"26 Dec 2025 13:35:45"` **data** `object` *required* Container for transaction and payment details. **data fields** **transaction** `object` *required* Transaction details. **transaction fields** **reff\_no** `string` *required* Merchant reference number if provided during VA creation (`merchant_reff_no`), otherwise falls back to `transaction_id`. Example: `"INV-2026-001"` **transaction\_id** `string` *required* Internal system transaction ID. Example: `"3211120250926133543246"` **type** `string` *required* Transaction type. Always `"va"` for Virtual Account. **status** `string` *required* Transaction status. Always `"paid"` for this webhook. **amount** `object` *required* Transaction amount details. **amount fields** **value** `number` *required* Transaction amount. Example: `100000` **currency** `string` *required* ISO 4217 currency code. Example: `"IDR"` **amount\_type** `string` *required* VA amount type: `"closed"` (fixed amount) or `"open"` (any amount). **tip** `null` *required* Tip amount. Always `null` for VA transactions. **post\_timestamp** `string` *required* Transaction post time. Example: `"26 Dec 2025 13:35:43"` **processed\_timestamp** `string` *required* Transaction processed time. Example: `"26 Dec 2025 13:35:45"` **payment** `object` *required* Payment method details. **payment fields** **method** `string` *required* Payment method. Always `"va"`. **additional\_info** `object` *required* Payment method specific information. **additional\_info fields** **va\_number** `string` *required* Virtual Account number used for payment (16 digits). Example: `"7872955146576837"` **va\_name** `string` *required* Virtual Account name/label. Example: `"Toko Budi"` **bank** `object` *required* Bank details. **bank fields** **short\_name** `string` *required* Short name of the bank. Example: `"Maybank"` **number** `string` *required* Bank number/code (3 digits). Example: `"016"` **swift\_code** `string` *required* Bank SWIFT code (8 chars). Example: `"IBBKIDJA"` **bank\_code** `string` *required* Internal bank code. Example: `"MAYBANK"` **fees** `object` *required* Transaction fee details. **fees fields** **name** `string` *required* Payment vendor fee name. Example: `"VA Maybank"` **amount** `number` *required* Fee amount charged. Example: `1500` **currency** `string` *required* Fee currency code. Example: `"IDR"` *** ### Payload Example ```json Success theme={null} { "status": 200, "success": true, "event": "va-transaction", "timestamp": "26 Dec 2025 13:35:45", "data": { "transaction": { "reff_no": "INV-2026-001", "transaction_id": "3211120250926133543246", "type": "va", "status": "paid", "amount": { "value": 100000, "currency": "IDR" }, "amount_type": "closed", "tip": null, "post_timestamp": "26 Dec 2025 13:35:43", "processed_timestamp": "26 Dec 2025 13:35:45" }, "payment": { "method": "va", "additional_info": { "va_number": "7872955146576837", "va_name": "Toko Budi", "bank": { "short_name": "Maybank", "number": "016", "swift_code": "IBBKIDJA", "bank_code": "MAYBANK" }, "fees": { "name": "VA Maybank", "amount": 1500, "currency": "IDR" } } } } } ``` *** *** ## Security and responses Return HTTP `200` promptly after validating the request. For retry behavior, see [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). Verify every webhook using [Security and signature validation](/api-reference/webhooks/security-and-signature). Use your configured callback path when building `StringToSign`. Handle duplicate deliveries idempotently using stable identifiers from the payload (for example `transaction_id` or `reff_no`). # List account transfers Source: https://docs.singapay.id/api-reference/account-transfer/list-account-transfers https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/account-transfer/{account_id} Returns a paginated list of account transfers where the given account is either the remitter or the beneficiary. Limited to records within the last year. Optional filters: `transaction_id` (partial match) and `status` (`success`, `pending`, `failed`). # Show account transfer detail Source: https://docs.singapay.id/api-reference/account-transfer/show-account-transfer-detail https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/account-transfer/{account_id}/{transaction_id} Returns the details of a single account transfer. The given account must be either the remitter or the beneficiary of the transaction. # Transfer between accounts (PG or cross-channel) Source: https://docs.singapay.id/api-reference/account-transfer/transfer-between-accounts-pg-or-cross-channel https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v1.0/account-transfer/{account_id}/transfer Transfers funds from the given PG account (remitter) to a beneficiary under the same merchant. Compatible-extend contract: omit `beneficiary_channel` (or set `PG`) and pass `beneficiary_account_number` for intra-PG movement; set `beneficiary_channel=KYC` to credit the merchant KYC credit-pool. `BILLER` is reserved. Requires request signature headers (`verify.signature-internal`). Idempotency: send an optional `merchant_ref_no` unique per merchant. If a value already used by the same merchant is submitted again, the original transfer is returned (HTTP 200) and no new movement is created — regardless of which of the merchant's accounts is the remitter. If `merchant_ref_no` is omitted or empty, the platform auto-generates a unique reference (format `AM--`) and returns it in the response. # Create account Source: https://docs.singapay.id/api-reference/accounts/create-account https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v1.0/accounts Create a new sub account under the calling merchant. `account_type` is required — choose between an `owned`/`personal_managed` sub account (created active, no KYB — `personal_managed` behaves the same as `owned`) and a `business_managed` sub account (created inactive and requiring BOSS KYB approval before it can transact). The calling merchant's own primary dashboard login is always granted access to the new account automatically. `invite_members` is optional — pass additional member emails to grant them access too; if omitted, only the primary merchant has access. For a `business_managed` sub account, `data.kyb_onboarding_url` carries a link to forward to the sub-merchant so they can self-submit their KYB data (individual/company is chosen on that onboarding page itself). Save this URL, as it becomes `null` once KYB is verified; it can also be re-fetched anytime via `GET /accounts/{id}` or `GET /accounts` while KYB is still pending. # Get account Source: https://docs.singapay.id/api-reference/accounts/get-account https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/accounts/{id} This feature is designed to provide detailed information regarding the details of a virtual account. It allows users to retrieve and view comprehensive data on a specific virtual account. For managed sub accounts, `data.kyb_onboarding_url` carries the account's current active KYB self-onboarding link, or `null` once KYB is fully verified. # Overview Source: https://docs.singapay.id/api-reference/accounts/introduction Manage sub-level accounts within the Singapay Payment Gateway — create, update, and organize account hierarchies with full operational control. Accounts in the Singapay Payment Gateway are designed to manage sub-level accounts efficiently. You can create, modify, and oversee subordinate accounts to delegate responsibilities, organize account hierarchies, and maintain operational control across your Singapay ecosystem. ## What you can do > [card] Create Accounts > > Register new sub-accounts under your merchant and attach them to specific credentials or integrations. > [card] Retrieve Accounts > > List all accounts or fetch a single account by ULID to check its details and current status. > [card] Update Status > > Activate or deactivate accounts at any time using the update status endpoint. ## Account status | Status | Description | | - | - | | `active` | Account is operational and can process transactions. | | `inactive` | Account is disabled and cannot process transactions. | ## Available endpoints > [card] [List Accounts](./list-accounts) > > Paginated list of accounts for the authenticated merchant. > [card] [Create Account](./create-account) > > Register a new sub-account under your merchant. > [card] [Get Account](./get-account) > > Retrieve a single account by ULID. > [card] [Update Account Status](./update-account-status) > > Activate or deactivate an account. > [!NOTE] > > All endpoints require authentication. See [Authentication](/api-reference/authentication). # List accounts Source: https://docs.singapay.id/api-reference/accounts/list-accounts https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/accounts This feature is designed to provide detailed information regarding the list of virtual accounts. It allows users to retrieve and view comprehensive data on all virtual accounts associated with their main account. Each managed sub account row carries its own `kyb_onboarding_url` so its current active KYB self-onboarding link can be read directly from the list without a separate call per account. # Update Source: https://docs.singapay.id/api-reference/accounts/update https://payment-b2b.singapay.id/api/docs/merchant-api.json patch /api/v1.0/accounts/update/{id} Update an account. All fields are optional, but at least one of `name`, `status`, `invite_members` must be provided. Optionally, provide `invite_members` (array of emails) to replace the account's team member list entirely — omitting the field leaves the current members unchanged. Note: a `managed` sub account cannot be set to `active` until its BOSS KYB verification is approved — attempting to do so returns 403. # Generate OAuth access token Source: https://docs.singapay.id/api-reference/authentication/generate-oauth-access-token https://biller-b2b.singapay.id/docs post /api/v1.0/access-token/b2b Authenticate using client credentials (Basic Auth) and obtain a JWT access token for subsequent API calls. Basic Authentication automatically generates a string encoded in Base64 format by combining the client_id and client_secret with a colon separator. # Get Access Token Source: https://docs.singapay.id/api-reference/authentication/get-access-token https://core.singapay.id/identity-verification/docs/swagger.json post /api/v1/kyc/auth/get-auth-token Sign `{client_id}:{timestamp}` with your `client_secret` using HMAC-SHA256 and send the hex digest as `signature`. On success you receive a Bearer token. `timestamp` must be within 5 minutes of our server clock. Your account must have KYC access enabled. If it does not, this call returns HTTP 401 with `error=FEATURE_NOT_ENABLED`. Contact support to enable access. # Get Account Balance Source: https://docs.singapay.id/api-reference/balance-inquiry/get-account-balance https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/balance-inquiry/{account_id} Retrieve the balance snapshot (held, available, pending and total) for a single account belonging to the authenticated merchant. # Get Merchant Balance Source: https://docs.singapay.id/api-reference/balance-inquiry/get-merchant-balance https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/balance-inquiry Retrieve the aggregated balance snapshot (held, available, pending and total) for the authenticated merchant. # Overview Source: https://docs.singapay.id/api-reference/balance-inquiry/introduction Check real-time balance for your merchant account or any sub-account within the Singapay Payment Gateway. The Balance Inquiry API lets you retrieve up-to-date balance information — either at the merchant level (aggregate across all accounts) or for a specific sub-account by ULID. Use this to monitor available funds before initiating disbursements or top-ups. ## What you can do > [card] Merchant Balance > > Retrieve the aggregate balance for the authenticated merchant across all sub-accounts. > [card] Account Balance > > Retrieve the balance for a single sub-account by its ULID. ## Available endpoints > [card] [Inquiry Merchant Balance](./get-merchant-balance) > > Returns aggregate balance for the authenticated merchant. > [card] [Inquiry Account Balance](./get-account-balance) > > Returns balance for one account by ULID. > [!NOTE] > > All endpoints require authentication. See [Authentication](/api-reference/authentication). # Bank Name Verification Source: https://docs.singapay.id/api-reference/bank/bank-name-verification https://core.singapay.id/identity-verification/docs/swagger.json post /api/v1/kyc/bank/verify Looks up the registered holder name on the bank for the given account number and compares it with the `name` you send. A completed check is billed (`pricing=PAID`), including when the account is not found. Validation errors and service failures are not billed (`pricing=FREE`). This feature must be enabled on your account. If it is not, the API returns `UNAUTHORIZED`. ### Outcomes | Result | Response | |---|---| | Account found | `code=SUCCESS`, `data.status="found"`, `pricing=PAID` | | No account at this bank | `code=SUCCESS`, `data.status="not found"`, `suggestion=reject`, `pricing=PAID` | | Temporary service issue | `code=SERVER_ERROR`, `pricing=FREE` | | Invalid request (account, bank, name, or `request_id`) | `code=CLIENT_ERROR`, `pricing=FREE` | | Same `request_id` with a different body | `code=DUPLICATE_REFERENCE`, `pricing=FREE` | | Missing token, feature not enabled, or IP not allowlisted | `code=UNAUTHORIZED`, `pricing=FREE` | | Prepaid balance too low | `code=INSUFFICIENT_BALANCE`, `pricing=FREE` | ### Account numbers You may include spaces, dashes, dots, or underscores. We ignore those characters. After that, the number must be 6–20 digits. ### Bank codes `bank_code` is a 3-digit Indonesian clearing code from the supported-banks list in the dashboard. Values such as `2` or `14` are accepted and padded to `002` / `014`. An unknown or disabled code returns `CLIENT_ERROR` (not `not found`). ### Idempotency Use a unique `request_id` for each new check (UUID v4 is recommended). Repeating the same `request_id` with the same body returns the original result and is billed once — unless the previous attempt did not complete, in which case the check runs again. A different body with the same `request_id` returns `DUPLICATE_REFERENCE`. # Cancel Source: https://docs.singapay.id/api-reference/cardless-withdrawal/cancel https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v1.0/cardless-withdrawals/cancel Cancels an `open` withdrawal and restores the debited amount to the account balance. Only withdrawals currently in `open` status can be canceled. The target account and transaction reference are specified in the request body, not in the URL path. See `Response Code` for SP000–SP020 definitions and merchant actions. # Create Source: https://docs.singapay.id/api-reference/cardless-withdrawal/create https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v1.0/cardless-withdrawals/create Initiates a cardless withdrawal, debits the account, and returns an OTP for ATM cash collection. Only fixed denominations (multiples of 50,000) are accepted. The target account is specified in the request body (`account_id`), not in the URL path. This endpoint is rate-limited. See `Response Code` for SP000–SP020 definitions and merchant actions. **CRITICAL:** This is a money-out operation requiring **X-Signature** and **X-Timestamp** authentication. # Overview Source: https://docs.singapay.id/api-reference/cardless-withdrawal/introduction Enable customers to withdraw cash from ATMs without a card — using an OTP issued by SingaPay and the customer's registered phone number. Cardless Withdrawal lets your customers withdraw cash at supported ATMs without a physical card. Your platform requests a withdrawal on behalf of the customer, SingaPay locks the merchant balance and issues an OTP, and the customer redeems it at the ATM using their phone number and OTP code. > [!NOTE] > > This is a **Money Out** operation. Each successful withdrawal debits funds from your Singapay Payment Gateway merchant balance. > [card] No card required > > Customers withdraw using only their phone number and a one-time OTP — no physical card needed. > [card] Balance locked on issuance > > Merchant balance is locked immediately when the OTP is generated — guaranteeing funds are available at ATM redemption. > [card] Auto-reverse on failure > > If the OTP expires or the ATM rejects the transaction, SingaPay automatically reverses the locked balance back to the merchant. *** ## Withdrawal Flow ```mermaid theme={null} sequenceDiagram participant C as Customer participant M as Merchant System participant S as SingaPay API participant A as ATM C->>M: Request withdrawal (bank type, amount, CustID/phone number) M->>M: Validate request M->>S: POST /cardless-withdrawals/{account_id} Note over M,S: bank_type, amount, cust_id S->>S: Lock merchant balance, generate OTP & expired_at (status: OPEN) S-->>M: OTP, CustID, expired_at M->>C: Forward OTP, CustID, expired_at & withdrawal instructions C->>A: Select cardless menu, input CustID + OTP A->>S: Validate CustID + OTP alt Success — Data Valid A->>C: Dispense cash A->>S: Withdrawal success notification S->>S: Status: OPEN → SUCCESS S-->>M: Webhook callback (SUCCESS) M->>C: Notify withdrawal successful else Failed / Expired — Invalid data or OTP expired A->>S: Withdrawal failed / expired notification S->>S: Reverse merchant balance S->>S: Status: OPEN → FAILED / EXPIRED S-->>M: Webhook callback (FAILED / EXPIRED) M->>C: Notify failure (FAILED / EXPIRED) M->>M: Refund customer internal balance (if applicable) end ``` *** ## Transaction Status | Status | Description | | - | - | | `OPEN` | OTP issued and active — awaiting customer ATM input. Merchant balance is locked. | | `SUCCESS` | Cash dispensed at ATM. Funds deducted from merchant balance. | | `FAILED` | ATM rejected the transaction — invalid OTP or CustID. Merchant balance reversed. | | `EXPIRED` | OTP expired before ATM redemption. Merchant balance automatically reversed. | *** ## Recommended Flow **1. Customer initiates withdrawal** Customer submits a cardless withdrawal request on your platform — providing the desired amount and their registered phone number (CustID). **2. Request OTP from SingaPay** Call **Create Cardless Withdrawal** with the bank type, amount, and CustID. SingaPay locks the merchant balance and returns an OTP with an expiry time. **3. Deliver credentials to customer** Forward the OTP, CustID, and expiry time to the customer along with ATM usage instructions. **4. Customer redeems at ATM** Customer visits the supported ATM, selects the cardless withdrawal menu, and enters their CustID and OTP. **5. Receive webhook notification** SingaPay sends a webhook callback to your system with the final transaction status — `SUCCESS`, `FAILED`, or `EXPIRED`. **6. Verify status (optional)** Call **Show Cardless Withdrawal** or **List Cardless Withdrawals** to confirm the final status and reconcile your records. *** ## Important Notes > [accordion] Balance locked on OTP issuance > > The merchant balance is locked the moment a withdrawal request is created. If the transaction fails or expires, SingaPay automatically reverses the locked amount back to the merchant balance — no manual action required. > [accordion] OTP expiry > > Each OTP has a fixed expiry defined by the `expired_at` field returned in the API response. Customers must redeem the OTP at an ATM before this timestamp. Expired transactions cannot be re-used — create a new withdrawal request instead. > [accordion] Supported ATM banks > > Only ATMs from the bank specified in the `bank_type` parameter can process the withdrawal. Ensure customers are directed to the correct ATM network. > [accordion] Cancellation > > Only transactions with status `OPEN` can be cancelled. Once a transaction reaches `SUCCESS`, `FAILED`, or `EXPIRED`, it cannot be cancelled. > [accordion] Customer internal balance > > If your platform maintains an internal customer balance, remember to refund it when a transaction results in `FAILED` or `EXPIRED` — SingaPay reverses the merchant balance, but internal platform balance adjustments are the merchant's responsibility. *** ## Available Endpoints > [card] [Create Cardless Withdrawal](./create) > > Initiate a withdrawal request and receive the OTP and CustID credentials to deliver to the customer. > [card] [List Cardless Withdrawals](./list) > > Retrieve a paginated list of all cardless withdrawal transactions for an account. > [card] [Show Cardless Withdrawal](./show-detail) > > Get detailed information about a specific cardless withdrawal transaction. > [card] [Cancel Cardless Withdrawal](./cancel) > > Cancel an `OPEN` cardless withdrawal transaction before it is redeemed at an ATM. > [!NOTE] > > All endpoints require authentication. See [Authentication](/api-reference/authentication). # List Source: https://docs.singapay.id/api-reference/cardless-withdrawal/list https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/cardless-withdrawals/transaction/{account_id} Returns a paginated list of cardless withdrawals for the account, limited to the last 12 months. Results are sorted newest-first, 25 records per page. Unlike the show endpoint, list records do not include the related `account` object. # Show Detail Source: https://docs.singapay.id/api-reference/cardless-withdrawal/show-detail https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/cardless-withdrawals/transaction/{account_id}/{reference_number} Retrieves full details of a single cardless withdrawal including status, fee breakdown, and balance impact. Lookup is by the merchant-supplied `reference_number`, not the platform `transaction_id`. # Binding Card Source: https://docs.singapay.id/api-reference/direct-debit/binding-card https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/direct-debit/binding Initiates a Direct Debit binding flow. The merchant must redirect the customer to `data.redirect_url` to complete bank authentication; the link is single-use and expires at `data.expires_at` (typically ~15 minutes). Final binding outcome is delivered via the configured `direct_debit_notif_url` callback. # Binding Status Source: https://docs.singapay.id/api-reference/direct-debit/binding-status https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v2.0/direct-debit/binding/{binding_id} Returns the current state of a binding. Use this endpoint to poll for `PENDING_AUTH → ACTIVE` transitions when webhook delivery is unavailable; otherwise prefer the `direct-debit.binding.succeeded` callback. `{binding_id}` is constrained to UUID at the route layer, so malformed values return **404** before controller execution. # Charge Source: https://docs.singapay.id/api-reference/direct-debit/charge https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/direct-debit/charge Pulls funds from a bound bank account into the merchant settlement account. # Get Transaction Source: https://docs.singapay.id/api-reference/direct-debit/get-transaction https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v2.0/direct-debit/transaction/{transaction_id} Returns the latest known state of a Direct Debit charge. If the row remains non-terminal beyond the configurable reconciliation window, this endpoint attempts an upstream reconcile before responding so the result is as fresh as possible. Reconcile failures are logged and the existing record is still returned. `{transaction_id}` is constrained to UUID at the route layer. # Overview Source: https://docs.singapay.id/api-reference/direct-debit/introduction Pull funds directly from a customer's bank account using a one-time authorization binding — no card required. Direct Debit lets you debit funds directly from a customer's bank account after a one-time authorization setup. The customer links their bank account once through a hosted webview, and you can charge it on demand — without redirecting the customer again. > [!NOTE] > > This is a **Money In** operation. Each charge pulls funds from the customer's bound bank account into your Singapay merchant settlement account. > [card] One-time setup > > Customer authorizes their bank account once via a hosted webview. All future charges use the stored `binding_id` — no customer redirect needed. > [card] OTP-aware charging > > Some banks require an OTP per charge. SingaPay handles both flows automatically and signals when `/verify-otp` is needed. > [card] Multi-bank support > > Supports BRI, Mandiri, BNI, Danamon, BCA, CIMB, BNC, and more via BI/SNAP bank codes. *** ## How Direct Debit Works Direct Debit has two phases: **Binding** (one-time) and **Charge** (repeatable). * **Binding** — The customer authorizes their bank account via a hosted webview. On success, an `ACTIVE` binding is created and can be used for future charges indefinitely. * **Charge** — The merchant initiates a pull payment using the `binding_id`. Depending on the bank's `payment_otp_mode`, the charge either completes silently or requires the customer to submit an OTP. *** ## Flow Diagram ```mermaid theme={null} sequenceDiagram participant C as Customer participant M as Merchant System participant S as SingaPay API participant B as Bank Note over C,B: Phase 1 — Binding (one-time setup) M->>S: POST /direct-debit/bindings Note over M,S: customer_ref, phone_no, bank_code, payment_otp_mode S-->>M: binding_id, redirect_url, expires_at (status: PENDING_AUTH) M->>C: Redirect to redirect_url C->>B: Authorize via hosted webview B-->>S: Binding result callback S->>S: Binding status → ACTIVE / FAILED / EXPIRED S-->>M: Webhook: binding.succeeded / binding.failed Note over C,B: Phase 2 — Charge (repeatable, no customer redirect) M->>S: POST /direct-debit/charge Note over M,S: binding_id, amount, merchant_reference alt No OTP required S->>B: Debit bank account B-->>S: Settlement confirmation S->>S: Transaction status → SUCCESS S-->>M: Webhook: transaction SUCCESS else OTP required S-->>M: HTTP 202 — requires_otp: true, transaction_id B->>C: OTP delivered by bank C->>M: Submit OTP M->>S: POST /direct-debit/verify-otp Note over M,S: transaction_id + otp S->>B: Verify OTP & debit account B-->>S: Settlement confirmation S->>S: Transaction status → SUCCESS / FAILED S-->>M: Webhook: transaction SUCCESS / FAILED end ``` *** ## Binding Status | Status | Description | | - | - | | `PENDING_AUTH` | Binding initiated — customer has been redirected to the bank webview for authorization. | | `ACTIVE` | Customer authorized successfully. This binding can be used for charges. | | `UNBOUND` | Binding was revoked by the merchant via the Unbind endpoint. | | `FAILED` | Customer cancelled or the bank rejected the authorization. | | `EXPIRED` | Customer did not complete authorization before `expires_at`. | *** ## Transaction Status | Status | Description | | - | - | | `PENDING` | Charge accepted, awaiting settlement confirmation from the bank. | | `PENDING_OTP` | OTP required — waiting for customer to submit OTP via `/verify-otp`. | | `SUCCESS` | Funds credited to merchant settlement account. Fee breakdown available in `fees`. | | `FAILED` | Bank rejected the charge — check `failure_code` and `failure_reason`. | | `EXPIRED` | OTP not submitted in time, or upstream timeout. | *** ## Recommended Flow **1. Create a binding** Call **Binding Card** with the customer's phone number, bank code, and preferred OTP mode. Redirect the customer to the returned `redirect_url` to complete bank authorization. **2. Confirm binding is active** Listen for the `direct-debit.binding.succeeded` webhook, or poll **Binding Status** until the status is `ACTIVE`. Store the `binding_id` — you will use it for all future charges. **3. Charge the bound account** Call **Charge** with the `binding_id`, `amount`, and a unique `merchant_reference`. If the bank requires OTP (`requires_otp: true`), proceed to the next step. **4. Verify OTP (if required)** If the Charge response returns HTTP 202 with `requires_otp: true`, prompt the customer to enter the OTP sent by their bank, then call **Verify OTP** with the `transaction_id` and OTP value. **5. Confirm payment outcome** Listen for the transaction webhook or call **Get Transaction** by `transaction_id` to confirm the final `SUCCESS` or `FAILED` status. *** ## Supported Banks | Bank | Bank Code | | - | - | | Bank Rakyat Indonesia (BRI) | `002` | | Bank Mandiri | `008` | | Bank Negara Indonesia (BNI) | `009` | | Bank Danamon | `011` | | Bank Central Asia (BCA) | `014` | | CIMB Niaga | `022` | | Bank Neo Commerce (BNC) | `490` | *** ## Important Notes > [accordion] Redirect URL is single-use and short-lived > > The `redirect_url` returned on binding creation is **single-use** and expires at `expires_at` (typically \~15 minutes). Treat it as opaque — do not parse or hardcode its host or path. If it expires before the customer completes authorization, create a new binding. > [accordion] OTP mode is bank-determined > > The `payment_otp_mode` parameter is a preferred hint — the bank may require OTP regardless of this setting. Always check the Charge response for `requires_otp` before assuming a silent charge will complete. > [accordion] Idempotency via merchant\_reference > > The `merchant_reference` field acts as an idempotency key for charges. Submitting the same reference twice returns `SP_DD_DUPLICATE_REFERENCE` — store the first `transaction_id` and query its status instead of retrying with a new request. > [accordion] Unbinding may also require OTP > > Some banks require OTP verification when revoking a binding. If the Unbind response returns `otp_required: true`, call **Verify OTP** with the `binding_id` and the `unbind_context` from the `otp_handoff` block. > [accordion] Signature required for charge > > The **Charge** endpoint requires additional `X-Signature` and `X-Timestamp` headers — separate from the standard Bearer token. See [Authentication](/api-reference/authentication) for signing requirements. > [accordion] IP whitelisting required > > All Direct Debit endpoints require IP whitelisting. Ensure your server IP is registered under the merchant account before going live. *** ## Available Endpoints > [card] [Binding Card](./binding-card) > > Initiate a binding — returns a hosted webview `redirect_url` for the customer to authorize their bank account. > [card] [Binding Status](./binding-status) > > Check the current state of a binding by `binding_id`. > [card] [Unbind Card](./unbind-card) > > Revoke an active binding. May require OTP verification for some banks. > [card] [Charge](./charge) > > Pull funds from a bound bank account. Returns `requires_otp: true` when OTP verification is needed. > [card] [Verify OTP](./verify-otp) > > Submit the customer OTP to complete a charge or unbinding that requires verification. > [card] [Get Transaction](./get-transaction) > > Retrieve the latest status of a Direct Debit charge by `transaction_id`. > [!NOTE] > > All endpoints require authentication. The Charge endpoint additionally requires `X-Signature` and `X-Timestamp`. See [Authentication](/api-reference/authentication). # Unbind Card Source: https://docs.singapay.id/api-reference/direct-debit/unbind-card https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/direct-debit/binding/{binding_id}/unbind Revokes an active binding. After this completes the binding can no longer be charged. Some banks require OTP; in that case the response is **HTTP 202** with `data.otp_required=true` and an `otp_handoff` block, and the merchant must follow up with `POST /verify-otp`. Other banks use a fire-and-forget flow; the binding remains in its current `status` until the `direct-debit.unbinding.succeeded` webhook confirms the final state. No request body is required. # Verify OTP Source: https://docs.singapay.id/api-reference/direct-debit/verify-otp https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/direct-debit/verify-otp Completes OTP verification for either payment or unbinding flows. Use `transaction_id` for payment OTP (after `POST /charge` returns `requires_otp=true`), or `binding_id` + `unbind_context` for unbind OTP (after `POST /binding/{id}/unbind` returns `otp_handoff`). Submitting both or neither returns **422 SP018**. # Check fee Source: https://docs.singapay.id/api-reference/disbursement-money-out/check-fee https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v1.0/disbursement/{account_id}/check-fee Calculates the transfer fee and total debit amount before you submit a disbursement. Provide the destination bank SWIFT code and the net amount the beneficiary should receive. The quote fails if the resulting gross amount would exceed the account available balance or merchant transfer limits. Recommended before transfer. # Disburse Transfer Source: https://docs.singapay.id/api-reference/disbursement-money-out/disburse-transfer https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/disbursement/transfer Submits a bank disbursement using the v2 API contract. The merchant account is specified in the request body (`account_id`), not in the URL path. See `Response Code` for SP000–SP020 definitions and merchant actions. **CRITICAL:** This is a money-out operation requiring **X-Signature** and **X-Timestamp** authentication per internal signing protocol. # Inquiry Status Source: https://docs.singapay.id/api-reference/disbursement-money-out/inquiry-status https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/disbursement/{account_id}/inquiry-status Retrieves the current status and details of a disbursement using your `reference_number` and the account in the path. For pending transactions, the service may refresh status from the banking partner before responding, See `Response Code` for the full SP000–SP020 reference. # Overview Source: https://docs.singapay.id/api-reference/disbursement-money-out/introduction Send funds from your Singapay account to any bank account in Indonesia — with fee checking and real-time status tracking. The Disbursement API lets you programmatically transfer funds from your Singapay balance to any Indonesian bank account. Use it to automate payouts to vendors, sellers, employees, or customers — with built-in fee checking before committing to a transfer. > [!NOTE] > > This is a **Money Out** operation. Each disbursement debits funds from your Singapay Payment Gateway account and transfers them to the destination bank account. > [card] Pre-transfer fee check > > Check the transfer fee and total debit amount before initiating any transfer. > [card] Real-time status > > Query disbursement status by reference number at any point in the transfer lifecycle. > [card] Multi-bank coverage > > Transfer to all major Indonesian banks using bank code or SWIFT code. *** ## Recommended flow **1. Check disbursement fee** Call **Check Disbursement Fee** to get the gross amount, fee, and net amount for the destination bank. This ensures transparency before the transfer is committed. **2. Initiate transfer** Call **Disburse Transfer** with the destination bank details and confirmed amount. A unique `reference_number` is returned to track the transaction. **3. Track status** Use **Inquiry Disbursement Status** with the `reference_number` to poll or verify the final transfer status — especially for pending transactions. *** ## Disbursement status | Status | Description | | - | - | | `pending` | Transfer initiated, awaiting processing by the bank network. | | `success` | Funds successfully transferred to the destination account. | | `failed` | Transfer failed — check the error code for the reason. | *** ## Important notes > [accordion] Fee structure > > Disbursement fees vary by destination bank. Use **Check Disbursement Fee** to get an accurate breakdown of gross, fee, and net amounts before committing to a transfer. > [accordion] Bank code formats > > The `bank_code` field accepts either a **3-digit numeric code** (e.g. `014` for BCA) or a **SWIFT code** (e.g. `CENAIDJA`). Both formats are supported on the **Disburse Transfer** endpoint. **Check Disbursement Fee** accepts the SWIFT code only (`bank_swift_code`). > [accordion] Signature required for transfers > > The **Disburse Transfer** and **Inquiry Status** endpoints require an additional `X-Signature` and `X-Timestamp` header using internal signing rules — separate from the standard Bearer token auth. > [accordion] Idempotency via reference number > > Always store the `reference_number` returned from a transfer. Use it to query status and handle retries safely — submitting the same reference number twice will not create a duplicate transfer. *** ## Available endpoints > [card] [List Disbursements](./list) > > Paginated list of disbursement transactions for an account (last 12 months). > [card] [Get Disbursement by Transaction ID](./show) > > Retrieve a single disbursement by its business `transaction_id` string. > [card] [Check Disbursement Fee](./check-fee) > > Get gross, fee, and net breakdown for a destination bank before transferring. > [card] [Disburse Transfer](./disburse-transfer) > > Initiate a bank transfer from your Singapay balance to the destination account. > [card] [Inquiry Disbursement Status](./inquiry-status) > > Query the current status of a disbursement by reference number. > [!NOTE] > > All endpoints require authentication, including `X-Signature` and `X-Timestamp` on transfer endpoints. See [Authentication](/api-reference/authentication). # List Source: https://docs.singapay.id/api-reference/disbursement-money-out/list https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/disbursement/{account_id} Returns a paginated list of bank disbursements for the specified merchant account. Includes transactions from the last twelve months, twenty-five records per page, sorted newest first. Requires merchant API authentication; the account must belong to the authenticated merchant. # Show Source: https://docs.singapay.id/api-reference/disbursement-money-out/show https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/disbursement/{account_id}/{transaction_id} Returns the details of a single disbursement for the specified account. Identify the transaction using the disbursement `transaction_id` (SingaPay business identifier), not the internal database primary key. # Create v1 (Legacy) Source: https://docs.singapay.id/api-reference/e-wallet-money-in/create-v1-legacy https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v1.0/ewallet-native/{account_id}/create-checkout Creates a native e-wallet checkout for the specified account. Payment amount must be within merchant configuration limits for the selected e-wallet vendor. # Create v2 Source: https://docs.singapay.id/api-reference/e-wallet-money-in/create-v2 https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/ewallet-native/create-order Creates a native e-wallet checkout with the account identifier in the request body. # Inquiry status Source: https://docs.singapay.id/api-reference/e-wallet-money-in/inquiry-status https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/ewallet-native/{account_id}/inquiry-status/{id} Inquires the current status of an e-wallet transaction. For open transactions, the system may contact the vendor to refresh the status. # Overview Source: https://docs.singapay.id/api-reference/e-wallet-money-in/introduction Learn how to process incoming payments using e-wallet apps like ShopeePay and Dana on the Singapay Payment Gateway. E-Wallet Native is a money-in payment method that allows your customers to pay directly using their e-wallet apps. When a checkout is created, the customer receives a redirect URL to authorize and complete the payment within their preferred e-wallet application. > [!NOTE] > > **Money In Operation:** Funds are transferred from the customer's e-wallet to your SingaPay Payment Gateway account. For top-ups to customer e-wallets (Money Out), please refer to the [E-Wallet Top Up (Money Out)](/api-reference/e-wallet-money-out/introduction) documentation. ## E-Wallet Payment Flow The process from creating a checkout to successfully confirming a payment: ```mermaid theme={null} sequenceDiagram participant M as Merchant System participant S as SingaPay API participant C as Customer participant E as E-Wallet Provider M->>S: POST /ewallet-native/{account_id}/create-checkout S-->>M: checkout_url & checkout_url_app M->>C: Redirect to e-wallet (web or deep link) C->>E: Authorize & complete payment E->>S: Payment confirmation notification S->>S: Update status: open → success S-->>M: Webhook notification (optional) M->>S: GET /inquiry-status (optional) S-->>M: Latest transaction status ``` **1. Create Checkout** **Merchant System** sends a `POST /ewallet-native/{account_id}/create-checkout` request to the SingaPay API containing the bill amount, vendor, and customer information. **2. Receive Redirect URLs** **SingaPay API** responds by providing the `checkout_url` and `checkout_url_app`. **3. Redirect Customer** **Merchant System** redirects the customer using the web URL or deep link to their e-wallet app. **4. Authorize Payment** **Customer** authorizes and completes the payment within the **E-Wallet Provider** app. **5. Payment Notification** **E-Wallet Provider** sends a payment confirmation notification to the **SingaPay API**. **6. Process Payment** **SingaPay API** processes the payment internally, changing the transaction status from `open` to `success`. **7. Webhook Notification (Optional)** **SingaPay API** sends a webhook notification to the **Merchant System** to inform them that the payment has been received. **8. Verify Status** **Merchant System** can call `GET /inquiry-status` or `/list` to verify the latest payment status. ## Supported E-Wallet Vendors > [card] ShopeePay > > `EWALLET_SHOPEEPAY` > > Supports web redirect and app deep link. > [card] Dana > > `EWALLET_DANA` > > Supports web redirect. > [card] OVO > > `EWALLET_OVO` > > Supports push to pay. ## Transaction Status Lifecycle Every e-wallet transaction goes through the following status lifecycle: | Status | Description | | - | - | | `open` | Checkout has been created, waiting for the customer to authorize and complete the payment via the e-wallet app. Checkout URL is active. | | `success` | Payment completed successfully. Funds have been received from the customer. | | `expired` | Checkout link has expired. Computed automatically when the `expired_at` timestamp has passed while the status is still `open`. | | `canceled` | Transaction was canceled before the payment was completed. | | `failed` | Payment attempt failed due to an error during processing. | ## Available endpoints > [card] [Create Checkout (Legacy)](./create-v1-legacy) > > Create a new e-wallet checkout order with a redirect URL for the customer > [card] [Create Checkout v2](./create-v2) > > Create a new e-wallet checkout order with a redirect URL for the customer > [card] [List E-Wallet](./list-transactions) > > Retrieve a paginated list of all e-wallet transactions for an account, with filters available. > [card] [Show E-Wallet](./show-transaction) > > Get detailed information about a specific e-wallet transaction. > [card] [Inquiry Status](./inquiry-status) > > Check and sync the latest payment status from the e-wallet vendor. This operation can trigger state changes. ## Important Notes > [accordion] Checkout Expiration & Auto-Expire > > By default, checkout URLs expire after **30 minutes**. You can set a custom expiration using the `expired_at` parameter. The `status_computed` field automatically shows `expired` when an open transaction's `expired_at` has passed, even if the raw status is still `open`. > [accordion] Understanding Redirect URLs > > The API returns two types of links: > > * `checkout_url`: Used for redirecting to a web browser. > * `checkout_url_app`: A deep link to directly open the related e-wallet app (if supported by the vendor). > [accordion] Fees & Settlements > > Each transaction details a `vendor_fee`, `merchant_fee`, and `net_amount` for transparent fee tracking. You can monitor reconciliation and settlement statuses via the `has_recon` and `has_settle` fields. > [accordion] Data Retention & Deletion Restrictions > > * Only transactions with the status `open` can be deleted. Paid or settled transactions cannot be deleted. > * Transaction history records from the **last 1 year** are available via the API. Older records are safely archived. # List transactions Source: https://docs.singapay.id/api-reference/e-wallet-money-in/list-transactions https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/ewallet-native-transactions/{account_id} Retrieves a paginated list of e-wallet native transactions for the specified account. Supports optional query filters for reference, status, vendor, amounts, settlement, and date ranges. # Show transaction Source: https://docs.singapay.id/api-reference/e-wallet-money-in/show-transaction https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/ewallet-native-transactions/{account_id}/{transaction_id} Retrieves the details of a single e-wallet transaction within the specified account. # Inquiry Status Source: https://docs.singapay.id/api-reference/e-wallet-money-out/inquiry-status https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/ewallet/{account_id}/inquiry-status Retrieves the current status of a previously initiated e-wallet transfer. This endpoint looks up the transaction by reference number and returns detailed status information. For transactions still in Pending status, the endpoint may query the e-wallet provider for updated status information. Status codes include 00 (Success), 03 (Pending), and 06 (Failed). Network timeouts during provider status checks will result in error code SP005. # Overview Source: https://docs.singapay.id/api-reference/e-wallet-money-out/introduction Transfer funds from your Singapay balance directly to customers' e-wallets — OVO, Dana, ShopeePay, GoPay, and more. The E-Wallet Top Up API lets you send funds from your Singapay account to any supported Indonesian e-wallet. Use it to automate cashback, refunds, rewards, or seller payouts directly to customers' e-wallet balances — no bank account required. > [!NOTE] > > This is a **Money Out** operation. Each top-up debits funds from your Singapay Payment Gateway balance and credits the destination e-wallet account. > [card] OVO > > Top up OVO balance directly. > [card] Dana > > Transfer to Dana accounts. > [card] ShopeePay > > Fund ShopeePay wallets. > [card] GoPay & more > > GoPay and other supported providers. *** ## Recommended flow ```mermaid theme={null} sequenceDiagram participant M as Merchant System participant S as SingaPay API participant E as E-Wallet Provider M->>S: Trigger Transfer (provider + phone number + amount) S->>S: Debit Singapay balance S->>E: Dispatch top-up to provider S-->>M: reference_number + status (pending/success/failed) M->>S: Inquiry Status (reference_number) S-->>M: Final transaction status ``` **1. Trigger top-up** Call **E-Wallet Top Up — Trigger Transfer** with the e-wallet provider, the customer's e-wallet phone number, and the amount. Singapay debits your balance and dispatches the top-up job to the provider. A `reference_number` is returned to track the transaction. **2. Inquiry status** Use **E-Wallet Top Up — Inquiry Status** with the `reference_number` to verify the final outcome — especially for transactions that remain in `pending` state. *** ## Transaction status | Status | Description | | - | - | | `pending` | Top-up initiated, awaiting processing by the e-wallet provider. | | `success` | Funds successfully credited to the destination e-wallet. | | `failed` | Top-up failed — check the response code for the reason. | *** ## Important notes > [accordion] Destination account validation > > **Trigger Transfer** validates the destination e-wallet account. If the account isn't found, the request fails with response code `SP117`. > [accordion] Provider-specific limits > > Each e-wallet provider has its own minimum and maximum top-up limits. Make sure the amount is within the provider's limits before you submit a transfer. > [accordion] Signature required for transfers > > The **Trigger Transfer** endpoint requires additional `X-Signature` and `X-Timestamp` headers using internal signing rules — separate from standard Bearer token auth. See [Authentication](/api-reference/authentication) for signing requirements. > [accordion] Reference number for tracking > > Store the `reference_number` returned from the Trigger Transfer call. Use it with **Inquiry Status** to safely check the outcome and handle retries without creating duplicate top-ups. > [accordion] Pending status handling > > For transactions that return `pending`, use **Inquiry Status** to refresh the status. If a `vendor_reference_no` exists on a pending record, Singapay will attempt to refresh the status from the provider — timeouts return response code `SP005`. *** ## Available endpoints > [card] [Trigger Transfer](./trigger-top-up) > > Initiate the top-up and transfer funds from your Singapay balance to the e-wallet. > [card] [Inquiry Status](./inquiry-status) > > Query the current status of a top-up transaction by reference number. > [!NOTE] > > All endpoints require `Authorization: Bearer ` and `X-PARTNER-ID` on every request. The Trigger Transfer endpoint additionally requires `X-Signature` and `X-Timestamp`. See [Authentication](/api-reference/authentication) for details. # Trigger Top-Up Source: https://docs.singapay.id/api-reference/e-wallet-money-out/trigger-top-up https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/ewallet/trigger-topup Initiates an e-wallet fund transfer to a beneficiary. This endpoint performs comprehensive validation, deducts funds from merchant balance atomically, creates a transaction record, and queues processing through the job system. The response indicates transaction has been queued with status typically Pending until background processing completes. **CRITICAL:** This is a money-out operation requiring **X-Signature** and **X-Timestamp** authentication per internal signing protocol. Middleware validation includes kill-switch check, request signature verification, rate limiting, and anomaly detection. Duplicate reference numbers within 24 hours are rejected with error code SP004. # E-Wallet Name Verification Source: https://docs.singapay.id/api-reference/e-wallet/e-wallet-name-verification https://core.singapay.id/identity-verification/docs/swagger.json post /api/v1/kyc/ewallet/verify Looks up the registered holder name on the e-wallet for the given phone number and compares it with the `name` you send. A completed check is billed (`pricing=PAID`), including when the account is not found. Validation errors and service failures are not billed (`pricing=FREE`). ### Outcomes | Result | Response | |---|---| | Account found with a registered name | `code=SUCCESS`, `data.status="found with kyc"`, `pricing=PAID` | | Account found, holder has not completed KYC | `code=SUCCESS`, `data.status="found without kyc"`, `similarity=0`, `suggestion=review`, `pricing=PAID` | | No account for this phone | `code=SUCCESS`, `data.status="not found"`, `suggestion=reject`, `pricing=PAID` | | Temporary service issue | `code=SERVER_ERROR`, `pricing=FREE` | | Invalid request (phone, name, wallet, or `request_id`) | `code=CLIENT_ERROR`, `pricing=FREE` | | Same `request_id` with a different body | `code=DUPLICATE_REFERENCE`, `pricing=FREE` | | Missing token, or IP not allowlisted | `code=UNAUTHORIZED`, `pricing=FREE` | | Prepaid balance too low | `code=INSUFFICIENT_BALANCE`, `pricing=FREE` | ### Phone numbers Send Indonesian numbers as `08…` or `62…` (9–13 digits). Do not include spaces or a `+` prefix. ### Idempotency Use a unique `request_id` for each new check (UUID v4 is recommended). Repeating the same `request_id` with the same body returns the original result and is billed once. A different body with the same `request_id` returns `DUPLICATE_REFERENCE`. # Face Comparison Source: https://docs.singapay.id/api-reference/face-comparison/face-comparison https://core.singapay.id/identity-verification/docs/swagger.json post /api/v1/kyc/face-comparison Compares `first_image` with `second_image` and returns a similarity score plus bounding boxes. A scored comparison (`SUCCESS`) and billed detection outcomes (`FACE_NOT_FOUND`, `FIRST_FACE_NOT_FOUND`, `SECOND_FACE_NOT_FOUND`, `MULTIPLE_FACES_DETECTED`) are billed (`pricing=PAID`). Validation errors and service failures are not billed (`pricing=FREE`). This feature must be enabled on your account. If it is not, the API returns `UNAUTHORIZED`. ### Outcomes | Result | Response | |---|---| | Faces compared | `code=SUCCESS`, `data.first_face` / `data.second_face` bounding boxes, `data.similarity`, `pricing=PAID` | | No face / multiple faces | `code` is the vendor detection code, `pricing=PAID` (no `data`) | | Face quality rejected by vendor | `code=CLIENT_ERROR`, `pricing=FREE` | | Temporary service issue | `code=SERVER_ERROR`, `pricing=FREE` | | Invalid images or `request_id` | `code=CLIENT_ERROR`, `pricing=FREE` | | Same `request_id` with different images | `code=DUPLICATE_REFERENCE`, `pricing=FREE` | | Missing token, feature not enabled, or IP not allowlisted | `code=UNAUTHORIZED`, `pricing=FREE` | | Prepaid balance too low | `code=INSUFFICIENT_BALANCE`, `pricing=FREE` | ### Images JPEG and PNG only, 5 MB or smaller per file. Send them either as: - `application/json` — `first_image` and `second_image` are raw base64 (no line breaks, no `data:image/…` prefix) - `multipart/form-data` — `request_id` as a text field, `first_image` and `second_image` as file parts (the same field names) Do not mix the two encodings in one request. ### Idempotency Use a unique `request_id` for each new comparison (UUID v4 is recommended). Repeating the same `request_id` with the same images returns the original result and is billed once — unless the previous attempt did not complete, in which case the comparison runs again. Different images with the same `request_id` return `DUPLICATE_REFERENCE`. # Get Transaction Detail Source: https://docs.singapay.id/api-reference/general/get-transaction-detail https://biller-b2b.singapay.id/docs post /api/v1/detail-bill-transaction Retrieve the full detail of a specific bill transaction by its transaction ID. # Inquiry Balance Source: https://docs.singapay.id/api-reference/general/inquiry-balance https://biller-b2b.singapay.id/docs post /api/v1/check-balance Retrieve the current deposit balance for the authenticated merchant. # List Transactions Source: https://docs.singapay.id/api-reference/general/list-transactions https://biller-b2b.singapay.id/docs post /api/v1/list-bill-transaction Retrieve a paginated list of bill transactions for the authenticated merchant. Supports filtering by transaction ID, customer ID, status, and date range. # Reset Customer ID Source: https://docs.singapay.id/api-reference/general/reset-customer-id https://biller-b2b.singapay.id/docs post /api/v1/reset-customer-id This API is intended solely for the development team to perform repeated tests in the development environment. Because of limitations on customer IDs in the dev server, the API can reset any customer ID that becomes unusable due to fraud detection mechanisms or other restrictions. # ID Forgery Check Source: https://docs.singapay.id/api-reference/id-forgery-check/id-forgery-check https://core.singapay.id/identity-verification/docs/swagger.json post /api/v1/kyc/id-forgery-check Assesses whether a photo of an Indonesian ID card (KTP) is a forgery / presentation-attack (photocopy, photograph of the original, edited image, or failed information checks). A completed assessment is billed (`pricing=PAID`), including when `data.is_forged` is `TRUE`. Validation failures and service failures are not billed (`pricing=FREE`). This feature must be enabled on your account. If it is not, the API returns `UNAUTHORIZED`. ### Outcomes | Result | Response | |---|---| | Assessment completed | `code=SUCCESS`, `data.is_forged` / `data.reason`, `pricing=PAID` | | Missing `request_id` / image, both `image_url` and `image_base64`, or wrong image format | `code=CLIENT_ERROR`, `pricing=FREE` (HTTP 400) | | Image exceeds 8MB | `code=CLIENT_ERROR`, `pricing=FREE` (HTTP 413) | | Temporary service issue | `code=SERVER_ERROR`, `pricing=FREE` | | Same `request_id` reused after a **completed** check | `code=DUPLICATE_REFERENCE`, `pricing=FREE` (HTTP 409) | | Same `request_id` reused after a **failed** attempt | Retried for real: the image you send this time is what actually gets processed and (if it succeeds) billed | | Missing token, feature not enabled, or IP not allowlisted | `code=UNAUTHORIZED`, `pricing=FREE` | | Prepaid balance too low | `code=INSUFFICIENT_BALANCE`, `pricing=FREE` | ### Images JPEG and PNG only, 8 MB or smaller. Send the photo either as: - `application/json` — `request_id` plus exactly one of `image_url` (HTTPS URL fetched by the engine) or `image_base64` (raw base64, no line breaks, no `data:image/…` prefix) - `multipart/form-data` — `request_id` as a text field, `image` as a file part Do not mix the two encodings in one request. ### `data.reason` mapping | `is_forged` | `reason` | |---|---| | `FALSE` | `PASS` | | `TRUE` | Known labels joined with `"; "` — photocopy, photograph of the original, edited, format validation failed, consistency check failed. Empty string when the engine returned no mapped codes. | Vendor warning codes are never returned to merchants. ### Idempotency Use a unique `request_id` for each new check (UUID v4 is recommended). Reusing a `request_id` that already resolved to a **completed** check always returns `DUPLICATE_REFERENCE`. Reusing a `request_id` whose prior attempt **failed** retries for real. # OCR KTP Check Source: https://docs.singapay.id/api-reference/ocr/ocr-ktp-check https://core.singapay.id/identity-verification/docs/swagger.json post /api/v1/kyc/ocr-ktp-verify Reads the fields printed on an Indonesian KTP (ID card) from an uploaded photo. A completed extraction is billed (`pricing=PAID`). Validation failures, an image the OCR engine cannot read as an ID card, and service failures are not billed (`pricing=FREE`). This feature must be enabled on your account. If it is not, the API returns `UNAUTHORIZED`. ### Outcomes | Result | Response | |---|---| | Extraction succeeded | `code=SUCCESS`, `pricing=PAID` | | Image isn't a recognizable ID card (per the OCR engine) | `code=CLIENT_ERROR`, `pricing=FREE` | | Extracted `id_number` isn't a valid 16-digit NIK | `code=CLIENT_ERROR`, `pricing=FREE` | | Missing `request_id` / `image`, or wrong image format | `code=CLIENT_ERROR`, `pricing=FREE` (HTTP 400) | | Image exceeds 8MB | `code=CLIENT_ERROR`, `pricing=FREE` (HTTP 413) | | Temporary service issue | `code=SERVER_ERROR`, `pricing=FREE` | | Same `request_id` reused after a **completed** extraction | `code=DUPLICATE_REFERENCE`, `pricing=FREE` (HTTP 409) — always, regardless of what image you send this time | | Same `request_id` reused after a **failed** attempt | Retried for real: the image you send this time is what actually gets processed and (if it succeeds) billed | | Missing token, feature not enabled, or IP not allowlisted | `code=UNAUTHORIZED`, `pricing=FREE` | | Prepaid balance too low | `code=INSUFFICIENT_BALANCE`, `pricing=FREE` | ### Image requirements JPEG or PNG only (checked against the actual bytes, not just the declared `Content-Type`), 8MB maximum. ### Idempotency Use a unique `request_id` for each new extraction (UUID v4 is recommended). Reusing a `request_id` that already resolved to a **completed** extraction always returns `DUPLICATE_REFERENCE`, regardless of what image you send this time — mint a new `request_id` for every extraction attempt. Reusing a `request_id` whose prior attempt **failed** retries for real — the image you send this time is what actually gets processed and (if it succeeds) billed. # Overview Source: https://docs.singapay.id/api-reference/payment-link-history/introduction Track, monitor, and reconcile every payment received through your Payment Links — each recorded as an individual Payment Link History. Every time a customer completes a payment through a Payment Link URL, Singapay creates a **Payment Link History** record. This API lets you list, filter, and inspect those records for reconciliation, reporting, and customer support. > [card] Per-payment records > > Every payment through a link creates its own history entry with status, amount, and method. > [card] Full fee breakdown > > Each record shows vendor fee, platform margin, and net amount received. > [card] Filterable & searchable > > Query by reference number, method, status, amount, or date range. *** ## Relationship with Payment Link A Payment Link is the **parent** — the reusable URL and its configuration. Each time a customer pays through it, a Payment Link History **child** record is created. > [!NOTE] > > **Example:** Payment Link `https://singapay.com/b2b/INV-2024-001` > > | History | Amount | Method | Date | > | - | - | - | - | > | #1 | IDR 500,000 | VA BRI | Jan 1 | > | #2 | IDR 500,000 | QRIS | Jan 2 | > | #3 | IDR 500,000 | GoPay | Jan 3 | > > One Payment Link → multiple independent history records. *** ## Transaction lifecycle **1. Customer opens the link** Customer accesses the Payment Link URL and views the payment page with item details. **2. Selects a payment method** Customer chooses from the available methods configured for that link (VA, QRIS, or E-Wallet). **3. History record created** A Payment Link History record is created immediately with status `pending`. **4. Customer completes payment** Customer pays via the selected method. The bank or payment provider sends a notification to Singapay. **5. Processing and reconciliation** Singapay validates the payment and reconciles the transaction. Status updates to `paid`. **6. Settlement** Funds are settled to your account (bank or Singapay Balance) based on your configured settlement method. *** ## Payment status | Status | Description | | - | - | | `pending` | History record created, awaiting payment from customer. | | `paid` | Payment confirmed and reconciled by Singapay. | | `settled` | Funds transferred to your account. | *** ## Important notes > [accordion] Multiple payment methods per link > > A single Payment Link can receive payments via different methods (VA, QRIS, E-Wallet). Each payment is recorded as a separate history entry regardless of method used. > [accordion] Customer information capture > > If customer detail collection is enabled on the Payment Link, name, email, and phone are captured and stored in each history record. > [accordion] Fee breakdown per transaction > > Every history record includes the payment method used, vendor fee, platform margin, and net amount received — ready for accounting reconciliation. > [accordion] QRIS special handling > > For QRIS payments, additional MDR (Merchant Discount Rate) information is recorded in the history entry alongside standard fields. > [accordion] Filtering and search > > Query histories by `reff_no`, `status`, `payment_method_name`, `amount`, date ranges (`created_at_from` / `created_at_to`), and settlement dates. Default sort is newest first. > [accordion] Data retention > > History records are retained for **1 year**. Data older than 1 year is archived and may not be accessible via the API. *** ## Available endpoints > [card] [List Payment Link Histories](./list) > > Paginated list of history records for an account with full filter support. > [card] [Show Payment Link History](./show) > > Retrieve a single history record by ID. > [!NOTE] > > All endpoints require authentication. See [Authentication](/api-reference/authentication). # List Source: https://docs.singapay.id/api-reference/payment-link-history/list https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/payment-link-histories/{account_id} Retrieve a paginated list of payment link transactions for an account. Each entry represents a single payment attempt made against one of the account's payment links. Results are restricted to transactions created within the last 12 months and are ordered newest-first by default. Use the query parameters to paginate, sort, and filter the result set; pagination details are returned in the response `meta` object. The following optional filters are available and may be combined: `reff_no`, `status`, `payment_method_name`, `payment_method_value`, `amount`, `amount_min`, `amount_max`, `has_settle`, `created_at_from`/`created_at_to`, `payment_date_from`/`payment_date_to`, `processed_timestamp_from`/`processed_timestamp_to`, and `settle_at_from`/`settle_at_to`. Date filters accept ISO 8601 values and define an inclusive range. # Show Source: https://docs.singapay.id/api-reference/payment-link-history/show https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/payment-link-histories/{account_id}/{history_id} Retrieve the full detail of a single payment link transaction belonging to an account. The response includes the related payment link and payment method when available. The `history_id` path parameter is the numeric transaction id returned as `id` by the list endpoint. A `404` response is returned when no matching transaction exists for the specified account. # Inquiry Postpaid (Legacy) Source: https://docs.singapay.id/api-reference/postpaid-v1/inquiry-postpaid-legacy https://biller-b2b.singapay.id/docs post /api/v1/postpaid/inquiry Perform a bill inquiry for postpaid products. The command field determines the product category. Returns bill details and a reference number for subsequent payment. # Payment Postpaid (Legacy) Source: https://docs.singapay.id/api-reference/postpaid-v1/payment-postpaid-legacy https://biller-b2b.singapay.id/docs post /api/v1/postpaid/payment Process a postpaid bill payment using a reference number obtained from a prior inquiry. Requires the merchant credential password for authorization. # Inquiry Postpaid (v2) Source: https://docs.singapay.id/api-reference/postpaid-v2/inquiry-postpaid-v2 https://biller-b2b.singapay.id/docs post /api/v2/postpaid/inquiry Perform a bill inquiry for postpaid products (V2). The command field determines the product category. Returns bill details including late fees and a reference number for subsequent payment. # Payment Postpaid (v2) Source: https://docs.singapay.id/api-reference/postpaid-v2/payment-postpaid-v2 https://biller-b2b.singapay.id/docs post /api/v2/postpaid/payment Process a postpaid bill payment using a reference number obtained from a prior inquiry (V2). Requires the merchant credential password for authorization. # Inquiry Prepaid (Legacy) Source: https://docs.singapay.id/api-reference/prepaid-v1/inquiry-prepaid-legacy https://biller-b2b.singapay.id/docs post /api/v1/prepaid/inquiry Perform a prepaid product inquiry. Currently supports PLN Token (plntok). Returns product details and a reference number for subsequent payment. # Payment Prepaid (Legacy) Source: https://docs.singapay.id/api-reference/prepaid-v1/payment-prepaid-legacy https://biller-b2b.singapay.id/docs post /api/v1/prepaid/payment Process a prepaid product payment. Supports Pulsa, Paket Data, and PLN Token. Pulsa and Paket Data support direct payment without prior inquiry. PLN Token requires a prior inquiry and reference_number. # Get Parameters Game Topup Source: https://docs.singapay.id/api-reference/prepaid-v2/get-parameters-game-topup https://biller-b2b.singapay.id/docs post /api/v2/prepaid/get-parameter-game-topup Retrieve the required parameters (e.g., server ID, username, platform) for a specific game topup product category. Use this before performing a game topup inquiry. # Payment Prepaid (v2) Source: https://docs.singapay.id/api-reference/prepaid-v2/payment-prepaid-v2 https://biller-b2b.singapay.id/docs post /api/v2/prepaid/payment Process a prepaid product payment. Supports Pulsa, Paket Data, PLN Token, Game Topup, and Voucher Game. Some products (pulsa, data, vouchg) support direct payment without prior inquiry. # Prepaid Inquiry (v2) Source: https://docs.singapay.id/api-reference/prepaid-v2/prepaid-inquiry-v2 https://biller-b2b.singapay.id/docs post /api/v2/prepaid/inquiry Perform a prepaid product inquiry. Supports PLN Token (plntok) and Game Topup (topupg). Returns product details and a reference number for subsequent payment. # Generate Source: https://docs.singapay.id/api-reference/qris-money-in/generate https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v1.0/qris-dynamic/{account_id}/generate-qr Generates a new MPM dynamic QRIS for the specified account. The returned transaction has `status` = `open` and contains the QR payload in `qr_data`, which should be rendered as a QR code for the customer to scan. - `amount` must be within the minimum and maximum limits configured for the merchant. - `expired_at` is optional. When omitted, the QRIS expires **1 hour** after creation. - The account must be active. Managed sub accounts that have not completed KYB verification cannot generate QRIS. - The final payment status is delivered via callback to the merchant's registered callback URL, including `merchant_reff_no`. It can also be checked via the inquiry-status or show endpoint using the returned `id`. **Idempotency.** This endpoint is **not idempotent**. `merchant_reff_no` is stored as a free-form merchant reference and is **not** checked for uniqueness; sending the same request again (including with the same `merchant_reff_no`) creates a new, separate QRIS transaction. If the response to a generate request is lost (e.g. network timeout), first look up the transaction via `GET /api/v1.0/qris-dynamic/{account_id}` filtered by `created_at_from`/`created_at_to` and `amount`, and match `merchant_reff_no` on the returned items, before generating a new QRIS. An unpaid QRIS expires automatically at `expired_at` and does not result in any funds movement. This endpoint is rate limited per merchant; requests above the limit are rejected with HTTP 429. # Inquiry Status Source: https://docs.singapay.id/api-reference/qris-money-in/inquiry-status https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/qris-dynamic/{account_id}/inquiry-status/{id} Checks the current status of a single QRIS money-in transaction, identified by its numeric `id` (returned by the generate and list endpoints). Use `status_computed` and `is_expired` to determine whether the QRIS has been paid, is still payable, or has expired. Returns the same payload as `GET /api/v1.0/qris-dynamic/{account_id}/show/{id}`. # Inquiry Merchant Source: https://docs.singapay.id/api-reference/qris-money-out/inquiry-merchant https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/qris/issuer/mpm/inquiry-merchant Decodes the provided MPM `qr_data`. If merchant information (tag 26) is absent, the endpoint will query the configured issuer vendor to resolve merchant/payment criteria. See `Response Code` for the full SP000–SP020 reference. # Inquiry Status Source: https://docs.singapay.id/api-reference/qris-money-out/inquiry-status https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/qris/status/{account_id} Retrieve the current status of a QRIS transaction for the specified account using `reference_number`, `type`, and `scope`. See `Response Code` for the full SP000–SP020 reference. # Overview Source: https://docs.singapay.id/api-reference/qris-money-out/introduction Send payments from your Singapay balance by scanning a merchant's QRIS code — powered by Indonesia's national payment switching networks. The QRIS Issuer (Money Out) API lets your platform act as an **issuer** — sending payments from your Singapay account to any QRIS MPM (Merchant Presented Mode) merchant. The customer scans the merchant's QR code, your system decodes it, confirms the merchant details, and initiates the credit payment through Singapay's switching network integration. > [!NOTE] > > This is a **Money Out** operation. Each payment debits funds from your Singapay account and credits the destination QRIS merchant via the supported switching network. > [card] Merchant lookup > > Decode any QRIS MPM code and retrieve verified merchant details before committing to a payment. > [card] Instant credit > > Initiate a payment credit transaction directly to the merchant via Indonesia's QRIS switching network. > [card] Status tracking > > Query the latest transaction status at any point after payment initiation. *** ## Recommended flow **1. Scan and decode QR code** Customer scans the merchant's QRIS MPM code. Your system captures the raw `qr_data` string from the QR code. **2. Inquiry merchant** Call **QRIS Issuer MPM — Inquiry Merchant** with the `qr_data`. Singapay decodes the QR, retrieves merchant details (name, NMID, category), and returns the verified merchant info. Present this to the customer for confirmation. **3. Initiate payment credit** Once the customer confirms, call **QRIS Issuer MPM — Payment Credit** with the confirmed amount and merchant details. A `reference_number` is returned to track the transaction. **4. Check transaction status** Use **QRIS — Inquiry Transaction Status** with the `reference_number` to verify the final transaction outcome — especially for pending or in-process payments. *** ## API overview | Method | Endpoint | Description | | :-: | - | - | | `POST` | `/api/v2.0/qris/issuer/mpm/inquiry-merchant` | Decode `qr_data` and retrieve verified QRIS merchant details. | | `POST` | `/api/v2.0/qris/issuer/mpm/payment-credit` | Initiate a payment credit to the QRIS merchant. | | `POST` | `/api/v2.0/qris/status/{account_id}` | Query the status of a QRIS transaction by `reference_number`. | All endpoints use `POST`, accept `application/json`, and require **OAuth 2.0 Bearer Token** authentication. *** ## Transaction status | Status | Description | | - | - | | `pending` | Payment initiated, awaiting confirmation from the switching network. | | `success` | Payment successfully credited to the merchant. | | `failed` | Payment failed — check the response code for the reason. | *** ## Important notes > [accordion] Always inquiry before payment > > Always call **Inquiry Merchant** before initiating a payment. This validates the QR code, retrieves the correct merchant details, and lets the customer confirm before funds are debited. > [accordion] Switching network support > > Singapay routes QRIS issuer payments through its supported switching networks. The routing is handled automatically based on the merchant's QRIS data. > [accordion] QR code format > > The `qr_data` field accepts the raw string decoded from the merchant's QR code — the full QRIS MPM payload. Do not modify or truncate the string before sending. > [accordion] Reference number for tracking > > Store the `reference_number` returned from the payment credit call. Use it with **Inquiry Transaction Status** to safely check the outcome and handle retries without creating duplicate transactions. > [accordion] Signature required > > Payment Credit and Inquiry Status endpoints require an additional `X-Signature` and `X-Timestamp` header. See [Authentication](/api-reference/authentication) for signing requirements. *** ## Available endpoints > [card] [QRIS Issuer MPM — Inquiry Merchant](./inquiry-merchant) > > Decode `qr_data` and retrieve verified merchant details from the QRIS switching network. > [card] [QRIS Issuer MPM — Payment Credit](./trigger-payment-credit) > > Initiate a payment credit to the destination QRIS merchant. > [card] [QRIS — Inquiry Transaction Status](./inquiry-status) > > Query the current status of a QRIS transaction by reference number. > [!NOTE] > > All endpoints require authentication. See [Authentication](/api-reference/authentication). # Trigger Payment Credit Source: https://docs.singapay.id/api-reference/qris-money-out/trigger-payment-credit https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/qris/issuer/mpm/payment-credit Initiates an issuer-side MPM payment (money-out) from the merchant account. The endpoint creates a pending `QrisTransaction`, performs ledger debit and statement entries, and enqueues the vendor dispatch job. See `Response Code` for the full SP000–SP020 reference; final settlement is performed asynchronously. **CRITICAL:** This is a money-out operation requiring **X-Signature** and **X-Timestamp** authentication per internal signing protocol. # Create payment code Source: https://docs.singapay.id/api-reference/retail-store/create-payment-code https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v1.0/retail-transactions/{account_id} Generates a native Retail Store payment code (Alfamart / Indomaret) the customer pays at the cashier. The amount must be within merchant configuration limits for the selected outlet. Retail access is pilot-gated per merchant. Payment confirmation arrives later as a POST callback to `callback_urls.transaction_notif_url` with `event = retail-transaction`. # Overview Source: https://docs.singapay.id/api-reference/retail-store/overview Generate one-time payment codes that customers pay in cash at Alfamart and Indomaret cashiers — each code recorded as a single fixed-amount Retail transaction. Retail Outlet lets customers who prefer cash pay at thousands of **Alfamart** and **Indomaret** stores across Indonesia. You create a payment code through the API, give it to the customer, and the customer shows it to the cashier and pays the exact amount. Similar to QRIS, **each payment code belongs to one transaction and can only be paid once**. > [!NOTE] > > Retail Outlet is currently offered to **selected merchants only**. To enable it for your merchant, contact your Singapay account manager. Create requests from merchants without access are rejected with `422`. > [card] Cash payments > > Accept cash from customers who don't have a bank account, e-wallet, or card. > [card] Nationwide coverage > > Customers pay at any Alfamart or Indomaret cashier — no app or registration needed. > [card] Webhook on payment > > Singapay notifies your `transaction_notif_url` as soon as the cashier confirms the payment. *** ## Payment flow ```mermaid theme={null} sequenceDiagram autonumber participant M as Merchant System participant S as SingaPay API participant C as Customer participant R as Retail Outlet M->>S: POST /retail-transactions/{account_id} Note over M,S: retail_code, amount, customer_name, expired_at S-->>M: payment_code, transaction_id (status: unpaid) M->>C: Show payment_code & payment instructions Note over M,C: Checkout page, email, or app C->>R: Show payment_code to the cashier C->>R: Pay the exact amount in cash R->>S: Payment confirmation S->>S: Update status (unpaid → paid) S-->>M: Webhook (event: retail-transaction) M->>S: GET /retail-transactions/{account_id}/{transaction_id} Note over M,S: Verify the final status (optional) ``` *** ## Key difference: one code = one transaction > [!WARNING] > > Unlike Virtual Account or Payment Link, **each payment code is valid for one payment only**. Once it is paid or expires, it cannot be used again. Create a new payment code for every new transaction. > [card] Cannot do > > * Reuse a payment code for another payment > * Accept partial payments or overpayments > * Change the amount or outlet after the code is created > * Create a code without an expiry time > [card] Must do > > * Create a new payment code for each transaction > * Set the exact amount and the outlet (`retail_code`) at creation > * Set `expired_at` to a time in the future > * Tell the customer which store to go to: Alfamart or Indomaret *** ## Supported outlets > [card] Alfamart > > `ALFAMART` > > Payment code can only be paid at Alfamart cashiers. > [card] Indomaret > > `INDOMARET` > > Payment code can only be paid at Indomaret cashiers. > [!NOTE] > > A payment code only works at the outlet you selected in `retail_code`. An Alfamart code cannot be paid at Indomaret, and an Indomaret code cannot be paid at Alfamart. *** ## Transaction status | Status | Description | | - | - | | `unpaid` | Payment code created and waiting for the customer to pay at the cashier. | | `paid` | The cashier confirmed the payment and funds were credited to your account. | | `expired` | `expired_at` passed before the customer paid. The code can no longer be paid. | | `failed` | The payment could not be completed. | > [!NOTE] > > Settlement is not a separate status. Check the `has_settle` and `settle_at` fields to see whether a `paid` transaction has been settled. *** ## Recommended flow **1. Create a payment code** Call **Create Payment Code** with `retail_code`, `amount`, `customer_name`, and `expired_at`. Send your own order ID in `merchant_reff_no` so you can match the transaction later. **2. Save the transaction** Store the `transaction_id` and `payment_code` from the response. You need `transaction_id` to look up the transaction later. **3. Give the code to the customer** Show the `payment_code`, the amount, the outlet (Alfamart or Indomaret), and the expiry time to the customer. **4. Customer pays at the cashier** The customer tells the cashier they want to make a payment, shows the payment code, and pays the exact amount in cash. **5. Receive the webhook** Singapay sends a `retail-transaction` webhook to your `transaction_notif_url` when the transaction becomes `paid`. Update the order on your side. **6. Verify the status (optional)** Call **Show Transaction** to confirm the latest status, for example if you did not receive the webhook. *** ## Important notes > [accordion] Amount limits > > By default, the amount must be between **IDR 15,000** and **IDR 2,500,000** per transaction. Your merchant may have different limits based on its configuration. If the amount is outside the limit, the request is rejected with `422` and a message showing the allowed min or max. > [accordion] Expiry time > > `expired_at` is **required** and must be a Unix timestamp in **milliseconds** (13 digits) set to a future time. After it passes, an `unpaid` transaction changes to `expired` and the code can no longer be paid. If you subscribe to the [Transaction Money-In Expiration Webhook](/api-reference/webhooks/transaction-moneyin-expiration), expired Retail transactions are included in it. > [accordion] Webhook notification > > When a transaction becomes `paid`, Singapay sends a POST request to your `transaction_notif_url` with `event = retail-transaction`. This URL is also used by other money-in products, so route requests by the `event` field. See [Shared Webhook Endpoints](/api-reference/webhooks/shared-endpoints) and verify every request as described in [Security and Signature Validation](/api-reference/webhooks/security-and-signature). > [accordion] No list or inquiry endpoint > > The API has two endpoints only: create and show. There is no separate inquiry-status endpoint — **Show Transaction** always returns the latest status. To browse or export Retail transactions, use the Singapay merchant dashboard. > [accordion] Fees and settlement > > A fee is charged per transaction and returned in `fees.amount`. The balance from a `paid` transaction follows your merchant's configured settlement method, the same as Virtual Account. Track settlement with the `has_settle` and `settle_at` fields. > [accordion] Timestamp format > > In API responses, `expired_at`, `processed_timestamp`, `post_timestamp`, and `settle_at` are Unix timestamps in **milliseconds**. `processed_timestamp` and `settle_at` stay `null` until the transaction is paid or settled. > [accordion] Rate limit > > The **Create Payment Code** endpoint is rate-limited per merchant. If you send too many requests, you will receive `429 Too Many Requests`. Wait before you try again. *** ## Available endpoints > [card] [Create Payment Code](./create-payment-code) > > Create a one-time Alfamart or Indomaret payment code for a fixed amount. > [card] [Show Transaction](./show-transaction) > > Get the details and latest status of a Retail transaction by its `transaction_id`. > [!NOTE] > > All endpoints require authentication. See [Authentication](/api-reference/authentication). # Show transaction Source: https://docs.singapay.id/api-reference/retail-store/show-transaction https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/retail-transactions/{account_id}/{transaction_id} Retrieves a single Retail Store transaction and its current status. There is no separate inquiry-status endpoint — the latest status is read from here. # Get List Source: https://docs.singapay.id/api-reference/settlement-transaction/get-list https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/settlement-transactions/{identifier} Retrieve a paginated list of the transactions included in a settlement belonging to the authenticated merchant. The settlement is looked up by its numeric id (`settlements.id`) **or** its reference number (`settlements.reference_no`); it must have status `completed` and belong to the merchant, otherwise the endpoint responds with `404`. Each item summarises one underlying money-in transaction (VA, QRIS, Payment Link, or E-Wallet). Optional filters: `transaction_type` and `is_refunded`. # List Source: https://docs.singapay.id/api-reference/statements/list https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/statements/{account_id} Paginated account statements filtered by **`processed_timestamp`** between `start_date` and `end_date` (defaults: current calendar month). Only rows created within the last **year**; **25** per page. Response includes top-level **`additional_info`** with resolved `start_date` / `end_date` (`Y-m-d`) and top-level **`pagination`** (camelCase keys) — not nested under `meta`. # Show Source: https://docs.singapay.id/api-reference/statements/show https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/statements/{account_id}/{statement_id} The second path parameter is matched against **`statements.transaction_id`** (business transaction id string — same column used across VA/disbursement/… statement rows). # Cancel Plan Source: https://docs.singapay.id/api-reference/subscription-recurring/cancel-plan https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/recurring/plans/cancel/{id} Cancels an active subscription plan and stops future billing. # Create Plan Source: https://docs.singapay.id/api-reference/subscription-recurring/create-plan https://payment-b2b.singapay.id/api/docs/merchant-api.json post /api/v2.0/recurring/plans Creates a recurring subscription plan and returns the plan details with its payment link. # Get Plan Source: https://docs.singapay.id/api-reference/subscription-recurring/get-plan https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v2.0/recurring/plans/{id} Retrieves a single subscription plan by its UUID. # Overview Source: https://docs.singapay.id/api-reference/subscription-recurring/introduction Create and manage recurring billing plans backed by tokenized card payments — with configurable retry policies and webhook notifications on every cycle. Subscription Merchant API v2.0 enables recurring billing via credit card. Create a plan, direct the customer through a **one-time card linking flow**, and Singapay automatically charges the saved card on every cycle — no customer action required after the initial setup. > [!NOTE] > > This is a **Money In** operation. Each cycle charge transfers funds from the customer's tokenized card to your Singapay Payment Gateway account. > [card] API Version > > v2.0 > [card] Base Path > > `/api/v2.0/recurring/plans` > [card] Auth > > Bearer Token (JWT) > [card] Channel > > Credit Card (recurring) *** ## Subscription lifecycle ```mermaid theme={null} sequenceDiagram autonumber participant C as Customer participant M as Merchant System participant S as SingaPay API participant PP as Payment Provider M->>S: POST /recurring/plans Note over M,S: Schedule, amount (or items), customer details S-->>M: Plan created + payment_link_url (status: pending_card_linking) M->>C: Redirect to payment_link_url C->>S: Enter card details (one-time card linking) S->>PP: Initial charge + card tokenization PP-->>S: Charge result + card token S->>S: Plan status → active S-->>M: Webhook: subscription.cycle.payment_success loop Each scheduled cycle S->>PP: Auto-charge (tokenized card, no customer action) PP-->>S: Charge result S-->>M: Webhook: payment_success or payment_failed Note over S,M: Retry block included on failure end ``` *** ## Plan status lifecycle | Status | Description | | - | - | | `pending_card_linking` | Plan created, awaiting customer to complete card linking via `payment_link_url`. | | `pending_payment` | Card linked, awaiting scheduled start (`schedule.start_time` is in the future). | | `active` | Subscription running — cycles auto-charged on schedule. | | `paused` | Merchant-initiated pause from the dashboard. No charges while paused. | | `suspended` | Auto-suspended after retries exhausted (when `failed_payment_action = stop_plan`). | | `cancelled` | Cancelled by merchant or auto-cancelled on hard failure during initial card linking. Terminal state. | | `completed` | All scheduled cycles charged (only for plans with `total_interval` set). | *** ## Initial card linking — auto-cancel on hard failure > [!WARNING] > > When a plan is created with `charge_immediately = true` and the customer's first card-linking attempt is **rejected by the issuer or acquirer**, the platform **auto-cancels the plan** immediately. > > There is no saved card to retry against, so retrying would never succeed. When an auto-cancel occurs: * The bill for that cycle moves to `cancelled` * The plan transitions from `pending_payment` / `pending_card_linking` directly to `cancelled` * The active payment link is expired — the customer cannot complete a charge against the cancelled plan * A `subscription.plan.status_changed` webhook fires with `plan.metadata.cancellation_reason = initial_linking_failed` > [!NOTE] > > Plans created with `charge_immediately = false` are **not** affected by this rule. To re-attempt after a hard failure, create a new plan. *** ## Amount vs. items A plan is either **amount-only** or **itemized** — never both. This is enforced on both Create and Update. > [card] Amount-only > > Send `amount`. The entire recurring charge is a single line item — simple and straightforward. > [card] Itemized > > Send `items[]`. The per-cycle charge is the sum of `quantity × unit_price` across all items. > [!WARNING] > > Sending both `amount` and `items` in the same request returns a `422` validation error. On Update, the patch shape must match the plan's existing type — mixing returns `409` with response code `SP102`. *** ## Retry policy When a cycle charge fails, Singapay automatically retries based on the plan's configured policy. | Field | Type / Range | Description | | - | - | - | | `retry_policy.max_attempts` | integer, 1–5 | Automatic retry attempts after the initial charge fails. | | `retry_policy.interval_days` | integer, 1–7 | Days to wait between consecutive retry attempts. | | `retry_policy.failed_payment_action` | `continue_plan` \| `stop_plan` | Behavior after retries exhausted. `continue_plan` keeps the subscription running on the next cycle; `stop_plan` suspends it. | *** ## Error reference > [accordion] HTTP status codes > > | Code | Description | > | - | - | > | `200` | Success (show, update, cancel) | > | `201` | Created (create plan) | > | `400` | Bad Request — validation or business rule error | > | `401` | Unauthorized — invalid or missing token | > | `404` | Plan or account not found | > | `409` | Plan cannot be updated or already cancelled | > | `422` | Validation error — missing field, amount/items conflict, etc. | > | `500` | Internal server error | > [accordion] Singapay response codes > > | Code | Description | HTTP Status | > | - | - | - | > | `SP000` | Success | 200 / 201 | > | `SP002` | General failure (internal error) | 500 | > | `SP020` | Merchant account not found | 404 | > | `SP100` | Subscription plan not found | 404 | > | `SP101` | Subscription plan already cancelled | 409 | > | `SP102` | Subscription plan cannot be updated in current state | 409 | *** ## Important notes > [accordion] Card-only channel > > Subscriptions run exclusively on credit card recurring. The initial card linking uses one-time 3DS; all subsequent cycle charges use the tokenized card silently — no customer action needed. > [accordion] Minimum amount > > The per-cycle charge must clear the card channel minimum. Plans below this floor are rejected on both Create and Update with a `422` validation error. > [accordion] Plan identifiers > > `subscription_id` is a globally unique merchant-supplied identifier across all plans for the merchant. `merchant_reff_no` is an optional, non-unique label for grouping and reporting — echoed back on every cycle webhook. > [accordion] Upgrade semantics (PATCH) > > A PATCH that changes `amount` or `items` triggers the **full upgrade flow** — the existing plan is closed and a new plan is created with `parent_plan_id` pointing at it, plus an optional proration and a fresh payment link. > > A PATCH that only changes `name`, `merchant_reff_no`, or `metadata` **patches the plan in place** without creating a new plan. > [accordion] IP whitelisting required > > All Merchant API routes require IP whitelisting. Ensure your server IP is registered for the merchant account before making any API calls. *** ## Available endpoints > [card] [Create Recurring Plan](./create-plan) > > Register a new plan. Returns a `payment_link_url` for the customer's one-time card linking. > [card] [Get Recurring Plan](./get-plan) > > Fetch current plan state — status, schedule progress, next payment date, retry policy, and lineage. > [card] [Update or Upgrade Plan](./update-plan) > > Patch cosmetic fields in place, or change amount / items to trigger the upgrade flow with a new plan and optional proration. > [card] [Cancel Plan](./cancel-plan) > > Stop a plan immediately. Active plans go through the lifecycle service; pending plans are cancelled outright. > [!NOTE] > > All endpoints require authentication. See [Authentication](/api-reference/authentication). *** ## Changelog | Date | Description | | - | - | | 2026-04-20 | Initial documentation — Subscription Merchant API v2.0 (create, show, update/upgrade, cancel) + Subscription Cycle webhook. | # Update Plan Source: https://docs.singapay.id/api-reference/subscription-recurring/update-plan https://payment-b2b.singapay.id/api/docs/merchant-api.json patch /api/v2.0/recurring/plans/{id} Patches a subscription plan in place, or upgrades/downgrades it to a new plan when `amount` or `items` change. # Overview Source: https://docs.singapay.id/api-reference/va-transaction/introduction Track, monitor, and reconcile every bank transfer received through your Virtual Accounts — each recorded as an individual VA Transaction. Every time a customer transfers funds to a Virtual Account number, Singapay creates a **VA Transaction** record. This API lets you list, filter, and inspect those records for reconciliation, settlement tracking, and customer support. > [card] Per-payment records > > Every bank transfer to a VA creates its own transaction entry with status, amount, and timing. > [card] Full fee breakdown > > Each record shows vendor fee, platform margin, and net amount received — ready for accounting. > [card] Query by VA number > > Retrieve all transactions for a specific VA number directly, without filtering by account. *** ## Relationship with Virtual Account A Virtual Account is the **parent** — the unique payment instrument with a VA number. Every time a customer pays into it, a VA Transaction **child** record is created. > [!NOTE] > > **Example:** VA `8890-1234-5678` (Permanent VA for Customer A) > > | Transaction | Amount | Date | > | - | - | - | > | #1 | IDR 500,000 | Jan 1 | > | #2 | IDR 750,000 | Jan 15 | > | #3 | IDR 300,000 | Feb 1 | > > One Virtual Account → multiple independent transaction records over time. *** ## Transaction lifecycle **1. Payment received** Customer transfers funds to the VA number via ATM, mobile banking, or internet banking. The bank sends a payment notification to Singapay. **2. Transaction created** A VA Transaction record is created immediately with status `unpaid`. **3. Processing** Singapay validates the payment amount, checks for duplicates, and verifies all payment details. **4. Reconciliation** The transaction is reconciled by the finance system. Status updates to `paid`. **5. Settlement** Funds are settled to your account (bank or Singapay Balance) based on your configured settlement method. *** ## Transaction status | Status | Description | | - | - | | `unpaid` | Payment notification received, pending validation. | | `paid` | Payment validated and reconciled by Singapay. | | `settled` | Funds transferred to your account. | *** ## Important notes > [accordion] Query by VA number > > Beyond listing all transactions for an account, you can query transactions directly by VA number using the dedicated endpoint — useful when you have the VA number from a customer inquiry but not the internal ULID. > [accordion] Status tracking > > Monitor each transaction through its full lifecycle: `unpaid` → `paid` → `settled`. Use webhook notifications to get real-time updates instead of polling. > [accordion] Fee breakdown per transaction > > Every transaction record includes the vendor fee, platform margin, and net amount received — broken down clearly for accounting and reconciliation purposes. > [accordion] Webhook notifications > > Configure webhooks to receive real-time `va-transaction` events the moment a payment is confirmed — no need to poll the API. See the [Webhook documentation](/api-reference/webhooks/introduction) for setup details. > [accordion] Filtering and search > > Query transactions by `transaction_id`, `va_number`, `status`, `amount` range, settlement status, or timestamp ranges (`post_timestamp`, `processed_timestamp`, `settle_at`). Default sort is newest first. > [accordion] Data retention > > Transaction records are retained for **1 year**. Data older than 1 year is archived and may not be accessible via the API. *** ## Available endpoints > [card] [List VA Transactions](./list) > > Paginated list of all VA transactions for an account with full filter support. > [card] [Get VA Transaction Detail](./show) > > Retrieve a single transaction by its business `transaction_id`. > [card] [List by VA Number](./list-by-va-number) > > All transactions for a specific VA number, bypassing account-level filtering. > [!NOTE] > > All endpoints require authentication. See [Authentication](/api-reference/authentication). # List Source: https://docs.singapay.id/api-reference/va-transaction/list https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/va-transactions/{account_id} Retrieve a paginated list of Virtual Account money-in transactions for an account. Each entry represents a single payment a customer made into one of the account's Virtual Accounts. Results are restricted to transactions created within the last 12 months and are ordered newest-first by default. Use the query parameters below to paginate, sort, and filter the result set; pagination details are returned in the response `meta` object. The following optional filters are available and may be combined: `transaction_id` (partial match), `merchant_reff_no` (partial match), `va_number` (exact match), `status`, `amount`, `amount_min`, `amount_max`, `has_settle`, `post_timestamp_from`/`post_timestamp_to`, `processed_timestamp_from`/`processed_timestamp_to`, and `settle_at_from`/`settle_at_to`. All timestamp filters accept a Unix timestamp in **milliseconds** and define an inclusive range. # List by VA number Source: https://docs.singapay.id/api-reference/va-transaction/list-by-va-number https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/va-transactions/{account_id}/detail-by-va-number/{va_number} Retrieve a paginated list of money-in transactions for a single Virtual Account, identified by its **VA number** rather than by transaction id. This is the convenient way to pull the full payment history of one specific Virtual Account. Results are restricted to transactions created within the last 12 months and are ordered newest-first by default (`per_page` defaults to 50). The VA number is fixed by the path; all other filters behave exactly as on the List endpoint. The following optional filters are available and may be combined: `transaction_id` (partial match), `merchant_reff_no` (partial match), `status`, `amount`, `amount_min`, `amount_max`, `has_settle`, `post_timestamp_from`/`post_timestamp_to`, `processed_timestamp_from`/`processed_timestamp_to`, and `settle_at_from`/`settle_at_to`. All timestamp filters accept a Unix timestamp in **milliseconds** and define an inclusive range. # Show Source: https://docs.singapay.id/api-reference/va-transaction/show https://payment-b2b.singapay.id/api/docs/merchant-api.json get /api/v1.0/va-transactions/{account_id}/{transaction_id} Retrieve a single Virtual Account money-in transaction by its business transaction id. The `transaction_id` path parameter is the **business** identifier (`va_transactions.transaction_id`) returned by the List endpoints — not the numeric database primary key. The transaction must belong to a Virtual Account under the supplied `account_id`, and that account must belong to the authenticated merchant. # Disbursement Webhook Source: https://docs.singapay.id/api-reference/webhooks/disbursement-transaction Real-time notifications for disbursement (money out) transactions processed through the SingaPay platform. Monitor transaction statuses and keep your system in sync. > [!NOTE] > > **Money Out Operation** — This webhook fires when funds are transferred from your SingaPay account to a beneficiary's bank account. ## Information | Method | Path | Format | Authentication | | - | - | - | - | | POST | `https://your-webhook-url/callback` | json | HMAC SHA512 Signature | SingaPay sends a `POST` request to your configured `disbursement_notif_url` when a disbursement transaction is successfully processed or fails. > [!NOTE] > > This webhook may share a callback URL with other event types. See [Shared webhook endpoints](/api-reference/webhooks/shared-endpoints) for routing by `event` value. *** ## Request Details ### Headers | Field | Value | Type | Mandatory | Description | | - | - | - | :-: | - | | `Content-Type` | `application/json` | Alphabetic | Yes | Specifies JSON format for the request body | | `User-Agent` | `SingaPaymentGateway/1.0` | Alphabetic | Yes | Identifies the source of the webhook | | `Accept` | `application/json` | Alphabetic | Yes | Expected response format | | `X-PARTNER-ID` | — | Alphanumeric | Yes | Your API Key from the merchant dashboard | | `X-Signature` | — | Alphanumeric | Yes | HMAC SHA512 signature (128 chars) for request verification | | `X-Timestamp` | — | Numeric | Yes | Unix timestamp in **seconds** when the request was sent | | `Authorization` | `Bearer ` | Alphanumeric | Yes | JWT bearer token; also used as component in the signature | > [!NOTE] > > All signature-related headers (`X-Signature`, `X-Timestamp`, `Authorization`) are always included when your merchant account has API credentials configured. Extract the access token from the `Authorization` header and use it as-is in the string to sign. See [How to Validate Signature](#how-to-validate-signature) below. *** ### Body Parameters **response\_code** `string` *required* Response code. See [Appendix 01 — Response Codes](#01-response-codes). Example: `SP000` **response\_message** `string` *required* Human-readable response message. Example: `Successfully` **event** `string` *required* Transaction type identifier. Always `"disbursement"` for bank transfer. Use this to distinguish from `"ewallet-topup"` and `"qris-issuer"` on the shared URL. **data** `object` *required* Response payload object. **data fields** **transaction\_id** `string` *required* System-generated transaction ID. Example: `"1512220251105174015668"` **reference\_number** `string` *required* Your unique merchant reference number. Example: `"123456789123"` **transaction\_status** `object` *required* Transaction status object. See [Appendix 02 — Transaction Status](#02-transaction-status). **transaction\_status fields** **code** `string` *required* Status code. E.g. `"00"`, `"01"`, `"06"` **desc** `string` *required* Status description. E.g. `"Success"`, `"Initiated"`, `"Failed"` **post\_timestamp** `string` *required* Transaction creation time in Unix **milliseconds**. Example: `"1762339215000"` **processed\_timestamp** `string` Processing completion time in Unix **milliseconds**. Empty string if the transaction failed. **bank** `object` *required* Beneficiary bank information. **bank fields** **code** `string` *required* Bank Swift or number code. E.g. `"002"`, `"BRINIDJA"` **name** `string` *required* Bank name. E.g. `"BRI"`, `"BNI"`, `"DANAMON"` **account\_name** `string` Beneficiary account holder name. `null` if the account inquiry failed. **account\_number** `string` *required* Beneficiary bank account number. Example: `"521398319083210"` **gross\_amount** `object` *required* Total amount including fees. **gross\_amount fields** **currency** `string` *required* ISO 4217 currency code. Example: `"IDR"` **value** `string` *required* Amount value. Example: `"50000"` **fee** `object` *required* Transfer fee details. **fee fields** **currency** `string` *required* ISO 4217 currency code. **value** `string` *required* Fee amount. Example: `"3000"` **net\_amount** `object` *required* Amount received by the beneficiary (`gross_amount − fee`). **net\_amount fields** **currency** `string` *required* ISO 4217 currency code. **value** `string` *required* Net amount value. Example: `"47000"` **balance\_after** `object` *required* Your account balance after the transaction. Both fields are `null` for failed transactions. **balance\_after fields** **currency** `string` ISO 4217 currency code. `null` if failed. **value** `string` Balance value. `null` if failed. Example: `"777000"` **notes** `string` Transaction notes from the original request. Example: `"bayar pajak"` **failed\_code** `string` Error code. Only present when the transaction status is failed. Example: `"SP003"` **failed\_reason** `string` Human-readable error message. Only present when the transaction status is failed. Example: `"INSUFFICIENT BALANCE"` *** ### Payload Examples ```json Success theme={null} { "response_code": "SP000", "response_message": "Successfully", "event": "disbursement", "data": { "transaction_id": "101222025122910292195055674", "reference_number": "11111111118", "transaction_status": { "code": "00", "desc": "Success" }, "post_timestamp": "1766978961000", "processed_timestamp": "1766978962000", "bank": { "code": "002", "name": "BRI", "account_name": "Dummy Test Account Internal", "account_number": "11111111118" }, "gross_amount": { "currency": "IDR", "value": "12504.00" }, "fee": { "currency": "IDR", "value": "2500" }, "net_amount": { "currency": "IDR", "value": "10004.00" }, "balance_after": { "currency": "IDR", "value": "829988" }, "notes": "test transfer" } } ``` ```json Failed theme={null} { "response_code": "SP001", "response_message": "Transaction Failure", "event": "disbursement", "data": { "transaction_id": "121222025122617513896515436", "reference_number": "333", "transaction_status": { "code": "06", "desc": "Failed" }, "post_timestamp": "1766746298000", "processed_timestamp": "", "bank": { "code": "002", "name": "BRI", "account_name": "", "account_number": "091701064838533" }, "gross_amount": { "currency": "IDR", "value": "12501.00" }, "fee": { "currency": "IDR", "value": "2500" }, "net_amount": { "currency": "IDR", "value": "10001.00" }, "balance_after": { "currency": "IDR", "value": "0" }, "notes": "test transfer", "failed_reason": "Transaction Failure : Invalid beneficiary account: Account inactive", "failed_code": "SP001" } } ``` *** *** ## Security and responses Return HTTP `200` promptly after validating the request. For retry behavior, see [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). Verify every webhook using [Security and signature validation](/api-reference/webhooks/security-and-signature). Use your configured callback path when building `StringToSign`. Handle duplicate deliveries idempotently using stable identifiers from the payload (for example `transaction_id` or `reff_no`). *** ## Disbursement-Specific Notes ### Idempotency Each `reference_number` can only be used once per account. If you retry with the same `reference_number`, you'll receive the existing transaction status rather than creating a duplicate transfer. ```php Detecting Duplicate Webhooks theme={null} $referenceNumber = $payload['data']['reference_number']; // Check if already processed $existingTransaction = findTransactionByReference($referenceNumber); if ($existingTransaction) { // Already processed — return 200 without re-processing http_response_code(200); exit; } processNewDisbursement($payload); ``` ### Timestamp Formats > [!WARNING] > > Disbursement webhooks use **two different timestamp formats**. Don't mix them up. | Field | Format | Example | Notes | | - | - | - | - | | `X-Timestamp` header | Unix seconds | `1695711945` | Used for signature validation | | `post_timestamp` (body) | Unix milliseconds | `1762339215000` | Divide by 1000 to convert | | `processed_timestamp` (body) | Unix milliseconds | `1762339215672` | Empty string if transaction failed | ```php Converting millisecond timestamps theme={null} // Convert to DateTime $postTimestamp = $payload['data']['post_timestamp']; // "1762339215000" $date = new DateTime(); $date->setTimestamp((int)($postTimestamp / 1000)); // Or with Carbon (Laravel) $date = \Carbon\Carbon::createFromTimestampMs($postTimestamp); ``` ### Balance Reconciliation The `balance_after` field shows your account balance after each transaction. For failed transactions, both `currency` and `value` are `null` — no balance change occurred. ```php Balance Consistency Check theme={null} if ($payload['data']['transaction_status']['code'] === '00') { $balanceAfter = (float)$payload['data']['balance_after']['value']; $grossAmount = (float)$payload['data']['gross_amount']['value']; $expectedBalance = $previousBalance - $grossAmount; if (abs($balanceAfter - $expectedBalance) > 0.01) { // Balance mismatch — log for investigation logBalanceDiscrepancy($transactionId, $expectedBalance, $balanceAfter); } } ``` *** ## Appendix ### 01: Response Codes | Code | Message | Description | Action | | - | - | - | - | | `SP000` | Successfully | Success | Check inquiry status | | `SP001` | Transaction Failure | Failed transaction | Check inquiry status | | `SP002` | General Failure | Internal server error | Check inquiry status | | `SP003` | Insufficient Balance | Account balance too low | Check inquiry status | | `SP004` | Duplicate Reference Number | Reference already used | — | | `SP005` | Timeout | Gateway timeout | Check inquiry status | | `SP006` | Exceed Beneficiary Limit | Beneficiary amount limit reached | Check inquiry status | | `SP007` | Exceed Account Limit | Account transaction limit reached | Contact IT Support | | `SP008` | Invalid Reference Number | Reference does not exist | — | | `SP009` | Transaction Not Found | Transaction not found | — | | `SP010` | Beneficiary Account Not Found | Account not found | — | | `SP011` | Beneficiary Vendor Not Active | Vendor not active | — | | `SP012` | Bad Request | Bad request | — | | `SP013` | Unauthorized | Unauthorized | — | | `SP014` | Not Found | Not found | — | | `SP015` | Forbidden | Forbidden | — | | `SP016` | Signature Invalid | Signature invalid | — | | `SP017` | Unauthorized IP | IP not authorized | Contact IT Support | | `SP018` | Validation Error | Payload validation error | — | | `SP019` | General Error | General error | Contact IT Support | | `SP020` | Merchant Account Not Found | Merchant account not found | — | ### 02: Transaction Status | Code | Status | Notes | | :-: | - | - | | `00` | Success | Transaction completed successfully | | `01` | Initiated | Payment call not yet received; retry is possible | | `02` | Paying | Pending/Suspect — retry status check in a few minutes; awaiting final callback | | `03` | Pending | Pending/Suspect — retry status check in a few minutes; awaiting final callback | | `04` | Refunded | Reversal transaction | | `05` | Canceled | Create a new transaction | | `06` | Failed | Transaction failed | | `07` | Not Found | Create a new transaction | # E-Wallet Native Webhook Source: https://docs.singapay.id/api-reference/webhooks/ewallet-moneyin Real-time notifications when a customer successfully pays via e-wallet (GoPay, OVO, ShopeePay, etc.) through your checkout session. Update your order status and fulfill transactions promptly. > [!NOTE] > > **Money In Operation** — This webhook fires when a customer completes an e-wallet payment, transferring funds into your SingaPay account. ## Information | Method | Path | Format | Authentication | | - | - | - | - | | POST | `https://your-webhook-url/callback` | json | HMAC SHA512 Signature | SingaPay sends a `POST` request to your configured `transaction_notif_url` when a customer completes payment via e-wallet native checkout. > [!NOTE] > > This webhook may share a callback URL with other event types. See [Shared webhook endpoints](/api-reference/webhooks/shared-endpoints) for routing by `event` value. *** ## Request Details ### Headers | Field | Value | Type | Mandatory | Description | | - | - | - | :-: | - | | `Content-Type` | `application/json` | Alphabetic | Yes | Specifies JSON format for the request body | | `User-Agent` | `SingaPaymentGateway/1.0` | Alphabetic | Yes | Identifies the source of the webhook | | `Accept` | `application/json` | Alphabetic | Yes | Expected response format | | `X-PARTNER-ID` | — | Alphanumeric | Yes | Your API Key from the merchant dashboard | | `X-Signature` | — | Alphanumeric | Yes | HMAC SHA512 signature (128 chars) for request verification | | `X-Timestamp` | — | Numeric | Yes | Unix timestamp in **seconds** when the request was sent | | `Authorization` | `Bearer ` | Alphanumeric | Yes | System-generated random bearer token; used as a component in the signature | > [!NOTE] > > The `Authorization` token for e-wallet webhooks is a **randomly generated string** — not a user access token. This webhook is triggered by a payment notification (system event), not a user action. Extract the token as-is and use it in the string to sign. See [How to Validate Signature](#how-to-validate-signature) below. *** ### Body Parameters **status** `number` *required* HTTP Status Code. Example: `200` **success** `boolean` *required* Indicates if the transaction was successful. Example: `true` **event** `string` *required* Event type identifier. Always `"ewallet-native-transaction"` for this webhook. **timestamp** `string` *required* Event timestamp in format `"d M Y H:i:s"`. Example: `"26 Dec 2025 13:35:45"` **data** `object` *required* Container for transaction, customer, and payment details. **data fields** **transaction** `object` *required* Transaction details. **transaction fields** **id** `integer` *required* Unique transaction ID. Example: `42` **reff\_no** `string` *required* Merchant reference number used during checkout creation. Example: `"INV-2026-001"` **merchant\_reff\_no** `string` Optional merchant reference number for tracing. Example: `"INV-2026-001"` **type** `string` *required* Transaction type. Always `"ewallet"`. **ewallet\_vendor** `string` *required* E-wallet vendor code. Example: `"GOPAY"`, `"OVO"`, `"SHOPEEPAY"` **status** `string` *required* Transaction status. Always `"paid"` for this webhook. **amount** `object` *required* **Net** transaction amount after fees — credited to your balance. **amount fields** **value** `number` *required* Net amount value. Example: `95000` **currency** `string` *required* ISO 4217 currency code. Example: `"IDR"` **total\_amount** `object` *required* **Gross** transaction amount — what the customer actually paid. **total\_amount fields** **value** `number` *required* Total amount value. Example: `100000` **currency** `string` *required* ISO 4217 currency code. Example: `"IDR"` **post\_timestamp** `string` *required* Timestamp when the transaction record was last updated. Example: `"26 Dec 2025 13:35:43"` **processed\_timestamp** `string` *required* Timestamp when the payment was confirmed and processed. Example: `"26 Dec 2025 13:35:45"` **customer** `object` *required* Customer details provided during checkout. All fields are optional depending on checkout creation data. **customer fields** **name** `string` Customer name. Example: `"John Doe"` **email** `string` Customer email address. Example: `"john@example.com"` **phone** `string` Customer phone number. Example: `"081234567890"` **payment** `object` *required* Payment method details. **payment fields** **method** `string` *required* Payment method. Always `"ewallet"`. **vendor** `string` *required* E-wallet vendor code — same as `transaction.ewallet_vendor`. Example: `"GOPAY"` **additional\_info** `object` *required* E-wallet specific payment information. **additional\_info fields** **payment\_event\_id** `number` *required* Internal payment event ID for traceability. Example: `1042` **vendor\_reference\_no** `string` Reference number from the e-wallet vendor. May be `null` depending on the provider's API response. *** ### Payload Example ```json Success theme={null} { "status": 200, "success": true, "event": "ewallet-native-transaction", "timestamp": "26 Dec 2025 13:35:45", "data": { "transaction": { "id": 42, "reff_no": "INV-2026-001", "merchant_reff_no": "INV-2026-001", "type": "ewallet", "ewallet_vendor": "GOPAY", "status": "paid", "amount": { "value": 95000, "currency": "IDR" }, "total_amount": { "value": 100000, "currency": "IDR" }, "post_timestamp": "26 Dec 2025 13:35:43", "processed_timestamp": "26 Dec 2025 13:35:45" }, "customer": { "name": "John Doe", "email": "john@example.com", "phone": "081234567890" }, "payment": { "method": "ewallet", "vendor": "GOPAY", "additional_info": { "payment_event_id": 1042, "vendor_reference_no": "PAY-XYZ-12345" } } } } ``` *** *** ## Security and responses Return HTTP `200` promptly after validating the request. For retry behavior, see [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). Verify every webhook using [Security and signature validation](/api-reference/webhooks/security-and-signature). Use your configured callback path when building `StringToSign`. Handle duplicate deliveries idempotently using stable identifiers from the payload (for example `transaction_id` or `reff_no`). *** ## E-Wallet Specific Notes > [accordion] amount vs total\_amount > > `total_amount` is the **gross amount the customer paid**. `amount` is the **net amount after fees** — this is what gets credited to your balance. Always use `total_amount` for display to the customer and `amount` for reconciliation. > [accordion] vendor\_reference\_no may be null > > The `vendor_reference_no` field may be `null` depending on the e-wallet provider's API response. Always handle `null` gracefully in your code — don't assume it's always populated. > [accordion] Customer fields are optional > > All `customer` fields (`name`, `email`, `phone`) are optional and depend on the data provided during checkout creation. Your handler should not assume any of these are present. > [accordion] Timestamp format & timezone > > Both `post_timestamp` and `processed_timestamp` use the format `"d M Y H:i:s"` (e.g. `"26 Dec 2025 13:35:45"`) in **Asia/Jakarta (WIB)** timezone — not UTC. # E-Wallet Top Up Webhook Source: https://docs.singapay.id/api-reference/webhooks/ewallet-moneyout Real-time notifications when an E-Wallet Top Up (money out) transaction completes or fails. Track success and failure outcomes for e-wallet disbursement via the shared disbursement_notif_url. > [!NOTE] > > **Money Out Operation** — This webhook fires when an E-Wallet Top Up transaction is completed (success or failed), transferring funds from your SingaPay account to a customer's e-wallet. ## Information | Method | Path | Format | Authentication | | - | - | - | - | | POST | `https://your-webhook-url/callback` | json | HMAC SHA512 Signature | SingaPay sends a `POST` request to your configured `disbursement_notif_url` when an E-Wallet Top Up transaction is completed (success or failed). > [!NOTE] > > This webhook may share a callback URL with other event types. See [Shared webhook endpoints](/api-reference/webhooks/shared-endpoints) for routing by `event` value. *** ## Request Details ### Headers | Field | Value | Type | Mandatory | Description | | - | - | - | :-: | - | | `Content-Type` | `application/json` | Alphabetic | Yes | Specifies JSON format for the request body | | `User-Agent` | `SingaPaymentGateway/1.0` | Alphabetic | Yes | Identifies the source of the webhook | | `Accept` | `application/json` | Alphabetic | Yes | Expected response format | | `X-PARTNER-ID` | — | Alphanumeric | Yes | Your API Key from the merchant dashboard | | `X-Signature` | — | Alphanumeric | Yes | HMAC SHA512 signature (128 chars) for request verification | | `X-Timestamp` | — | Numeric | Yes | Unix timestamp in **seconds** when the request was sent | | `Authorization` | `Bearer ` | Alphanumeric | Yes | JWT bearer token; also used as component in the signature | > [!NOTE] > > All signature-related headers (`X-Signature`, `X-Timestamp`, `Authorization`) are always included when your merchant account has API credentials configured. Extract the access token from the `Authorization` header and use it as-is in the string to sign. See [How to Validate Signature](#how-to-validate-signature) below. *** ### Body Parameters **response\_code** `string` *required* Response code. See [Appendix 01 — Response Codes](#01-response-codes). Example: `SP000` **response\_message** `string` *required* Human-readable response message. Example: `Successfully` **event** `string` *required* Transaction type identifier. Always `"ewallet-topup"` for this webhook. Use this to distinguish from `"disbursement"` and `"qris-issuer"` on the shared URL. **data** `object` *required* Response payload object. **data fields** **transaction\_id** `string` *required* System-generated transaction ID. Example: `"EW1512220251105174015668"` **reference\_number** `string` *required* Your unique merchant reference number. Example: `"REF123456789"` **notes** `string` Transaction notes from the original request. Example: `"topup OVO pelanggan"` **transaction\_status** `object` *required* Transaction status object. See [Appendix 02 — Transaction Status](#02-transaction-status). **transaction\_status fields** **code** `string` *required* Status code. `"00"` = Success, `"06"` = Failed **desc** `string` *required* Status description. E.g. `"Success"`, `"Failed"` **post\_timestamp** `string` *required* Transaction creation time in Unix **milliseconds**. Example: `"1766978961000"` **processed\_timestamp** `string` Processing completion time in Unix **milliseconds**. Empty string if the transaction failed. **ewallet** `object` *required* E-wallet beneficiary information. **ewallet fields** **code** `string` *required* E-wallet provider code. E.g. `"OVO"`, `"DANA"`, `"GOPAY"`, `"LINKAJA"`, `"SHOPEEPAY"` **customer\_number** `string` *required* Customer's e-wallet phone number or account number. Example: `"08123456789"` **customer\_name** `string` Customer's name on the e-wallet. `null` if account inquiry is not available. **gross\_amount** `object` *required* Total amount deducted from your merchant balance (net + fee). **gross\_amount fields** **currency** `string` *required* ISO 4217 currency code. Example: `"IDR"` **value** `string` *required* Gross amount value. Example: `"50000.00"` **fee** `object` *required* Admin fee charged for this transaction. **fee fields** **currency** `string` *required* ISO 4217 currency code. **value** `string` *required* Fee amount. Example: `"2500.00"` **net\_amount** `object` *required* Net amount received by the customer (`gross_amount − fee`). **net\_amount fields** **currency** `string` *required* ISO 4217 currency code. **value** `string` *required* Net amount value. Example: `"47500.00"` **balance\_after** `object` *required* Your merchant account balance after the transaction. **balance\_after fields** **currency** `string` ISO 4217 currency code. Empty string if unavailable. **value** `string` Balance value. Empty string if unavailable. Example: `"750000"` **failed\_code** `string` Error code. Only present when the transaction failed. Example: `"CONNECTION_ERROR"` **failed\_reason** `string` Human-readable error description. Only present when the transaction failed. Example: `"Connection timeout to vendor"` *** ### Payload Examples ```json Success theme={null} { "response_code": "SP000", "response_message": "Successfully", "event": "ewallet-topup", "data": { "transaction_id": "EW101222025122910292195055674", "reference_number": "REF-EWALLET-001", "notes": "topup OVO pelanggan", "transaction_status": { "code": "00", "desc": "Success" }, "post_timestamp": "1766978961000", "processed_timestamp": "1766978962000", "ewallet": { "code": "OVO", "customer_number": "08123456789", "customer_name": "Budi Santoso" }, "gross_amount": { "currency": "IDR", "value": "50000.00" }, "fee": { "currency": "IDR", "value": "2500.00" }, "net_amount": { "currency": "IDR", "value": "47500.00" }, "balance_after": { "currency": "IDR", "value": "750000" } } } ``` ```json Failed theme={null} { "response_code": "SP001", "response_message": "Transaction Failure", "event": "ewallet-topup", "data": { "transaction_id": "EW121222025122617513896515436", "reference_number": "REF-EWALLET-002", "notes": "topup DANA pelanggan", "transaction_status": { "code": "06", "desc": "Failed" }, "post_timestamp": "1766978900000", "processed_timestamp": "", "ewallet": { "code": "DANA", "customer_number": "08198765432", "customer_name": null }, "gross_amount": { "currency": "IDR", "value": "100000.00" }, "fee": { "currency": "IDR", "value": "2500.00" }, "net_amount": { "currency": "IDR", "value": "97500.00" }, "balance_after": { "currency": "IDR", "value": "850000" }, "failed_code": "CONNECTION_ERROR", "failed_reason": "Connection timeout to vendor" } } ``` *** *** ## Security and responses Return HTTP `200` promptly after validating the request. For retry behavior, see [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). Verify every webhook using [Security and signature validation](/api-reference/webhooks/security-and-signature). Use your configured callback path when building `StringToSign`. Handle duplicate deliveries idempotently using stable identifiers from the payload (for example `transaction_id` or `reff_no`). *** ## E-Wallet Top Up specific notes ### Idempotency Each `reference_number` can only be used once per account. If you retry with the same `reference_number`, you'll receive the existing transaction status rather than creating a duplicate top up. ```php Detecting Duplicate Webhooks theme={null} $referenceNumber = $payload['data']['reference_number']; $existingTransaction = findTransactionByReference($referenceNumber); if ($existingTransaction) { // Already processed — return 200 without re-processing http_response_code(200); exit; } processEwalletTopUp($payload); ``` ### Timestamp Formats > [!WARNING] > > E-Wallet Top Up webhooks use **two different timestamp formats**. Don't mix them up. | Field | Format | Example | Notes | | - | - | - | - | | `X-Timestamp` header | Unix seconds | `1695711945` | Used for signature validation | | `post_timestamp` (body) | Unix milliseconds | `1766978961000` | Divide by 1000 to convert | | `processed_timestamp` (body) | Unix milliseconds | `1766978962000` | Empty string if transaction failed | When validating signatures, always use the **X-Timestamp header value** (in seconds), not the timestamps from the request body (which are in milliseconds). ```php Converting millisecond timestamps theme={null} // Convert to DateTime $postTimestamp = $payload['data']['post_timestamp']; // "1766978961000" $date = new DateTime(); $date->setTimestamp((int)($postTimestamp / 1000)); // Or with Carbon (Laravel) $date = \Carbon\Carbon::createFromTimestampMs($postTimestamp); ``` ### Balance Refund on Failure When an E-Wallet Top Up fails, SingaPay **automatically refunds** the full `gross_amount` (net + fee) back to your merchant balance. You do not need to request a manual refund — the balance is restored immediately upon failure detection. The `balance_after` field reflects the post-refund balance. ### Balance Tracking The `balance_after` field shows your account balance after the transaction: * For **successful** transactions: remaining balance after deduction * For **failed** transactions: balance after automatic refund (balance is restored) * Use this to verify balance consistency with your system * All amounts are in IDR (Indonesian Rupiah) *** ## Appendix ### 01: Response Codes | Code | Message | Description | Action | | - | - | - | - | | `SP000` | Successfully | Success | Check inquiry status | | `SP001` | Transaction Failure | Failed transaction | Check inquiry status | | `SP002` | General Failure | Internal server error | Check inquiry status | | `SP003` | Insufficient Balance | Account balance too low | Check inquiry status | | `SP004` | Duplicate Reference Number | Reference already used | — | | `SP005` | Timeout | Gateway timeout | Check inquiry status | | `SP006` | Exceed Beneficiary Limit | Beneficiary amount limit reached | Check inquiry status | | `SP007` | Exceed Account Limit | Account transaction limit reached | Contact IT Support | | `SP008` | Invalid Reference Number | Reference does not exist | — | | `SP009` | Transaction Not Found | Transaction not found | — | | `SP010` | Beneficiary Account Not Found | Account not found | — | | `SP011` | Beneficiary Vendor Not Active | Vendor not active | — | | `SP012` | Bad Request | Bad request | — | | `SP013` | Unauthorized | Unauthorized | — | | `SP014` | Not Found | Not found | — | | `SP015` | Forbidden | Forbidden | — | | `SP016` | Signature Invalid | Signature invalid | — | | `SP017` | Unauthorized IP | IP not authorized | Contact IT Support | | `SP018` | Validation Error | Payload validation error | — | | `SP019` | General Error | General error | Contact IT Support | | `SP020` | Merchant Account Not Found | Merchant account not found | — | ### 02: Transaction Status | Code | Status | Notes | | :-: | - | - | | `00` | Success | Transaction completed successfully | | `01` | Initiated | Payment call not yet received; retry is possible | | `02` | Paying | Pending/Suspect — retry status check in a few minutes; awaiting final callback | | `03` | Pending | Pending/Suspect — retry status check in a few minutes; awaiting final callback | | `04` | Refunded | Reversal transaction | | `05` | Canceled | Create a new transaction | | `06` | Failed | Transaction failed | | `07` | Not Found | Create a new transaction | # Overview Source: https://docs.singapay.id/api-reference/webhooks/introduction Receive real-time notifications for transaction and account events via webhooks. Webhooks allow Singapay to push real-time notifications to your server whenever an event occurs — such as a transaction status change, disbursement completion, or product expiration. Instead of polling the API, your endpoint receives an HTTP `POST` request the moment something happens. ## How it works When an event is triggered, Singapay sends a `POST` request to the webhook URL you have configured in your merchant dashboard. Your server must respond with HTTP `200 OK` to acknowledge receipt. ## Retry mechanism If your endpoint does not return HTTP `200 OK`, SingaPay automatically retries delivery. See [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism) for status-specific rules, intervals, and failure notifications. ## Webhook categories Webhooks are grouped by event type: **Money In** * Virtual Account Transaction * QRIS Acquirer Transaction * Payment Link Transaction * E-Wallet Native Transaction * Subscription Cycle **Money Out** * Disbursement Transaction * E-Wallet Top Up Transaction * QRIS Issuer Transaction **Optional** * Sub-Account KYB Verification * Sub-Account KYB Verification * Payment Link Inquiry * Product Expiration * Transaction Money-In Expiration ## Best practices * Always validate the webhook payload before processing. * Return `200 OK` as quickly as possible — offload heavy processing to a background job. * Handle duplicate deliveries idempotently, since retries may deliver the same event more than once. * Log all incoming webhook payloads for debugging and reconciliation. # Payment Link Webhook Source: https://docs.singapay.id/api-reference/webhooks/payment-link Real-time notifications when a payment is completed through a payment link. Includes transaction details, customer information, and payment method used. > [!NOTE] > > **Money In Operation** — This webhook fires when a customer completes a payment via a Payment Link, transferring funds into your SingaPay account. ## Information | Method | Path | Format | Authentication | | - | - | - | - | | POST | `https://your-webhook-url/callback` | json | HMAC SHA512 Signature | SingaPay sends a `POST` request to your configured `transaction_notif_url` when a Payment Link transaction is successfully completed. For optional view and expiry notifications (when someone opens a link), see [Payment Link Inquiry](/api-reference/webhooks/payment-link-inquiry). > [!NOTE] > > This webhook may share a callback URL with other event types. See [Shared webhook endpoints](/api-reference/webhooks/shared-endpoints) for routing by `event` value. *** ## Request Details ### Headers | Field | Value | Type | Mandatory | Description | | - | - | - | :-: | - | | `Content-Type` | `application/json` | Alphabetic | Yes | Specifies JSON format for the request body | | `X-PARTNER-ID` | — | Alphanumeric | Yes | Your API Key from the merchant dashboard. Example: `b3ed7d4b-a96c-6c08-b3c7-12c3124242d9` | *** ### Body Parameters **status** `number` *required* HTTP Status Code. Example: `200` **success** `boolean` *required* `true` for 2xx responses, `false` for 4xx–5xx. **data** `object` *required* Container for transaction, customer, and payment details. **data fields** **transaction** `object` *required* Transaction details. **transaction fields** **reff\_no** `string` *required* Unique transaction reference number (26 chars). Example: `"18917720251110094037705"` **type** `string` *required* Transaction type. Always `"pl"` for Payment Link. **status** `string` *required* Transaction status. See [Transaction Status Codes](#transaction-status-codes). Example: `"paid"` **amount** `object` *required* Transaction amount details. **amount fields** **value** `string` *required* Transaction amount. Example: `"10000.00"` **currency** `string` *required* ISO 4217 currency code. Example: `"IDR"` **tip** `mixed` Tip amount if any. `null` if no tip was added. **post\_timestamp** `string` *required* Transaction post time. Example: `"10 Nov 2025 09:46:38"` **processed\_timestamp** `string` *required* Transaction processed time. Example: `"10 Nov 2025 09:46:38"` **customer** `object` *required* Customer details. **customer fields** **id** `mixed` Customer unique ID. `null` if the customer is not registered. **name** `string` *required* Customer full name. Example: `"Mohammad Zulkifli Katili"` **email** `string` *required* Customer email address. Example: `"mohzulkilfikatili@gmail.com"` **phone** `string` *required* Customer phone number. Example: `"082291501085"` **payment** `object` *required* Payment method details. **payment fields** **method** `string` *required* Payment method. Always `"payment_link"`. **additional\_info** `object` *required* Payment Link-specific information. **additional\_info fields** **payment\_link** `object` *required* Payment link metadata. **payment\_link fields** **id** `number` *required* Payment link ID. Example: `189` **reff\_no** `string` *required* Payment link reference number. Example: `"PL20251105160923690b1443a67e9"` **title** `string` *required* Payment link title. Example: `"tes"` **payment\_date** `string` *required* Payment completion datetime (ISO 8601). Example: `"2025-11-05T09:09:49.000000Z"` **payment\_url** `string` *required* Full payment link URL. **status** `string` *required* Payment link status. Example: `"open"` **required\_customer\_detail** `boolean` *required* Whether customer details are required at checkout. Example: `true` **max\_usage** `number` *required* Maximum number of times the link can be used. Example: `1000` **current\_usage** `number` *required* Current number of times the link has been used. Example: `4` **expired\_at** `string` Payment link expiration datetime. `null` if no expiry is set. **total\_amount** `string` *required* Payment link total amount. Example: `"10000.00"` **account\_id** `number` *required* Account ID associated with the payment link. Example: `35` **created\_at** `string` *required* Creation datetime (ISO 8601). Example: `"2025-11-05T09:09:49.000000Z"` **updated\_at** `string` *required* Last updated datetime (ISO 8601). Example: `"2025-11-10T02:46:38.000000Z"` *** ### Payload Examples ```json Success theme={null} { "status": 200, "success": true, "data": { "transaction": { "reff_no": "18917720251110094037705", "type": "pl", "status": "paid", "amount": { "value": "10000.00", "currency": "IDR" }, "tip": null, "post_timestamp": "10 Nov 2025 09:46:38", "processed_timestamp": "10 Nov 2025 09:46:38" }, "customer": { "id": null, "name": "Mohammad Zulkifli Katili", "email": "mohzulkilfikatili@gmail.com", "phone": "082291501085" }, "payment": { "method": "payment_link", "additional_info": { "payment_link": { "id": 189, "reff_no": "PL20251105160923690b1443a67e9", "title": "tes", "payment_date": "2025-11-05T09:09:49.000000Z", "payment_url": "https://sandbox-paymentlink.singapay.id/b2b/PL20251105160923690b1443a67e9", "status": "open", "required_customer_detail": true, "max_usage": 1000, "current_usage": 4, "expired_at": null, "total_amount": "10000.00", "account_id": 35, "created_at": "2025-11-05T09:09:49.000000Z", "updated_at": "2025-11-10T02:46:38.000000Z" } } } } } ``` ```json Unauthorized (401) theme={null} { "status": 401, "success": false, "error": { "code": 401, "message": "Unauthorized partner, please sign in" } } ``` *** ## Transaction Status Codes | Status | Description | | :-: | - | | `paid` | Payment completed successfully | | `pending` | Payment is pending | | `expired` | Payment link has expired | | `failed` | Payment has failed | *** ## Event Description This webhook fires when a payment is successfully completed through a payment link. The payload covers: > [card] Transaction Details > > Reference number, type, status, amount, and timestamps. > [card] Customer Info > > Name, email, and phone number of the paying customer. > [card] Payment Link Metadata > > Usage count, expiry, status, URL, and creation timestamps. > [card] Payment Method > > Method used (`payment_link`) and all associated additional info. *** *** ## Security and responses Return HTTP `200` promptly after validating the request. For retry behavior, see [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). Verify every webhook using [Security and signature validation](/api-reference/webhooks/security-and-signature). Use your configured callback path when building `StringToSign`. Handle duplicate deliveries idempotently using stable identifiers from the payload (for example `transaction_id` or `reff_no`). # Payment Link Inquiry Webhook Source: https://docs.singapay.id/api-reference/webhooks/payment-link-inquiry Optional real-time notifications when someone opens or views a payment link, or when an inquiry session expires. Track engagement and conversion without affecting payment link functionality. > [!NOTE] > > **Optional webhook** — This webhook is completely optional. Payment links work normally without it. Configure `payment_link_inquiry_notif_url` only if you need view or expiry notifications. For completed payments, use the [Payment Link Transaction](/api-reference/webhooks/payment-link) webhook instead. ## Information | Method | Path | Format | Authentication | | - | - | - | - | | POST | `https://your-webhook-url/callback` | json | HMAC SHA512 Signature | SingaPay sends a `POST` request to your configured `payment_link_inquiry_notif_url` when: * A customer opens or views a payment link (`payment_link.inquiry`) * A payment link history record expires (`payment_link.inquiry.expired`) > [!NOTE] > > **Separate URL:** Unlike money-in transaction webhooks on `transaction_notif_url`, inquiry events use a dedicated `payment_link_inquiry_notif_url`. If this URL is not configured, no inquiry webhooks are sent. For batch product expiration, see [Product Expiration](/api-reference/webhooks/product-expiration). For batch unpaid transaction expiration, see [Transaction Money-In Expiration](/api-reference/webhooks/transaction-moneyin-expiration). *** ## Request Details ### Headers | Field | Value | Type | Mandatory | Description | | - | - | - | :-: | - | | `Content-Type` | `application/json` | Alphabetic | Yes | Specifies JSON format for the request body | | `User-Agent` | `SingaPaymentGateway/1.0` | Alphabetic | Yes | Identifies the source of the webhook | | `Accept` | `application/json` | Alphabetic | Yes | Expected response format | | `X-PARTNER-ID` | — | Alphanumeric | Yes | Your API Key from the merchant dashboard | | `X-Signature` | — | Alphanumeric | Yes | HMAC SHA512 signature (128 chars) for request verification | | `X-Timestamp` | — | Numeric | Yes | Unix timestamp in **seconds** when the request was sent | | `Authorization` | `Bearer ` | Alphanumeric | Yes | System-generated random bearer token; used as a component in the signature | > [!NOTE] > > The `Authorization` token is a **randomly generated string** — not a user access token. This webhook is triggered by a system event (link opened or session expired), not a user API call. Extract the token as-is and use it in the string to sign. See [How to Validate Signature](#how-to-validate-signature) below. *** ### Body Parameters **status** `number` *required* HTTP status code. Example: `200` **success** `boolean` *required* Indicates whether the webhook was sent successfully. Example: `true` **event** `string` *required* Event type identifier. `payment_link.inquiry` when a link is opened; `payment_link.inquiry.expired` when a history session expires. **timestamp** `string` *required* Event timestamp in format `"d M Y H:i:s"`. Example: `"26 Dec 2025 13:35:45"` **data** `object` *required* Container for payment link and history details. **data fields** **payment\_link\_history** `object` *required* Current payment link history (this inquiry or transaction attempt). **payment\_link\_history fields** **id** `number` *required* Payment link history ID. Example: `12345` **reff\_no** `string` *required* Unique reference for this history. Example: `"PLH-20251226-ABC123"` **status** `string` *required* History status. E.g. `"pending"`, `"expired"`, `"paid"`, `"failed"` **amount** `object` *required* Transaction amount for this attempt. **amount fields** **value** `number` *required* Amount value. Example: `50000` **currency** `string` *required* ISO 4217 currency code. Example: `"IDR"` **vendor\_fee** `number` Vendor fee. `null` if not calculated yet. **our\_margin** `number` Platform margin. `null` if not calculated yet. **net\_amount** `number` Net amount. `null` if not calculated yet. **payment\_method\_name** `string` Selected payment method name. E.g. `"QRIS"`. `null` if not selected. **payment\_method\_value** `string` Payment method value. E.g. `"qris"`. `null` if not selected. **payment\_method\_additional** `object` Additional payment method info. `null` if none. **customer\_name** `string` Customer name. `null` if not provided yet. **customer\_email** `string` Customer email. `null` if not provided yet. **customer\_phone** `string` Customer phone. `null` if not provided yet. **ip\_address** `string` Customer IP address. Example: `"103.123.45.67"` **expired\_at** `string` History expiration time. Example: `"2025-12-26 14:35:45"` **created\_at** `string` *required* History creation time. **updated\_at** `string` *required* History last update time. **payment\_link** `object` *required* Parent payment link details (shared across inquiries). **payment\_link fields** **id** `number` *required* Payment link ID. Example: `678` **reff\_no** `string` *required* Payment link reference number. Example: `"PL-20251220-XYZ789"` **title** `string` *required* Payment link title. Example: `"Donasi Amal"` **description** `string` Payment link description. `null` if none. **status** `string` *required* Payment link status. Example: `"active"` **total\_amount** `object` *required* Payment link amount. **total\_amount fields** **value** `number` *required* Amount value. Example: `50000` **currency** `string` *required* ISO 4217 currency code. Example: `"IDR"` **max\_usage** `number` Maximum usage limit. `null` if unlimited. **current\_usage** `number` *required* Current usage count. Example: `25` **payment\_url** `string` *required* Full payment link URL. **required\_customer\_detail** `boolean` *required* Whether customer details are required at checkout. **expired\_at** `string` Payment link expiration. `null` if no expiry. **created\_at** `string` *required* Payment link creation time. **updated\_at** `string` *required* Payment link last update time. *** ### Payload Examples ```json Inquiry theme={null} { "status": 200, "success": true, "event": "payment_link.inquiry", "timestamp": "26 Dec 2025 13:35:45", "data": { "payment_link_history": { "id": 12345, "reff_no": "PLH-20251226-ABC123", "status": "pending", "amount": { "value": 50000, "currency": "IDR" }, "vendor_fee": null, "our_margin": null, "net_amount": null, "payment_method_name": null, "payment_method_value": null, "payment_method_additional": null, "customer_name": null, "customer_email": null, "customer_phone": null, "ip_address": "103.123.45.67", "expired_at": "2025-12-26 14:35:45", "created_at": "2025-12-26 13:35:45", "updated_at": "2025-12-26 13:35:45" }, "payment_link": { "id": 678, "reff_no": "PL-20251220-XYZ789", "title": "Donasi Amal", "description": "Donasi untuk kegiatan sosial", "status": "active", "total_amount": { "value": 50000, "currency": "IDR" }, "max_usage": 100, "current_usage": 25, "payment_url": "https://pay.singapay.id/pl/abc123", "required_customer_detail": true, "expired_at": "2025-12-31 23:59:59", "created_at": "2025-12-20 10:00:00", "updated_at": "2025-12-26 13:35:45" } } } ``` ```json Expired theme={null} { "status": 200, "success": true, "event": "payment_link.inquiry.expired", "timestamp": "26 Dec 2025 14:35:45", "data": { "payment_link_history": { "id": 12345, "reff_no": "PLH-20251226-ABC123", "status": "expired", "amount": { "value": 50000, "currency": "IDR" }, "vendor_fee": null, "our_margin": null, "net_amount": null, "payment_method_name": null, "payment_method_value": null, "payment_method_additional": null, "customer_name": null, "customer_email": null, "customer_phone": null, "ip_address": "103.123.45.67", "expired_at": "2025-12-26 14:35:45", "created_at": "2025-12-26 13:35:45", "updated_at": "2025-12-26 14:35:45" }, "payment_link": { "id": 678, "reff_no": "PL-20251220-XYZ789", "title": "Donasi Amal", "description": "Donasi untuk kegiatan sosial", "status": "active", "total_amount": { "value": 50000, "currency": "IDR" }, "max_usage": 100, "current_usage": 25, "payment_url": "https://pay.singapay.id/pl/abc123", "required_customer_detail": true, "expired_at": "2025-12-31 23:59:59", "created_at": "2025-12-20 10:00:00", "updated_at": "2025-12-26 14:35:45" } } } ``` *** *** ## Security and responses Return HTTP `200` promptly after validating the request. For retry behavior, see [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). Verify every webhook using [Security and signature validation](/api-reference/webhooks/security-and-signature). Use your configured callback path when building `StringToSign`. Handle duplicate deliveries idempotently using stable identifiers from the payload (for example `transaction_id` or `reff_no`). *** ## Payment Link Inquiry specific notes ### When to use this webhook > [card] Use when > > * Track views and engagement on payment links > * Monitor conversion (views vs completed payments) > * Alert when high-value links are accessed > * Detect abandonment when inquiry sessions expire > * Trigger follow-up when email was captured but payment was not completed > [card] Skip when > > * You only need completed payment notifications ([Payment Link Transaction](/api-reference/webhooks/payment-link)) > * You do not need view or inquiry tracking > * Simple payment links without analytics requirements ### Event types | Event | When it fires | | - | - | | `payment_link.inquiry` | Customer opens or views the payment link; creates a `payment_link_history` with status `pending` | | `payment_link.inquiry.expired` | Inquiry session timeout reached; `payment_link_history` status becomes `expired` | ### Data structure The payload contains two objects: 1. **`payment_link_history`** — This inquiry or payment attempt (unique per link open) 2. **`payment_link`** — Parent link configuration and usage counters (`current_usage` / `max_usage`) ```php Handle inquiry and expired events theme={null} = $maxUsage * 0.9) { sendAlert('Payment link is 90% full'); } } if ($payload['event'] === 'payment_link.inquiry.expired') { $historyReffNo = $payload['data']['payment_link_history']['reff_no']; logAbandonedPayment($historyReffNo); $email = $payload['data']['payment_link_history']['customer_email'] ?? null; if ($email !== null) { sendFollowUpEmail($email); } } ?> ``` ### Customer data handling Customer fields in `payment_link_history` may be `null` on initial inquiry and populated after the customer submits the form or selects a payment method. Always check for `null`: ```php theme={null} $customerName = $payload['data']['payment_link_history']['customer_name'] ?? 'Unknown'; $customerEmail = $payload['data']['payment_link_history']['customer_email']; if ($customerEmail !== null) { sendEmail($customerEmail, 'Thank you for viewing our payment link'); } $paymentMethod = $payload['data']['payment_link_history']['payment_method_name']; if ($paymentMethod !== null) { trackMethodSelection($paymentMethod); } ``` ### Timestamp format > [!WARNING] > > This webhook uses **human-readable datetime strings**, not Unix timestamps in the body. | Field | Format | Example | | - | - | - | | `timestamp` (root) | `d M Y H:i:s` | `26 Dec 2025 13:35:45` | | `payment_link_history.*_at` | `Y-m-d H:i:s` | `2025-12-26 13:35:45` | | `payment_link.*_at` | `Y-m-d H:i:s` | `2025-12-20 10:00:00` | For signature validation, use **`X-Timestamp`** (Unix seconds in the header), not the body `timestamp` field. ```php Parse body timestamps theme={null} $timestamp = $payload['timestamp']; // "26 Dec 2025 13:35:45" $date = DateTime::createFromFormat('d M Y H:i:s', $timestamp); // Carbon (Laravel) $date = \Carbon\Carbon::createFromFormat('d M Y H:i:s', $timestamp); ``` ### Access token format The `Authorization` header contains a **random system-generated token**, not a user JWT: ``` Authorization: Bearer a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6 ``` Extract it normally and include it in the string to sign. Validation uses your Client Secret as the HMAC key. ### Idempotency Use `payment_link_history.reff_no` to detect duplicate deliveries: ```php theme={null} $historyReffNo = $payload['data']['payment_link_history']['reff_no']; if (findInquiryByReffNo($historyReffNo)) { http_response_code(200); exit; } processNewInquiry($payload); ``` ### Usage tracking ```php theme={null} $paymentLink = $payload['data']['payment_link']; $currentUsage = $paymentLink['current_usage']; $maxUsage = $paymentLink['max_usage']; if ($maxUsage !== null) { $usagePercentage = ($currentUsage / $maxUsage) * 100; if ($usagePercentage >= 90) { sendAlert("Payment link '{$paymentLink['title']}' is at {$usagePercentage}% capacity"); } if ($currentUsage >= $maxUsage) { sendAlert("Payment link '{$paymentLink['title']}' has reached maximum usage"); } } ``` ### Expiration handling Both the payment link and individual history sessions can expire: ```php theme={null} $paymentLinkExpiredAt = $payload['data']['payment_link']['expired_at']; if ($paymentLinkExpiredAt !== null) { $expiryDate = DateTime::createFromFormat('Y-m-d H:i:s', $paymentLinkExpiredAt); if ($expiryDate < new DateTime()) { logExpiredLink($payload['data']['payment_link']['id']); } } $historyExpiredAt = $payload['data']['payment_link_history']['expired_at']; // When the current inquiry session will expire ``` # Product Expiration Webhook Source: https://docs.singapay.id/api-reference/webhooks/product-expiration Optional batch notifications when payment links, virtual accounts, or QRIS transactions expire. Track and clean up expired products in a single webhook call, or query product status via API for real-time updates. > [!NOTE] > > **Optional webhook** — This webhook is completely optional. Products expire normally without it. Configure `product_expiration_notif_url` only if you need batch expiration notifications for **products** (links, VAs, QR codes). For expired **unpaid transaction attempts**, see [Transaction Money-In Expiration](/api-reference/webhooks/transaction-moneyin-expiration). ## Information | Method | Path | Format | Authentication | | - | - | - | - | | POST | `https://your-webhook-url/callback` | json | HMAC SHA512 Signature | SingaPay sends a `POST` request to your configured `product_expiration_notif_url` when payment products reach their expiration time. Unlike transaction webhooks, this is a **batch notification** that can include multiple expired products in a single call. > [!NOTE] > > **Batch notification:** One webhook may contain expired Payment Links, Virtual Accounts, and QRIS transactions together. Arrays can be empty when no products of that type expired. If `product_expiration_notif_url` is not configured, no expiration webhooks are sent. *** ## Request Details ### Headers | Field | Value | Type | Mandatory | Description | | - | - | - | :-: | - | | `Content-Type` | `application/json` | Alphabetic | Yes | Specifies JSON format for the request body | | `User-Agent` | `SingaPaymentGateway/1.0` | Alphabetic | Yes | Identifies the source of the webhook | | `Accept` | `application/json` | Alphabetic | Yes | Expected response format | | `X-PARTNER-ID` | — | Alphanumeric | Yes | Your API Key from the merchant dashboard | | `X-Signature` | — | Alphanumeric | Yes | HMAC SHA512 signature (128 chars) for request verification | | `X-Timestamp` | — | Numeric | Yes | Unix timestamp in **seconds** when the request was sent | | `Authorization` | `Bearer ` | Alphanumeric | Yes | System-generated random bearer token; used as a component in the signature | > [!NOTE] > > The `Authorization` token is a **randomly generated string** — not a user access token. This webhook is triggered by the system's scheduled expiration checker, not a user API call. Extract the token as-is and use it in the string to sign. See [How to Validate Signature](#how-to-validate-signature) below. *** ### Body Parameters **status** `number` *required* HTTP status code. Example: `200` **success** `boolean` *required* Indicates whether the webhook was sent successfully. Example: `true` **event** `string` *required* Event type identifier. Always `"product_expiration"` for this webhook. **timestamp** `string` *required* Event timestamp in format `"d M Y H:i:s"`. Example: `"26 Dec 2025 14:00:00"` **merchant** `object` *required* Merchant information. **merchant fields** **id** `number` *required* Merchant ID. Example: `123` **name** `string` *required* Merchant name. Example: `"PT Example Indonesia"` **data** `object` *required* Container for expired products. Each array is always present and may be empty. **data fields** **payment\_links** `array` *required* Expired payment links. **payment\_links item fields** **id** `number` *required* Payment link ID. **reff\_no** `string` *required* Payment link reference number. **title** `string` *required* Payment link title. **status** `string` *required* Status. Should be `"expired"`. **expired\_at** `string` *required* Expiration datetime (`Y-m-d H:i:s`). **virtual\_accounts** `array` *required* Expired virtual accounts. **virtual\_accounts item fields** **id** `number` *required* Virtual account ID. **reff\_no** `string` *required* VA reference number. **virtual\_account\_number** `string` *required* Virtual account number (16 digits). **status** `string` *required* Status. Should be `"expired"`. **expired\_at** `string` *required* Expiration datetime (`Y-m-d H:i:s`). **qris\_transactions** `array` *required* Expired QRIS transactions. **qris\_transactions item fields** **id** `number` *required* QRIS transaction ID. **reff\_no** `string` *required* QRIS reference number. **nmid** `string` *required* NMID (merchant identifier for QRIS). **status** `string` *required* Status. Should be `"expired"`. **expired\_at** `string` *required* Expiration datetime (`Y-m-d H:i:s`). **summary** `object` *required* Summary counts for the batch. **summary fields** **total\_expired** `number` *required* Total count of all expired products. **payment\_links\_count** `number` *required* Count of expired payment links. **virtual\_accounts\_count** `number` *required* Count of expired virtual accounts. **qris\_transactions\_count** `number` *required* Count of expired QRIS transactions. *** ### Payload Examples ```json Batch — Multiple Types theme={null} { "status": 200, "success": true, "event": "product_expiration", "timestamp": "26 Dec 2025 14:00:00", "merchant": { "id": 123, "name": "PT Example Indonesia" }, "data": { "payment_links": [ { "id": 456, "reff_no": "PL-20251220-XYZ789", "title": "Donasi Amal", "status": "expired", "expired_at": "2025-12-26 14:00:00" }, { "id": 457, "reff_no": "PL-20251221-ABC123", "title": "Pembayaran Tagihan", "status": "expired", "expired_at": "2025-12-26 14:00:00" } ], "virtual_accounts": [ { "id": 789, "reff_no": "VA-20251226-ABC123", "virtual_account_number": "7872955146576837", "status": "expired", "expired_at": "2025-12-26 14:00:00" }, { "id": 790, "reff_no": "VA-20251226-DEF456", "virtual_account_number": "7872955146576838", "status": "expired", "expired_at": "2025-12-26 14:00:00" }, { "id": 791, "reff_no": "VA-20251226-GHI789", "virtual_account_number": "7872955146576839", "status": "expired", "expired_at": "2025-12-26 14:00:00" } ], "qris_transactions": [ { "id": 321, "reff_no": "QRIS-20251226-DEF456", "nmid": "ID1234567890123", "status": "expired", "expired_at": "2025-12-26 14:00:00" } ] }, "summary": { "total_expired": 6, "payment_links_count": 2, "virtual_accounts_count": 3, "qris_transactions_count": 1 } } ``` ```json Single Type — Virtual Accounts Only theme={null} { "status": 200, "success": true, "event": "product_expiration", "timestamp": "26 Dec 2025 14:00:00", "merchant": { "id": 123, "name": "PT Example Indonesia" }, "data": { "payment_links": [], "virtual_accounts": [ { "id": 789, "reff_no": "VA-20251226-ABC123", "virtual_account_number": "7872955146576837", "status": "expired", "expired_at": "2025-12-26 14:00:00" } ], "qris_transactions": [] }, "summary": { "total_expired": 1, "payment_links_count": 0, "virtual_accounts_count": 1, "qris_transactions_count": 0 } } ``` *** *** ## Security and responses Return HTTP `200` promptly after validating the request. For retry behavior, see [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). Verify every webhook using [Security and signature validation](/api-reference/webhooks/security-and-signature). Use your configured callback path when building `StringToSign`. Handle duplicate deliveries idempotently using stable identifiers from the payload (for example `transaction_id` or `reff_no`). *** ## Product expiration specific notes ### When to use this webhook > [card] Use when > > * Automated cleanup of expired products in your system > * Customer notifications for expired payment links or VAs > * Expiration analytics and operational reporting > * Trigger re-engagement flows (new links, new VAs) > * Alert operations on high expiration volumes > [card] Skip when > > * You poll product status via API on demand > * Manual monitoring is sufficient > * You need real-time expiration handling (use product APIs or individual webhooks) ### Batch notification This webhook is unique: it batches multiple expired products into one call. * **Multiple product types** — Payment Links, Virtual Accounts, and QRIS in one payload * **Multiple items per type** — Each array can contain many records * **Scheduled execution** — Triggered by a system cron job, not real-time * **Efficient** — Fewer webhook calls than one notification per product > [!WARNING] > > Do not rely on this webhook for real-time expiration. There may be a delay between expiration and notification. For immediate handling, poll product status via API. ### Processing batch webhooks ```php Process all expired products theme={null} 100) { alertHighExpirationRate($totalExpired); } http_response_code(200); echo json_encode(['status' => 'success']); ?> ``` ### Product types included | Array | Product | Key fields | Typical action | | - | - | - | - | | `data.payment_links` | Payment link pages | `id`, `reff_no`, `title`, `expired_at` | Resend or create new links | | `data.virtual_accounts` | Temporary and permanent VAs | `id`, `reff_no`, `virtual_account_number`, `expired_at` | Archive VA numbers, notify customers | | `data.qris_transactions` | QRIS payment transactions | `id`, `reff_no`, `nmid`, `expired_at` | Update lifecycle status | ### Simplified payload The webhook sends **minimal fields** per product to keep batch payloads manageable. The following are **not** included: * Amount, currency, payment URL, usage counts * Bank code (VAs), QR string (QRIS) * Created or updated timestamps Use `id` or `reff_no` to fetch full details via the product API when needed. ### Timestamp format | Field | Format | Example | | - | - | - | | `timestamp` (root) | `d M Y H:i:s` | `26 Dec 2025 14:00:00` | | `expired_at` (per product) | `Y-m-d H:i:s` | `2025-12-26 14:00:00` | For signature validation, use **`X-Timestamp`** (Unix seconds in the header), not the body `timestamp` field. ```php Parse timestamps theme={null} $timestamp = $payload['timestamp']; $date = DateTime::createFromFormat('d M Y H:i:s', $timestamp); $expiredAt = $payload['data']['payment_links'][0]['expired_at'] ?? null; if ($expiredAt) { $expiry = DateTime::createFromFormat('Y-m-d H:i:s', $expiredAt); } ``` ### Access token format The `Authorization` header contains a **random system-generated token**, not a user JWT. Extract it normally and include it in the string to sign. ### Idempotency Use a batch-level identifier to avoid reprocessing the same scheduled run: ```php theme={null} $webhookId = $payload['event'] . '_' . $payload['merchant']['id'] . '_' . strtotime($payload['timestamp']); if (isWebhookProcessed($webhookId)) { http_response_code(200); exit; } processExpirationBatch($payload); markWebhookProcessed($webhookId); ``` ### Summary statistics ```php theme={null} $summary = $payload['summary']; logExpirationBatch([ 'total' => $summary['total_expired'], 'payment_links' => $summary['payment_links_count'], 'vas' => $summary['virtual_accounts_count'], 'qris' => $summary['qris_transactions_count'], 'timestamp' => $payload['timestamp'], ]); if ($summary['total_expired'] > 50) { sendAlert("High expiration rate: {$summary['total_expired']} products expired"); } if ($summary['payment_links_count'] > $summary['total_expired'] * 0.7) { alertTeam('Most expirations are payment links — review expiration settings'); } ``` ### Scheduling and timing * Triggered by a **system cron job** (typically hourly or daily — confirm schedule with SingaPay support) * Batches all products that expired since the last check * Not real-time — plan for a delay between expiration and notification ### Use cases **Automated cleanup** — Archive expired VAs and remove them from active lists. **Customer re-engagement** — Follow up when payment links expire; issue new links where appropriate. **Analytics** — Generate expiration reports using `summary` counts by product type. **Operations monitoring** — Alert when `total_expired` exceeds historical averages. # QRIS Acquirer Webhook Source: https://docs.singapay.id/api-reference/webhooks/qris-acquirer Real-time notifications for QRIS payment transactions processed through the SingaPay platform. Monitor payment events and keep your system in sync instantly. > [!NOTE] > > **Money In Operation** — This webhook fires when a customer completes a QRIS payment, transferring funds into your SingaPay account. ## Information | Method | Path | Format | Authentication | | - | - | - | - | | POST | `https://your-webhook-url/callback` | json | HMAC SHA512 Signature | SingaPay sends a `POST` request to your configured `transaction_notif_url` when a QRIS transaction is successfully processed. > [!NOTE] > > This webhook may share a callback URL with other event types. See [Shared webhook endpoints](/api-reference/webhooks/shared-endpoints) for routing by `event` value. *** ## Request Details ### Headers | Field | Value | Type | Mandatory | Description | | - | - | - | :-: | - | | `Content-Type` | `application/json` | Alphabetic | Yes | Specifies JSON format for the request body | | `User-Agent` | `SingaPaymentGateway/1.0` | Alphabetic | Yes | Identifies the source of the webhook | | `Accept` | `application/json` | Alphabetic | Yes | Expected response format | | `X-PARTNER-ID` | — | Alphanumeric | Yes | Your API Key from the merchant dashboard | | `X-Signature` | — | Alphanumeric | Yes | HMAC SHA512 signature (128 chars) for request verification | | `X-Timestamp` | — | Numeric | Yes | Unix timestamp in **seconds** when the request was sent | | `Authorization` | `Bearer ` | Alphanumeric | Yes | System-generated random bearer token; used as a component in the signature | > [!NOTE] > > The `Authorization` token for QRIS webhooks is a **randomly generated string** — not a user access token. This webhook is triggered by a bank payment notification (system event), not a user action. Extract the token as-is from the header and use it in the string to sign. See [How to Validate Signature](#how-to-validate-signature) below. *** ### Body Parameters **status** `number` *required* HTTP Status Code. Example: `200` **success** `boolean` *required* Indicates if the transaction was successful. Example: `true` **event** `string` *required* Event type identifier. Always `"qris-acquirer-transaction"` for this webhook. **timestamp** `string` *required* Event timestamp in format `"d M Y H:i:s"`. Example: `"26 Dec 2025 13:31:59"` **data** `object` *required* Container for transaction, customer, and payment details. **data fields** **transaction** `object` *required* Transaction details. **transaction fields** **id** `integer` *required* Unique transaction ID. Example: `42` **reff\_no** `string` *required* Unique transaction reference number (28 chars). Example: `"6601K62BH34X445J046C4W5249E6"` **merchant\_reff\_no** `string` Optional merchant reference number for tracing. Example: `"INV-2026-001"` **type** `string` *required* Transaction type. Always `"qris"` for QRIS transactions. **status** `string` *required* Transaction status. Always `"paid"` for this webhook. **amount** `object` *required* Base transaction amount before tip. **amount fields** **value** `number` *required* Base transaction amount. Example: `1000123` **currency** `string` *required* ISO 4217 currency code. Example: `"IDR"` **tip** `object` *required* Tip amount details. **tip fields** **value** `number` *required* Tip amount. `0` if no tip. Example: `0` **currency** `string` *required* ISO 4217 currency code. Example: `"IDR"` **total\_amount** `object` *required* Total amount including tip (`amount + tip`). **total\_amount fields** **value** `number` *required* Total transaction amount. Example: `1000123` **currency** `string` *required* ISO 4217 currency code. Example: `"IDR"` **post\_timestamp** `string` *required* Transaction post time. Example: `"26 Dec 2025 13:31:59"` **processed\_timestamp** `string` *required* Transaction processed time. Example: `"26 Dec 2025 13:31:59"` **customer** `object` *required* Customer details. **customer fields** **id** `string` *required* Customer unique ID (26 chars). Example: `"01K2KVRQQP45234X9T3YWG1FKT"` **name** `string` *required* Customer full name. Example: `"Moh. Zulkifli Katili"` **email** `string` *required* Customer email address. Example: `"tes@gmail.com"` **phone** `string` *required* Customer phone number. Example: `"08123993201"` **payment** `object` *required* Payment method details. **payment fields** **method** `string` *required* Payment method. Always `"qris"`. **additional\_info** `object` *required* QRIS-specific payment information. **additional\_info fields** **qr\_string** `string` *required* Raw QRIS string data used for payment. Example: `"00020101021226570015ID.SINGAPAY.WWW..."` **payment\_event\_id** `number` *required* Internal payment event ID for tracking. Example: `12345` *** ### Payload Example ```json Success theme={null} { "status": 200, "success": true, "event": "qris-acquirer-transaction", "timestamp": "26 Dec 2025 13:31:59", "data": { "transaction": { "id": 42, "reff_no": "6601K62BH34X445J046C4W5249E6", "merchant_reff_no": "INV-2026-001", "type": "qris", "status": "paid", "amount": { "value": 1000123, "currency": "IDR" }, "tip": { "value": 0, "currency": "IDR" }, "total_amount": { "value": 1000123, "currency": "IDR" }, "post_timestamp": "26 Dec 2025 13:31:59", "processed_timestamp": "26 Dec 2025 13:31:59" }, "customer": { "id": "01K2KVRQQP45234X9T3YWG1FKT", "name": "Moh. Zulkifli Katili", "email": "tes@gmail.com", "phone": "08123993201" }, "payment": { "method": "qris", "additional_info": { "qr_string": "00020101021226570015ID.SINGAPAY.WWW01110508140001102122183098102390303UMI51440014ID.CO.QRIS.WWW02157434441747371980303UMI520472315303360540710001235802ID5916PT TARSIUS TAHIR6009Tangerang6105544786253051017588683110703C0108286601K62BH34X445J046C4W5249E663045FC6", "payment_event_id": 12345 } } } } ``` *** *** ## Security and responses Return HTTP `200` promptly after validating the request. For retry behavior, see [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). Verify every webhook using [Security and signature validation](/api-reference/webhooks/security-and-signature). Use your configured callback path when building `StringToSign`. Handle duplicate deliveries idempotently using stable identifiers from the payload (for example `transaction_id` or `reff_no`). # QRIS Issuer Webhook Source: https://docs.singapay.id/api-reference/webhooks/qris-issuer Real-time notifications when a QRIS Issuer (money out) transaction completes or fails. Track success and failure outcomes for QRIS issuer payments via the shared disbursement_notif_url. > [!NOTE] > > **Money Out Operation** — This webhook fires when a QRIS Issuer transaction is completed (success or failed), transferring funds from your SingaPay account to a merchant via QRIS. ## Information | Method | Path | Format | Authentication | | - | - | - | - | | POST | `https://your-webhook-url/callback` | json | HMAC SHA512 Signature | SingaPay sends a `POST` request to your configured `disbursement_notif_url` when a QRIS Issuer transaction is completed (success or failed). > [!NOTE] > > This webhook may share a callback URL with other event types. See [Shared webhook endpoints](/api-reference/webhooks/shared-endpoints) for routing by `event` value. *** ## Request Details ### Headers | Field | Value | Type | Mandatory | Description | | - | - | - | :-: | - | | `Content-Type` | `application/json` | Alphabetic | Yes | Specifies JSON format for the request body | | `User-Agent` | `SingaPaymentGateway/1.0` | Alphabetic | Yes | Identifies the source of the webhook | | `Accept` | `application/json` | Alphabetic | Yes | Expected response format | | `X-PARTNER-ID` | — | Alphanumeric | Yes | Your API Key from the merchant dashboard | | `X-Signature` | — | Alphanumeric | Conditional | HMAC SHA512 signature (128 chars). Included when signature security is enabled | | `X-Timestamp` | — | Numeric | Conditional | Unix timestamp in **seconds**. Included when signature security is enabled | | `Authorization` | `Bearer ` | Alphanumeric | Conditional | JWT bearer token; included when signature security is enabled | > [!NOTE] > > Signature-related headers (`X-Signature`, `X-Timestamp`, `Authorization`) are included when your merchant account has API credentials configured and signature security is enabled. When enabled, extract the access token from the `Authorization` header and use it as-is in the string to sign. See [How to Validate Signature](#how-to-validate-signature) below. *** ### Body Parameters **response\_code** `string` *required* Response code. See [Appendix 01 — Response Codes](#01-response-codes). Example: `SP000` **response\_message** `string` *required* Human-readable response message. Example: `Successful` **event** `string` *required* Transaction type identifier. Always `"qris-issuer"` for this webhook. Use this to distinguish from `"disbursement"` and `"ewallet-topup"` on the shared URL. **data** `object` *required* Response payload object. **data fields** **transaction\_id** `string` *required* System-generated transaction ID. Example: `"112220251111135424691"` **reference\_number** `string` *required* Your unique merchant reference number. Example: `"123456789123"` **transaction\_status** `object` *required* Transaction status object. See [Appendix 02 — Transaction Status](#02-transaction-status). **transaction\_status fields** **code** `string` *required* Status code. E.g. `"00"` (Success), `"06"` (Failed) **desc** `string` *required* Status description. E.g. `"Success"`, `"Failed"` **post\_timestamp** `string` *required* Transaction creation time in Unix **milliseconds**. Example: `"1762844064000"` **processed\_timestamp** `string` Processing completion time in Unix **milliseconds**. Empty string if the transaction failed. **qr\_data** `string` *required* The raw EMVCo string encoded in the QR code image. **type** `string` *required* QR code type. E.g. `"mpm"`, `"cpm"`, `"mpm-dynamic"`, `"mpm-static"` **scope** `string` *required* QR code scope. E.g. `"issuer"`, `"acquirer"` **gross\_amount** `object` *required* Total amount including fees. **gross\_amount fields** **currency** `string` *required* ISO 4217 currency code. Example: `"IDR"` **value** `string` *required* Gross amount value. Example: `"21500.00"` **fee** `object` *required* Transfer fee details. **fee fields** **name** `string` Fee description. Example: `"Transfer Fee"` **currency** `string` *required* ISO 4217 currency code. **value** `string` *required* Fee amount. Example: `"500.00"` **net\_amount** `object` *required* Amount paid to the merchant (`gross_amount − fee`). **net\_amount fields** **currency** `string` *required* ISO 4217 currency code. **value** `string` *required* Net amount value. Example: `"21000.00"` **balance\_after** `object` *required* Your account balance after the transaction. Both fields are `null` for failed transactions. **balance\_after fields** **currency** `string` ISO 4217 currency code. `null` if failed. **value** `string` Balance value. `null` if failed. Example: `"120000.00"` **rrn** `string` Retrieval Reference Number issued by the QRIS switching network. Used for reconciliation with the acquirer/switcher. Empty string if the transaction failed. Example: `"9f3kd82p1a77"` **failed\_code** `string` Error code. Only present when the transaction failed. Example: `"CONNECTION_ERROR"` **failed\_reason** `string` Human-readable error description. Only present when the transaction failed. Example: `"Connection timeout to vendor"` *** ### Payload Examples ```json Success theme={null} { "response_code": "SP000", "response_message": "Successfully", "event": "qris-issuer", "data": { "transaction_id": "912042026071011453372901847", "reference_number": "INVQR-20260710-00931", "transaction_status": { "code": "00", "desc": "Success" }, "post_timestamp": "1783650123000", "processed_timestamp": "1783650124512", "qr_data": "00020101021226620015ID.SINGAPAY.WWW0118936011122334450002021035224094080303UME51440014ID.CO.QRIS.WWW02153559174130998870303UME5204601153033605405150005802ID5903eos6005DEPOK6105746786221051017730486640703C0163044A21", "type": "mpm-dynamic", "scope": "issuer", "gross_amount": { "currency": "IDR", "value": "50750" }, "fee": { "currency": "IDR", "value": "750" }, "net_amount": { "currency": "IDR", "value": "50000" }, "balance_after": { "currency": "IDR", "value": "184320450.00" }, "rrn": "9f3kd82p1a77" } } ``` ```json Failed theme={null} { "response_code": "SP001", "response_message": "Transaction Failure", "event": "qris-issuer", "data": { "transaction_id": "912042026071011453372901848", "reference_number": "INVQR-20260710-00932", "transaction_status": { "code": "06", "desc": "Failed" }, "post_timestamp": "1783650321000", "processed_timestamp": "", "qr_data": "00020101021226620015ID.SINGAPAY.WWW0118936011122334450002021035224094080303UME51440014ID.CO.QRIS.WWW02153559174130998870303UME5204601153033605405150005802ID5903eos6005DEPOK6105746786221051017730486640703C0163044A21", "type": "mpm-dynamic", "scope": "issuer", "gross_amount": { "currency": "IDR", "value": "50750" }, "fee": { "currency": "IDR", "value": "750" }, "net_amount": { "currency": "IDR", "value": "50000" }, "balance_after": { "currency": null, "value": null }, "rrn": "", "failed_code": "CONNECTION_ERROR", "failed_reason": "Connection timeout to vendor" } } ``` *** *** ## Security and responses Return HTTP `200` promptly after validating the request. For retry behavior, see [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). Verify every webhook using [Security and signature validation](/api-reference/webhooks/security-and-signature). Use your configured callback path when building `StringToSign`. Handle duplicate deliveries idempotently using stable identifiers from the payload (for example `transaction_id` or `reff_no`). *** ## QRIS Issuer specific notes ### Idempotency Each `reference_number` can only be used once per account. If you retry with the same `reference_number`, you'll receive the existing transaction status rather than creating a duplicate payment. ```php Detecting Duplicate Webhooks theme={null} $referenceNumber = $payload['data']['reference_number']; $existingTransaction = findTransactionByReference($referenceNumber); if ($existingTransaction) { // Already processed — return 200 without re-processing http_response_code(200); exit; } processQrisIssuerPayment($payload); ``` ### Timestamp Formats > [!WARNING] > > QRIS Issuer webhooks use **two different timestamp formats**. Don't mix them up. | Field | Format | Example | Notes | | - | - | - | - | | `X-Timestamp` header | Unix seconds | `1695711945` | Used for signature validation | | `post_timestamp` (body) | Unix milliseconds | `1762844064000` | Divide by 1000 to convert | | `processed_timestamp` (body) | Unix milliseconds | `1762844065000` | Empty string if transaction failed | When validating signatures, always use the **X-Timestamp header value** (in seconds), not the timestamps from the request body (which are in milliseconds). ```php Converting millisecond timestamps theme={null} $postTimestamp = $payload['data']['post_timestamp']; // "1762844064000" $date = new DateTime(); $date->setTimestamp((int)($postTimestamp / 1000)); // Or with Carbon (Laravel) $date = \Carbon\Carbon::createFromTimestampMs($postTimestamp); ``` ### Balance Tracking The `balance_after` field shows your account balance after the transaction: * For **successful** transactions: remaining balance after deduction * For **failed** transactions: both `currency` and `value` are `null` (no balance change) * Use this to verify balance consistency with your system * All amounts are in IDR (Indonesian Rupiah) ```php Balance Consistency Check theme={null} if ($payload['data']['transaction_status']['code'] === '00') { $balanceAfter = (float)$payload['data']['balance_after']['value']; $grossAmount = (float)$payload['data']['gross_amount']['value']; $expectedBalance = $previousBalance - $grossAmount; if (abs($balanceAfter - $expectedBalance) > 0.01) { logBalanceDiscrepancy($transactionId, $expectedBalance, $balanceAfter); } } ``` *** ## Appendix ### 01: Response Codes | Code | Message | Description | Action | | - | - | - | - | | `SP000` | Successfully | Success | Check inquiry status | | `SP001` | Transaction Failure | Failed transaction | Check inquiry status | | `SP002` | General Failure | Internal server error | Check inquiry status | | `SP003` | Insufficient Balance | Account balance too low | Check inquiry status | | `SP004` | Duplicate Reference Number | Reference already used | — | | `SP005` | Timeout | Gateway timeout | Check inquiry status | | `SP006` | Exceed Beneficiary Limit | Beneficiary amount limit reached | Check inquiry status | | `SP007` | Exceed Account Limit | Account transaction limit reached | Contact IT Support | | `SP008` | Invalid Reference Number | Reference does not exist | — | | `SP009` | Transaction Not Found | Transaction not found | — | | `SP010` | Beneficiary Account Not Found | Account not found | — | | `SP011` | Beneficiary Vendor Not Active | Vendor not active | — | | `SP012` | Bad Request | Bad request | — | | `SP013` | Unauthorized | Unauthorized | — | | `SP014` | Not Found | Not found | — | | `SP015` | Forbidden | Forbidden | — | | `SP016` | Signature Invalid | Signature invalid | — | | `SP017` | Unauthorized IP | IP not authorized | Contact IT Support | | `SP018` | Validation Error | Payload validation error | — | | `SP019` | General Error | General error | Contact IT Support | | `SP020` | Merchant Account Not Found | Merchant account not found | — | ### 02: Transaction Status | Code | Status | Notes | | :-: | - | - | | `00` | Success | Transaction completed successfully | | `01` | Initiated | Payment call not yet received; retry is possible | | `02` | Paying | Pending/Suspect — retry status check in a few minutes; awaiting final callback | | `03` | Pending | Pending/Suspect — retry status check in a few minutes; awaiting final callback | | `04` | Refunded | Reversal transaction | | `05` | Canceled | Create a new transaction | | `06` | Failed | Transaction failed | | `07` | Not Found | Create a new transaction | # Webhook Retry Mechanism Source: https://docs.singapay.id/api-reference/webhooks/retry-mechanism Singapay automatically retries failed webhook deliveries to ensure reliable communication between our system and your server. When Singapay sends a webhook to your endpoint and does not receive a valid response, the system will automatically retry the delivery. Retries are designed to handle temporary disruptions such as timeouts, server downtime, or connection errors. > [!NOTE] > > Each retry is performed with a **1-minute interval** between attempts. If all retries are exhausted, a failure notification will be sent to your registered merchant email. ## Retry Rules by HTTP Status The number of retry attempts depends on the HTTP response status returned by your endpoint. | HTTP Status / Condition | Handler | Max Retries | Description | | - | - | - | - | | `500` Internal Server Error | `handleFailedHttpResponse()` | 1 | Your server encountered an internal error. | | `503` Service Unavailable | `handleFailedHttpResponse()` | 4 | Your server is temporarily unreachable. | | `400` / `404` Bad Request / Not Found | `handleFailedHttpResponse()` | 2 | Endpoint may be incorrect or temporarily unavailable. | | `307` / `308` Temporary / Permanent Redirect | `retryRedirect()` | 5 | Redirects are followed up to 5 times. | | `301` / `302` / `303` Redirect | `handleFailedHttpResponse()` | 0 | Redirects are **not** followed — update your endpoint URL. | | Exception (cURL error, timeout, DNS) | `catch(Exception $e)` | 1 | Connection-level failures. | | Other (default) | `handleFailedHttpResponse()` | 5 | All other status codes not listed above. | > [!WARNING] > > Redirects via `301`, `302`, or `303` will **not** be followed and receive **zero retries**. Make sure your webhook URL points directly to the correct endpoint. ## Retry Interval > [card] Interval Between Retries > > Each retry attempt is made **1 minute** after the previous one. Retries stop once the maximum limit for that status code is reached. > [card] Retry Cache TTL > > Retry counts are stored in cache with a **15-minute TTL**. All attempts are logged to our database for auditing. ## Example: HTTP 503 Retry Flow Here's what happens when your endpoint consistently returns `503`: **1. Attempt #1** Singapay sends the webhook. Your server responds `503`. System schedules a retry in 1 minute. **2. Attempt #2** First retry. Still `503`. Another retry scheduled in 1 minute. **3. Attempt #3** Second retry. Still `503`. Another retry scheduled. **4. Attempt #4 (Final)** Third and final retry. Still `503`. No more retries. Failure logged and notification email sent. > [!NOTE] > > Total maximum delivery time for a `503` scenario: approximately **4 minutes** across all attempts. ## What Happens After All Retries Fail If the webhook cannot be delivered after all retry attempts: 1. The failure is **logged in the database** and visible via the Callback menu on your merchant dashboard. 2. A **failure notification email** is sent to your registered merchant email address. ## Best Practices > [card] Return 2xx > > Always respond with an HTTP status between `200–299` to acknowledge receipt. > [card] Stay Available > > Keep your webhook endpoint stable and publicly accessible at all times. > [card] Avoid Redirects > > Do not use redirect URLs (`301–308`) as your webhook endpoint. > [!TIP] > > Process webhooks asynchronously — return `200 OK` immediately and handle the payload in a background job to avoid timeouts. # Settlement Notification Webhook Source: https://docs.singapay.id/api-reference/webhooks/settlement Real-time notifications when a settlement batch is completed, or when an individual settled transaction is refunded or has its refund cancelled. Keep your books in sync with what SingaPay has actually paid out. > [!NOTE] > > **Accounting Operation** — This webhook fires on settlement lifecycle events (completion, refund, refund cancellation). It reports money movements between your `pending_balance`, `available_balance`, and your bank account. ## Information | Method | Path | Format | Authentication | | - | - | - | - | | POST | `https://your-webhook-url/callback` | json | HMAC SHA512 Signature | SingaPay sends a `POST` request to your configured `settlement_notif_url` whenever a settlement batch reaches a final state, or when a settled transaction is refunded / has its refund cancelled. > [!NOTE] > > This webhook may share a callback URL with other event types. Always route by the `event` value in the body. See [Shared webhook endpoints](/api-reference/webhooks/shared-endpoints). *** ## Events This single webhook covers three settlement events, distinguished by the `event` field: | `event` | Fired when | `data` contains | | - | - | - | | `settlement.completed` | A settlement batch is completed — either a sequential settlement is **approved** by Finance, or a **parallel (auto) settlement** is created by the scheduler. | `settlement`, `total_transactions` | | `settlement.refunded` | A single settled transaction is **refunded** back from your balance (settlement method `balance` / `auto-balance` only). | `settlement`, `refund` | | `settlement.refund_cancelled` | A previous refund is **cancelled** and the balance is restored. | `settlement`, `refund` | > [!NOTE] > > Settlement currently supports **money-in** transactions only (Virtual Account, QRIS, Payment Link, E-Wallet). Refund events apply only to settlements using the `balance` or `auto-balance` method. *** ## Request Details ### Headers | Field | Value | Type | Mandatory | Description | | - | - | - | :-: | - | | `Content-Type` | `application/json` | Alphabetic | Yes | Specifies JSON format for the request body | | `User-Agent` | `SingaPaymentGateway/1.0` | Alphabetic | Yes | Identifies the source of the webhook | | `Accept` | `application/json` | Alphabetic | Yes | Expected response format | | `X-PARTNER-ID` | — | Alphanumeric | Yes | Your API Key from the merchant dashboard | | `X-Signature` | — | Alphanumeric | Yes | HMAC SHA512 signature (128 chars) for request verification | | `X-Timestamp` | — | Numeric | Yes | Unix timestamp in **seconds** when the request was sent | | `Authorization` | `Bearer ` | Alphanumeric | Yes | System-generated random bearer token; used as a component in the signature | > [!NOTE] > > The `Authorization` token for settlement webhooks is a **randomly generated string** — not a user access token. Settlement events are triggered by an admin approval, a scheduler, or a refund action (system events), not a user request. Extract the token as-is and use it in the string to sign. See [Security and signature validation](/api-reference/webhooks/security-and-signature). *** ### Body Parameters — common envelope Every settlement webhook shares the same top-level envelope: **status** `number` *required* HTTP Status Code. Always `200`. **success** `boolean` *required* Indicates a successful event. Always `true`. **event** `string` *required* Event type identifier. One of `"settlement.completed"`, `"settlement.refunded"`, `"settlement.refund_cancelled"`. **timestamp** `string` *required* Event timestamp in format `"d M Y H:i:s"`. Example: `"18 Jun 2026 10:00:00"` **data** `object` *required* Container for the settlement details (and, for refund events, the refund details). *** ### `data.settlement` (present on all events) **settlement** `object` *required* The settlement batch the event relates to. **settlement fields** **id** `integer` *required* Unique settlement ID. Example: `1234` **reference\_no** `string` *required* Settlement reference number. Format `SETTLEMENT-{merchant_id}-{uniqid}`. Example: `"SETTLEMENT-1-ABC123"` **title** `string` *required* Human-readable batch title. Example: `"Settlement Acme (01 Jun 2026 - 17 Jun 2026)"` **status** `string` *required* Settlement status. `"completed"` for completed settlements. **settlement\_type** `string` *required* Transaction scope of the batch. One of `"ALL"`, `"VA"`, `"QRIS"`, `"EWALLET"`. **settlement\_method** `string` *required* How funds were moved. One of `"balance"`, `"bank-account"`, `"auto-balance"`, `"e-wallet"`. **is\_auto\_created** `boolean` *required* `true` if this batch was created automatically by parallel (auto) settlement; `false` for sequential settlements approved by Finance. **start\_date** `string` *required* Start of the transaction date range covered. Format `"d M Y H:i:s"`. **end\_date** `string` *required* End of the transaction date range covered. Format `"d M Y H:i:s"`. **amount** `number` *required* Total **net** amount of the settled transactions. Example: `1000000` **total\_admin\_fee** `number` *required* Sum of admin fees across the batch. Example: `5000` **total\_vendor\_fee** `number` *required* Sum of payment-vendor fees across the batch. Example: `3000` **total\_our\_margin** `number` *required* Sum of SingaPay margin across the batch. Example: `2000` **settlement\_fee** `number` *required* Settlement transfer fee. Non-zero only for the `bank-account` method; `0` for all other methods. **total\_to\_transfer** `number` *required* Net amount transferred: `amount - settlement_fee`. Example: `1000000` **total\_refunded** `number` *required* Accumulated net amount that has been refunded from this settlement. Example: `0` **currency** `string` *required* ISO 4217 currency code. Always `"IDR"`. **transfer\_status** `string` Bank transfer status for the `bank-account` method: `"pending"`, `"success"`, or `"failed"`. `null` for all other methods. **approved\_by** `string` Who completed the settlement. The approver's name for sequential settlements, or `"SYSTEM"` for auto settlements. **approved\_at** `string` Timestamp the settlement was completed. Format `"d M Y H:i:s"`. **recipient** `object` *required* Destination bank account (populated only for the `bank-account` method; otherwise all fields are `null`). **recipient fields** **bank\_code** `string` Recipient bank code. Example: `"BRI"` **account\_number** `string` Recipient account number. **account\_name** `string` Recipient account holder name. *** ### `data.total_transactions` (`settlement.completed` only) **total\_transactions** `integer` *required* Number of transactions included in the completed settlement batch. Example: `5` *** ### `data.refund` (`settlement.refunded` & `settlement.refund_cancelled` only) **refund** `object` *required* Details of the individual transaction that was refunded or had its refund cancelled. **refund fields** **settlement\_detail\_id** `integer` *required* ID of the settlement detail row (the transaction's line within the batch). Example: `987` **transaction\_type** `string` *required* Class name of the underlying transaction. One of `"VATransaction"`, `"QrisTransaction"`, `"PaymentLinkHistory"`, `"EwalletTransaction"`, `"PaymentLinkingTransaction"`. **transaction\_id** `integer` *required* ID of the underlying transaction. Example: `42` **transaction\_reff** `string` *required* Reference of the underlying transaction. Example: `"INV-2026-001"` **account\_id** `integer` Account the balance movement applied to. May be `null`. **net\_amount** `object` *required* Net amount deducted (refund) or restored (refund cancelled). **net\_amount fields** **value** `number` *required* Net amount value. Example: `95000` **currency** `string` *required* ISO 4217 currency code. Always `"IDR"`. **is\_refunded** `boolean` *required* `true` once the detail has been refunded. Remains `true` even after a refund is cancelled. **is\_refund\_cancelled** `boolean` *required* `true` if the refund has been cancelled. `false` for an active refund. **refunded\_by** `string` Admin who performed the refund. May be `null`. **refunded\_at** `string` Timestamp the refund was performed. Format `"d M Y H:i:s"`. May be `null`. **refund\_cancelled\_by** `string` Admin who cancelled the refund. `null` for `settlement.refunded`. **refund\_cancelled\_at** `string` Timestamp the refund was cancelled. Format `"d M Y H:i:s"`. `null` for `settlement.refunded`. **actor** `string` The admin who triggered this specific event (refunder or canceller). May be `null`. *** ### Payload Examples ```json settlement.completed theme={null} { "status": 200, "success": true, "event": "settlement.completed", "timestamp": "18 Jun 2026 10:00:00", "data": { "settlement": { "id": 1234, "reference_no": "SETTLEMENT-1-ABC123", "title": "Settlement Acme (01 Jun 2026 - 17 Jun 2026)", "status": "completed", "settlement_type": "ALL", "settlement_method": "balance", "is_auto_created": false, "start_date": "01 Jun 2026 00:00:00", "end_date": "17 Jun 2026 23:59:59", "amount": 1000000, "total_admin_fee": 5000, "total_vendor_fee": 3000, "total_our_margin": 2000, "settlement_fee": 0, "total_to_transfer": 1000000, "total_refunded": 0, "currency": "IDR", "transfer_status": null, "approved_by": "Jane Finance", "approved_at": "18 Jun 2026 10:00:00", "recipient": { "bank_code": null, "account_number": null, "account_name": null } }, "total_transactions": 5 } } ``` ```json settlement.completed (bank-account) theme={null} { "status": 200, "success": true, "event": "settlement.completed", "timestamp": "18 Jun 2026 10:05:00", "data": { "settlement": { "id": 1240, "reference_no": "SETTLEMENT-1-XYZ789", "title": "Settlement Acme (17 Jun 2026 - 17 Jun 2026)", "status": "completed", "settlement_type": "VA", "settlement_method": "bank-account", "is_auto_created": false, "start_date": "17 Jun 2026 00:00:00", "end_date": "17 Jun 2026 23:59:59", "amount": 2000000, "total_admin_fee": 10000, "total_vendor_fee": 6000, "total_our_margin": 4000, "settlement_fee": 13000, "total_to_transfer": 1987000, "total_refunded": 0, "currency": "IDR", "transfer_status": "success", "approved_by": "Jane Finance", "approved_at": "18 Jun 2026 10:05:00", "recipient": { "bank_code": "BRI", "account_number": "1234567890", "account_name": "PT Acme Indonesia" } }, "total_transactions": 8 } } ``` ```json settlement.refunded theme={null} { "status": 200, "success": true, "event": "settlement.refunded", "timestamp": "19 Jun 2026 09:30:00", "data": { "settlement": { "id": 1234, "reference_no": "SETTLEMENT-1-ABC123", "title": "Settlement Acme (01 Jun 2026 - 17 Jun 2026)", "status": "completed", "settlement_type": "ALL", "settlement_method": "balance", "is_auto_created": false, "start_date": "01 Jun 2026 00:00:00", "end_date": "17 Jun 2026 23:59:59", "amount": 1000000, "total_admin_fee": 5000, "total_vendor_fee": 3000, "total_our_margin": 2000, "settlement_fee": 0, "total_to_transfer": 1000000, "total_refunded": 95000, "currency": "IDR", "transfer_status": null, "approved_by": "Jane Finance", "approved_at": "18 Jun 2026 10:00:00", "recipient": { "bank_code": null, "account_number": null, "account_name": null } }, "refund": { "settlement_detail_id": 987, "transaction_type": "VATransaction", "transaction_id": 42, "transaction_reff": "INV-2026-001", "account_id": 7, "net_amount": { "value": 95000, "currency": "IDR" }, "is_refunded": true, "is_refund_cancelled": false, "refunded_by": "Bob Admin", "refunded_at": "19 Jun 2026 09:30:00", "refund_cancelled_by": null, "refund_cancelled_at": null, "actor": "Bob Admin" } } } ``` ```json settlement.refund_cancelled theme={null} { "status": 200, "success": true, "event": "settlement.refund_cancelled", "timestamp": "19 Jun 2026 11:00:00", "data": { "settlement": { "id": 1234, "reference_no": "SETTLEMENT-1-ABC123", "title": "Settlement Acme (01 Jun 2026 - 17 Jun 2026)", "status": "completed", "settlement_type": "ALL", "settlement_method": "balance", "is_auto_created": false, "start_date": "01 Jun 2026 00:00:00", "end_date": "17 Jun 2026 23:59:59", "amount": 1000000, "total_admin_fee": 5000, "total_vendor_fee": 3000, "total_our_margin": 2000, "settlement_fee": 0, "total_to_transfer": 1000000, "total_refunded": 0, "currency": "IDR", "transfer_status": null, "approved_by": "Jane Finance", "approved_at": "18 Jun 2026 10:00:00", "recipient": { "bank_code": null, "account_number": null, "account_name": null } }, "refund": { "settlement_detail_id": 987, "transaction_type": "VATransaction", "transaction_id": 42, "transaction_reff": "INV-2026-001", "account_id": 7, "net_amount": { "value": 95000, "currency": "IDR" }, "is_refunded": true, "is_refund_cancelled": true, "refunded_by": "Bob Admin", "refunded_at": "19 Jun 2026 09:30:00", "refund_cancelled_by": "Bob Admin", "refund_cancelled_at": "19 Jun 2026 11:00:00", "actor": "Bob Admin" } } } ``` *** ## Security and responses Return HTTP `200` promptly after validating the request. For retry behavior, see [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). Verify every webhook using [Security and signature validation](/api-reference/webhooks/security-and-signature). Use your configured `settlement_notif_url` path when building `StringToSign`. Handle duplicate deliveries idempotently using stable identifiers from the payload — for `settlement.completed` use `data.settlement.reference_no`; for refund events combine `data.settlement.reference_no` with `data.refund.settlement_detail_id` (and the `event`). *** ## Settlement Specific Notes > [accordion] One callback URL, three events > > All three events are delivered to the same `settlement_notif_url`. Always branch on the `event` field. A `settlement.completed` payload has `total_transactions`; refund events have a `refund` object instead. > [accordion] Sequential vs auto settlement > > `is_auto_created = false` means a sequential settlement approved by Finance (`approved_by` is the approver's name). `is_auto_created = true` means a parallel auto settlement created by the scheduler (`approved_by = "SYSTEM"`). Both arrive as `settlement.completed`. > [accordion] amount vs total\_to\_transfer > > `amount` is the total net amount of the settled transactions. `total_to_transfer` is what was actually moved out — `amount - settlement_fee`. The `settlement_fee` is only non-zero for the `bank-account` method. > [accordion] Refunds only for balance methods > > `settlement.refunded` and `settlement.refund_cancelled` fire only for settlements using the `balance` or `auto-balance` method. Refund deducts (and cancel restores) the transaction's **net amount** from your `available_balance` — fees are not refunded. > [accordion] Refund state via flags > > Track refund state with `is_refunded` and `is_refund_cancelled`. An active refund is `is_refunded=true, is_refund_cancelled=false`. A cancelled refund is `is_refunded=true, is_refund_cancelled=true` — note `is_refunded` stays `true`. > [accordion] Nullable fields > > `transfer_status` and the `recipient.*` fields are populated only for the `bank-account` method and are `null` for all other methods. Actor fields (`refunded_by`, `refund_cancelled_by`, `actor`) and `account_id` may be `null`. Handle `null` gracefully. > [accordion] Timestamp format & timezone > > All timestamps (`timestamp`, `approved_at`, `start_date`, `end_date`, `refunded_at`, `refund_cancelled_at`) use the format `"d M Y H:i:s"` (e.g. `"18 Jun 2026 10:00:00"`) in **Asia/Jakarta (WIB)** timezone — not UTC. # Shared Webhook Endpoints Source: https://docs.singapay.id/api-reference/webhooks/shared-endpoints Route SingaPay webhooks when multiple event types share the same callback URL. Covers transaction_notif_url (money in) and disbursement_notif_url (money out). Some webhook types share a single callback URL configured in your merchant dashboard. Use the top-level `event` field in the JSON body to route each payload to the correct handler. *** ## Money In — `transaction_notif_url` SingaPay delivers these money-in events to the same `transaction_notif_url`: | `event` value | Webhook documentation | | - | - | | `va-transaction` | [Virtual Account Transaction](/api-reference/webhooks/va-transaction) | | `qris-acquirer-transaction` | [QRIS Acquirer Transaction](/api-reference/webhooks/qris-acquirer) | | `payment-link-transaction` | [Payment Link Transaction](/api-reference/webhooks/payment-link) | | `ewallet-native-transaction` | [E-Wallet Native Transaction](/api-reference/webhooks/ewallet-moneyin) | > [!NOTE] > > [Subscription Cycle](/api-reference/webhooks/subscription) uses a **dedicated** `subscription_cycle_notif_url`, not `transaction_notif_url`. ### Routing example ```php PHP theme={null} 'success']); ``` *** ## Money Out — `disbursement_notif_url` SingaPay delivers these money-out events to the same `disbursement_notif_url`: | `event` value | Webhook documentation | | - | - | | `disbursement` | [Disbursement Transaction](/api-reference/webhooks/disbursement-transaction) | | `ewallet-topup` | [E-Wallet Top Up Transaction](/api-reference/webhooks/ewallet-moneyout) | | `qris-issuer` | [QRIS Issuer Transaction](/api-reference/webhooks/qris-issuer) | You can also distinguish payloads using nested fields such as `data.bank`, `data.ewallet`, or `data.qr_data` when present. ### Routing example ```php PHP theme={null} 'success']); ``` *** ## Dedicated URLs (not shared) | Dashboard field | Used for | | - | - | | `subscription_cycle_notif_url` | [Subscription Cycle](/api-reference/webhooks/subscription) | | `kyb_notif_url` | [Sub-Account KYB Verification](/api-reference/webhooks/sub-account-kyb) | | `payment_link_inquiry_notif_url` | [Payment Link Inquiry](/api-reference/webhooks/payment-link-inquiry) | | `product_expiration_notif_url` | [Product Expiration](/api-reference/webhooks/product-expiration) | | `transaction_expiration_notif_url` | [Transaction Money-In Expiration](/api-reference/webhooks/transaction-moneyin-expiration) | Validate and acknowledge all webhooks using [Security and signature validation](/api-reference/webhooks/security-and-signature). # Sub-Account KYB Verification Webhook Source: https://docs.singapay.id/api-reference/webhooks/sub-account-kyb Real-time notifications when a managed sub-account's KYB (Know Your Business) submission is approved or rejected by our verification team. > [!NOTE] > > **Sub-Account Operation** — This webhook fires on KYB review outcomes for your **managed sub-accounts** (`business_managed`). It does not apply to your own merchant-level KYB, or to `owned`/`personal_managed` sub-accounts (which never require KYB). ## Information | Method | Path | Format | Authentication | | - | - | - | - | | POST | `https://your-webhook-url/callback` | json | HMAC SHA512 Signature | SingaPay sends a `POST` request to your configured `kyb_notif_url` whenever a managed sub-account's KYB submission finishes review — either approved, or rejected at one of the review stages. *** ## Events This single webhook covers two events, distinguished by the `event` field: | `event` | Fired when | `data` contains | | - | - | - | | `kyb.approved` | The sub-account passes **all** review stages (Document → DTTOT → Blacklist) and becomes `active`. | `account`, `verified_at` | | `kyb.rejected` | **Any** review stage (Document, DTTOT, or Blacklist) rejects the submission. | `account`, `stage`, `reason`, `rejected_at` | > [!NOTE] > > KYB review runs through three sequential stages: **Document Check → DTTOT Check → Blacklist Check**. `kyb.rejected` can fire at any of the three — you will receive a **separate webhook call for each rejection**, not just one at the end. `kyb.approved` fires only once, after the final stage passes. *** ## Request Details ### Headers | Field | Value | Type | Mandatory | Description | | - | - | - | :-: | - | | `Content-Type` | `application/json` | Alphabetic | Yes | Specifies JSON format for the request body | | `User-Agent` | `SingaPaymentGateway/1.0` | Alphabetic | Yes | Identifies the source of the webhook | | `Accept` | `application/json` | Alphabetic | Yes | Expected response format | | `X-PARTNER-ID` | — | Alphanumeric | Yes | Your API Key from the merchant dashboard | | `X-Signature` | — | Alphanumeric | Yes | HMAC SHA512 signature (128 chars) for request verification | | `X-Timestamp` | — | Numeric | Yes | Unix timestamp in **seconds** when the request was sent | | `Authorization` | `Bearer ` | Alphanumeric | Yes | System-generated random bearer token; used as a component in the signature | > [!NOTE] > > The `Authorization` token for KYB webhooks is a **randomly generated string** — not a user access token. KYB review outcomes are triggered by an internal reviewer action, not a merchant request. Extract the token as-is and use it in the string to sign. See [Security and signature validation](/api-reference/webhooks/security-and-signature). *** ### Body Parameters — common envelope Every KYB webhook shares the same top-level envelope: **status** `number` *required* HTTP Status Code. Always `200`. **success** `boolean` *required* Indicates a successful event. Always `true`. **event** `string` *required* Event type identifier. One of `"kyb.approved"`, `"kyb.rejected"`. **timestamp** `string` *required* Event timestamp in format `"d M Y H:i:s"`. Example: `"28 Aug 2026 14:33:55"` **data** `object` *required* Container for the account details (and, for rejections, the rejection details). *** ### `data.account` (present on all events) **account** `object` *required* The sub-account the event relates to. Shape is identical to the `Account` object returned by [`GET /accounts/{id}`](/api-reference). **account fields** **id** `string` *required* Account ULID. Example: `"01K946KF851RK7FX075GJHBVKF"` **account\_number** `string` Account number. May be `null`. **name** `string` *required* Account name. **status** `string` *required* `"active"` or `"inactive"`. **account\_type** `string` *required* Always `"business_managed"` in the context of this webhook. **kyb\_status** `string` One of `"kyb_waiting_document"`, `"kyb_in_review"`, `"kyb_rejected"`, `"kyb_verified"`. **kyb\_rejection\_reason** `string` The currently outstanding rejection reason. `null` unless `kyb_status` is `"kyb_rejected"`. **business\_type** `string` `"individual"` or `"company"`. `null` until the sub-merchant makes this choice during onboarding. **legal\_name** `string` Legal company name (`business_type = "company"`) or the primary owner's full name (`business_type = "individual"`). `null` until `kyb_status = "kyb_verified"`. **brand\_name** `string` Business/brand name. `null` until `kyb_status = "kyb_verified"`. **kyb\_onboarding\_url** `string` The sub-merchant's self-onboarding link. Stays active (and identical) across reject → resubmit cycles; becomes `null` once `kyb_status = "kyb_verified"` (the link is revoked). **invite\_members** `string[]` Email addresses of your dashboard members who have access to this sub-account. *** ### `data.verified_at` (`kyb.approved` only) **verified\_at** `string` *required* Timestamp the final review stage was approved. Format `"d M Y H:i:s"`. *** ### `data.stage`, `data.reason`, `data.rejected_at` (`kyb.rejected` only) **stage** `string` *required* Which review stage rejected the submission. One of `"document"`, `"dttot"`, `"blacklist"`. **reason** `string` *required* Free-text reason written by the reviewer. Not a structured error code — read it directly to determine what needs correcting. **rejected\_at** `string` *required* Timestamp the rejection was recorded. Format `"d M Y H:i:s"`. *** ### Payload Examples ```json kyb.approved theme={null} { "status": 200, "success": true, "event": "kyb.approved", "timestamp": "28 Aug 2026 14:33:55", "data": { "account": { "id": "01K946KF851RK7FX075GJHBVKF", "account_number": "000000000123", "name": "SingaPay Demo Store", "status": "active", "account_type": "business_managed", "kyb_status": "kyb_verified", "kyb_rejection_reason": null, "business_type": "company", "legal_name": "PT SingaPay Demo Indonesia", "brand_name": "SingaPay Demo Store", "kyb_onboarding_url": null, "invite_members": ["owner@merchant.com"] }, "verified_at": "28 Aug 2026 14:33:55" } } ``` ```json kyb.rejected theme={null} { "status": 200, "success": true, "event": "kyb.rejected", "timestamp": "28 Aug 2026 14:35:12", "data": { "account": { "id": "01K946KF851RK7FX075GJHBVKF", "account_number": "000000000123", "name": "SingaPay Demo Store", "status": "inactive", "account_type": "business_managed", "kyb_status": "kyb_rejected", "kyb_rejection_reason": "KTP tidak terbaca / dokumen buram", "business_type": "company", "legal_name": null, "brand_name": null, "kyb_onboarding_url": "https://sandbox-payment-b2b.singapay.id/kyb/0b0e5ad5957a7c2de066c2cde97e91089b605aae9afeba3398ff871cd1e99d54", "invite_members": ["owner@merchant.com"] }, "stage": "document", "reason": "KTP tidak terbaca / dokumen buram", "rejected_at": "28 Aug 2026 14:35:12" } } ``` *** ## Security and responses Return HTTP `200` promptly after validating the request. For retry behavior, see [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). Verify every webhook using [Security and signature validation](/api-reference/webhooks/security-and-signature). Use your configured `kyb_notif_url` path when building `StringToSign`. Handle duplicate deliveries idempotently using `data.account.id` combined with the `event` (and, for rejections, `data.stage`) as a stable identifier. *** ## Sub-Account KYB Specific Notes > [accordion] Dedicated callback URL > > `kyb_notif_url` is a dedicated field — it does not share a callback URL with any other webhook type. Configure it separately in your dashboard under **Settings → Credentials → Webhook & Notification URLs**. > [accordion] Multiple rejections per sub-account > > Review runs through three sequential stages. If a sub-merchant is rejected, corrects the issue, and resubmits, and is rejected again at a later stage, you will receive a **new** `kyb.rejected` webhook for that stage — each rejection in the account's history triggers its own call. > [accordion] The onboarding link survives rejection > > `kyb_onboarding_url` stays the same across reject → resubmit cycles — no new link is generated on rejection. The sub-merchant reopens the same URL to fix and resubmit their data. The link is only revoked (becomes `null`) once `kyb_status` reaches `kyb_verified`. > [accordion] kyb\_status alone doesn't tell you why > > `kyb_status = "kyb_rejected"` tells you a rejection is outstanding, but the specific reason lives in `kyb_rejection_reason` — a **free-text string** written by a human reviewer, not a structured per-field error code. If you need to know exactly which document or field was flagged, parse the reason text or direct your sub-merchant to read it carefully before resubmitting. > [accordion] legal\_name and brand\_name are null until verified > > Both fields only populate once `kyb_status = "kyb_verified"` — they are `null` throughout `kyb_waiting_document`, `kyb_in_review`, and `kyb_rejected`, including in the `kyb.rejected` payload itself. > [accordion] Timestamp format & timezone > > All timestamps (`timestamp`, `verified_at`, `rejected_at`) use the format `"d M Y H:i:s"` (e.g. `"28 Aug 2026 14:33:55"`) in **Asia/Jakarta (WIB)** timezone — not UTC. # Subscription Cycle Webhook Source: https://docs.singapay.id/api-reference/webhooks/subscription Real-time notifications for every recurring billing attempt (success, failure, retry) and plan status transitions. Keep your subscription state in sync with SingaPay. > [!NOTE] > > **Dedicated URL** — Unlike `transaction_notif_url` which is shared across VA, QRIS, Payment Link, and E-Wallet events, the `subscription_cycle_notif_url` is exclusively for subscription events. Configure it separately in the merchant dashboard. ## Information | Method | Path | Format | Authentication | | - | - | - | - | | POST | `https://your-webhook-url/callback` | json | HMAC SHA512 Signature | This webhook fires whenever one of the following happens on any subscription plan: * A cycle charge **succeeds** — initial charge after card linking, every recurring cycle, or a successful retry * A cycle charge **fails** — initial attempt and every retry attempt are delivered separately * The plan **status changes** — e.g. `suspended` after retries exhausted, `completed` after the last cycle, or `cancelled` (including system-initiated auto-cancel for `charge_immediately = true` plans rejected by the issuer) The `event` field distinguishes between them. *** ## Events | Event | When it fires | `success` field | | - | - | :-: | | `subscription.cycle.payment_success` | A cycle bill is paid (initial, recurring, or successful retry) | `true` | | `subscription.cycle.payment_failed` | A cycle bill attempt fails — fired on every attempt including each retry | `true` (HTTP `200`) | | `subscription.plan.status_changed` | The plan transitions to `suspended`, `cancelled`, or `completed` | `true` | > [!NOTE] > > `success: true` on `payment_failed` events indicates the webhook itself was emitted successfully — **not** that the charge succeeded. Always check the `event` field to determine the actual outcome. *** ## Request Details ### Headers | Field | Value | Type | Mandatory | Description | | - | - | - | :-: | - | | `Content-Type` | `application/json` | Alphabetic | Yes | Specifies JSON format for the request body | | `User-Agent` | `SingaPaymentGateway/1.0` | Alphabetic | Yes | Identifies the source of the webhook | | `Accept` | `application/json` | Alphabetic | Yes | Expected response format | | `X-PARTNER-ID` | — | Alphanumeric | Yes | Your API Key from the merchant dashboard | | `X-Signature` | — | Alphanumeric | Yes | HMAC SHA512 signature (128 chars) for request verification | | `X-Timestamp` | — | Numeric | Yes | Unix timestamp in **seconds** when the request was sent | | `Authorization` | `Bearer ` | Alphanumeric | Yes | System-generated random bearer token; used as a component in the signature | > [!NOTE] > > The `Authorization` token is a **randomly generated string** — not a user access token. Extract it as-is and use it in the string to sign. The signing scheme is identical to other SingaPay webhooks. See [How to Validate Signature](#security--signature-validation) below. *** ## Body Parameters — Payment Success / Failed These two events share the same body shape. The only difference is the `event` value and, on failure, whether `bill.retry` indicates more attempts are coming. **status** `number` *required* HTTP-style status code. Always `200`. **success** `boolean` *required* Always `true` — indicates the webhook was emitted successfully, **not** the charge outcome. **event** `string` *required* `"subscription.cycle.payment_success"` or `"subscription.cycle.payment_failed"`. **timestamp** `string` *required* Event timestamp in format `"d M Y H:i:s"`. Example: `"01 May 2026 00:00:15"` **data** `object` *required* Event payload. **data fields** **plan** `object` *required* Snapshot of the subscription plan at the time of the event. **plan fields** **id** `string` *required* Subscription Plan ID (26-char ULID). Example: `"01JAB3CD4E5F6G7H8J9K0M1N2"` **subscription\_id** `string` *required* Globally unique merchant-supplied plan reference. Example: `"PLAN-20260420-001"` **merchant\_reff\_no** `string` Merchant-side reference label echoed from plan creation. `null` if not set. **name** `string` *required* Plan display name. Example: `"Premium Monthly"` **amount** `number` *required* Per-cycle charge amount. Example: `150000` **currency** `string` *required* ISO 4217 currency code. Example: `"IDR"` **status** `string` *required* Current plan status. Example: `"active"` **parent\_plan\_id** `string` ID of the previous plan superseded via upgrade. `null` if not an upgrade. **retry\_policy** `object` *required* Plan-level retry policy. **retry\_policy fields** **max\_attempts** `integer` *required* Max retry attempts after the initial charge fails. Example: `3` **interval\_days** `integer` *required* Days between consecutive retries. Example: `3` **failed\_payment\_action** `string` *required* `"continue_plan"` or `"stop_plan"`. **bill** `object` *required* The specific cycle bill this event relates to. **bill fields** **id** `integer` *required* Internal bill ID. Example: `12345` **bill\_number** `string` *required* Human-readable bill number — also used as the webhook `reff_no` and idempotency key. Example: `"SUBBILL-202605-0001"` **status** `string` *required* `"pending"` | `"processing"` | `"paid"` | `"failed"` **total\_amount** `number` *required* Charge amount for this bill. Example: `150000` **currency** `string` *required* ISO 4217 currency code. Always `"IDR"` today. **due\_date** `string` Cycle due date (ISO 8601). Example: `"2026-05-01T00:00:00+07:00"` **paid\_date** `string` Paid timestamp (ISO 8601). `null` on `payment_failed`. **failure\_reason** `string` Human-readable failure reason. Present on `payment_failed`. Example: `"card_declined"` **payment\_reference** `string` Provider-side reference for this charge. Example: `"IONPAYTEST01202604201200000001"` **retry** `object` *required* Per-bill retry state combining the plan policy with the live attempt counter. **retry fields** **attempt** `integer` *required* How many retry attempts have been made so far. `0` on the initial attempt. **max\_attempts** `integer` *required* Max retry attempts (mirrors `plan.retry_policy.max_attempts`). **attempts\_remaining** `integer` *required* `max_attempts - attempt`, clamped to `0`. **max\_attempts\_reached** `boolean` *required* `true` when no more retries will fire. **interval\_days** `integer` *required* Days between retries. **failed\_payment\_action** `string` *required* `"continue_plan"` or `"stop_plan"`. **next\_retry\_at** `string` Next retry timestamp (ISO 8601). `null` when no more retries are scheduled. **last\_attempt\_at** `string` Most recent retry attempt timestamp (ISO 8601). **history** `array` *required* Chronological list of retry attempts on this bill. **history item fields** **attempt** `integer` *required* Retry sequence number (1-indexed). **status** `string` *required* `"pending"` | `"processing"` | `"paid"` | `"failed"` **retry\_date** `string` When this retry was executed (ISO 8601). **next\_retry\_date** `string` When the next retry is scheduled (ISO 8601). **failure\_reason** `string` Reason this particular retry failed. **cycle** `object` The cycle this bill belongs to. **cycle fields** **id** `integer` *required* Internal cycle ID. Example: `7890` **cycle\_number** `integer` *required* 1-indexed cycle number within the plan. Example: `3` **status** `string` *required* `"pending"` | `"paid"` | `"failed"` | `"skipped"` **period\_start** `string` Cycle period start (ISO 8601). **period\_end** `string` Cycle period end (ISO 8601). *** ### Payload Examples — Payment Events ```json payment_success (Cycle 3, first attempt) theme={null} { "status": 200, "success": true, "event": "subscription.cycle.payment_success", "timestamp": "01 May 2026 00:00:15", "data": { "plan": { "id": "01JAB3CD4E5F6G7H8J9K0M1N2", "subscription_id": "PLAN-20260420-001", "merchant_reff_no": "SUB-CUST-ACME-001", "name": "Premium Monthly", "amount": 150000, "currency": "IDR", "status": "active", "parent_plan_id": null, "retry_policy": { "max_attempts": 3, "interval_days": 3, "failed_payment_action": "continue_plan" } }, "bill": { "id": 12345, "bill_number": "SUBBILL-202605-0001", "status": "paid", "total_amount": 150000, "currency": "IDR", "due_date": "2026-05-01T00:00:00+07:00", "paid_date": "2026-05-01T00:00:15+07:00", "failure_reason": null, "payment_reference": "IONPAYTEST01202605010000000001", "retry": { "attempt": 0, "max_attempts": 3, "attempts_remaining": 3, "max_attempts_reached": false, "interval_days": 3, "failed_payment_action": "continue_plan", "next_retry_at": null, "last_attempt_at": null, "history": [] } }, "cycle": { "id": 7890, "cycle_number": 3, "status": "paid", "period_start": "2026-05-01T00:00:00+07:00", "period_end": "2026-06-01T00:00:00+07:00" } } } ``` ```json payment_failed (retry coming) theme={null} { "status": 200, "success": true, "event": "subscription.cycle.payment_failed", "timestamp": "01 May 2026 00:00:20", "data": { "plan": { "id": "01JAB3CD4E5F6G7H8J9K0M1N2", "subscription_id": "PLAN-20260420-001", "merchant_reff_no": "SUB-CUST-ACME-001", "name": "Premium Monthly", "amount": 150000, "currency": "IDR", "status": "active", "parent_plan_id": null, "retry_policy": { "max_attempts": 3, "interval_days": 3, "failed_payment_action": "continue_plan" } }, "bill": { "id": 12346, "bill_number": "SUBBILL-202605-0002", "status": "failed", "total_amount": 150000, "currency": "IDR", "due_date": "2026-05-01T00:00:00+07:00", "paid_date": null, "failure_reason": "card_declined", "payment_reference": "IONPAYTEST01202605010000000002", "retry": { "attempt": 1, "max_attempts": 3, "attempts_remaining": 2, "max_attempts_reached": false, "interval_days": 3, "failed_payment_action": "continue_plan", "next_retry_at": "2026-05-04T00:00:00+07:00", "last_attempt_at": "2026-05-01T00:00:20+07:00", "history": [ { "attempt": 1, "status": "failed", "retry_date": "2026-05-01T00:00:20+07:00", "next_retry_date": "2026-05-04T00:00:00+07:00", "failure_reason": "card_declined" } ] } }, "cycle": { "id": 7891, "cycle_number": 4, "status": "pending", "period_start": "2026-05-01T00:00:00+07:00", "period_end": "2026-06-01T00:00:00+07:00" } } } ``` ```json payment_failed (retries exhausted) theme={null} { "status": 200, "success": true, "event": "subscription.cycle.payment_failed", "timestamp": "07 May 2026 00:00:20", "data": { "plan": { "...": "..." }, "bill": { "id": 12346, "bill_number": "SUBBILL-202605-0002", "status": "failed", "total_amount": 150000, "currency": "IDR", "failure_reason": "card_declined", "retry": { "attempt": 3, "max_attempts": 3, "attempts_remaining": 0, "max_attempts_reached": true, "interval_days": 3, "failed_payment_action": "stop_plan", "next_retry_at": null, "last_attempt_at": "2026-05-07T00:00:20+07:00", "history": [ { "attempt": 1, "status": "failed", "retry_date": "2026-05-01T00:00:20+07:00", "failure_reason": "card_declined" }, { "attempt": 2, "status": "failed", "retry_date": "2026-05-04T00:00:20+07:00", "failure_reason": "card_declined" }, { "attempt": 3, "status": "failed", "retry_date": "2026-05-07T00:00:20+07:00", "failure_reason": "card_declined" } ] } } } } ``` > [!WARNING] > > When `bill.retry.max_attempts_reached` is `true` and `failed_payment_action` is `"stop_plan"`, expect a subsequent `subscription.plan.status_changed` event with `plan.status: "suspended"` to arrive shortly after. *** ## Body Parameters — Plan Status Changed Fires when the plan transitions to `suspended`, `cancelled`, or `completed`. **status** `number` *required* Always `200`. **success** `boolean` *required* Always `true`. **event** `string` *required* `"subscription.plan.status_changed"` **timestamp** `string` *required* Event timestamp in format `"d M Y H:i:s"`. Example: `"07 May 2026 00:05:00"` **data** `object` *required* **data fields** **plan** `object` *required* Plan snapshot — same shape as the `plan` block in payment events above. `plan.status` reflects the **new** status. **previous\_status** `string` *required* Status the plan was in before the transition. Example: `"active"` ### Payload Example — Plan Status Changed ```json Plan suspended after retries exhausted theme={null} { "status": 200, "success": true, "event": "subscription.plan.status_changed", "timestamp": "07 May 2026 00:05:00", "data": { "plan": { "id": "01JAB3CD4E5F6G7H8J9K0M1N2", "subscription_id": "PLAN-20260420-001", "merchant_reff_no": "SUB-CUST-ACME-001", "name": "Premium Monthly", "amount": 150000, "currency": "IDR", "status": "suspended", "parent_plan_id": null, "retry_policy": { "max_attempts": 3, "interval_days": 3, "failed_payment_action": "stop_plan" } }, "previous_status": "active" } } ``` *** ## Security and responses Return HTTP `200` promptly after validating the request. For retry behavior, see [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). Verify every webhook using [Security and signature validation](/api-reference/webhooks/security-and-signature). Use your configured callback path when building `StringToSign`. Handle duplicate deliveries idempotently using stable identifiers from the payload (for example `transaction_id` or `reff_no`). *** ## Idempotency Use `bill.bill_number` as your primary idempotency key when storing successful deliveries. The same bill number may arrive more than once if your endpoint returned a non-2xx response and SingaPay retried the webhook delivery. For failed charge retries, the `bill_number` stays the same but `bill.retry.attempt` increments. Use the compound key `(bill_number, retry.attempt)` if you need per-attempt idempotency. *** ## Important Notes > [accordion] One event per attempt > > Every retry attempt emits its own `subscription.cycle.payment_failed` (or `payment_success` on the attempt that finally clears). Monitor `bill.retry.attempts_remaining` to know whether another automatic attempt is coming. > [accordion] Plan status events are separate > > When retries are exhausted with `failed_payment_action: stop_plan`, expect a `payment_failed` event followed shortly by a `plan.status_changed` event with `plan.status: "suspended"`. These are two distinct webhook deliveries. > [accordion] Plan lineage after upgrades > > After a PATCH upgrade, the new plan has a different `plan.id` but the same `plan.subscription_id` and `plan.merchant_reff_no`. The old plan's ID is available on `plan.parent_plan_id` for reconciliation. > [accordion] merchant\_reff\_no is optional > > If you didn't set `merchant_reff_no` at plan creation, it will be `null` on every cycle webhook. Set it during plan creation to have it echoed back reliably for your own tracking. > [accordion] Currency is always IDR > > `bill.currency` is always `"IDR"` today — card recurring runs in IDR only. # Transaction Money-In Expiration Webhook Source: https://docs.singapay.id/api-reference/webhooks/transaction-moneyin-expiration Optional batch notifications when unpaid money-in transactions expire. Track expired payment link histories, virtual account transactions, and QRIS histories in a single webhook call to improve collection and abandonment monitoring. > [!NOTE] > > **Optional webhook** — This webhook is completely optional. Unpaid transactions expire normally without it. Configure `transaction_expiration_notif_url` only if you need batch expiration notifications for **unpaid transaction attempts**. For expired **products** (payment links, VAs, QRIS codes), see [Product Expiration](/api-reference/webhooks/product-expiration). ## Information | Method | Path | Format | Authentication | | - | - | - | - | | POST | `https://your-webhook-url/callback` | json | HMAC SHA512 Signature | SingaPay sends a `POST` request to your configured `transaction_expiration_notif_url` when money-in transactions expire before payment is completed. This is a **batch notification** that can include multiple expired transaction records in a single call. > [!NOTE] > > **Batch notification:** One webhook may contain expired Payment Link Histories, Virtual Account Transactions, and QRIS Histories together. Arrays can be empty when no transactions of that type expired. If `transaction_expiration_notif_url` is not configured, no transaction expiration webhooks are sent. *** ## Request Details ### Headers | Field | Value | Type | Mandatory | Description | | - | - | - | :-: | - | | `Content-Type` | `application/json` | Alphabetic | Yes | Specifies JSON format for the request body | | `User-Agent` | `SingaPaymentGateway/1.0` | Alphabetic | Yes | Identifies the source of the webhook | | `Accept` | `application/json` | Alphabetic | Yes | Expected response format | | `X-PARTNER-ID` | — | Alphanumeric | Yes | Your API Key from the merchant dashboard | | `X-Signature` | — | Alphanumeric | Yes | HMAC SHA512 signature (128 chars) for request verification | | `X-Timestamp` | — | Numeric | Yes | Unix timestamp in **seconds** when the request was sent | | `Authorization` | `Bearer ` | Alphanumeric | Yes | System-generated random bearer token; used as a component in the signature | > [!NOTE] > > The `Authorization` token is a **randomly generated string** — not a user access token. This webhook is triggered by the system's scheduled expiration checker, not a user API call. Extract the token as-is and use it in the string to sign. See [How to Validate Signature](#how-to-validate-signature) below. *** ### Body Parameters **status** `number` *required* HTTP status code. Example: `200` **success** `boolean` *required* Indicates whether the webhook was sent successfully. Example: `true` **event** `string` *required* Event type identifier. Always `"transaction_expiration"` for this webhook. **timestamp** `string` *required* Event timestamp in format `"d M Y H:i:s"`. Example: `"26 Dec 2025 14:00:00"` **merchant** `object` *required* Merchant information. **merchant fields** **id** `number` *required* Merchant ID. Example: `123` **name** `string` *required* Merchant name. Example: `"PT Example Indonesia"` **data** `object` *required* Container for expired transactions. Each array is always present and may be empty. **data fields** **payment\_link\_histories** `array` *required* Expired payment link histories (unpaid payment attempts). **payment\_link\_histories item fields** **id** `number` *required* Payment link history ID. **reff\_no** `string` *required* History reference number. **payment\_link\_id** `number` *required* Parent payment link ID. **status** `string` *required* Status. Should be `"expired"`. **expired\_at** `string` *required* Expiration datetime (`Y-m-d H:i:s`). **virtual\_account\_transactions** `array` *required* Expired virtual account transactions (unpaid). **virtual\_account\_transactions item fields** **id** `number` *required* VA transaction ID. **reff\_no** `string` *required* Transaction reference number. **virtual\_account\_id** `number` *required* Parent virtual account ID. **status** `string` *required* Status. Should be `"expired"`. **expired\_at** `string` *required* Expiration datetime (`Y-m-d H:i:s`). **qris\_histories** `array` *required* Expired QRIS histories (unpaid payment attempts). **qris\_histories item fields** **id** `number` *required* QRIS history ID. **reff\_no** `string` *required* History reference number. **qris\_transaction\_id** `number` *required* Parent QRIS transaction ID. **status** `string` *required* Status. Should be `"expired"`. **expired\_at** `string` *required* Expiration datetime (`Y-m-d H:i:s`). **summary** `object` *required* Summary counts for the batch. **summary fields** **total\_expired** `number` *required* Total count of all expired transactions. **payment\_link\_histories\_count** `number` *required* Count of expired payment link histories. **virtual\_account\_transactions\_count** `number` *required* Count of expired VA transactions. **qris\_histories\_count** `number` *required* Count of expired QRIS histories. *** ### Payload Examples ```json Batch — Multiple Types theme={null} { "status": 200, "success": true, "event": "transaction_expiration", "timestamp": "26 Dec 2025 14:00:00", "merchant": { "id": 123, "name": "PT Example Indonesia" }, "data": { "payment_link_histories": [ { "id": 456, "reff_no": "PLH-20251226-ABC123", "payment_link_id": 789, "status": "expired", "expired_at": "2025-12-26 14:00:00" }, { "id": 457, "reff_no": "PLH-20251226-DEF456", "payment_link_id": 790, "status": "expired", "expired_at": "2025-12-26 14:00:00" } ], "virtual_account_transactions": [ { "id": 321, "reff_no": "VAT-20251226-GHI789", "virtual_account_id": 654, "status": "expired", "expired_at": "2025-12-26 14:00:00" }, { "id": 322, "reff_no": "VAT-20251226-JKL012", "virtual_account_id": 655, "status": "expired", "expired_at": "2025-12-26 14:00:00" }, { "id": 323, "reff_no": "VAT-20251226-MNO345", "virtual_account_id": 656, "status": "expired", "expired_at": "2025-12-26 14:00:00" } ], "qris_histories": [ { "id": 987, "reff_no": "QRH-20251226-PQR678", "qris_transaction_id": 246, "status": "expired", "expired_at": "2025-12-26 14:00:00" } ] }, "summary": { "total_expired": 6, "payment_link_histories_count": 2, "virtual_account_transactions_count": 3, "qris_histories_count": 1 } } ``` ```json Single Type — VA Transactions Only theme={null} { "status": 200, "success": true, "event": "transaction_expiration", "timestamp": "26 Dec 2025 14:00:00", "merchant": { "id": 123, "name": "PT Example Indonesia" }, "data": { "payment_link_histories": [], "virtual_account_transactions": [ { "id": 321, "reff_no": "VAT-20251226-GHI789", "virtual_account_id": 654, "status": "expired", "expired_at": "2025-12-26 14:00:00" } ], "qris_histories": [] }, "summary": { "total_expired": 1, "payment_link_histories_count": 0, "virtual_account_transactions_count": 1, "qris_histories_count": 0 } } ``` *** *** ## Security and responses Return HTTP `200` promptly after validating the request. For retry behavior, see [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). Verify every webhook using [Security and signature validation](/api-reference/webhooks/security-and-signature). Use your configured callback path when building `StringToSign`. Handle duplicate deliveries idempotently using stable identifiers from the payload (for example `transaction_id` or `reff_no`). *** ## Transaction money-in expiration specific notes ### When to use this webhook > [card] Use when > > * Track unpaid invoices and abandoned payment attempts > * Automated follow-up and remarketing for expired sessions > * Conversion and abandonment analytics > * Alert collections on high expiration volumes > [card] Skip when > > * You poll transaction status via API on demand > * You only need product-level expiration ([Product Expiration](/api-reference/webhooks/product-expiration)) > * Manual monitoring is sufficient ### Transaction vs product expiration > [!WARNING] > > This webhook is **not** the same as [Product Expiration](/api-reference/webhooks/product-expiration). Understanding the difference is essential. | Aspect | Transaction expiration (this webhook) | [Product expiration](/api-reference/webhooks/product-expiration) | | - | - | - | | What expires | Unpaid transaction attempts / records | Payment products themselves | | Payment link | Payment link **history** (one attempt) | Payment link (the product/page) | | Virtual account | VA **transaction** (one unpaid txn) | Virtual account (the VA number) | | QRIS | QRIS **history** (one attempt) | QRIS transaction (the QR product) | | Use case | Abandoned payments, follow-up reminders | Product cleanup, inventory management | | Reusability | Parent product can still be reused | Product is expired and cannot be reused | **Example timeline:** 1. Customer opens a payment link at 10:00 — creates a **payment link history** (expires 10:30 if unpaid). 2. At 10:30 — **this webhook** reports the expired history; the payment link itself remains active. 3. Customer opens the same link at 11:00 — a **new** history is created. 4. End of day — payment link product expires — **[Product Expiration](/api-reference/webhooks/product-expiration)** fires; the link can no longer accept new attempts. For a single session expiring when a customer views a link, you may also receive [Payment Link Inquiry](/api-reference/webhooks/payment-link-inquiry) (`payment_link.inquiry.expired`). ### Batch notification * Multiple transaction types in one payload * Scheduled cron execution (not real-time) * Empty arrays are normal when a type had no expirations ```php Process batch theme={null} 100) { alertHighAbandonmentRate($payload['summary']['total_expired']); } http_response_code(200); echo json_encode(['status' => 'success']); ?> ``` ### Transaction types included | Array | Record type | Parent ID field | Note | | - | - | - | - | | `data.payment_link_histories` | Unpaid payment link attempt | `payment_link_id` | Parent link stays active | | `data.virtual_account_transactions` | Unpaid VA transaction | `virtual_account_id` | Parent VA stays active | | `data.qris_histories` | Unpaid QRIS attempt | `qris_transaction_id` | Parent QRIS may stay active | Use parent IDs to fetch full product details via API and send new payment attempts on the same product. ```php Fetch parent payment link theme={null} $plHistory = $payload['data']['payment_link_histories'][0]; $paymentLink = fetchPaymentLinkAPI($plHistory['payment_link_id']); sendReminderEmail( getCustomerEmail($plHistory['reff_no']), $paymentLink['payment_url'], 'Your previous payment session expired. Click here to pay again!' ); ``` ### Simplified payload Minimal fields per transaction to keep batch payloads small. **Not** included: amount, currency, customer details, payment method, VA number, QR string, created/updated timestamps. Query by `id`, `reff_no`, or parent product ID via API when you need full details. ### Timestamp format | Field | Format | Example | | - | - | - | | `timestamp` (root) | `d M Y H:i:s` | `26 Dec 2025 14:00:00` | | `expired_at` (per item) | `Y-m-d H:i:s` | `2025-12-26 14:00:00` | For signature validation, use **`X-Timestamp`** (Unix seconds in the header). ### Idempotency ```php theme={null} $webhookId = $payload['event'] . '_' . $payload['merchant']['id'] . '_' . strtotime($payload['timestamp']); if (isWebhookProcessed($webhookId)) { http_response_code(200); exit; } processTransactionExpirationBatch($payload); markWebhookProcessed($webhookId); ``` ### Summary statistics ```php theme={null} $summary = $payload['summary']; logTransactionExpirationBatch([ 'total' => $summary['total_expired'], 'payment_link_histories' => $summary['payment_link_histories_count'], 'va_transactions' => $summary['virtual_account_transactions_count'], 'qris_histories' => $summary['qris_histories_count'], ]); if ($summary['total_expired'] > 50) { sendAlert("High abandonment rate: {$summary['total_expired']} transactions expired"); } ``` ### Scheduling and timing Triggered by a **system cron job** (frequency varies — confirm with SingaPay support). Not real-time; allow delay between expiration and notification. For immediate handling, poll via API or use individual transaction webhooks. ### Recommended practices * **Use both optional expiration webhooks** — transaction expiration for abandonment; product expiration for inventory cleanup. * **Set sensible session timeouts** — e.g. 15–30 minutes for payment links, longer for VA invoices, shorter for in-store QRIS. * **Limit remarketing frequency** — avoid spamming customers who abandon repeatedly. * **Correlate with success webhooks** — compare expired vs paid volumes to tune expiry settings and UX. # Virtual Account Webhook Source: https://docs.singapay.id/api-reference/webhooks/va-transaction Real-time notifications for Virtual Account transactions processed through the SingaPay platform. Monitor payment events and keep your system in sync instantly. > [!NOTE] > > **Money In Operation** — This webhook fires when a customer completes a Virtual Account payment, transferring funds into your SingaPay account. ## Information | Method | Path | Format | Authentication | | - | - | - | - | | POST | `https://your-webhook-url/callback` | json | HMAC SHA512 Signature | SingaPay sends a `POST` request to your configured `transaction_notif_url` when a Virtual Account transaction is successfully processed. > [!NOTE] > > This webhook may share a callback URL with other event types. See [Shared webhook endpoints](/api-reference/webhooks/shared-endpoints) for routing by `event` value. *** ## Request Details ### Headers | Field | Value | Type | Mandatory | Description | | - | - | - | :-: | - | | `Content-Type` | `application/json` | Alphabetic | Yes | Specifies JSON format for the request body | | `User-Agent` | `SingaPaymentGateway/1.0` | Alphabetic | Yes | Identifies the source of the webhook | | `Accept` | `application/json` | Alphabetic | Yes | Expected response format | | `X-PARTNER-ID` | — | Alphanumeric | Yes | Your API Key from the merchant dashboard | | `X-Signature` | — | Alphanumeric | Yes | HMAC SHA512 signature (128 chars) for request verification | | `X-Timestamp` | — | Numeric | Yes | Unix timestamp in **seconds** when the request was sent | | `Authorization` | `Bearer ` | Alphanumeric | Yes | System-generated random bearer token; used as a component in the signature | > [!NOTE] > > The `Authorization` token for VA webhooks is a **randomly generated string** — not a user access token. This is because the webhook is triggered by a bank payment notification (system event), not a user action. Extract it as-is from the header and use it in the string to sign. See [How to Validate Signature](#how-to-validate-signature) below. *** ### Body Parameters **status** `number` *required* HTTP Status Code. Example: `200` **success** `boolean` *required* Indicates if the transaction was successful. Example: `true` **event** `string` *required* Event type identifier. Always `"va-transaction"` for this webhook. **timestamp** `string` *required* Event timestamp in format `"d M Y H:i:s"`. Example: `"26 Dec 2025 13:35:45"` **data** `object` *required* Container for transaction and payment details. **data fields** **transaction** `object` *required* Transaction details. **transaction fields** **reff\_no** `string` *required* Merchant reference number if provided during VA creation (`merchant_reff_no`), otherwise falls back to `transaction_id`. Example: `"INV-2026-001"` **transaction\_id** `string` *required* Internal system transaction ID. Example: `"3211120250926133543246"` **type** `string` *required* Transaction type. Always `"va"` for Virtual Account. **status** `string` *required* Transaction status. Always `"paid"` for this webhook. **amount** `object` *required* Transaction amount details. **amount fields** **value** `number` *required* Transaction amount. Example: `100000` **currency** `string` *required* ISO 4217 currency code. Example: `"IDR"` **amount\_type** `string` *required* VA amount type: `"closed"` (fixed amount) or `"open"` (any amount). **tip** `null` *required* Tip amount. Always `null` for VA transactions. **post\_timestamp** `string` *required* Transaction post time. Example: `"26 Dec 2025 13:35:43"` **processed\_timestamp** `string` *required* Transaction processed time. Example: `"26 Dec 2025 13:35:45"` **payment** `object` *required* Payment method details. **payment fields** **method** `string` *required* Payment method. Always `"va"`. **additional\_info** `object` *required* Payment method specific information. **additional\_info fields** **va\_number** `string` *required* Virtual Account number used for payment (16 digits). Example: `"7872955146576837"` **va\_name** `string` *required* Virtual Account name/label. Example: `"Toko Budi"` **bank** `object` *required* Bank details. **bank fields** **short\_name** `string` *required* Short name of the bank. Example: `"Maybank"` **number** `string` *required* Bank number/code (3 digits). Example: `"016"` **swift\_code** `string` *required* Bank SWIFT code (8 chars). Example: `"IBBKIDJA"` **bank\_code** `string` *required* Internal bank code. Example: `"MAYBANK"` **fees** `object` *required* Transaction fee details. **fees fields** **name** `string` *required* Payment vendor fee name. Example: `"VA Maybank"` **amount** `number` *required* Fee amount charged. Example: `1500` **currency** `string` *required* Fee currency code. Example: `"IDR"` *** ### Payload Example ```json Success theme={null} { "status": 200, "success": true, "event": "va-transaction", "timestamp": "26 Dec 2025 13:35:45", "data": { "transaction": { "reff_no": "INV-2026-001", "transaction_id": "3211120250926133543246", "type": "va", "status": "paid", "amount": { "value": 100000, "currency": "IDR" }, "amount_type": "closed", "tip": null, "post_timestamp": "26 Dec 2025 13:35:43", "processed_timestamp": "26 Dec 2025 13:35:45" }, "payment": { "method": "va", "additional_info": { "va_number": "7872955146576837", "va_name": "Toko Budi", "bank": { "short_name": "Maybank", "number": "016", "swift_code": "IBBKIDJA", "bank_code": "MAYBANK" }, "fees": { "name": "VA Maybank", "amount": 1500, "currency": "IDR" } } } } } ``` *** *** ## Security and responses Return HTTP `200` promptly after validating the request. For retry behavior, see [Webhook retry mechanism](/api-reference/webhooks/retry-mechanism). Verify every webhook using [Security and signature validation](/api-reference/webhooks/security-and-signature). Use your configured callback path when building `StringToSign`. Handle duplicate deliveries idempotently using stable identifiers from the payload (for example `transaction_id` or `reff_no`).