curl --request POST \
--url https://uat-interface.haipay.asia/usd/collect/apply \
--header 'Content-Type: application/json' \
--data '
{
"appId": 1054,
"orderId": "M233323000059",
"name": "Robert Taylor",
"phone": "+12025551234",
"email": "robert.taylor@gmail.com",
"amount": "299.99",
"payType": "CREDIT_CARD",
"inBankCode": "CREDIT_CARD",
"clientIp": "203.0.113.1",
"callBackUrl": "https://merchant.com/payment/success",
"callBackFailUrl": "https://merchant.com/payment/fail",
"cancelUrl": "https://merchant.com/payment/cancel",
"notifyUrl": "https://merchant.com/api/notify",
"subject": "Payment for order",
"body": "Premium subscription",
"partnerUserId": "149597870",
"sign": "af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw=="
}
'import requests
url = "https://uat-interface.haipay.asia/usd/collect/apply"
payload = {
"appId": 1054,
"orderId": "M233323000059",
"name": "Robert Taylor",
"phone": "+12025551234",
"email": "robert.taylor@gmail.com",
"amount": "299.99",
"payType": "CREDIT_CARD",
"inBankCode": "CREDIT_CARD",
"clientIp": "203.0.113.1",
"callBackUrl": "https://merchant.com/payment/success",
"callBackFailUrl": "https://merchant.com/payment/fail",
"cancelUrl": "https://merchant.com/payment/cancel",
"notifyUrl": "https://merchant.com/api/notify",
"subject": "Payment for order",
"body": "Premium subscription",
"partnerUserId": "149597870",
"sign": "af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw=="
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const url = 'https://uat-interface.haipay.asia/usd/collect/apply';
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
appId: 1054,
orderId: 'M233323000059',
name: 'Robert Taylor',
phone: '+12025551234',
email: 'robert.taylor@gmail.com',
amount: '299.99',
payType: 'CREDIT_CARD',
inBankCode: 'CREDIT_CARD',
clientIp: '203.0.113.1',
callBackUrl: 'https://merchant.com/payment/success',
callBackFailUrl: 'https://merchant.com/payment/fail',
cancelUrl: 'https://merchant.com/payment/cancel',
notifyUrl: 'https://merchant.com/api/notify',
subject: 'Payment for order',
body: JSON.stringify('Premium subscription'),
partnerUserId: '149597870',
sign: 'af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw=='
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://uat-interface.haipay.asia/usd/collect/apply",
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([
'appId' => 1054,
'orderId' => 'M233323000059',
'name' => 'Robert Taylor',
'phone' => '+12025551234',
'email' => 'robert.taylor@gmail.com',
'amount' => '299.99',
'payType' => 'CREDIT_CARD',
'inBankCode' => 'CREDIT_CARD',
'clientIp' => '203.0.113.1',
'callBackUrl' => 'https://merchant.com/payment/success',
'callBackFailUrl' => 'https://merchant.com/payment/fail',
'cancelUrl' => 'https://merchant.com/payment/cancel',
'notifyUrl' => 'https://merchant.com/api/notify',
'subject' => 'Payment for order',
'body' => 'Premium subscription',
'partnerUserId' => '149597870',
'sign' => 'af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw=='
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://uat-interface.haipay.asia/usd/collect/apply")
.header("Content-Type", "application/json")
.body("{\n \"appId\": 1054,\n \"orderId\": \"M233323000059\",\n \"name\": \"Robert Taylor\",\n \"phone\": \"+12025551234\",\n \"email\": \"robert.taylor@gmail.com\",\n \"amount\": \"299.99\",\n \"payType\": \"CREDIT_CARD\",\n \"inBankCode\": \"CREDIT_CARD\",\n \"clientIp\": \"203.0.113.1\",\n \"callBackUrl\": \"https://merchant.com/payment/success\",\n \"callBackFailUrl\": \"https://merchant.com/payment/fail\",\n \"cancelUrl\": \"https://merchant.com/payment/cancel\",\n \"notifyUrl\": \"https://merchant.com/api/notify\",\n \"subject\": \"Payment for order\",\n \"body\": \"Premium subscription\",\n \"partnerUserId\": \"149597870\",\n \"sign\": \"af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw==\"\n}")
.asString();{
"status": "1",
"error": "00000000",
"msg": "success",
"data": {
"orderId": "M233323000059",
"orderNo": "6023071013539074",
"payUrl": "https://pay.haipay.asia/cashier/1L9zQS2",
"bankCode": "PIX",
"clientToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
"sign": "af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw=="
}
}Collection Application
Create collection order
curl --request POST \
--url https://uat-interface.haipay.asia/usd/collect/apply \
--header 'Content-Type: application/json' \
--data '
{
"appId": 1054,
"orderId": "M233323000059",
"name": "Robert Taylor",
"phone": "+12025551234",
"email": "robert.taylor@gmail.com",
"amount": "299.99",
"payType": "CREDIT_CARD",
"inBankCode": "CREDIT_CARD",
"clientIp": "203.0.113.1",
"callBackUrl": "https://merchant.com/payment/success",
"callBackFailUrl": "https://merchant.com/payment/fail",
"cancelUrl": "https://merchant.com/payment/cancel",
"notifyUrl": "https://merchant.com/api/notify",
"subject": "Payment for order",
"body": "Premium subscription",
"partnerUserId": "149597870",
"sign": "af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw=="
}
'import requests
url = "https://uat-interface.haipay.asia/usd/collect/apply"
payload = {
"appId": 1054,
"orderId": "M233323000059",
"name": "Robert Taylor",
"phone": "+12025551234",
"email": "robert.taylor@gmail.com",
"amount": "299.99",
"payType": "CREDIT_CARD",
"inBankCode": "CREDIT_CARD",
"clientIp": "203.0.113.1",
"callBackUrl": "https://merchant.com/payment/success",
"callBackFailUrl": "https://merchant.com/payment/fail",
"cancelUrl": "https://merchant.com/payment/cancel",
"notifyUrl": "https://merchant.com/api/notify",
"subject": "Payment for order",
"body": "Premium subscription",
"partnerUserId": "149597870",
"sign": "af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw=="
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const url = 'https://uat-interface.haipay.asia/usd/collect/apply';
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
appId: 1054,
orderId: 'M233323000059',
name: 'Robert Taylor',
phone: '+12025551234',
email: 'robert.taylor@gmail.com',
amount: '299.99',
payType: 'CREDIT_CARD',
inBankCode: 'CREDIT_CARD',
clientIp: '203.0.113.1',
callBackUrl: 'https://merchant.com/payment/success',
callBackFailUrl: 'https://merchant.com/payment/fail',
cancelUrl: 'https://merchant.com/payment/cancel',
notifyUrl: 'https://merchant.com/api/notify',
subject: 'Payment for order',
body: JSON.stringify('Premium subscription'),
partnerUserId: '149597870',
sign: 'af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw=='
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://uat-interface.haipay.asia/usd/collect/apply",
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([
'appId' => 1054,
'orderId' => 'M233323000059',
'name' => 'Robert Taylor',
'phone' => '+12025551234',
'email' => 'robert.taylor@gmail.com',
'amount' => '299.99',
'payType' => 'CREDIT_CARD',
'inBankCode' => 'CREDIT_CARD',
'clientIp' => '203.0.113.1',
'callBackUrl' => 'https://merchant.com/payment/success',
'callBackFailUrl' => 'https://merchant.com/payment/fail',
'cancelUrl' => 'https://merchant.com/payment/cancel',
'notifyUrl' => 'https://merchant.com/api/notify',
'subject' => 'Payment for order',
'body' => 'Premium subscription',
'partnerUserId' => '149597870',
'sign' => 'af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw=='
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://uat-interface.haipay.asia/usd/collect/apply")
.header("Content-Type", "application/json")
.body("{\n \"appId\": 1054,\n \"orderId\": \"M233323000059\",\n \"name\": \"Robert Taylor\",\n \"phone\": \"+12025551234\",\n \"email\": \"robert.taylor@gmail.com\",\n \"amount\": \"299.99\",\n \"payType\": \"CREDIT_CARD\",\n \"inBankCode\": \"CREDIT_CARD\",\n \"clientIp\": \"203.0.113.1\",\n \"callBackUrl\": \"https://merchant.com/payment/success\",\n \"callBackFailUrl\": \"https://merchant.com/payment/fail\",\n \"cancelUrl\": \"https://merchant.com/payment/cancel\",\n \"notifyUrl\": \"https://merchant.com/api/notify\",\n \"subject\": \"Payment for order\",\n \"body\": \"Premium subscription\",\n \"partnerUserId\": \"149597870\",\n \"sign\": \"af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw==\"\n}")
.asString();{
"status": "1",
"error": "00000000",
"msg": "success",
"data": {
"orderId": "M233323000059",
"orderNo": "6023071013539074",
"payUrl": "https://pay.haipay.asia/cashier/1L9zQS2",
"bankCode": "PIX",
"clientToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
"sign": "af0gAHkUOyYHu9owQp8NJ4mPEeUW4vuJcjdxqLIzrVw8AvpLSjD1DXupReSG/CyuSkFRyiIvCp5u703AuGGmfgD2gKDH3Ywau41bAbG2jnHJ8mtjiSJ5iWUzanyd4Kr7d1+rETbzUl7/BkW3t0X8UUFdqpxwG8DPUjAwUKfplWDHV7koG51Ozexd80DCsmW6eWdouAZ1uNXGLYmV3ftE3BmfNRtuv1C5bfTJWrTEIOxbF6g2uYOFZTlIgrQgd7/2PsAYwQQXNz8Q8CYl4OxqCv4pXJxaLWPbR5tqZu9og5kn32C9aHW/NlU1y39vzz+4ef81yPAqUV9oHlSMSPrMmw=="
}
}Secret Key & Private Key (Generate Signature)
Related Topics
- International Credit Card (VISA/MASTER) Payment API
- HaiPay API Reference Overview
- HaiPay Configuration and Signature Guide
Body
Business ID (obtained from backend, must pass corresponding business ID based on currency in URL)
Merchant refund application order number
Real phone number
Transaction amount (accurate to two decimal places; do not add punctuation, e.g., ",")
URL to redirect after successful payment
URL to redirect after failed payment
Payment remark
Unique user identifier (e.g., userId), used for risk control, must be real and valid, otherwise it will affect transactions. Format requirements: digits, uppercase and lowercase letters or common symbols -~!@#$%&*()_.
Signature
User name, recommended to use real name, format: firstName and lastName separated by space, example: John Doe
Real email address
Client IP address
Cancel payment redirect URL. If provided, users can click back on the payment page and be redirected to this URL
Callback URL
Remark details

