Skip to main content
Version: 1.0

Refund transaction

Endpoint: /api/v1/transaction/refund

Method: POST

Header: How to generate JWT_TOKEN

{
"X-APPOTAPAY-AUTH": Bearer JWT_TOKEN,
"Content-Type": "application/json"
}

HTTP Request:

ParamsTypeRequiredDescription
refundIdStringPartner refund id (Unique)
appotapayTransIdStringAppotaPay transaction id
amountIntegerRefund amount
reasonStringRefund reason
signatureStringSignature check data
signature = HMAC_SHA256(data, secretKey)

data: amount={amount}&appotapayTransId={appotapayTransId}&reason={reason}&refundId={refundId}

HTTP Response:

ParamsData typeDescription
errorCodeIntegerError Code
messageStringError code detail
appotapayTransIdStringAppotaPay transaction id
refundIdStringAppotaPay refund id
refundOriginalIdStringPartner refund id
amountIntegerRefund amount
reasonStringRefund reason
statusStringStatus
transactionTsIntegerPayment time
signatureStringSignature check data
signature = HMAC_SHA256(data, secretKey)

data: amount={amount}&appotapayTransId={appotapayTransId}&errorCode={errorCode&reason={reason}&refundId={refundId}&refundOriginalId={refundOriginalId}&status={status}&transactionTs={transactionTs}

Transaction Status

StatusDescription
pendingThe transaction does not support automatic refund, AppotaPay will resolve manually in 1 working day. You could check status by calling API. Please contact Customer center if this status does not change after 1 day.
processingThe Refund status will be changed to "Processing" if that transaction supports automatic refund. You could check status by calling API. Please contact Customer center if this status does not change after 1 day.
successRefund successfully
errorRefund Fail

Example

Request

{
"refundId": "237052c887614019bedfd1851a287d9c",
"appotapayTransId": "AP211364332963",
"amount" : 10000,
"reason": "Test refund",
"signature": "20150ead77ee8ce0c6c161bf3fef42775423196e74268d26f2de077378007167"
}

Response

{
"errorCode": 0,
"message": "Thành công",
"data": {
"appotapayTransId": "AP211364332963",
"refundId": "57bd2769-3827-42a4-be47-aab498496a46",
"refundOriginalId": "237052c887614019bedfd1851a287d9c",
"amount": 10000,
"reason": "Test refund",
"status": "processing",
"transactionTs": 1638180805
},
"signature": "cf31a492c8639b213ea55782a8853792a676522cf26a111b6e0fe45249042c3b"
}

Error

{
"errorCode": int,
"message": error message
}