Read the subscription from Stripe now
Read the subscription from Stripe now (admin)
Every request sends Authorization: Bearer ...: the access token in local mode, an API key stk_... in cloud mode. Use Send to try it against your cloud instance with your API key.
Asks Stripe for the workspace's subscription and applies it, as its webhook would, then
answers like GET /v1/billing. The dashboard calls it when it comes back from Checkout, so a
paid workspace opens even when the webhook is late or lost; a background job does the same
every 10 minutes for workspaces whose plan may be out of date.
AuthorizationBearer <token>API key (stk_...), or in the Community Edition the access token (stk_local_...)
Billing status after the sync
application/json- response
enabled*booleanBilling is configured on this instance
plan*stringstarter, plus, pro or business (cloud; an operator may also set a plan of their own), unlocked (Community Edition)
subscription_status*|Stripe's status (active, trialing, past_due, canceled, unpaid, incomplete); null when never subscribed
plan_expires_at*|End of the trial or paid period, plus a 3-day payment grace when Stripe bills it (null = no end)
trial_ends_at*|When the free trial ends (Stripe's trial_end, or the server-side trial's end without billing); null when not in a trial
date-timesuspended*booleanThe period ended unpaid; the workspace is read-only
has_customer*booleanA Stripe customer exists (the portal is available)
seats*integerPeople billed: every workspace member, whatever the role (plans are priced per user). Open invitations are billed once accepted; the subscription's quantity follows the members
trial*stringWhether choosing Starter now starts its 7-day trial (card required): available; used (this workspace had a subscription before); other_workspace (another workspace of the account is in its trial, so this one is charged today); none (billing off, or the workspace already pays). Each workspace gets the trial once, one workspace of an account at a time
"available""used""other_workspace""none"curl -X POST 'https://staqly.example.com/v1/billing/sync'{ "enabled": true, "plan": "plus", "subscription_status": "active", "plan_expires_at": "string", "trial_ends_at": "2019-08-24T14:15:22Z", "suspended": true, "has_customer": true, "seats": 3, "trial": "available"}