Skip to main content

SDK libraries

Tingee SDK is the official set of libraries that helps developers integrate the Tingee Open API into their applications quickly and securely, without manually handling technical details such as generating the HMAC-SHA512 signature, managing timestamps or setting HTTP headers.

⚡

Fast integration

Install the SDK with a single command. Call an API with one line of code instead of dozens of lines of HTTP + signature handling.

🔐

Automatic authentication

The SDK automatically generates the HMAC-SHA512 signature and sets the x-signature and x-request-timestamp headers on every request.

🛡️

Type-safe

Full support for TypeScript types, Java DTOs, C# models and PHP typed classes — fewer runtime errors.


Supported languages​

LanguagePackageRequirements
Node.js / TypeScript@tingee/sdk-nodeNode.js ≥ 18
Javavn.tingee:sdk-javaJava ≥ 17
C# / .NETTingee.Sdk.NET 8+
PHPtingee/sdk-phpPHP ≥ 8.0

SDK vs. calling the API manually​

Calling the API manuallyUsing the SDK
AuthenticationWrite HMAC-SHA512 yourself, format the timestamp, set headers✓ Automatic
SerializationSerialize/deserialize JSON yourself✓ Automatic, with typed responses
MaintenanceMust be updated whenever the API changes✓ Update the SDK version
Amount of code~30 lines per API call✓ 1–3 lines
Type safetyNone✓ Full type support

Example: Create a virtual account​

✕ Calling the API manually (Node.js)

import axios from 'axios';
import { createHmac } from 'crypto';
import { format } from 'date-fns';

const body = {
accountType: 'personal-account',
bankBin: '970418',
accountNumber: '0935926988',
accountName: 'NGUYEN THI HUYEN',
identity: '040191014068',
mobile: '0123456789',
};

const timestamp = format(new Date(), 'yyyyMMddHHmmssSSS');
const message = `${timestamp}:${JSON.stringify(body)}`;
const signature = createHmac('sha512', 'YOUR_SECRET_KEY').update(message).digest('hex');

const res = await axios.post('https://open-api.tingee.vn/v1/create-va', body, {
headers: {
'x-signature': signature,
'x-request-timestamp': timestamp,
'x-client-id': 'YOUR_CLIENT_ID',
'Content-Type': 'application/json',
},
});

✓ Using the SDK

import { TingeeClient, isSuccessResponse } from '@tingee/sdk-node';

const client = new TingeeClient({
secretKey: process.env.TINGEE_SECRET_KEY!,
clientId: process.env.TINGEE_CLIENT_ID!,
});

const result = await client.bank.createVa({
accountType: 'personal-account',
bankBin: '970418',
accountNumber: '0935926988',
accountName: 'NGUYEN THI HUYEN',
identity: '040191014068',
mobile: '0123456789',
});

if (isSuccessResponse(result)) {
console.log('confirmId:', result.data.confirmId);
}

API groups​

The SDK organizes methods into feature groups, making them easy to discover and use:

GroupDescriptionReference docs
bankVirtual accounts (VA), QR codes, balance notificationsBanking · QR Code
merchantMerchant management and configurationMaster Merchant
shopShop managementMaster Merchant
deviceTingeeBox devices, reading the security code, displaying QR codesTingeeBox
deepLinkCreate payment Deep LinksDeep Link
directDebitRegistration, debiting, refundsDirect Debit
transactionTransaction history lookupBanking
accountNumberAccount number listBanking
userReferral code verification—

References​

You can find the SDK source code here: github.com/tingeehub


Next steps​