POST /v1/checkout/sessions, get back a payment URL, redirect your customer, and Flexprice activates the subscription once payment is confirmed.
Session lifecycle
Create a Checkout Session
payment_action.url. Each session has its own link. Do not reuse URLs across sessions.
Request fields
Other Checkout Actions
Two more actions exist, but they are not created through this endpoint. Each is triggered by adding acheckout object to the endpoint that owns the change, so that Flexprice can compute the amount and defer the change itself:
Passing either action here returns a validation error naming the endpoint to use instead. Once created, both are read, deleted, and monitored through the same endpoints and webhook events described on this page. See Pay-First Checkout.
Get a Checkout Session
checkout_status on your redirect pages before showing the customer a result.
Delete a Checkout Session
completed, failed, expired) cannot be deleted.
Webhook events
Subscribe to these in Settings > Webhooks to drive fulfillment from your backend.Safe to receive the same event twice. If your payment provider delivers
payment_link.paid more than once, Flexprice ignores the duplicate. Your
webhook handler should also be idempotent for the same reason.Requirements
Customer must exist first. Thecustomer_external_id must refer to a customer already in Flexprice. Create them at sign-up if they don’t exist yet.
Plan must have a non-zero charge. Checkout requires a payable invoice amount to generate a payment link. Plans with only free or zero-amount charges will cause session creation to fail.
Idempotency on retry. An idempotency_key is reserved while its session is active, so retrying with the same key returns 409 rather than creating a duplicate. Read the open session with GET /checkout/sessions/{id} to recover its payment URL. Once the session reaches a terminal state the key can be reused.
Razorpay Setup
Configure the webhook events Razorpay needs to send Flexprice.
Implementation Guide
Full end-to-end integration with code examples.

