curl --request POST \
--url https://staging-payments.commerce.asia/api/services/app/PaymentGateway/RequestPayment \
--header 'Abp-TenantId: <abp-tenantid>' \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'cap-signature: <cap-signature>' \
--data '
{
"channelId": 0,
"providerChannelId": "string",
"currencyCode": "MYR",
"amount": 0,
"referenceCode": "string",
"description": "string",
"ipAddress": "string",
"userAgent": "string",
"returnUrl": "string",
"callbackUrl": "string",
"savePayment": false,
"customer": {
"email": "string",
"mobileNo": "string",
"name": "string",
"username": "string",
"identificationNumber": "string",
"identificationType": 1
},
"subMerchant": {
"uniqueId": "string",
"name": "string"
},
"localCitizen": true,
"recurringPaymentInfo": {
"id": "string",
"mode": 1,
"numberOfPayments": 1,
"effectiveDate": "string",
"maximumPaymentAmount": 0,
"expiryDate": "string",
"isFixedAmount": true
},
"requestPaymentExtraInfo": {
"channelGroupId": 0
},
"platformCharge": {
"partnerId": "string",
"amount": 0
},
"timestamp": 0
}
'{
"currencyCode": "MYR",
"amount": 0,
"transactionNumber": "string",
"channelId": 0,
"redirectionType": 1,
"redirectUrl": "string",
"clientScript": "string"
}Request Payment
The payment gateway requests a new payment
The following input parameters are expected to be provided by the merchant to perform an online payment transaction.
- Channel Id may refer to the Get Channel List
- If merchants would like to use CommercePay Hosted Payment Web solution, merchants may skip Channel Id parameter.
curl --request POST \
--url https://staging-payments.commerce.asia/api/services/app/PaymentGateway/RequestPayment \
--header 'Abp-TenantId: <abp-tenantid>' \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'cap-signature: <cap-signature>' \
--data '
{
"channelId": 0,
"providerChannelId": "string",
"currencyCode": "MYR",
"amount": 0,
"referenceCode": "string",
"description": "string",
"ipAddress": "string",
"userAgent": "string",
"returnUrl": "string",
"callbackUrl": "string",
"savePayment": false,
"customer": {
"email": "string",
"mobileNo": "string",
"name": "string",
"username": "string",
"identificationNumber": "string",
"identificationType": 1
},
"subMerchant": {
"uniqueId": "string",
"name": "string"
},
"localCitizen": true,
"recurringPaymentInfo": {
"id": "string",
"mode": 1,
"numberOfPayments": 1,
"effectiveDate": "string",
"maximumPaymentAmount": 0,
"expiryDate": "string",
"isFixedAmount": true
},
"requestPaymentExtraInfo": {
"channelGroupId": 0
},
"platformCharge": {
"partnerId": "string",
"amount": 0
},
"timestamp": 0
}
'{
"currencyCode": "MYR",
"amount": 0,
"transactionNumber": "string",
"channelId": 0,
"redirectionType": 1,
"redirectUrl": "string",
"clientScript": "string"
}Headers
Your unique Merchant ID assigned by CommercePay.
Your API credentials used for authentication (typically a Bearer token).
A unique security hash used to verify the integrity of the request body. See Generate Signature for how to generate this.
Body
Currency code with a 3-letter ISO 4217 standard code
3"MYR"
Please take note: The Amount parameter only accepts integer units. For example, 1000 is equivalent to 10.00 for the backend.
Invalid Format: 1,000.00
100
Merchant Reference Code
50Customer’s IP address captured by the merchant system
50Return URL supplied by the merchant server for the payment response and used by CommercePay to redirect the customer's browser back to the desired page on the Merchant’s site
500"https://returnurl.com/"
new Date().getTime()
1621851652617
An identifier that represents a CommercePay payments channel. Refer to the id on response endpoints of Get Channel List
Optional: Send without channelId parameter to call Payment web
2
An identifier that represents the payment provider channel. To get providerChannelId, kindly refer to Get Provider Channels for more information
"TEST0021"
Transaction Description
100"Order details"
[Conditional] Customer’s user agent. It is recommended to input for a better user experience for specific channels due to different platforms such as desktop, mobile, or app view. Example channels impact: ShopeePay
200Callback URL is host-to-host communication. CommercePay sends the transaction response to the merchant callback server based on the callback URL given. If the URL is provided, the callback will be triggered; otherwise, it would not trigger. Refer to the Merchant Callback URL to know more
500"https://callback.com/"
[Conditional for Tokenize Payment] To save user info for subsequent payment
Show child attributes
Show child attributes
Show child attributes
Show child attributes
[Conditional for certain channel] Example: If the customer is from Malaysia, kindly set it as True; else, set it as False
[Conditional for Recurring Payment]
Show child attributes
Show child attributes
[Optional]
Show child attributes
Show child attributes
Optional: Only Authorized Partners by CommercePay are allowed to charge platform fees to the merchant
Show child attributes
Show child attributes
[Optional]
Show child attributes
Show child attributes
[Optional]
Show child attributes
Show child attributes
Code to identify virtual account to make payment.
30[Conditional for Loyalty payment]
Show child attributes
Show child attributes
Response
Success
Currency code with a 3-letter ISO 4217 standard code
3"MYR"
Please take note: The Amount parameter only accepts integer units. For example, 1000 is equivalent to 10.00 for the backend
100
Unique CAP Transaction Number
24Refer to endpoints in Get Channel List
Notes: 1 = UrlRedirection
1, 2 URL used for the customer to redirect to the payment page
Client script used for the customer to redirect to the payment page
Transaction Expired Date Time
