Cancellation Payment API
EndPoint
POST /api/v2/ewallet/transaction/cancel
Header Params
| Parameters | Requirement | Data type | Description | Note |
|---|---|---|---|---|
| X-APPOTAPAY-AUTH | required | String | To create a JWT_TOKEN | |
| Content-Type | required | String | Value: application/json | |
| X-Request-ID | optional | String | Format is UUIDv4. Request ID for troubleshooting purposes | max:42 |
| X-Language | optional | String | Value vi or en The value corresponding to the payment link can be in Vietnamese or English (default: vi) | in:vi,en |
| X-Account-Ref-ID | optional | String | 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": "Bearer JWT_TOKEN",
"Content-Type": "application/json",
"X-Request-ID": "Your_Unique_id",
"X-Language": "vi",
"X-Account-Ref-ID": "9723f73b-9295-4acb-884b-ab6310c2e653"
}
Request Params
| Parameters | Requirement | Data type | Description | Note |
|---|---|---|---|---|
| orderId | required | String | Partner's order code | |
| signature | required | String | Data verification signature | signature = hash_hmac('sha256', 'orderId={orderId}&verificationCode={verificationCode}' , SECRET_KEY) |
Example Request
{
"orderId": "241698338917842945",
"signature": "8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92"
}
Response Params
Success
Http Status Code
200-OK
| Parameters | Data type | Description |
|---|---|---|
| transactionId | String | TransactionId from AppotaPay |
| orderId | Integer | Partner's orderId |
Error
HTTP Status Code !=
200
| Parameters | Data type | Description |
|---|---|---|
| errorCode | Integer | Error code |
| message | String | Description about the error |
Common error code table
The full error code is available, please see here
| Error code | Description |
|---|---|
| 1 | Request information missing or invalid |
| 2 | The signature parameter is incorrect. |
| 21 | The OTP code is incorrect. |
| 22 | The OTP code has expired, please perform the transaction again. |
| 30 | The order code is duplicated, please perform the transaction again. |
| 32 | The payment amount is invalid. |
| 33 | Transaction failed. |
| 34 | The transaction is being processed, please check again later. |
| 36 | The transaction does not exist. |
| 39 | The user has entered the OTP code incorrectly too many times. |
| 40 | The transaction has been refunded. |
| 41 | The transaction was successful previously. |
| 42 | The request to obtain the OTP code has exceeded the specified number of attempts |
| 52 | Invalid payment method |
| 65 | Invalid account |
| 70 | You have exceeded the daily transaction limit, please try again later. |
| 75 | Insufficient funds for payment |
| 84 | The transaction amount exceeds the allowed limit, please contact support for assistance. |
| 93 | The transaction refund time has elapsed. |
| 94 | The system is under maintenance, please try again later. |
| 99 | Unknown error, please check the transaction again later |
| 106 | The transaction does not support partial refunds. |
| 125 | Unable to refund the transaction as the refund period has expired |
| 162 | You have exceeded the monthly transaction limit, please try again later. |
| 401 | Authentication error |
| 500 | The system encountered an error, please try again later. |