Skip to main content
POST
Create Checkout Session
Create a payment-gated plan checkout from a trusted merchant backend. Auth: secret key only. Publishable keys are always rejected.
The merchant backend derives customer_id from its authenticated user or team. Do not trust a browser-provided customer ID. The response contains a hosted URL or Stripe Checkout client_secret, or reports an immediately completed or scheduled transition.

Modes

Plan checkout

Use this when a customer is selecting a plan.
string
required
External customer ID. The customer must already exist.
string
required
The plan code to subscribe the customer to (e.g. pro).
Plan checkout is payment-gated. Free-to-paid checkout uses an incomplete subscription. Paid-to-paid upgrades keep the old subscription active in a durable pending intent and apply the billing change only after Stripe confirms payment. If prepaid credits fully cover a paid plan change, Nozle applies it without Stripe and returns type: "completed". Free plans may also complete immediately. A downgrade or other cycle-end transition returns type: "scheduled"; browser callers still use this same endpoint.

Return URL

string
URL Stripe should return to after embedded checkout completes. It must use an exactly allowlisted HTTPS origin. If omitted, Nozle uses the configured dashboard return URL.
string
Backward-compatible alias for return_url.

Request examples

Plan checkout:

Response

string
required
stripe, completed, or scheduled.
string
Stripe Checkout Session client secret. Pass this to stripe.initEmbeddedCheckout().
string
Hosted checkout URL. Navigate the current page to this URL.
string
Camel-case alias for client_secret.
string
Nozle invoice ID being paid.
integer
Amount due for the checkout session, in the invoice currency’s smallest unit.
string
Invoice currency.

Credit-funded response

When no external payment remains due:

Scheduled response

Webhook requirement

Stripe must be able to reach your Nozle public API URL. When a Stripe provider is connected, Nozle registers the Stripe webhook endpoint for that tenant’s Stripe account:
Checkout relies on these Stripe events:
  • payment_intent.succeeded
  • payment_intent.payment_failed
  • payment_intent.canceled