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:
Params | Type | Required | Description |
---|---|---|---|
refundId | String | √ | Partner refund id (Unique) |
appotapayTransId | String | √ | AppotaPay transaction id |
amount | Integer | √ | Refund amount |
reason | String | √ | Refund reason |
signature | String | √ | Signature check data signature = HMAC_SHA256(data, secretKey) data: amount={amount}&appotapayTransId={appotapayTransId}&reason={reason}&refundId={refundId} |
HTTP Response:
Params | Data type | Description |
---|---|---|
errorCode | Integer | Error Code |
message | String | Error code detail |
appotapayTransId | String | AppotaPay transaction id |
refundId | String | AppotaPay refund id |
refundOriginalId | String | Partner refund id |
amount | Integer | Refund amount |
reason | String | Refund reason |
status | String | Status |
transactionTs | Integer | Payment time |
signature | String | Signature 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
Status | Description |
---|---|
pending | The 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. |
processing | The 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. |
success | Refund successfully |
error | Refund 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
}
List of suppliers supporting refunds
Vendor code | Refund support time | Auto via API | Partial refund | Refund many times | Full refund | Time the user receives money |
---|---|---|---|---|---|---|
Napas | 1 year | Yes | Yes | Yes | 5 - 7 working days | |
Vpbank Visa - Mastercard | 6 months | Yes | Yes | Yes | 10 - 15 working days | |
VnptPay | Yes | No | No | Yes | ||
ONEPAY | No | No | ||||
EBILL | No | No | ||||
SHOPEE | 90 days | Yes | Yes | Yes | Yes | Real time |
MOCA | 1 month | Yes | No | No | Yes | Real time |
APPOTA WALLET | Yes | No | No | Yes | Real time | |
MOMO | Yes | Yes | Yes | Yes | Real time | |
ViettelPay | No | No | No | No | ||
ZaloPay | 180 days | Yes | Yes | Yes | Yes | Real time |
VA | No | No | No | |||
VNpay | Yes | Yes | No | |||
Cybersource | No | No | No | No | No | No |