Skip to main content
Version: Lastest

Refund transaction

Endpoint: POST /api/v2/transaction/refund

Header Params

ParamsRequirementData typeDescriptionNote
X-APPOTAPAY-AUTHrequiredStringTo create a JWT_TOKEN
Content-TyperequiredStringValue: application/json
X-Request-IDoptionalStringFormat is UUIDv4. Request ID for troubleshooting purposesmax:40
X-LanguageoptionalStringValue vi or en,The value corresponding to the payment link can be in Vietnamese or English (default: vi)

in:vi,en

X-Account-Ref-IDoptionalString

Iidentifier of the sub account provided by AppotaPay.

Mandatory be passed over when processing payment for transactions of owner-type sub account

{
"X-APPOTAPAY-AUTH": "JWT_TOKEN",
"Content-Type": "application/json",
"X-Request-ID": "Your_Unique_id",
"X-Language": "vi",
"X-Account-Ref-ID": "9723f73b-9295-4acb-884b-ab6310c2e653"
}

Params

ParamsRequirementData typeDescriptionFormat
partnerRefIdrequiredStringThe partner's transaction reference code for AppotaPay (must be unique)max:50,alphanumeric
transactionIdrequiredStringThe payment transaction code returned from AppotaPayalphanumeric
amountrequiredIntegerThe refunded amountmin:1000
currencyrequiredStringCurrency unit (accepts VND)in:VND
reasonrequiredStringReason for refundmax:100,alphanumeric

Response

ParamsRequirementData typeDescription
refundIdrequiredStringRefund transaction code on AppotaPay's side
transactionIdrequiredStringPayment transaction code on AppotaPay's side
partnerRefIdrequiredStringPartner's refund transaction reference code
amountrequiredIntegerThe refunded amount
currencyrequiredStringCurrency unit (accepts VND)
reasonrequiredStringReason for refund
statusrequiredStringRefund status
createdAtrequiredStringTransaction execution time. (in RFC-3339 standard format)
refundedAtoptionalStringRefund execution time if the refund transaction is successful. (in RFC-3339 standard format)

Refund transaction status code table

StatusDescription
pendingPayment transactions do not support automatic refunds. AppotaPay will receive and manually process refund requests within 1 day. Partners can call the API to check the transaction status. If after 1 day the transaction has not changed to its final status (success, error), please contact customer support for assistance
processingPayment transactions support automatic refunds. AppotaPay receives and is processing the refund request. Partners can call the API to check the transaction status. If after 1 day the transaction has not changed to its final status (success, error), please contact customer support for assistance.
successRefund transaction successful.
errorRefund transaction failed.

Example

Request

{
"partnerRefId": "5f61cf4f41e2b",
"transactionId": "AP241453209745",
"amount": 10000,
"currency": "VND",
"reason": "test refund"
}

Response

{
"refundId": "f28a4ac3-e407-45f1-902b-bc05c6c50dfa",
"transactionId": "AP241453209745",
"partnerRefId": "5f61cf4f41e2b",
"amount": 10000,
"currency": "VND",
"reason": "test refund",
"status": "success",
"createdAt": "2024-09-11T11:21:17+07:00",
"refundedAt": ""
}

Error

HTTP Status Code != 200 With the returned errorCode, please refer to the error code table here

Error response params

ParamsRequirementData typeDescription
errorCoderequiredIntegererror code
messagerequiredStringError description
errorsoptionalArray of ObjectDetailed error description of each field if available
errors.fieldrequiredObjectField with error
errors.reasonrequiredObjectDescription of the field with error
{
"errorCode": 1,
"message": "Invalid Params",
"errors": [
{
"field": "transaction.amount",
"reason": "Field amount is required"
},
{
"field": "transaction.currency",
"reason": "Field currency is required"
}
]
}

List of suppliers supporting refunds

Vendor codeRefund support timeAuto via APIPartial refundRefund many timesFull refundTime the user receives money
Napas1 yearYesYesYes5 - 7 working days
Vpbank Visa - Mastercard6 monthsYesYesYes10 - 15 working days
VnptPayYesNoNoYes
ONEPAYNoNo
EBILLNoNo
SHOPEE90 daysYesYesYesYesReal time
MOCA1 monthYesNoNoYesReal time
APPOTA WALLETYesNoNoYesReal time
MOMOYesYesYesYesReal time
ViettelPayNoNoNoNo
ZaloPay180 daysYesYesYesYesReal time
VANoNoNo
VNpayYesYesNo
CybersourceNoNoNoNoNoNo

Error code table

Error codeDescription
1Missing or invalid request information
31Duplicated transaction code
36The transaction does not exist
129Please wait {times} to create a new refund request.
135The transaction does not support refunds
401Unauthorized
500The system encountered an error, please try again later