Skip to main content

Unlink an account

Use this API to unlink an account from the Direct Debit service.

If the customer's account requires verification before unlinking, Tingee returns a link to a web page where the customer enters an OTP.

DELETE
URLhttps://open-api.tingee.vn/v1/direct-debit/delete-subscription

Create a request to unlink a bank account. The unlinking either completes immediately or returns an OTP verification URL.

Header Request​

HeaderRequiredDescription
Content-Type✓application/json
x-client-id✓Partner identifier issued by TINGEE.
x-signature✓HMAC SHA512 authentication signature. See How to generate the signature.
x-request-timestamp✓Time the request is sent (format: yyyyMMddHHmmssSSS, UTC+7)

Body Parameter​

FieldTypeRequiredDescription
requestIdstring✓ID of the request to Tingee (UUID).
subscriptionIdstring✓ID of the linked bank account (UUID). The account must be active.
tokenRefstring✓Reference code of the customer's account.
returnUrlstring✓URL to redirect back to the partner after completion.

Code samples​

curl --location --request DELETE 'https://open-api.tingee.vn/v1/direct-debit/delete-subscription' \
--header 'accept: application/json' \
--header 'x-client-id: YOUR_CLIENT_ID' \
--header 'x-request-timestamp: 20240509154004003' \
--header 'x-signature: YOUR_SIGNATURE' \
--header 'Content-Type: application/json' \
--data '{
"requestId": "550760e0-1cc2-44b9-85ba-eb318e228b4f",
"subscriptionId": "89188e53-eba3-40fa-9323-04422ced3637",
"tokenRef": "TKN-12345678",
"returnUrl": "https://example.com"
}'

Sample Response​

When the unlinking completes immediately:

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

When the customer must verify with an OTP:

{
"code": "00",
"message": "Success",
"data": {
"code": "01",
"confirmUrl": "https://direct-debit.tingee.vn/confirm-delete-subscription?requestId=550760e0-1cc2-44b9-85ba-eb318e228b4f&clientId=...&subscriptionId=89188e53-eba3-40fa-9323-04422ced3637&signature=...&expirationTime=20260115124049"
}
}
FieldTypeDescription
codestringResponse code (00 means success).
messagestringDetailed message.
data.codestringUnlinking result:
- 00: The account was unlinked successfully.
- 01: The customer must verify with an OTP via confirmUrl.
data.confirmUrlstringURL of the OTP verification page to redirect the customer to (only present when data.code = 01).
The URL is valid for 30 minutes.

Common error codes​

CodeDescriptionHow to handle
1067No active subscription to unlink was foundCheck subscriptionId and tokenRef; the subscription may have been unlinked already — use Query account status to confirm.
1068, 1009Direct Debit is not configured for the Merchant, or the payment platform is not supportedContact TINGEE to check the Merchant's Direct Debit configuration.
90, 91, 92, 97Request authentication error (timestamp, client-id, signature)See System error codes.
OthersOther errorsSee Error codes.