Change the plan
POST
/billing/plan
const url = 'https://example.com/billing/plan';const options = { method: 'POST', headers: { cookie: '__Host-bottle.session_token=<__Host-bottle.session_token>', 'Content-Type': 'application/json' }, body: '{"plan":"shop"}'};
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://example.com/billing/plan \ --header 'Content-Type: application/json' \ --cookie __Host-bottle.session_token=<__Host-bottle.session_token> \ --data '{ "plan": "shop" }'Moving up costs money today, so this returns a page to confirm the amount on. Moving down happens at renewal, costs nothing now, and is recorded immediately. Asking for the plan they are already on cancels a move that was waiting. During a trial nothing is charged either way: the trial carries on, on the plan asked for, with its areas open.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
plan
required
string
Responses
Section titled “Responses”Somewhere to confirm, or where this business now stands
Media typeapplication/json
object
url
required
string | null format: uri
subscription
required
object
plan
required
string
status
required
string
inGoodStanding
required
boolean
manageable
required
boolean
trialEndsAt
required
string | null format: date-time
currentPeriodEnd
required
string | null format: date-time
cancelAt
required
string | null format: date-time
pendingPlan
required
string | null
pendingPlanAt
required
string | null format: date-time
rateLimits
required
object
requestsPerMinute
required
integer
heavyPerMinute
required
integer
discount
required
object
percentOff
required
integer
until
required
string | null format: date-time
customPrice
required
object
monthlyPence
required
integer
from
required
string | null format: date-time
vehiclesUsed
required
integer
addons
required
Array<string>
areasGranted
required
Array<string>
features
required
object
rounds
required
boolean
vehicles
required
boolean
rota
required
boolean
cash
required
boolean
standingOrders
required
boolean
yards
required
boolean
deliveryPartners
required
boolean
whatsapp
required
boolean
storefront
required
boolean
assets
required
boolean
servicing
required
boolean
Example
{ "subscription": { "plan": "shop", "status": "trialing", "pendingPlan": "shop", "addons": [ "shop" ], "areasGranted": [ "rounds" ] }}Not signed in
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Not allowed to manage billing, or asking for a key to do it
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Nothing to move: this business has never paid and is not on a trial
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}Billing is not configured on this deployment
Media typeapplication/json
object
error
required
string
message
required
string
Example
{ "error": "not_found", "message": "Customer not found"}