Create a collection order
Create a pay-in order for a customer. Use the hosted checkout (H5 cashier) to send the customer to a PAYJN payment page, or the API mode to show the payment details on your own checkout page. Both modes use the same order query and the same result notification.
POST /api-pay/collection/order/create-h5
POST /api-pay/collection/order/create-api (API mode)
Request headers
| Field | Type | Required | Description |
|---|---|---|---|
Content-Type | String | Yes | application/json |
sign | String | Yes | Request signature. See Authentication. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
merchantCode | String(6) | Yes | Your merchant code, issued by PAYJN after onboarding. |
paymentMethodCode | String | Yes | Payment method, for example QRIS or a bank code for a virtual account. See the country pages or Query payment methods. |
merchantOrderId | String(50) | Yes | Your own order number. Letters and digits, up to 50 characters, unique in your system. Used for queries and to prevent duplicates. |
amount | Integer | Yes | Order amount in local currency. Decimals are not supported. |
merchantNotifyUrl | String | Yes | Your server URL that receives the asynchronous result notification for this order. |
returnUrl | String | No | Page the customer returns to after paying. |
remark | String | No | Free text, returned unchanged in the response. |
customer | Object | Yes | Customer information. |
customer.name | String | Yes | Customer's name. |
customer.phone | String | Yes | Customer's mobile number in the local format of the country. |
customer.email | String | Yes | Customer's email address, in a valid email format. |
{
"merchantCode": "100001",
"paymentMethodCode": "QRIS",
"merchantOrderId": "ORDER20261129001",
"amount": 50000,
"merchantNotifyUrl": "https://merchant.example.com/payjn/notify",
"returnUrl": "https://merchant.example.com/orders/ORDER20261129001",
"customer": {
"name": "Customer Name",
"phone": "081234567890",
"email": "customer@example.com"
}
}
Response
| Field | Type | Description |
|---|---|---|
code | Integer | 200 means the request was accepted. Any other value is an error; see msg. |
msg | String | Error message when code is not 200. |
data | Object | Result object, returned when code is 200. |
data.merchantCode | String | Your merchant code. |
data.countryCode | String | Country code of the order. |
data.platformOrderId | String(32) | PAYJN order number. |
data.merchantOrderId | String(50) | Your order number. |
data.amount | String | Order amount in local currency. |
data.status | String | SUCCESS, FAILURE, PROCESSING or CANCELLED. See Order status. |
data.paymentMethodCode | String | Payment method of the order. |
data.paymentInfo.type | String | url, code or json. Hosted checkout always returns url. |
data.paymentInfo.content | String | Payment URL (type url), or the VA number or QR text (type code, API mode). |
data.returnUrl | String | Return URL from the request. |
data.transFeeRate | String | Fee rate applied to the order, as agreed for your merchant account. |
data.transFee | String | Fee for this transaction. |
data.totalTransFee | String | Total fee for the order. |
data.desc | String | Result description. |
data.createTime | String | Creation time in the market's local time, yyyy-MM-dd HH:mm:ss. |
{
"code": 200,
"msg": "",
"data": {
"merchantCode": "100001",
"countryCode": "IDN",
"platformOrderId": "C1000011764400000000001",
"merchantOrderId": "ORDER20261129001",
"amount": "50000",
"status": "PROCESSING",
"paymentMethodCode": "QRIS",
"paymentInfo": {
"type": "url",
"content": "https://{checkout-host}/pay/..."
},
"createTime": "2026-11-29 10:00:00"
}
}
Notes
- The API mode (create-api) is available in Indonesia. Other markets use the hosted checkout.
- Treat the order as paid only after a SUCCESS result from the notification or the order query, never from the customer's return to returnUrl.
Get API access
Full integration documentation, your API host, merchant code and keys are provided after onboarding. Review is usually completed on the same day, and a test mode is switched on for your account before launch.