staqlydocs
REST APIAPI referenceBilling

End the free trial now and pay for the plan

End the free trial now and pay for the plan (a workspace owner)

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.

POST
/v1/billing/start-paid-plan

Ends the workspace's Stripe trial now: the card on file is charged at once for the plan. The way out of a trial paused for review (trial_review); any owner in a trial may use it. Answers like GET /v1/billing; 402 payment_failed when the charge didn't go through (update the card in the billing portal), 409 when the workspace is not in a trial.

Authorization

headerAuthorizationBearer <token>

API key (stk_...), or in the Community Edition the access token (stk_local_...)

Response Body

Billing status, the plan paid

application/json
  1. response
enabled*boolean

Billing is configured on this instance

plan*string

starter, 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

Formatdate-time
suspended*boolean

The period ended unpaid; the workspace is read-only

has_customer*boolean

A Stripe customer exists (the portal is available)

seats*integer

People 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*string

Whether choosing Starter now starts its 7-day trial (card required): available; used (this workspace had a subscription before); card_used (its card on file was used in an earlier free trial that wasn't paid for, so it is charged today); 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

Value in"available""used""card_used""other_workspace""none"
trial_revoked*|

card when the free trial was ended at once because the workspace's card was used in an earlier free trial that ended unpaid (in the last 180 days; known only once Checkout completed): Stripe charged the card then. Shown while unpaid and for two weeks after; null otherwise

Value in"card"null
trial_review*|

channels while the free trial is paused for review: the workspace connected a personal account (or two people behind shared spaces) of an earlier free trial that ended unpaid. Nothing is charged; publishing and new channels wait (402 trial_already_used) until it starts the paid plan (POST /v1/billing/start-paid-plan) or the operator clears it; drafts and settings stay. null otherwise

Value in"channels"null
Example Request
curl -X POST 'https://staqly.example.com/v1/billing/start-paid-plan'
Example Response
{  "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",  "trial_revoked": "card",  "trial_review": "channels"}