Skip to main content

Payment Initiation

Personal

Business

Payment initiation API

In a company's internal payment workflow, disbursing money is usually split into two independent steps: the accountant initiates the order and the director approves it. While this process ensures financial control and safety, it is time-consuming and lacks continuity between stages.

The Payment Initiation API lets you create payment transactions from a company's bank account through an API, reducing the accounting team's workload for initiating payments and making it easy to manage corporate disbursement orders. The Cas SDK Payment Initiation API is designed to accurately mirror a company's real-world payment process while allowing flexible integration into accounting systems, ERPs, or in-house software. The Cas SDK supports:

  • Initiating payment orders via API from the accountant's account

Benefits of using the Cas SDK:

  • Fits the accounting and finance workflows of Vietnamese businesses
  • Preserves segregation of duties and internal control, just like a company's current disbursement process
  • Easy to integrate into existing systems via API, especially ERP software

Steps to Integrate Payment Initiation​

Below are the steps to integrate Payment Initiation into your product.

  1. Create a grant /grant/token with scopes set to payment_initiation.
  2. Open the Cas Link interface using the grantToken returned in the previous step. See details
  3. After the user completes authentication, your frontend will receive a publicToken. Use this publicToken to obtain an accessToken for the grant.
  4. You can now call the Payment Initiation API.

Call API​

Create access grant for Pay Out​

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": "payment_initiation",
"language": "vi",
"redirectUri": "https://your-domain.vn/link",
}'
info

For API details, see here

Get accessToken from publicToken​

  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"
}'
info

For API details, see here

Payment Initiation API​

  curl --location 'https://sandbox.bankhub.dev/payment-initiation' \
--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"
}'
info

For API details, see here