Create checkout session

POST https://app.speybooks.com/api/v1/billing/checkout

Create a Stripe Checkout session for subscribing to a plan. If the organisation has no Stripe customer, one is created automatically. Remaining trial days are applied as a trial period on the Stripe subscription.

Returns the Stripe checkout URL for client-side redirect and the session ID for tracking. Triggers a billing.checkout_started audit log entry.

Body parameters

plan string required
Plan to subscribe to.
sole_traderlimited_company

Response

200 Returns a Stripe Checkout URL. Redirect the user to this URL to collect payment details.
Show response fields
checkoutUrl string
Stripe Checkout session URL. Redirect the user here.
sessionId string
Stripe Checkout session ID for reference.

Error codes

400 Invalid or unavailable plan specified.
404 Organisation not found.