Sync the subscription from Stripe
POST
/billing/reconcile
const url = 'https://example.com/billing/reconcile';const options = { method: 'POST', headers: { cookie: 'bottle.session_token=<bottle.session_token>', 'Content-Type': 'application/json' }, body: '{"checkoutSessionId":"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://example.com/billing/reconcile \ --header 'Content-Type: application/json' \ --cookie bottle.session_token=<bottle.session_token> \ --data '{ "checkoutSessionId": "example" }'Reads the subscription from Stripe and records it. Safe to call at any time: it changes nothing that is already up to date.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Media typeapplication/json
object
checkoutSessionId
The Checkout session just finished, when there is one.
string
Examplegenerated
{ "checkoutSessionId": "example"}Responses
Section titled “Responses”Where this business stands afterwards
Media typeapplication/json
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
Example
{ "plan": "starter", "status": "trialing", "pendingPlan": "starter"}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"}