Checkout V2
Beta — Checkout V2 is rolling out now. The session endpoints below are tagged Checkout V2 (Beta) in the API.
What's New: A Session-Oriented Checkout
Checkout V2 introduces a session-oriented model. Instead of creating a payment up front, a checkout now starts with a Checkout Session — a short-lived object that represents your customer's intent to pay.
The key difference from the previous flow:
- You create a session first, and get back a hosted
checkoutUrl. - The actual
Paymentis only created when the customer submits a payment method on the checkout page. For subscriptions, theSubscriptionand its first payment are created at that same moment.
This keeps your records clean (no half-finished payments) and lets the hosted page own the entire payment experience.
Sessions are temporary. You can control how long a session stays valid with expiresIn (in hours); if you don't set it, a session expires about 1 hour after creation.
Two Ways to Create a Session
There are two API endpoints for creating a payment session, depending on whether you're charging once or setting up recurring billing. Both use your private API key and the standard API host https://api.inflowpay.xyz (see Base URLs & Request Format).
Both endpoints return the same shape on success (201 Created):
{
"sessionId": "sess_abc123",
"checkoutUrl": "https://checkout.inflowpay.com/pay/sess_abc123"
}Redirect your customer to the checkoutUrl to complete the payment.
One-Time Payment
Use this when you want to charge a customer once. You pass the products and currency directly in the request — no need to create a link or offer first.
POST /api/checkout/sessions/one-time-payment
| Field | Required | Description |
|---|---|---|
currency | Yes | EUR or USD |
products | Yes | List of items to charge for (name, price in cents, quantity) |
successUrl | No | Where the customer returns after a successful payment |
cancelUrl | No | Where the customer returns if they abandon checkout |
customerEmail | No | Pre-fills the customer's email |
expiresIn | No | Hours until the session expires (minimum 0.25 = 15 minutes) |
curl -X POST https://api.inflowpay.xyz/api/checkout/sessions/one-time-payment \
-H "Content-Type: application/json" \
-H "X-Inflow-Api-Key: inflow_prod_your_key" \
-d '{
"currency": "EUR",
"products": [{ "name": "Premium Plan", "price": 4999, "quantity": 1 }],
"successUrl": "https://yoursite.com/success",
"customerEmail": "[email protected]"
}'Subscription
Use this to start a recurring subscription from an existing Subscription Offer. Create the offer first (from the Dashboard or API), then create a session for it. See Subscription Overview to learn about offers.
POST /api/checkout/sessions/subscription/{subscriptionOfferId}
| Field | Required | Description |
|---|---|---|
successUrl | No | Overrides the offer's default success URL |
cancelUrl | No | Overrides the offer's default cancel URL |
customerEmail | No | Pre-fills the customer's email |
expiresIn | No | Hours until the session expires (minimum 0.25 = 15 minutes) |
curl -X POST https://api.inflowpay.xyz/api/checkout/sessions/subscription/sub_offer_abc123 \
-H "Content-Type: application/json" \
-H "X-Inflow-Api-Key: inflow_prod_your_key" \
-d '{
"customerEmail": "[email protected]"
}'Checkout URLs
Your customers reach the hosted checkout through one of these URLs. Payment links and subscription links resolve into a Checkout V2 session, which is served on the /pay/{sessionId} page.
| Use Case | URL Format |
|---|---|
| Payment link | checkout.inflowpay.com/l/{linkId} |
| Subscription link | checkout.inflowpay.com/subscribe/{offerId} |
| Checkout session (returned by the APIs above) | checkout.inflowpay.com/pay/{sessionId} |
Payment and subscription links are still the easiest way to share a checkout — they're generated automatically when you create a link or an offer. The session endpoints are for when you want to create the checkout dynamically from your backend.
Next Steps
- Checkout Interface Overview — what your customers see on the hosted page.
- Session Customization — brand the checkout with your colors, logo, and name.
- Subscription Overview — create and manage recurring billing offers.
Updated 1 day ago