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.
{
  "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"
}

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_detailsCustomer information, returned as a JSON-encoded string — parse it before reading the fields below.
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 customer information as customer_details, returned as a JSON object. No parsing needed. null if customer_details is empty or not valid JSON.
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": "9e536777-2bfa-4161-9931-35f5c4b23faf",
    "client_id": "9dbf86be-f9e9-4000-8b39-fdd5a841fce1",
    "amount": "100000",
    "currency": "IDR",
    "description": "Order Product",
    "customer_details": "{\"customer_name\":\"John Doe\",\"product_name\":\"Product Test\"}",
    "customer_obj": {
        "customer_name": "John Doe",
        "product_name": "Product Test"
    },
    "checkout_url": "{host}/checkout/9e536777-2bfa-4161-9931-35f5c4b23faf",
    "success_redirect_url": "https://example.com/success"
}

Payment Expiry (TTL)


Webhook