Change subscription plan/quantity for a product.
POST
/billing/change-plan
const url = 'https://api.siteqwality.com/billing/change-plan';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","idempotency_key":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
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 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "product": "uptime", "pack_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "billing_interval": "example", "idempotency_key": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'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
idempotency_key
Client-generated, stable across retries of ONE confirm attempt, so a double-click is one Stripe mutation.
Optional purely for backwards compatibility: a cached frontend bundle predating this field must keep working. A request without one gets no replay protection beyond the per-account advisory lock, which serializes concurrent requests but cannot recognise a client retry after a timeout.
string | null format: uuid
Responses
Section titled “ Responses ”Plan changed
Media type application/json
object
success
required
Retained so an already-cached frontend bundle keeps working.
boolean
status
required
"updated" when the change is live, "requires_payment" when the
customer must confirm a payment before it takes effect.
string
client_secret
string | null
stripe_subscription_id
string | null
Example generated
{ "success": true, "status": "example", "client_secret": "example", "stripe_subscription_id": "example"}Invalid billing interval
Missing or invalid authentication
Caller is not a super admin
Internal server error