MagicWP Docs
Subscriptions

Preview addon cancellation

POST
/v1/subscriptions/{sub_id}/addons/{addon_record_id}/cancel/preview

Permission: billing.manage

Authorization

apiToken
headerAuthorizationBearer <token>

An API token (mwp_…) from Settings → API tokens. Only accepted on this host.

Path Parameters

sub_id*Sub Id
Formatuuid
addon_record_id*Addon Record Id
Formatuuid

Request Body

application/json
  1. body
quantity*Quantity

Number of units to cancel

Range1 <= value

Response Body

Successful Response

application/json
  1. response
success*boolean
data*

The result; on an error, details such as code and permission.

message*string
status_code*integer
timestamp*string
Formatdate-time
meta?|null
curl -X POST "https://example.com/v1/subscriptions/497f6eca-6276-4993-bfeb-53cbbbba6f08/addons/497f6eca-6276-4993-bfeb-53cbbbba6f08/cancel/preview" \  -H "Content-Type: application/json" \  -d '{    "quantity": 1  }'
{  "message": "string",  "status_code": 0,  "timestamp": "2019-08-24T14:15:22Z",  "meta": {},  "success": true,  "data": {    "addon_name": "string",    "current_quantity": 0,    "cancel_quantity": 0,    "remaining_quantity": 0,    "resource_type": "none",    "resource_removed": 0,    "capacity_after_cancel": 0,    "current_usage": 0,    "can_cancel": true,    "reason": null  }}