Skip to content
PGSwift Docs
Documentation/Checkout Invoice

Checkout Invoice

Merchants can use this API to create a checkout interface for processing transactions.

POST /api/checkout

Request

NameTypeRequiredValidationDescription
merchant_transaction_idstringtrueMerchant-provided unique transaction identifier.
amountstringtrueNumeric, 1-12 digitsTransaction amount expressed as a numeric value.
currencystringtrueAllowed value: "IDR"Transaction currency (only Indonesian Rupiah is supported).
customer_namestringtrue5-25 characters, Allowed: a-z A-Z 0-9 - (space)Customer name linked to the transaction.
product_namestringtrue5-25 characters, Allowed: a-z A-Z 0-9 - (space)Product name linked to the transaction.
descriptionstringfalseOptional transaction details.
success_redirect_urlstringfalseURL to redirect the customer upon successful payment. Also supports mobile deep link URLs.
company_namestringfalseYour company name, shown as the Virtual Account name when your customer pays by VA. Supported on selected banks only; elsewhere a default name is shown. Allowed characters: letters A-Z, spaces and .; other characters (including digits) are removed. Values longer than 30 characters are cut, and if fewer than 3 letters remain the value is ignored (e.g. A+B becomes AB and is ignored).
{
  "merchant_transaction_id": "ICZ10000001",
  "amount": "100000",
  "currency": "IDR",
  "description": "Lorem Ipsum",
  "customer_name": "John Doe",
  "product_name": "Product Test",
  "success_redirect_url": "https://example.com/success",
  "company_name": "PT Maju Jaya"
}

Response

NameDescription
transaction_idSystem-generated unique transaction identifier.
client_idClient identifier of the requesting party
amountNumeric representation of the transaction amount.
currencyCurrency code used in the transaction (IDR is the only supported currency).
descriptionTransaction description text.
customer_detailsJSON-encoded string with customer_name, product_name, and company_name (when sent). Parse it, or use customer_obj.
customer_details.customer_nameName of the customer for this transaction. Available only after parsing customer_details.
customer_details.product_nameName of the product for this transaction. Available only after parsing customer_details.
customer_objThe same values as an object. company_name is present only when it was sent. null when the details are empty or invalid.
checkout_urlWeb URL where users can complete payment through their browser.
success_redirect_urlURL to redirect the customer upon successful payment. Also supports mobile deep link URLs.

Use the HTTP status code to detect failure: any non-2xx response is a failure. The failure body has one of three shapes, shown in the tabs below. Authentication and IP whitelist errors use the shapes described in Error Responses.

{
    "transaction_id": "08a30e1b-2ef2-435b-b1fb-9885eb70545e",
    "client_id": "da2ca5d8-dbc2-4cf3-b101-e804af8ea644",
    "amount": "100000",
    "currency": "IDR",
    "description": "Order Product",
    "customer_details": "{\"customer_name\":\"John Doe\",\"product_name\":\"Product Test\",\"company_name\":\"PT Maju Jaya\"}",
    "customer_obj": {
        "customer_name": "John Doe",
        "product_name": "Product Test",
        "company_name": "PT Maju Jaya"
    },
    "checkout_url": "{host}/checkout/08a30e1b-2ef2-435b-b1fb-9885eb70545e",
    "success_redirect_url": "https://example.com/success"
}

Payment Expiry (TTL)


Webhook