Skip to main content

POST /credits/checkout

This endpoint creates a Stripe checkout session to allow a user to purchase a credit package. Requires session-based authentication (JWT access token from login).
For third-party integrations: Use POST /credits/checkout/api with API Key authentication instead.

Request Body

string
required
The ID of the credit package to purchase. Get available packages from /credits/packages.
string
The URL to redirect to after a successful purchase. Defaults to dashboard with success indicator.
string
The URL to redirect to if the purchase is canceled. Defaults to dashboard with canceled indicator.

Response

string
The ID of the Stripe checkout session.
string
The URL of the Stripe checkout page. Redirect the user here to complete purchase.
object
Details of the selected package.

POST /credits/checkout/api

This endpoint creates a Stripe checkout session using API Key authentication. Ideal for third-party integrations and external applications.

Authentication

Requires API Key authentication. Include your API key in the Authorization header:

Request Body

Same as /credits/checkout above.

Response

Same as /credits/checkout above.