Request Payout
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": 123,
"providerChannelId": "<string>",
"currencyCode": "<string>",
"amount": {},
"referenceCode": "<string>",
"description": "<string>",
"ipAddress": "<string>",
"userAgent": "<string>",
"returnUrl": "<string>",
"callbackUrl": "<string>",
"customer": {
"customer.email": "<string>",
"customer.mobileNo": "<string>",
"customer.name": "<string>",
"customer.username": "<string>"
},
"localCitizen": true,
"timestamp": {}
}
'import requests
url = "https://staging-payments.commerce.asia/api/services/app/PaymentGateway/RequestPayment"
payload = {
"channelId": 123,
"providerChannelId": "<string>",
"currencyCode": "<string>",
"amount": {},
"referenceCode": "<string>",
"description": "<string>",
"ipAddress": "<string>",
"userAgent": "<string>",
"returnUrl": "<string>",
"callbackUrl": "<string>",
"customer": {
"customer.email": "<string>",
"customer.mobileNo": "<string>",
"customer.name": "<string>",
"customer.username": "<string>"
},
"localCitizen": True,
"timestamp": {}
}
headers = {
"Abp-TenantId": "<abp-tenantid>",
"Authorization": "<authorization>",
"cap-signature": "<cap-signature>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Abp-TenantId': '<abp-tenantid>',
Authorization: '<authorization>',
'cap-signature': '<cap-signature>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
channelId: 123,
providerChannelId: '<string>',
currencyCode: '<string>',
amount: {},
referenceCode: '<string>',
description: '<string>',
ipAddress: '<string>',
userAgent: '<string>',
returnUrl: '<string>',
callbackUrl: '<string>',
customer: {
'customer.email': '<string>',
'customer.mobileNo': '<string>',
'customer.name': '<string>',
'customer.username': '<string>'
},
localCitizen: true,
timestamp: {}
})
};
fetch('https://staging-payments.commerce.asia/api/services/app/PaymentGateway/RequestPayment', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging-payments.commerce.asia/api/services/app/PaymentGateway/RequestPayment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'channelId' => 123,
'providerChannelId' => '<string>',
'currencyCode' => '<string>',
'amount' => [
],
'referenceCode' => '<string>',
'description' => '<string>',
'ipAddress' => '<string>',
'userAgent' => '<string>',
'returnUrl' => '<string>',
'callbackUrl' => '<string>',
'customer' => [
'customer.email' => '<string>',
'customer.mobileNo' => '<string>',
'customer.name' => '<string>',
'customer.username' => '<string>'
],
'localCitizen' => true,
'timestamp' => [
]
]),
CURLOPT_HTTPHEADER => [
"Abp-TenantId: <abp-tenantid>",
"Authorization: <authorization>",
"Content-Type: application/json",
"cap-signature: <cap-signature>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://staging-payments.commerce.asia/api/services/app/PaymentGateway/RequestPayment"
payload := strings.NewReader("{\n \"channelId\": 123,\n \"providerChannelId\": \"<string>\",\n \"currencyCode\": \"<string>\",\n \"amount\": {},\n \"referenceCode\": \"<string>\",\n \"description\": \"<string>\",\n \"ipAddress\": \"<string>\",\n \"userAgent\": \"<string>\",\n \"returnUrl\": \"<string>\",\n \"callbackUrl\": \"<string>\",\n \"customer\": {\n \"customer.email\": \"<string>\",\n \"customer.mobileNo\": \"<string>\",\n \"customer.name\": \"<string>\",\n \"customer.username\": \"<string>\"\n },\n \"localCitizen\": true,\n \"timestamp\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Abp-TenantId", "<abp-tenantid>")
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("cap-signature", "<cap-signature>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://staging-payments.commerce.asia/api/services/app/PaymentGateway/RequestPayment")
.header("Abp-TenantId", "<abp-tenantid>")
.header("Authorization", "<authorization>")
.header("cap-signature", "<cap-signature>")
.header("Content-Type", "application/json")
.body("{\n \"channelId\": 123,\n \"providerChannelId\": \"<string>\",\n \"currencyCode\": \"<string>\",\n \"amount\": {},\n \"referenceCode\": \"<string>\",\n \"description\": \"<string>\",\n \"ipAddress\": \"<string>\",\n \"userAgent\": \"<string>\",\n \"returnUrl\": \"<string>\",\n \"callbackUrl\": \"<string>\",\n \"customer\": {\n \"customer.email\": \"<string>\",\n \"customer.mobileNo\": \"<string>\",\n \"customer.name\": \"<string>\",\n \"customer.username\": \"<string>\"\n },\n \"localCitizen\": true,\n \"timestamp\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging-payments.commerce.asia/api/services/app/PaymentGateway/RequestPayment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Abp-TenantId"] = '<abp-tenantid>'
request["Authorization"] = '<authorization>'
request["cap-signature"] = '<cap-signature>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"channelId\": 123,\n \"providerChannelId\": \"<string>\",\n \"currencyCode\": \"<string>\",\n \"amount\": {},\n \"referenceCode\": \"<string>\",\n \"description\": \"<string>\",\n \"ipAddress\": \"<string>\",\n \"userAgent\": \"<string>\",\n \"returnUrl\": \"<string>\",\n \"callbackUrl\": \"<string>\",\n \"customer\": {\n \"customer.email\": \"<string>\",\n \"customer.mobileNo\": \"<string>\",\n \"customer.name\": \"<string>\",\n \"customer.username\": \"<string>\"\n },\n \"localCitizen\": true,\n \"timestamp\": {}\n}"
response = http.request(request)
puts response.read_body{
"currencyCode": "<string>",
"amount": 123,
"transactionNumber": "<string>",
"channelId": 123,
"redirectionType": 123,
"redirectUrl": "<string>"
}Payout APIs
Request Payout
Request a payout and transfer funds via bank account or DuitNow Proxy.
POST
/
api
/
services
/
app
/
PaymentGateway
/
RequestPayment
Request Payout
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": 123,
"providerChannelId": "<string>",
"currencyCode": "<string>",
"amount": {},
"referenceCode": "<string>",
"description": "<string>",
"ipAddress": "<string>",
"userAgent": "<string>",
"returnUrl": "<string>",
"callbackUrl": "<string>",
"customer": {
"customer.email": "<string>",
"customer.mobileNo": "<string>",
"customer.name": "<string>",
"customer.username": "<string>"
},
"localCitizen": true,
"timestamp": {}
}
'import requests
url = "https://staging-payments.commerce.asia/api/services/app/PaymentGateway/RequestPayment"
payload = {
"channelId": 123,
"providerChannelId": "<string>",
"currencyCode": "<string>",
"amount": {},
"referenceCode": "<string>",
"description": "<string>",
"ipAddress": "<string>",
"userAgent": "<string>",
"returnUrl": "<string>",
"callbackUrl": "<string>",
"customer": {
"customer.email": "<string>",
"customer.mobileNo": "<string>",
"customer.name": "<string>",
"customer.username": "<string>"
},
"localCitizen": True,
"timestamp": {}
}
headers = {
"Abp-TenantId": "<abp-tenantid>",
"Authorization": "<authorization>",
"cap-signature": "<cap-signature>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Abp-TenantId': '<abp-tenantid>',
Authorization: '<authorization>',
'cap-signature': '<cap-signature>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
channelId: 123,
providerChannelId: '<string>',
currencyCode: '<string>',
amount: {},
referenceCode: '<string>',
description: '<string>',
ipAddress: '<string>',
userAgent: '<string>',
returnUrl: '<string>',
callbackUrl: '<string>',
customer: {
'customer.email': '<string>',
'customer.mobileNo': '<string>',
'customer.name': '<string>',
'customer.username': '<string>'
},
localCitizen: true,
timestamp: {}
})
};
fetch('https://staging-payments.commerce.asia/api/services/app/PaymentGateway/RequestPayment', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging-payments.commerce.asia/api/services/app/PaymentGateway/RequestPayment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'channelId' => 123,
'providerChannelId' => '<string>',
'currencyCode' => '<string>',
'amount' => [
],
'referenceCode' => '<string>',
'description' => '<string>',
'ipAddress' => '<string>',
'userAgent' => '<string>',
'returnUrl' => '<string>',
'callbackUrl' => '<string>',
'customer' => [
'customer.email' => '<string>',
'customer.mobileNo' => '<string>',
'customer.name' => '<string>',
'customer.username' => '<string>'
],
'localCitizen' => true,
'timestamp' => [
]
]),
CURLOPT_HTTPHEADER => [
"Abp-TenantId: <abp-tenantid>",
"Authorization: <authorization>",
"Content-Type: application/json",
"cap-signature: <cap-signature>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://staging-payments.commerce.asia/api/services/app/PaymentGateway/RequestPayment"
payload := strings.NewReader("{\n \"channelId\": 123,\n \"providerChannelId\": \"<string>\",\n \"currencyCode\": \"<string>\",\n \"amount\": {},\n \"referenceCode\": \"<string>\",\n \"description\": \"<string>\",\n \"ipAddress\": \"<string>\",\n \"userAgent\": \"<string>\",\n \"returnUrl\": \"<string>\",\n \"callbackUrl\": \"<string>\",\n \"customer\": {\n \"customer.email\": \"<string>\",\n \"customer.mobileNo\": \"<string>\",\n \"customer.name\": \"<string>\",\n \"customer.username\": \"<string>\"\n },\n \"localCitizen\": true,\n \"timestamp\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Abp-TenantId", "<abp-tenantid>")
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("cap-signature", "<cap-signature>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://staging-payments.commerce.asia/api/services/app/PaymentGateway/RequestPayment")
.header("Abp-TenantId", "<abp-tenantid>")
.header("Authorization", "<authorization>")
.header("cap-signature", "<cap-signature>")
.header("Content-Type", "application/json")
.body("{\n \"channelId\": 123,\n \"providerChannelId\": \"<string>\",\n \"currencyCode\": \"<string>\",\n \"amount\": {},\n \"referenceCode\": \"<string>\",\n \"description\": \"<string>\",\n \"ipAddress\": \"<string>\",\n \"userAgent\": \"<string>\",\n \"returnUrl\": \"<string>\",\n \"callbackUrl\": \"<string>\",\n \"customer\": {\n \"customer.email\": \"<string>\",\n \"customer.mobileNo\": \"<string>\",\n \"customer.name\": \"<string>\",\n \"customer.username\": \"<string>\"\n },\n \"localCitizen\": true,\n \"timestamp\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging-payments.commerce.asia/api/services/app/PaymentGateway/RequestPayment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Abp-TenantId"] = '<abp-tenantid>'
request["Authorization"] = '<authorization>'
request["cap-signature"] = '<cap-signature>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"channelId\": 123,\n \"providerChannelId\": \"<string>\",\n \"currencyCode\": \"<string>\",\n \"amount\": {},\n \"referenceCode\": \"<string>\",\n \"description\": \"<string>\",\n \"ipAddress\": \"<string>\",\n \"userAgent\": \"<string>\",\n \"returnUrl\": \"<string>\",\n \"callbackUrl\": \"<string>\",\n \"customer\": {\n \"customer.email\": \"<string>\",\n \"customer.mobileNo\": \"<string>\",\n \"customer.name\": \"<string>\",\n \"customer.username\": \"<string>\"\n },\n \"localCitizen\": true,\n \"timestamp\": {}\n}"
response = http.request(request)
puts response.read_body{
"currencyCode": "<string>",
"amount": 123,
"transactionNumber": "<string>",
"channelId": 123,
"redirectionType": 123,
"redirectUrl": "<string>"
}An API endpoint used to request a payout and transfer funds to the specified recipients through a bank account or DuitNow Proxy.
Request
Headers
string
required
Your unique Merchant ID assigned by CommercePay.
string
required
Your API credentials used for authentication (typically a Bearer token).
string
required
A unique security hash used to verify the integrity of the request body. See Generate Signature for how to generate this.
Body
integer
required
An identifier that represents a CommercePay payments channel. Production Payout ChannelId: 9. Staging Payout ChannelId: 15.
string
required
An identifier that represents the payment method (Bank or DuitNow Proxy). You can obtain the providerChannelId via the Get Provider Channels API or refer to it here.
string
required
Currency code with a 3-letter ISO 4217 standard code. Maximum length: 3. Example:
MYR.int64
required
Payout amount. This field accepts only integer values. For example, 1050 represents 10.50.
string
required
Merchant reference code. Maximum length: 50.
string
Transaction description. Maximum length: 100.
string
required
Customer’s IP address captured by the merchant system. Maximum length: 50.
string
Customer’s user agent. Maximum length: 200.
string
required
A return URL provided by the merchant. The user can be redirected to the final destination page from the CommercePay receipt page after the transaction payment has been completed. Maximum length: 500.
string
A URL provided by the merchant to receive server-to-server notifications from the system regarding transaction status updates. This URL is called automatically once the payment process is completed or when the transaction status changes. Maximum length: 500.
object
required
Show properties
Show properties
string
Customer’s email address. Maximum length: 150.
string
Customer’s mobile number. Required when processing a payout via DuitNow Proxy using a mobile number. Maximum length: 16.
string
Customer’s name. Required when processing a payout via bank transfer. Maximum length: 36.
string
A field for bank account number, national ID (NRIC) or Business Registration Number. Maximum length: 36.
boolean
required
If the customer is Malaysian, set this to true; otherwise, set it to false.
int64
required
Current timestamp. Example:
1621851652617.Request Payload Sample
Payout_With_Bank
{
"channelId": 15,
"providerChannelId": "UOVBMYKL", // Beneficiary Bank Swift Code
"currencyCode": "MYR",
"amount": 1000,
"referenceCode": "BankPayout_1",
"description": "BankPayout_1",
"ipAddress": "202.184.234.13",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0",
"returnUrl": "https://staging-web-payments.commerce.asia",
"callbackUrl": "https://callback.com",
"customer": {
"email": "ATD@commerce.asia",
"mobileNo": "0101234567",
"name": "ACCOUNT DUITNOW - HYPHEN ACCOUNT DUITNOW - HYPHEN", // Beneficiary Bank Account Name
"username": "2093011793" // Beneficiary Bank Account Number
},
"localCitizen": true,
"timestamp": 1669862494
}
Payout_With_DuitNow_Proxy
{
"channelId": 15,
"providerChannelId": "NRIC", // Proxy Mode
"currencyCode": "MYR",
"amount": 1000,
"referenceCode": "ProxyPayout_1",
"description": "ProxyPayout_1",
"ipAddress": "202.184.234.13",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0",
"returnUrl": "https://staging-web-payments.commerce.asia",
"callbackUrl": "https://callback.com",
"customer": {
"email": "ATD@commerce.asia",
"mobileNo": "0101234567",
"name": "John",
"username": "660124020789" // National ID Or Business Registration Number
},
"LocalCitizen": true,
"timestamp": 1669862494
}
Response
Body
string
Payout currency. Maximum length: 3.
integer
Payout amount. For example, 1050 represents 10.50.
string
Unique CommercePay Transaction Number. Maximum length: 24.
integer
An identifier that represents a CommercePay payments channel.
integer
Represents the redirectUrl type. This field returns 1 (URL redirection).
string
URL used for the customer to redirect to the payment page.
Response Payload Sample
Response_2XX
{
"result": {
"currencyCode": "MYR",
"amount": 1000,
"transactionNumber": "20061769514A13A0A02260425",
"channelId": 15,
"redirectionType": 1,
"redirectUrl": "https://dev-payments.commerce.asia/paymentgateway/Return/15?exchangeToken=QVNNMGd5Nmh5NzAxNnp3RkRUOVdRbFIzakcrM0ZHRnJmRmZkUlp5aDNuaz0"
}
}
Error Responses
| Code | Message |
|---|---|
| 2056 | Failed Payment Request |
| 1 | Invalid Signature. |
Response_400
{
"result": null,
"error": {
"code": 2056,
"message": "Failed Payment Request"
}
}
Response_400
{
"result": {
"code": 1,
"message": "Invalid Signature."
},
"error": null
}
