Skip to main content
Version: Lastest

API Refund

The partner can make refunds for successfully paid cycles within 180 days from the date of successful transaction. Partners can submit a request for total or partial refund. With partial refunds, the partner can make multiple requests provided that the total partial refund is less than or equal to the amount paid.

Endpoint: /api/v1/subs/refunds

Method: POST

Header Params

ParamRequiredTypeDescriptionNote
X-APPOTAPAY-AUTHrequiredString How to generate JWT_TOKEN
Content-TyperequiredStringValue: application/json
X-Request-IDoptionalStringUUIDv4 format. Request ID to check when a problem occursmax:42
LanguageoptionalStringThe value vi or en corresponding to the payment link will be 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",
"Language": "vi",
"X-Account-Ref-ID": "9723f73b-9295-4acb-884b-ab6310c2e653"
}

Request params

ParamRequiredTypeDescriptionNote
refundRefIdRequiredStringPartner's refund transaction reference codemin:1, max: 50, format: alphanumeric
attemptIdRequiredStringIdentifier for the corresponding successful payment attempt of cycle to be refunded. It's returned in cycle callback
amountRequiredIntegerThe refunded amount
currencyRequiredStringCurrency unitin: VND
reasonRequiredStringReason for refund

- FRAUDULENT: Fraudulent

- DUPLICATE: Duplicate

- REQUESTED_BY_CUSTOMER: Requested by customer

- CANCELLATION: Cancellation

- OTHER: Others

Example Request

{
"refundRefId": "ASKJLKALK20398141",
"attemptId": "01HY2TRW9EBTPWGPJDGPD9JMA9",
"reason": "REQUESTED_BY_CUSTOMER",
"currency": "VND",
"amount": 10000
}

Response data

Success

Http Status Code 200 - OK

Success responses will contain a single Refund object

Failure

HTTP Status Code != 200

Error response params

ParamRequiredTypeDescription
errorCoderequiredIntegerError code
messagerequiredStringError message
errorsoptionalArrayDetailed error description
errors.*.fieldoptionalStringField data is corrupted
errors.*.reasonoptionalStringDescription of the data field in error
{
"errorCode": 3002,
"message": "Duplicate reference code of partner, please try again"
}

Common error code table

Full error code, please check this error code list

Error codeDescription
0Success
1Missing or Invalid Params
11Partner is not found
13Partner has been blocked
14API Key is invalid
15API Key is not activated or blocked
92IP is not allowed to access
99Undefined error, please contact AppotaPay for more detailed information
110The total refund amount exceeds the transaction amount
125Refund cannot be processed due to payment exceeding validity period
401Unauthorized
500Server error
3002Duplicate reference code of partner, please try again
3057Cycle attempt id is invalid