API Cancel cycle
Endpoint: /api/v1/subs/plans/{planId}/cycles/{cycleId}/cancel
Method: POST
Header Params
Param | Required | Type | Description | Note |
---|---|---|---|---|
X-APPOTAPAY-AUTH | required | String | How to generate JWT_TOKEN | |
Content-Type | required | String | Value: application/json | |
X-Request-ID | optional | String | UUIDv4 format. Request ID to check when a problem occurs | max:42 |
Language | optional | String | The value vi or en corresponding to the payment link will be 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": "JWT_TOKEN",
"Content-Type": "application/json",
"X-Request-ID": "Your_Unique_id",
"Language": "vi",
"X-Account-Ref-ID": "9723f73b-9295-4acb-884b-ab6310c2e653"
}
Response data
Success
Http Status Code
200
-OK
Success responses will contain a single Cycle object
Failure
HTTP Status Code !=
200
Error response params
Param | Required | Type | Description |
---|---|---|---|
errorCode | required | Integer | Error code |
message | required | String | Error message |
errors | optional | Array | Detailed error description |
errors.*.field | optional | String | Field data is corrupted |
errors.*.reason | optional | String | Description of the data field in error |
{
"errorCode": 3008,
"message": "Cycle not exist"
}
Common error code table
Full error code, please check this error code list
Error code | Description |
---|---|
0 | Success |
1 | Missing or Invalid Params |
11 | Partner is not found |
13 | Partner has been blocked |
14 | API Key is invalid |
15 | API Key is not activated or blocked |
92 | IP is not allowed to access |
99 | Undefined error, please contact AppotaPay for more detailed information |
401 | Unauthorized |
500 | Server error |
3005 | Plan not exist |
3006 | Plan was inactive before |
3008 | Cycle not exist |
3009 | Unable to cancel cycle. Only cycles in SCHEDULED or RETRYING status may be cancelled |