Skip to main content

Refund a transaction

Use this API to refund a transaction paid via the Direct Debit service.

The customer can request a full or partial refund of the transaction amount.

POST
URLhttps://open-api.tingee.vn/v1/direct-debit/refund

Request a refund for a successful transaction. Supports partial or full refunds.

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
subscriptionIdstring✓ID of the linked bank account (UUID).
tokenRefstring✓Reference code of the customer's account.
transactionIdstring✓ID of the transaction to refund (the RequestId of the payment order).
amountnumber✓Amount to refund.

Code samples​

curl --location --request POST 'https://open-api.tingee.vn/v1/direct-debit/refund' \
--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 '{
"subscriptionId": "89188e53-eba3-40fa-9323-04422ced3637",
"tokenRef": "TKN-12345678",
"transactionId": "550760e0-1cc2-44b9-85ba-eb318e228b4f",
"amount": 50000
}'

Sample Response​

{
"code": "00",
"message": "Success",
"data": {
"status": "success",
"transactionId": "550760e0-1cc2-44b9-85ba-eb318e228b4f",
"refundAmount": 50000
}
}
FieldTypeDescription
codestringResponse code (00 means success).
messagestringDetailed message.
data.statusstringRefund status: success, failure, Pending.
data.transactionIdstringID of the refunded debit transaction.
data.refundAmountnumberRefunded amount.

Common error codes​

CodeDescriptionHow to handle
1030No matching successful payment transaction was foundCheck transactionId, subscriptionId and tokenRef; you can only refund transactions that were paid successfully.
1125The refund amount exceeds the remaining refundable amountLower amount so it does not exceed the transaction amount minus the total already refunded.
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.