Skip to content

Take back a change waiting at the renewal

DELETE
/orgs/{org}/billing/plan/pending
curl --request DELETE \
--url https://api.sloose.com/orgs/org_9f3c/billing/plan/pending \
--header 'Authorization: Bearer <token>'

Takes back a move to a lower plan (the schedule is released, and the subscription stays on its plan) or a cancellation (the subscription renews), until the period’s end. Administrators, through their own session; never a staff member’s view.

org
required

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

string
Example
org_9f3c

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

Which change was taken back.

Media typeapplication/json
object
undone
required
string
Allowed values: move cancel
Example
{
"undone": "move"
}

No bearer, or one that no longer resolves: a session that is unknown or expired (code: AUTH_REQUIRED), or an API token that was revoked or expired (TOKEN_REVOKED, TOKEN_EXPIRED), whose organisation is gone (ORG_NOT_FOUND) or whose member or user row is (MEMBERSHIP_GONE).

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 bearer’s role is too low, it was issued for a different organisation, it is an API token (SESSION_REQUIRED), or it is a staff member’s view (IMPERSONATION_REFUSED). Like every route behind a session: a session signed in but in no organisation is refused code: NO_ORG, a banned person code: BANNED, and a closed organisation code: ORG_CLOSED.

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"
}

NOTHING_PENDING: nothing waits at the renewal. CHANGE_IN_PROGRESS: another change to the organisation’s plan, or a webhook about it, is being made at this moment. PLAN_SETTLING: the last change, a renewal, or a change made at Stripe is still reaching the organisation — what Stripe bills and what Sloose has recorded differ — so nothing is decided until they agree; try again in a minute. CHANGE_UNCONFIRMED: Stripe did not answer the release, so the move may have been taken back; the plan as it stands arrives within a minute.

Media typeapplication/json
object
error
required
string
code
required
string
Allowed values: NOTHING_PENDING CHANGE_IN_PROGRESS PLAN_SETTLING CHANGE_UNCONFIRMED
key
additional properties
Example
{
"code": "NOTHING_PENDING"
}

Stripe refused the request (PAYMENT_PROVIDER_REFUSED) — nothing was charged, though a step taken before the refusal stands: the organisation’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. Or the restore switch is on (code: MAINTENANCE): every route but /health and /robots.txt is refused before anything is read, with Retry-After (the operator’s ADMIN_TOKEN alone is let through to POST /staff/people/{id}/delete, and to nothing else).

Media typeapplication/json
One of:
object
error
required
string
key
additional properties
Example
{
"code": "MAINTENANCE"
}
Retry-After
integer

Seconds until asking again is worth it (300 while the switch is on).

Report a problem with this page

sloose.com