Endpoint #
DELETE /rtcl/v1/subscription/{id}
Description #
Cancel an active subscription using the configured payment gateway.
Authentication & Permission #
This endpoint requires: #
- REST API enabled in RTCL settings
- Valid authentication headers
- API Key
- Bearer JWT Token
- User must be:
- Logged in
Required Headers #
| Header | Value |
|---|---|
| Authorization | Bearer YOUR_JWT_TOKEN |
| X-API-KEY | YOUR_API_KEY |
| Content-Type | application/json |
cURL Examples #
curl -X DELETE "https://example.com/wp-json/rtcl/v1/subscription/12" \
-H "Content-Type: application/json" \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Request Parameters #
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | ✅ | Subscription ID |
Success Responses #
{
"id": 12,
"message": "Subscription cancel successfully."
}
Error Responses #
Not Logged In #
{
"code": "rtcl_rest_authentication_error",
"message": "You are not logged in.",
"data": {
"status": 404
}
}
Subscription Not Found #
{
"code": "rtcl_rest_authentication_error",
"message": "Subscription not found.",
"data": {
"status": 400
}
}
REST API Disabled #
{
"code": "DENIED_REST_API",
"message": "Denied api call",
"data": {
"status": 403
}
}
Invalid API Key / Token #
{
"code": "rtcl_rest_authentication_error",
"message": "Invalid API authentication credentials.",
"data": {
"status": 403
}
}
Gateway Cancel Failed #
{
"code": "rtcl_rest_authentication_error",
"message": "Unable to cancel subscription at gateway.",
"data": {
"status": 400
}
}