Change the workspace subscription plan
Applies a previewed plan change and returns the updated subscription. Send the preview's `timing` (`now` charges the prorated difference immediately, `period_end` schedules the change for the renewal), `dueNowCents` and `recurringAmountCents` as the customer confirmed them; the server re-quotes and rejects with a conflict when the timing or recurring amount differs or the charge due now is higher. Requires a Clerk session with a synced profile and the `billing:manage` workspace permission. Send an `Idempotency-Key` header to make retries safe.
apiKeyAuthorizationBearer <snoze_sk_…>Workspace API key created in Workspace settings → API keys. Scopes on the key bound what it can read and write.
workspaceId*stringapplication/json- body
plan*string"free""team""business""enterprise"interval*string"month""year"timing*string"now""period_end"dueNowCents*numberrecurringAmountCents*numberSuccess
application/json- response
data*curl -X POST 'https://api.snoze.dev/v1/workspaces/string/billing/change-plan' \ -H 'Content-Type: application/json' \ -d '{ "plan": "free", "interval": "month", "timing": "now", "dueNowCents": 0, "recurringAmountCents": 0}'{ "data": { "workspaceId": "string", "plan": "free", "status": "none", "polarCustomerId": "string", "polarSubscriptionId": "string", "polarProductId": "string", "cancelAtPeriodEnd": true, "currentPeriodStart": "string", "recurringInterval": "month", "currentPeriodEnd": "string", "scheduledChange": { "plan": "free", "interval": "month", "effectiveAt": "string" } }}Preview a subscription plan change
Quotes moving the existing subscription to the requested plan and billing interval without changing anything. A more expensive plan on the same interval applies now and returns the prorated charge (per-second, before tax and discounts); cheaper plans and interval switches are scheduled for the renewal. Requires a Clerk session with a synced profile and the `billing:manage` workspace permission; the caller's pricing-experiment variant is applied.
Cancel a scheduled plan change
Keeps the current plan by dropping a downgrade or interval switch scheduled for the renewal, then returns the subscription. Succeeds without changes when nothing is scheduled; a workspace without a subscription is a conflict. Requires a Clerk session with a synced profile and the `billing:manage` workspace permission. Send an `Idempotency-Key` header to make retries safe.