Preview the cost and consequences of a plan change.
POST
/billing/change-plan/preview
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 ” Media type application/json
object
product
required
string
pack_id
required
string format: uuid
billing_interval
required
string
Responses
Section titled “ Responses ”Proration preview and downgrade warnings
Media type application/json
object
amount_due_now_cents
required
What Stripe will charge immediately. Zero under the current proration
policy for an existing subscription: create_prorations puts the
difference on the NEXT invoice rather than charging now.
integer format: int64
next_invoice_total_cents
required
integer format: int64
currency
required
string
lines
required
Array<object>
object
description
required
string
amount_cents
required
integer format: int64
warnings
required
Array<object>
Something the customer loses by making this change.
object
kind
required
Stable machine key, so the client can style or order without parsing the message.
string
message
required
string
Example generated
{ "amount_due_now_cents": 1, "next_invoice_total_cents": 1, "currency": "example", "lines": [ { "description": "example", "amount_cents": 1 } ], "warnings": [ { "kind": "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