Create HTML5 URL
Generate Paylabs HTML5 payment page link.
Request URL
URL: ${ROOT_URL}/payment/v2.3/h5/createLink
HTTPMethod: POST
EndpointUrl: /payment/v2.3/h5/createLink
HTML5 URL is a Paylabs-hosted payment page so merchants don't need to build their own. Status inquiry, notifyUrl, and redirectUrl behave the same as API orders.
HTML5 Request Parameters
Header
| Field Name | Type | Value | Required |
|---|---|---|---|
| Content-Type | String(30) | Fixed value "application/json;charset=utf-8" | Yes |
| X-TIMESTAMP | String(29) | Current time, format 2022-09-16T16:58:47.964+07:00 | Yes |
| X-SIGNATURE | String(64) | Signature. For details please check Data Signing Rules | Yes |
| X-PARTNER-ID | String(20) | Merchant ID | Yes |
| X-REQUEST-ID | String(64) | Unique ID for each request | Yes |
Body
| Parameter | Type | Required | Remarks |
|---|---|---|---|
| requestId | String(64) | Yes | Unique ID for each request |
| merchantId | String(20) | Yes | Unique identifier provided by payment gateway to merchant |
| storeId | String(30) | No | Only if using branch ID |
| merchantTradeNo | String(32) | Yes | Unique identifier created by the merchant for each transaction |
| amount | Decimal(12,2) | Yes | In IDR, 2 decimals |
| payer | String(60) | No | Payer name |
| phoneNumber | String(20) | Yes | Customer phone number |
| productName | String(100) | Yes | Product/service name |
| notifyUrl | String(200) | No | Callback URL after payment done; see Order Inquiry for parameters |
| redirectUrl | String(200) | Yes | Callback URL after payment success/fail |
| lang | String(10) | No | Default Indonesian; use en for English |
| paymentType | String(20) | No | Payment type. If empty, customer can choose from available options. |
| feeType | String(3) | No | Fee deduction type: BEN/OUR. Default BEN. OUR adds fee to order amount automatically. |
HTML5 Response Parameters
Header
| Field Name | Type | Value | Required |
|---|---|---|---|
| Content-Type | String(30) | Fixed value "application/json;charset=utf-8" | Yes |
| X-TIMESTAMP | String(29) | Current time, format 2022-09-16T16:58:47.964+07:00 | Yes |
| X-SIGNATURE | String(64) | Signature. For details please check Data Signing Rules | Yes |
| X-PARTNER-ID | String(20) | Merchant ID | Yes |
| X-REQUEST-ID | String(64) | Unique ID for each request | Yes |
Body
| Parameter | Type | Required | Remarks |
|---|---|---|---|
| errCode | String(32) | No | 0 means success, otherwise see Error Code |
| errCodeDes | String(128) | No | Error description |
| requestId | String(64) | Yes | Unique ID for each request |
| merchantId | String(20) | No | Merchant ID |
| storeId | String(30) | No | Only if using branch ID |
| merchantTradeNo | String(32) | Yes | Merchant order number |
| url | String(200) | No | Payment URL. If paymentType empty, page shows available options for customer to choose. |
Example
Request
POST /payment/v2.3/h5/createLink
# HTTP Header
Content-Type: application/json;charset=utf-8
X-TIMESTAMP: 2022-09-16T16:58:47.964+07:00
X-SIGNATURE: xxxxxxxxx
X-PARTNER-ID: 010001
X-REQUEST-ID: xxxxxxxxxxxxxxxxxxxxxxxx
# HTTP Body
{
"merchantId":"0010001",
"merchantTradeNo":"11649757268000",
"requestId":"21649757268000",
"amount":"10200",
"phoneNumber":00000000,
"productName":"apple",
"redirectUrl":"https://www.google.com",
"lang":"en",
"payer":"test"
}Response
POST /payment/v2.3/h5/createLink
# HTTP Header
Content-Type: application/json;charset=utf-8
X-TIMESTAMP: 2022-09-16T16:58:47.964+07:00
X-SIGNATURE: xxxxxxxxx
X-PARTNER-ID: 010001
X-REQUEST-ID: xxxxxxxxxxxxxxxxxxxxxxxx
# HTTP Body
{
"merchantId":"0010001",
"requestId":"21649757268000",
"errCode":"0",
"url":"http://paylabs-dev.com/payer/en-home-index.html?k=c2b2da7c8ce8b00691a68c38d77e000e9f412199770e6b1adf72bbc6c2914ee808f93e627825ecb4679cd31eea1c5114"
}