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

Data Signing Rules

Field NameTypeValueRequired
Content-TypeString(30)Fixed value "application/json;charset=utf-8"Yes
X-TIMESTAMPString(29)Current time, format 2022-09-16T16:58:47.964+07:00Yes
X-SIGNATUREString(64)Signature. For details please check Data Signing RulesYes
X-PARTNER-IDString(20)Merchant IDYes
X-REQUEST-IDString(64)Unique ID for each requestYes

Body

ParameterTypeRequiredRemarks
requestIdString(64)YesUnique ID for each request
merchantIdString(20)YesUnique identifier provided by payment gateway to merchant
storeIdString(30)NoOnly if using branch ID
merchantTradeNoString(32)YesUnique identifier created by the merchant for each transaction
amountDecimal(12,2)YesIn IDR, 2 decimals
payerString(60)NoPayer name
phoneNumberString(20)YesCustomer phone number
productNameString(100)YesProduct/service name
notifyUrlString(200)NoCallback URL after payment done; see Order Inquiry for parameters
redirectUrlString(200)YesCallback URL after payment success/fail
langString(10)NoDefault Indonesian; use en for English
paymentTypeString(20)NoPayment type. If empty, customer can choose from available options.
feeTypeString(3)NoFee deduction type: BEN/OUR. Default BEN. OUR adds fee to order amount automatically.

HTML5 Response Parameters

Header

Field NameTypeValueRequired
Content-TypeString(30)Fixed value "application/json;charset=utf-8"Yes
X-TIMESTAMPString(29)Current time, format 2022-09-16T16:58:47.964+07:00Yes
X-SIGNATUREString(64)Signature. For details please check Data Signing RulesYes
X-PARTNER-IDString(20)Merchant IDYes
X-REQUEST-IDString(64)Unique ID for each requestYes

Body

Error Code

ParameterTypeRequiredRemarks
errCodeString(32)No0 means success, otherwise see Error Code
errCodeDesString(128)NoError description
requestIdString(64)YesUnique ID for each request
merchantIdString(20)NoMerchant ID
storeIdString(30)NoOnly if using branch ID
merchantTradeNoString(32)YesMerchant order number
urlString(200)NoPayment 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"
}