---
title: "Create On Demand Checkout"
method: POST
path: "/v1/orgs/{org_id}/billing/credits/on-demand-checkout-session"
tags: ["billing"]
---

# Create On Demand Checkout

`POST /v1/orgs/{org_id}/billing/credits/on-demand-checkout-session`

## Request

- Base URL: `https://api.sonenta.dev`
- URL: `https://api.sonenta.dev/v1/orgs/{org_id}/billing/credits/on-demand-checkout-session`
- Auth: none declared

One-time Checkout for EXACTLY `credits_needed` credits at the on-demand rate
($0.035/credit, config) — the pay-or-pack out-of-credits path. The signed
webhook grants the credits to the balance (kind=credit_pack path, idempotent
on session id); the front re-runs the batch after success. MoR via the same
Managed-Payments checkout as packs. Below Stripe's $0.50 min -> buy a pack.

## Path parameters

- `org_id` string, required

## Request body

- OnDemandCheckoutIn
  - `credits_needed` integer, required
  - `success_url` string, uri, required
  - `cancel_url` string, uri, required

## Response `200`

Successful Response

- CheckoutOut
  - `url` string, required
  - `session_id` string, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/sonenta/apis/sonenta-api.md) · [All operations](https://skmtc.dev/sonenta/apis/sonenta-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sonenta/apis/sonenta-api/revisions/f853ea49fb05?raw)
