Skip to main content
POST
/
checkout
Create Checkout Session
curl --request POST \
  --url https://api.nozle.app/api/v1/checkout \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "customer_id": "<string>",
  "plan_code": "<string>",
  "success_url": "<string>"
}
'
{
  "client_secret": "<string>",
  "invoice_id": "<string>",
  "amount_cents": 123,
  "currency": "<string>"
}
Create a Stripe Checkout session for a customer to subscribe to a plan. Returns a client_secret that you pass to Stripe’s embedded checkout component. Auth: pk_ (publishable key) or sk_ (secret key).
customer_id
string
required
External customer ID. The customer must already exist.
plan_code
string
required
The plan code to subscribe the customer to (e.g. pro).
success_url
string
URL to redirect the customer to after successful checkout. Defaults to your configured redirect URL.

Response

client_secret
string
required
Stripe Checkout Session client secret. Pass this to stripe.initEmbeddedCheckout().
invoice_id
string
The Lago invoice ID associated with this checkout.
amount_cents
number
Total amount in cents.
currency
string
ISO 4217 currency code.