Nhảy tới nội dung
Phiên bản: Lastest

Reverse Authorization

Bạn có thể sử dụng API để huỷ uỷ quyền, với các giao dịch có trạng thái AUTHORIZED và chưa thực hiện capture.

Thời gian tối đa để thực hiện huỷ uỷ quyền là T+7 từ thời điểm uỷ quyền (authorization) thành công. Nếu giao dịch đó sau 7 ngày không được capture hoặc reversal, chúng tôi sẽ thực hiện huỷ uỷ quyền.

EndPoint

POST /credit-card/reversal

Header Params

{
Content-Type: "application/json",
X-APPOTAPAY-AUTH: "your_auth_token",
Language: "vi", // option vi | en, default vi
X-Request-ID: "your_request_id" // optional - easy to debug request
}

Request Params

Tham sốYêu cầuKiểu dữ liệuMô tảLưu ý
authorizationIdrequiredStringMã giao dịch khi thực hiện authorization
merchantRefIdrequiredStringMã tham chiếu, định danh cho yêu cầu khởi tạo từ merchant

Example Request

{
"merchantRefId": "MufRIHgy13",
"authorizationId": "01HJAFB1GMVTC74SN2FMA5PG5X"
}

Response Params

{
"reversalId": "01HQHS26CFK4CEGE2QW0PATV5B",
"authorizationId": "01HQHRZQNJE4BWRB8P9P5Z8BE7",
"merchantRefId": "MufRIHgy11",
"amount": 1000000,
"currency": "VND",
"status": "success",
"createdAt": "2024-02-26T10:59:13+07:00",
"updatedAt": "2024-02-26T10:59:15+07:00",
"reversedAt": "2024-02-26T10:59:14+07:00"
}

Thành công

Http Status Code 200 - OK

Tham sốKiểu dữ liệuMô tả
merchantRefIdStringMã tham chiếu, merchant gửi trong request
authorizationIdStringMã giao dịch khi thực hiện authorization
reversalIdStringMã giao dịch huỷ uỷ quyền, AppotaPay tạo và trả cho merchant
amountNumberSố tiền đã huỷ uỷ quyền
statusStringTrạng thái huỷ uỷ quyền
success: yêu cầu huỷ uỷ quyền thành công
error: huỷ uỷ quyền không thành công
pending: yêu cầu huỷ uỷ quyền đang được xử lý
errorInformationObjectLý do thất bại
errorInformation.errorCodeIntegerMã lỗi thất bại, xem chi tiết tại error code
errorInformation.messageStringMô tả lý do thất bại
errorInformation.detailsArray or ObjectChi tiết thông tin thất bại
errorInformation.details.fieldStringTrường gây ra lỗi
errorInformation.details.reasonStringLý do
createdAtStringThời gian khởi tạo giao dịch theo chuẩn RFC-3339, time zone UTC+7
updatedAtStringThời gian cập nhật giao dịch gần nhất theo chuẩn RFC-3339, time zone UTC+7
reversedAtStringThời gian thực hiện huỷ uỷ quyền theo chuẩn RFC-3339, time zone UTC+7

Thất bại

HTTP Status Code != 200