Skip to main content

GCash API

Endpoints

Live POST https://pay.onlinepay.ai/payment

Sandbox POST https://testpay.onlinepay.ai/payment

note

OnlinePay will obtain the HTTP Header referer to verify the website source. The website source must be configured by OnlinePay to be verified. If you do not access the interface through a browser, you need to actively add a referer.

Request Parameters

Header Params

ParameterTypeRequiredDescription
paymentTypestringYesFixed value: GCASH

Basic Information

ParameterTypeRequiredDescription
merNointegerYesMerchant Number, Unique identifier assigned to the merchant by the onlinepay payment platform when registering with onlinepay
merOrderNostringYesMerchant Order Number, Each order must be unique, and each merchant order number can only be submitted once within 1 second
currencyCodestringYesPlease refer to Currency Code
sourceAmountstringYesTotal amount of the order, keep two decimals
returnUrlstringYesJump address after payment is completed (max 512 characters)
notifyUrlstringNoAsynchronous notification address to notify the merchant of the final payment result (max 512 characters)
signstringYesSignature, MD5(merNo+merOrderNo+currencyCode+sourceAmount+PrivateKey) or RSA

Additional Information

ParameterTypeRequiredDescription
ipAddressstringYesCardholder IP address (max 64 characters)
versionstringYesV3.0.0
userIdstringYesPayment user ID
emailstringYesPayment user Email(max 100 characters)
osTypestringYesMobile system, Mobile system IOS or ANDROID
terminalstringYesTerminal, WEB: indicates that a PC browser is used.WAP: indicates that a mobile browser is used.APP: indicates that a mobile app is used.MINI_APP: indicates that a mini program is usedss

Example Request

{
"merNo": 111111,
"merOrderNo": "222222",
"currencyCode": "USD",
"sourceAmount": "100.05",
"returnUrl": "https://example.com",
"notifyUrl": "https://example.com/notify",
"sign": "906FDF4880B00B00281F2AB61AE9A721",
"ipAddress": "192.168.1.1",
"version": "V3.0.0",
"userId": "111",
"email": "[email protected]",
"osType": "ANDROID",
"terminal": "WAP"
}

Responses Body

ParameterTypeRequiredDescription
codestringYesIf the value is 00000, it will return success, other please refer to Error Code
messagestringYesInterface returns description
dataobjectYes**Request response data
-tradeNostringYesThe flow number generated after each order payment (unique marker)
-payCodestringYesPayment status code(Where: 1 means payment failure, 0 means payment success, 2 means pending)
-payUrlstringYes**If the paycode is 2, redirect to this address
-merOrderNostringYesCorresponds to the [OrderNo] parameter of the order submission parameter

Example Responses

{
"code":"00000",
"message":"SUCCESS",
"data":{
"payCode":0,
"tradeNo":"3333333",
"merorderNo":"222222",
"payUrl":"https://abc.com/"
}
}