Skip to main content

Create a link session

This API lets the partner's server (backend) create a bank account link session (Bank Link Session) on the Tingee system and receive a secure SDK URL.

POST
URLhttps://open-api.tingee.vn/v1/create-bank-link-session

Create a bank account link session to get the SDK URL to display on the client.

1. Request Headers​

HeaderTypeRequiredDescription
Content-Typestring✓Data format. Required: application/json
x-client-idstring✓Client ID issued to the partner by Tingee.
x-request-timestampstring✓Time the request is sent (format: yyyyMMddHHmmssSSS, e.g. 20260701153045999).
x-signaturestring✓HMAC-SHA512 signature that verifies the integrity of the request data. See How to generate the signature for details.

2. Request Body (JSON)​

PropertyData typeRequiredDescription
typestring✕Session type. Values: bank-link or bank-config. The partner default is bank-link. To open the configuration screen, pass bank-config.
shopIdnumber✕ID of the shop to link the bank account to once linking is complete.
allowedBanksarray[string]✕List of bank codes shown in the SDK (e.g. ["BIDV", "VCB", "ACB"]). If omitted, the system shows all supported banks.
Values are bank codes (code in Supported banks), not BINs.
disallowedBanksarray[string]✕List of bank codes to hide from the SDK (e.g. ["TPB"]). After exclusion, at least one bank must remain available.
bankNamestring✕Specify a single bank code (e.g. BIDV) to lock the flow and take the customer straight to that bank's linking screen.
bankAccountTypestring✕Type of account to link: personal-account (personal), business-account (business), business-household-account (household business).
redirectUrlstring✕Your URL to redirect the customer's browser to after linking is complete on the mobile or web SDK.
metadatastring✕Custom partner data (up to 1000 characters). This value is sent back in the Account linking webhook.
isEnableQRScanboolean✕Show a QR scan button on the mobile SDK screen to auto-fill account details from a bank QR code. Disabled by default.
Only shown for some banks / account types supported by the SDK.
merchantIdnumber~Sub-merchant ID. Required when you use a Master Merchant account to create a session for a sub-merchant; the sub-merchant must belong to the Master Merchant calling the API.

Sample Request Body:​

{
"shopId": 123,
"type": "bank-link",
"allowedBanks": ["BIDV", "VCB", "ACB"],
"redirectUrl": "https://merchant.example.vn/bank-link/callback"
}

3. Response Data​

Tingee OpenAPI returns the result as JSON:

PropertyData typeDescription
codestringResult status code. 00 means the session was created successfully.
messagestringMessage describing the response status.
datastringFull bank link SDK URL containing the security token.

Sample Success Response:​

{
"code": "00",
"message": "Success",
"data": "https://uat-bank-link.tingee.vn?token=eyJtZXJjaGFudElkIjoxMDAxfQ&s=7d5b6e..."
}

Sample Error Response:​

{
"code": "97",
"message": "Invalid signature",
"data": null
}

Business error codes:​

Error codeMeaningHow to handle
1063No banks availableMake sure allowedBanks contains at least one supported bank.
1031Shop not foundCheck that shopId exists and belongs to the right Merchant, or leave shopId empty.
1094Shop does not belong to the Master MerchantCheck that shopId is assigned to the Master Merchant, or leave shopId empty.
1095, 1096Master Merchant merchantId errorPass the merchantId of a sub-merchant that belongs to the Master Merchant calling the API.
90, 91, 92, 97Request authentication error (timestamp, client-id, signature)See System error codes.
OthersOther errorsSee Error codes.

4. Backend example (Node.js)​

The following code shows how to call the create link session API from your server:

// timestamp and signature are generated as described in "Get started"
export async function createBankLinkSession(timestamp, signature) {
const body = {
shopId: 123,
type: 'bank-link',
redirectUrl: 'https://merchant.example.vn/bank-link/callback'
};

const response = await fetch(`${process.env.TINGEE_OPEN_API_URL}/v1/create-bank-link-session`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-client-id': process.env.TINGEE_CLIENT_ID,
'x-request-timestamp': timestamp,
'x-signature': signature
},
body: JSON.stringify(body)
});

const result = await response.json();
if (result.code !== '00') {
throw new Error(`[${result.code}] ${result.message}`);
}

// data is the full SDK URL used on the client
return {
url: result.data
};
}