Skip to content

Start the plan chosen during the trial now

POST
/orgs/{org}/billing/plan/start
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.

org
required

The org id the session was issued for. A token for one org can never read another.

string
Example
org_9f3c

The org id the session was issued for. A token for one org can never read another.

The trial was ended at Stripe.

Media typeapplication/json
object
startedAt
required
string
Examplegenerated
{
"startedAt": "example"
}

No bearer, or one that is expired, revoked or no longer resolves to a member.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

The card was declined: the trial goes on, and nothing was charged.

Media typeapplication/json
object
error
required
string
code
required
string
Allowed values: CARD_DECLINED
key
additional properties
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).

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
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.

Media typeapplication/json
object
error
required
string
code
required
string
Allowed values: NOT_TRIALING CHANGE_IN_PROGRESS PLAN_SETTLING CHANGE_UNCONFIRMED
key
additional properties
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.

Media typeapplication/json
object
error
required
string
code
required
string
Allowed values: PAYMENT_PROVIDER_REFUSED PAYMENT_PROVIDER_UNAVAILABLE
key
additional properties
Example
{
"code": "PAYMENT_PROVIDER_REFUSED"
}

Stripe is not configured.

Media typeapplication/json
object
error
required
string
key
additional properties
Examplegenerated
{
"error": "example"
}

Report a problem with this page