Change the plan
Moves the organization to another plan or billing cycle, and takes back a pending cancellation. During the trial the change is immediate and free. On a paid subscription an upgrade is immediate (the new price is charged from the next invoice) and a downgrade waits for the renewal. Open invoices are issued again at the new price. A subscription that never paid (a partner organization) moving to a paid plan gets its first invoice, due today. Owner only.
Authorization
bearer_auth Authorization: Bearer <token>. Either a session access token from POST /auth/login (refresh it with POST /auth/refresh) or a store API token (mobi_st_…). A store API token works only for the store it was issued in, and can do at most what its issuing user can there, narrowed to the scopes it was issued with.
In: header
Path Parameters
Tenant id
uuidRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PUT "https://example.com/tenants/497f6eca-6276-4993-bfeb-53cbbbba6f08/subscription" \ -H "Content-Type: application/json" \ -d '{ "billing_cycle": "monthly", "plan_code": "profissional" }'{
"billing_cycle": "monthly",
"cancel_at_period_end": true,
"current_period_end": "2019-08-24T14:15:22Z",
"current_period_start": "2019-08-24T14:15:22Z",
"grace_ends_at": "2019-08-24T14:15:22Z",
"open_invoice": null,
"pending_plan": null,
"plan": {
"annual_price_cents": 0,
"code": "string",
"limits": {
"assistant_messages_per_store": 0,
"emails_per_month": 0,
"seats": 0,
"storage_gb": 0,
"stores": 0
},
"monthly_price_cents": 0,
"name": "string",
"public": true
},
"price_cents": 0,
"provider": "string",
"status": "trialing",
"tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
"trial_days_left": 0,
"trial_ends_at": "2019-08-24T14:15:22Z",
"usage": {
"assistant_messages": 0,
"seats": 0,
"storage_bytes": 0,
"stores": 0
}
}{
"code": "not_found",
"details": {},
"error": "Order not found"
}{
"code": "not_found",
"details": {},
"error": "Order not found"
}{
"code": "not_found",
"details": {},
"error": "Order not found"
}{
"code": "not_found",
"details": {},
"error": "Order not found"
}{
"code": "not_found",
"details": {},
"error": "Order not found"
}{
"code": "not_found",
"details": {},
"error": "Order not found"
}