MagicWP Docs
Subscriptions

Preview upgrade pricing before confirming

POST
/v1/subscriptions/{sub_id}/upgrade/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

Request Body

application/json
  1. body
new_plan_id*New Plan Id
Formatuuid

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/upgrade/preview" \  -H "Content-Type: application/json" \  -d '{    "new_plan_id": "2d17ed43-dab8-4ccb-b506-9f23ea4d4c78"  }'
{  "message": "string",  "status_code": 0,  "timestamp": "2019-08-24T14:15:22Z",  "meta": {},  "success": true,  "data": {    "current_plan": "string",    "new_plan": "string",    "billing_cycle": "string",    "current_price": "string",    "new_price": "string",    "prorated_amount": "string",    "remaining_days": 0,    "cycle_days": 0,    "current_period_end": null,    "new_sites": 0,    "new_storage": 0  }}