POST/api/integrations/billing/checkout

Create a checkout session

Creates a checkout session for the specified subscription price. Provide baseURL for the post-checkout redirect and priceID for the price to purchase; set enableTrial to enable a 14-day trial. Use the returned URL to direct the user to checkout.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

3 body fields

Checkout session configuration, including the redirect URL and price identifier.

baseURLstringrequired
The base URL for the redirect after checkout.
enableTrialbooleanoptional
Enables a 14-day trial for the account.
priceIDstringrequired
The Price ID for checkout.

4 status codes
200Returns the checkout session identifier and the URL to redirect the user to the checkout session.
session_idstringrequired
The unique identifier for the checkout session.
urlstringrequired
URL to redirect the user to the checkout session.
400Returned when the checkout request is invalid.
401Returned when the request lacks valid authentication.
500Returned when an internal server error occurs.

Error handling

A 400 is returned when the request is invalid, including when baseURL or priceID is missing. A 401 is returned when the request lacks valid authentication; a 500 indicates an internal server error.