Skip to main content

Bank account linking result webhook

When a customer completes linking a bank account through the SDK (Frontend Web or Mobile SDK), the TINGEE system automatically sends a webhook notification (event type bank-link) to the webhook URL you configured on the Portal.

POST
URLhttps://your-server.com/api/webhook/bank-link

Notification that syncs the successfully linked bank account information from Tingee to the partner system.

Webhook authentication types​

Tingee supports 3 security authentication types when sending webhooks to your server (configured directly on the Portal):

  1. Signature authentication (Recommended): If you configure a Secret Token for the webhook endpoint on the Portal, Tingee includes the x-signature header. The signature is generated with HMAC_SHA512(timestamp + ":" + json_body, secretKey).
  2. API Key authentication (custom header): If you choose API Key as the authentication type, Tingee attaches a header with the name and value you set in advance on the Portal.
  3. API Credentials authentication (Client ID & Secret Token): If you choose API Credentials as the authentication type, Tingee attaches the x-client-id header containing your Client ID so you can match it.

Headers sent​

These headers help you identify the request and verify the integrity of the received data.

HeaderDescription
Content-TypeAlways application/json.
x-request-idUnique identifier of each webhook request (UUID).
x-request-timestampTime the notification is sent (format: yyyyMMddHHmmssSSS, UTC+7).
x-signatureHMAC SHA512 signature used to verify the data (sent if a Secret Token is configured).
x-client-idYour Client ID (sent if API Credentials authentication is selected).

Body Parameter​

The details of the linked bank account are sent in the body.

FieldTypeDescription
merchantIdnumberPartner ID (Merchant ID).
typestringWebhook event type. Fixed value: bank-link.
merchantAccountNumberIdnumberID of the newly linked bank account on the Tingee system.
accountTypestringLinked account type (e.g. PersonalAccount, BusinessAccount).
vaAccountNumberstringVirtual account (VA) number or actual receiving account number that was created/linked.
bankNamestringCode / short name of the linked bank (e.g. BIDV, VCB, ACB...).
bankBinstringBIN of the linked bank (e.g. 970418 for BIDV).
shopIdnumberID of the shop attached to this bank account.
statusstringBank linking status. Value: success.
metadatastringAdditional data (metadata) you passed when creating the linking session (if any).

Sample Payload Body:​

{
"merchantId": 1001,
"type": "bank-link",
"merchantAccountNumberId": 456,
"accountType": "business-account",
"vaAccountNumber": "1234567890",
"bankName": "BIDV",
"bankBin": "970418",
"shopId": 12,
"status": "success",
"metadata": "custom_data_here"
}

Webhook authentication​

Depending on the Webhook authentication type you choose on the Portal, your server authenticates requests as follows:

1. No authentication​

The system sends no authentication information other than the default headers (x-request-id, x-request-timestamp).

2. Custom API key​

Tingee attaches a custom header (e.g. x-api-key) containing the secret key value you set on the Portal. You only need to check that this header matches.

3. API Credentials (Recommended)​

This is the most secure method, using the Client ID and Secret Token pair:

  • Headers sent: x-client-id, x-request-timestamp and the x-signature signature.
  • Match x-client-id, then recompute the x-signature signature with HMAC-SHA512 over the string ${x-request-timestamp}:${body} using the corresponding Secret Token as the key, and compare.

Signature verification code samples (API Credentials)​

import { createHmac } from 'crypto';

function verifyWebhook(headers: any, body: any, secretKey: string): boolean {
const signature = headers['x-signature'];
const timestamp = headers['x-request-timestamp'];

const message = `${timestamp}:${JSON.stringify(body)}`;
const computedSig = createHmac('sha512', secretKey).update(message).digest('hex');

return computedSig === signature;
}

Responding to the request​

After receiving and processing the webhook successfully (e.g. activating the linked bank account status in your system), your server must respond with HTTP 200 OK and the following JSON:

{
"code": "00",
"message": "Success"
}

⚠️ Important notes​

  • Scope configuration: To receive this webhook, your webhook endpoint on the Portal must be registered with the bank-link scope.
  • Latency: The webhook is sent immediately after the bank linking succeeds on the client.
  • Idempotency: Store merchantAccountNumberId to avoid duplicate processing if the system resends the webhook because of a temporary network issue.