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 Payment is only created when the customer submits a payment method on the checkout page. For subscriptions, the Subscription and 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
FieldRequiredDescription
currencyYesEUR or USD
productsYesList of items to charge for (name, price in cents, quantity)
successUrlNoWhere the customer returns after a successful payment
cancelUrlNoWhere the customer returns if they abandon checkout
customerEmailNoPre-fills the customer's email
expiresInNoHours 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}
FieldRequiredDescription
successUrlNoOverrides the offer's default success URL
cancelUrlNoOverrides the offer's default cancel URL
customerEmailNoPre-fills the customer's email
expiresInNoHours 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 CaseURL Format
Payment linkcheckout.inflowpay.com/l/{linkId}
Subscription linkcheckout.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