`POST /v1/orgs/{org}/billing/plan` (DAWG-145): move a live subscription between Team, Business and Enterprise.
const url = 'https://api.updawg.net/v1/orgs/example/billing/plan';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"plan":"example"}'};
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.updawg.net/v1/orgs/example/billing/plan \ --header 'Content-Type: application/json' \ --data '{ "plan": "example" }'Asks Stripe to swap the price, with the days so far billed at the old plan’s rate; the organization’s plan changes when Stripe’s webhook says the subscription has, as it does for a new one. Starting a subscription is checkout’s, and ending one the customer portal’s.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Organization slug.
Request Bodyrequired
Section titled “Request Bodyrequired”object
team or business.
Example generated
{ "plan": "example"}Responses
Section titled “Responses”Asked of Stripe; the plan changes when its webhook arrives.
Not team, business or enterprise.
object
Example generated
{ "detail": "example", "status": 1, "title": "example", "type": "example"}No session.
object
Example generated
{ "detail": "example", "status": 1, "title": "example", "type": "example"}Only an owner, in person, manages billing.
object
Example generated
{ "detail": "example", "status": 1, "title": "example", "type": "example"}No such organization, or not yours.
object
Example generated
{ "detail": "example", "status": 1, "title": "example", "type": "example"}No live subscription to change (no-subscription), or already on that plan (same-plan).
object
Example generated
{ "detail": "example", "status": 1, "title": "example", "type": "example"}The organization’s data is in another region (wrong-region, DAWG-159). detail names that region’s API; send the request there.
object
Example generated
{ "detail": "example", "status": 1, "title": "example", "type": "example"}Over the organization’s request limit. Retry-After says when to try again; RateLimit-Limit is the burst.
object
Example generated
{ "detail": "example", "status": 1, "title": "example", "type": "example"}This deployment takes no payments (billing-unavailable).
object
Example generated
{ "detail": "example", "status": 1, "title": "example", "type": "example"}