Create a Stripe Checkout Session for self-service top-up
Billing
Create top-up checkout session
Create a Stripe Checkout Session for a self-service top-up or to save a new card.
POST
Create a Stripe Checkout Session for self-service top-up
Creates a Stripe Checkout Session and returns the URL to redirect your customer to. Two modes are supported:Documentation Index
Fetch the complete documentation index at: https://docs.omnifence.ai/llms.txt
Use this file to discover all available pages before exploring further.
payment(default) — a one-time top-up. The customer pays theamount_usdyou supplied. Stripe credits your balance with the same USD amount once the checkout completes successfully, regardless of the presentment currency.setup— a zero-dollar checkout that saves a card without charging it. Useful before enabling auto top-up. Omitamount_usd.
billing:write scope.
Amounts
| Field | Min | Max | Notes |
|---|---|---|---|
amount_usd | $5 | $5000 | Required for mode=payment, omitted for mode=setup. |
Tax and currency
Checkout collects a billing address (required) so Stripe Tax can apply local tax. Customers in supported regions can pay in local currency via Adaptive Pricing; your USD balance is always credited theamount_usd you set.
After checkout
When the customer completes payment, Stripe sends acheckout.session.completed webhook to our server and we credit your balance. The success URL we set redirects them back to /billing?topup=success.
If the payment fails or the customer cancels, no charge is made and the cancel URL redirects them back to /billing?topup=cancelled.
The returned topup_intent_id is a durable handle to this top-up attempt — useful for correlating logs.
Webhook events to subscribe to
If you’re integrating directly (not via the dashboard), subscribe to the following Stripe events on your own Stripe account so you can react to top-up state changes:checkout.session.completedcheckout.session.async_payment_succeededcheckout.session.async_payment_failedpayment_intent.payment_failed
