MagicWP Docs
Subscriptions

Preview subscription price before purchase

POST
/v1/subscriptions/preview

Permission: billing.manage

Authorization

apiToken
headerAuthorizationBearer <token>

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

Request Body

application/json
  1. body
plan_id*Plan Id
Formatuuid
billing_cycle?Billing Cycle
Default"monthly"
coupon_code?string|null
addons?array<>

Optional addons to include in the initial order. Each item: {addon_id, quantity}.

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/preview" \  -H "Content-Type: application/json" \  -d '{    "plan_id": "00713021-9aea-41da-9a88-87760c08fa72"  }'
{  "message": "string",  "status_code": 0,  "timestamp": "2019-08-24T14:15:22Z",  "meta": {},  "success": true,  "data": {    "plan": {      "name": "string",      "sites": 0,      "storage": 0    },    "pricing": {      "billing_cycle": "string",      "cycle_days": 0,      "plan_price": "string",      "discount": "string",      "addons_subtotal": "string",      "final_price": "string"    },    "addons": [      {        "addon_id": "5ff038d0-7cf6-40b4-8583-90cbc723fc2b",        "name": "string",        "resource_type": "none",        "resource_amount": 0,        "quantity": 0,        "unit_price": "string",        "line_total": "string"      }    ],    "coupon": null  }}