Reference

Change plan

Moves the subscription to another plan: at once for a larger plan, charging the difference for the rest of the period; at the period's end for a smaller one.

PUT
/orgs/{org}/billing/subscription

Authorization

bearer
headerAuthorizationBearer <token>

Path Parameters

org*string

Request Body

application/json
  1. body
plan*|

The plan the subscription moves to when the period ends.

Value in"launch""scale"null

Response Body

The plan and usage.

application/json
  1. response
enabled*boolean

Whether this server bills at all.

plan*Plan

unlimited when the server does not bill, as when self-hosted.

Value in"free""launch""scale""enterprise""unlimited"
name*string
status*|

The subscription's status in Stripe.

period_start*|

An ISO 8601 time.

period_end*|

An ISO 8601 time.

next_plan*|

The plan the subscription moves to when the period ends.

Value in"launch""scale"null
cancel_at_period_end*boolean
past_due_since*|

An ISO 8601 time.

minimum_cents*integer|null
usage_cents*integer

The usage of the period so far.

estimate_cents*integer

The usage or the minimum, whichever is more.

meters*array<>
stored*
indexes*
files*

Bytes stored by the organization's filesystems.

filesystems*
features*array<>
plans*array<>
customer*boolean

Whether the portal can be opened.

Example Request
curl -X PUT 'https://example.com/v1/orgs/string/billing/subscription' \  -H 'Content-Type: application/json' \  -d '{  "plan": "launch"}'
Example Response
{  "enabled": true,  "plan": "free",  "name": "string",  "status": "string",  "period_start": "string",  "period_end": "string",  "next_plan": "launch",  "cancel_at_period_end": true,  "past_due_since": "string",  "minimum_cents": 0,  "usage_cents": 0,  "estimate_cents": 0,  "meters": [    {      "meter": "storage",      "name": "string",      "quantity": 0,      "unit": "string",      "price": "string",      "amount_cents": 0,      "limit": 0    }  ],  "stored": {    "gb": 0,    "limit_gb": 0  },  "indexes": {    "count": 0,    "limit": 0  },  "files": {    "gb": 0,    "limit_gb": 0  },  "filesystems": {    "count": 0,    "limit": 0  },  "features": [    "pinning"  ],  "plans": [    {      "plan": "free",      "name": "string",      "minimum_cents": 0,      "storage_gb": 0,      "features": [        "pinning"      ]    }  ],  "customer": true}