Skip to main content
Version: Lastest

Refund callback

After requesting a refund, the AppotaPay system calls back the results to the partner's system

Note
  • Using the signature parameter to check the integrity of the received data, the partner creates a signature from the data received by AppotaPay and then compares it with the signature parameter sent by AppotaPay.

Web callback

AppotaPay will send the results via the API URL of the partner sending AppotaPay for configuration, the partner server checks the data integrity through the signature parameter then updates the status of refund.

{
"Content-Type": "applicaton/json"
}

Request params

Method: POST

ParamTypeDescription
dataStringTransaction information is encode with base64encode & json_encode format
signatureStringSignature to check data

signature = HMAC_SHA256(data, secretKey)

timeStringResponse time

Decode

  1. Partners use the Base64Decode function to decode data in string form.
  2. Use the JSON_Decode function to decode the data a second time in json form.
Tham sốYêu cầuKiểu dữ liệuMô tả
eventRequiredString

Event:

- refund.succeeded: Refund transaction successful

- refund.failed: Refund transaction failed

dataRequiredObjectData
data.refundIdRequiredStringRefund transaction code on AppotaPay's side
data.attemptIdRequiredStringIdentifier for the corresponding successful payment attempt of cycle to be refunded. It's returned in cycle callback
data.refundRefIdRequiredStringPartner's refund transaction reference code
data.amountRequiredIntegerThe refunded amount
data.currencyRequiredStringCurrency unit
data.reasonRequiredStringReason for refund

- FRAUDULENT: Fraudulent

- DUPLICATE: Duplicate

- REQUESTED_BY_CUSTOMER: Requested by customer

- CANCELLATION: Cancellation

- OTHER: Others

data.statusRequiredStringRefund status
data.createdAtRequiredStringTransaction execution time (ISO 8601)
data.updatedAtRequiredStringTransaction update time (ISO 8601)

Response format

  • The partner needs to respond to AppotaPay to confirm that they have received the result
  • The response is considered successful when HTTP code = 200