Skip to navigation

Create or Reuse a Checkout Session

View as Markdown

Start the selected AI Plus or AI Pro plan through Checkout: uiMode HOSTED_PAGE (the default) returns a hosted page url; ELEMENTS returns a clientSecret and publishableKey for the Payment Element in the caller’s page. A caller with a continuing subscription changes plan with POST /v1/billing/plan-changes and cancels or resumes it with PATCH /v1/billing/subscription.

Authentication

AuthorizationBearer

Your aVenture API key (https://aventure.vc/settings/api-keys) or OAuth access token

Request

This endpoint expects an object.
planstringRequired
AI Plus or AI Pro plan to start through Checkout
uiModeenumOptional

How the caller presents Checkout; HOSTED_PAGE when omitted

Allowed values:

Response headers

X-RateLimit-LimitintegerOptional

Requests allowed per client IP in the current rate-limit window.

X-RateLimit-RemainingintegerOptional

Requests left before the tightest applicable rate-limit bucket rejects.

X-RateLimit-ResetintegerOptional

Seconds until the exhausted rate-limit bucket admits another request; 0 when none is exhausted.

Response

Created
expiresAtdatetime
When the Checkout Session stops accepting payment
planstring
Canonical paid billing plan offered by aVenture.
clientSecretstring or nullOptional

Checkout Session client secret for Stripe.js initCheckout; set for ELEMENTS

publishableKeystring or nullOptional

Stripe publishable key that loads Stripe.js; set for ELEMENTS

urlstring or nullOptionalformat: "uri"

Hosted Checkout page to open in a browser; set for HOSTED_PAGE

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
406
Not Acceptable Error
409
Conflict Error
415
Unsupported Media Type Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error