POST /api/checkout
Request
| Name | Type | Required | Validation | Description |
|---|---|---|---|---|
| merchant_transaction_id | string | true | Merchant-provided unique transaction identifier. | |
| amount | string | true | Numeric, 1-12 digits | Transaction amount expressed as a numeric value. |
| currency | string | true | Allowed value: "IDR" | Transaction currency (only Indonesian Rupiah is supported). |
| customer_name | string | true | 5-25 characters, Allowed: a-z A-Z 0-9 - (space) | Customer name linked to the transaction. |
| product_name | string | true | 5-25 characters, Allowed: a-z A-Z 0-9 - (space) | Product name linked to the transaction. |
| description | string | false | Optional transaction details. | |
| success_redirect_url | string | false | URL to redirect the customer upon successful payment. Also supports mobile deep link URLs. | |
| company_name | string | false | Your 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
| Name | Description |
|---|---|
| transaction_id | System-generated unique transaction identifier. |
| client_id | Client identifier of the requesting party |
| amount | Numeric representation of the transaction amount. |
| currency | Currency code used in the transaction (IDR is the only supported currency). |
| description | Transaction description text. |
| customer_details | JSON-encoded string with customer_name, product_name, and company_name (when sent). Parse it, or use customer_obj. |
| customer_details.customer_name | Name of the customer for this transaction. Available only after parsing customer_details. |
| customer_details.product_name | Name of the product for this transaction. Available only after parsing customer_details. |
| customer_obj | The same values as an object. company_name is present only when it was sent. null when the details are empty or invalid. |
| checkout_url | Web URL where users can complete payment through their browser. |
| success_redirect_url | URL 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"
}
The request body failed validation. errors lists the messages per field.
{
"success": false,
"message": "Validation errors occurred.",
"errors": {
"amount": ["The amount field is required."]
}
}
The request was rejected while it was being processed. The HTTP status matches the error. error.code is often 0, so match on the HTTP status instead.
{
"error": {
"code": 0,
"message": "Error description"
}
}
An unexpected error occurred. Retry after a brief delay.
{
"status": false,
"data": null,
"message": "Error description"
}
Payment Expiry (TTL)
Webhook