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
| Language | Package | Requirements |
|---|---|---|
| Node.js / TypeScript | @tingee/sdk-node | Node.js ≥ 18 |
| Java | vn.tingee:sdk-java | Java ≥ 17 |
| C# / .NET | Tingee.Sdk | .NET 8+ |
| PHP | tingee/sdk-php | PHP ≥ 8.0 |
SDK vs. calling the API manually
| Calling the API manually | Using the SDK | |
|---|---|---|
| Authentication | Write HMAC-SHA512 yourself, format the timestamp, set headers | ✓ Automatic |
| Serialization | Serialize/deserialize JSON yourself | ✓ Automatic, with typed responses |
| Maintenance | Must be updated whenever the API changes | ✓ Update the SDK version |
| Amount of code | ~30 lines per API call | ✓ 1–3 lines |
| Type safety | None | ✓ 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:
| Group | Description | Reference docs |
|---|---|---|
bank | Virtual accounts (VA), QR codes, balance notifications | Banking · QR Code |
merchant | Merchant management and configuration | Master Merchant |
shop | Shop management | Master Merchant |
device | TingeeBox devices, reading the security code, displaying QR codes | TingeeBox |
deepLink | Create payment Deep Links | Deep Link |
directDebit | Registration, debiting, refunds | Direct Debit |
transaction | Transaction history lookup | Banking |
accountNumber | Account number list | Banking |
user | Referral code verification | — |
References
You can find the SDK source code here: github.com/tingeehub