Preview the cost and consequences of a plan change.
const url = 'https://api.siteqwality.com/billing/change-plan/preview';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"product":"uptime","pack_id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","billing_interval":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.siteqwality.com/billing/change-plan/preview \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "product": "uptime", "pack_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "billing_interval": "example" }'Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
Responses
Section titled “ Responses ”Proration preview and downgrade warnings
object
One of new, upgrade, downgrade, cancel_scheduled_change,
none, blocked. See [change_type].
When the change takes effect. Absent for changes applied immediately.
What Stripe charges today. For an upgrade this is the prorated difference (Stripe’s own preview of the immediate invoice); for a downgrade it is always zero.
For an upgrade or a first purchase: the total of the invoice raised
today. For a downgrade: what this product costs per billing period
from effective_at (zero when moving to free, or when a complimentary
plan covers it).
object
Something the customer loses by making this change.
object
Stable machine key, so the client can style or order without parsing the message.
Why a blocked change cannot be made yet.
Example generated
{ "change_type": "example", "effective_at": "2026-04-15T12:00:00Z", "amount_due_now_cents": 1, "next_invoice_total_cents": 1, "currency": "example", "lines": [ { "description": "example", "amount_cents": 1 } ], "warnings": [ { "kind": "example", "message": "example" } ], "message": "example"}Unknown pack, inactive pack, or an add-on pack
Missing or invalid authentication
Caller is not a super admin
Internal server error