Start the plan chosen during the trial now
const url = 'https://api.sloose.com/orgs/org_9f3c/billing/plan/start';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
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.sloose.com/orgs/org_9f3c/billing/plan/start \ --header 'Authorization: Bearer <token>'A plan chosen during the org’s trial starts when the trial ends: its subscription has a trial ending on the org’s, the card taken and nothing charged before then (#330 PR 2b). This ends that trial at once, and Stripe charges the plan’s first period now; the plan reaches the org when Stripe’s webhook says it was paid. Administrators, through their own session; never a staff member’s view.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The org id the session was issued for. A token for one org can never read another.
Example
org_9f3cThe org id the session was issued for. A token for one org can never read another.
Responses
Section titled “Responses”The trial was ended at Stripe.
object
Examplegenerated
{ "startedAt": "example"}No bearer, or one that is expired, revoked or no longer resolves to a member.
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}The card was declined: the trial goes on, and nothing was charged.
object
Example
{ "code": "CARD_DECLINED"}The bearer’s role is too low, it was issued for a different org, it is an API token (SESSION_REQUIRED), or it is a staff member’s view (IMPERSONATION_REFUSED).
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}NOT_TRIALING: no plan waits for a trial to end — none chosen, the subscription is not on a trial, or it is set to cancel. CHANGE_IN_PROGRESS: another change to the org’s plan, or a webhook about it, is being made at this moment. PLAN_SETTLING: what Stripe bills and what Sloose has recorded differ, so nothing is decided until they agree. CHANGE_UNCONFIRMED: Stripe did not answer, so the trial may have ended; the plan as it stands arrives within a minute.
object
Example
{ "code": "NOT_TRIALING"}Stripe refused the request (PAYMENT_PROVIDER_REFUSED) — nothing was charged, though a step taken before the refusal stands: the org’s first Stripe customer, or an existing customer’s billing email brought up to date — or was unavailable (PAYMENT_PROVIDER_UNAVAILABLE: unreachable, failing or rate-limiting), which may or may not have gone through — check before retrying. Stripe’s own words are logged, not returned.
object
Example
{ "code": "PAYMENT_PROVIDER_REFUSED"}Stripe is not configured.
object
Examplegenerated
{ "error": "example"}