Pay Out
Transfer API
Pay Out is Cas’s automated money transfer service that allows your system to create payment orders and transfer money to any bank account quickly, securely, and transparently. This service is ideal for businesses that need to process multiple transfers daily—such as salary payouts, refunds, or partner payments.
Benefits:
- Easy integration with a single API: Connect user accounts, make smarter transaction decisions, manage risks, and transfer funds—all through a single integration with bankHub.
- Optimized payout operations: Accounting teams no longer need to handle manual tasks, reducing workload.
- Minimized payment risks: Instead of manual transfers that are error-prone, using the API ensures all transactions are executed exactly as input.
- Time-saving: With just one click, you can trigger thousands of automated transactions.
- For enhanced performance, the Pay Out API is commonly used in combination with the Balance API (real-time account balance queries).
Steps to Integrate Pay Out
Below are the steps to integrate Pay Out into your product.
-
Create a grant /grant/token with
scopes
set totransfer
. -
Open the Cas Link interface using the
grantToken
returned in the previous step. See details -
After the user completes authentication, your frontend will receive a
publicToken
. Use this token to obtain the accessToken for the grant. -
You can now call the Pay Out API.
Call API
Grant access for Pay Out
- CURL
- Javascript (Axios)
curl --location 'https://sandbox.bankhub.dev/grant/token' \
--header 'X-BankHub-Api-Version: 2023-01-01' \
--header 'x-client-id: <CLIENT_ID_HERE>' \
--header 'x-secret-key: <SECRET_KEY_HERE>' \
--header 'Content-Type: application/json' \
--data '{
"scopes": "transfer",
"language": "vi",
"redirectUri": "https://your-domain.vn/link",
}'
const axios = require('axios');
const data = JSON.stringify({
"scopes": "transfer",
"language": "vi",
"redirectUri": "https://your-domain.vn/link",
});
const config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://sandbox.bankhub.dev/grant/token',
headers: {
'X-BankHub-Api-Version': '2023-01-01',
'x-client-id': '<CLIENT_ID_HERE>',
'x-secret-key': '<SECRET_KEY_HERE>',
'Content-Type': 'application/json',
},
data: data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
For detail API, here
Get accessToken from publicToken
- CURL
- Javascript (Axios)
curl --location 'https://sandbox.bankhub.dev/grant/exchange' \
--header 'X-BankHub-Api-Version: 2023-01-01' \
--header 'x-client-id: <CLIENT_ID_HERE>' \
--header 'x-secret-key: <SECRET_KEY_HERE>' \
--header 'Content-Type: application/json' \
--data '{
"publicToken": "bdbde2bad-7685-4f95-987c-71309a4a3"
}'
const axios = require('axios');
const data = JSON.stringify({
"publicToken": "bdbde2bad-7685-4f95-987c-71309a4a3"
});
const config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://sandbox.bankhub.dev/grant/exchange',
headers: {
'X-BankHub-Api-Version': '2023-01-01',
'x-client-id': '<CLIENT_ID_HERE>',
'x-secret-key': '<SECRET_KEY_HERE>',
'Content-Type': 'application/json'
},
data: data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
For detail API, heretại đây
API Pay Out
- CURL
- Javascript (Axios)
curl --location 'https://sandbox.bankhub.dev/transfer' \
--header 'X-BankHub-Api-Version: 2023-01-01' \
--header 'Authorization: <ACCESS_TOKEN_HERE>' \
--header 'x-client-id: <CLIENT_ID_HERE>' \
--header 'x-secret-key: <SECRET_KEY_HERE>'
--header 'x-interaction-id: ebcccee7-b5c6-4990-994b-fccf01320e54' \
--data '{
"amount": 10000,
"fromAccountNumber": "000",
"toBin": "970415",
"toAccountNumber": "113366668888",
"description": "CK"
}'
const axios = require('axios');
const data = JSON.stringify({
"amount": 10000,
"fromAccountNumber": "000",
"toBin": "970415",
"toAccountNumber": "113366668888",
"description": "CK"
});
const config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://sandbox.bankhub.dev/transfer',
headers: {
'X-BankHub-Api-Version': '2023-01-01',
'Authorization': '<ACCESS_TOKEN_HERE>',
'x-client-id': '<CLIENT_ID_HERE>',
'x-secret-key': '<SECRET_KEY_HERE>',
'x-interaction-id': 'ebcccee7-b5c6-4990-994b-fccf01320e54',
},
data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
For detail API, here