Checkout sessions
Checkout starts when your server asks Elixpo Pay to create a session with your secret key. We resolve the price from your catalog, return a hosted checkout URL, and you redirect the buyer there. Your app never sees card data and never signs an amount.
Create a session
http
POST https://payouts.elixpo.com/v1/checkout/sessions
Authorization: Bearer <ELIXPO_PAY_API_KEY>
Content-Type: application/json
{
"tier": "member", // product tier to purchase
"currency": "INR", // we pick the matching catalog price
"customer": {
"uid": "u_123", // buyer id in your namespace
"email": "buyer@example.com" // optional, prefilled at checkout
},
"success_url": "https://blogs.elixpo.com/settings",
"metadata": { "plan": "member" } // optional, echoed onto the session
}Authenticate with your ELIXPO_PAY_API_KEY (secret key). The amount is never sent by you — Elixpo Pay looks up the active price for (tier, currency) in your catalog, so a user can't tamper with the price.
Response
json
201 Created
{
"id": "cs_…",
"url": "https://payouts.elixpo.com/checkout?session=cs_…",
"amount": 19900, // resolved from the catalog (minor units)
"currency": "INR",
"tier": "member",
"expires_at": "2026-06-17T12:30:00.000Z"
}Redirect the buyer
javascript
// In your app (server-side), when a user upgrades:
const res = await fetch("https://payouts.elixpo.com/v1/checkout/sessions", {
method: "POST",
headers: {
Authorization: "Bearer " + process.env.ELIXPO_PAY_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
tier: "member",
currency: "INR",
customer: { uid: user.id, email: user.email },
success_url: "https://blogs.elixpo.com/settings",
}),
});
const session = await res.json();
redirect(session.url); // send the buyer to hosted checkoutWhat happens next
- The hosted page loads the session, lazily creates a Razorpay order, and opens Razorpay Checkout.
- On success the client signature is verified and we fulfill immediately; the Razorpay webhook re-confirms authoritatively (idempotent — never double-grants).
- We grant the entitlement, then notify your app (see Webhooks) and redirect the buyer to
success_url.