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-APPOTAPAY-AUTH": "JWT_TOKEN",
"Content-Type": "application/json",
"X-Request-ID": "Your_Unique_id",
"X-Language": "vi"
}

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

Response

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"
}
]
}

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