Test modeDucat runs on Stripe's test mode for now, so no real card is charged.

Features

Checkout Available in test mode

A checkout session opens Stripe's hosted, mobile-ready payment page for your prices. Ducat makes the session for your team, tells you when it's paid, and keeps every session your own.

What it does

Subscriptions or one-off

mode subscription for recurring prices, mode payment for one-time prices; up to 20 line items, each with a quantity (per seat or flat).

Paid means paid

Ducat passes on Stripe's payment_status: paid, unpaid or no_payment_required. A bank debit that's complete but still clearing reads unpaid, so you never switch a plan on early.

Promotion codes

A code your customer typed applies at checkout. Only codes made for your team, or for everyone, work.

Cancel an order

Expire an open session so its page can't be paid any more. A completed one answers 409.

Retries are safe

An Idempotency-Key on any POST goes to Stripe scoped to your team, so a retry never makes or charges twice.

Metadata that travels

metadata on the session is copied onto the subscription it makes, so your own ids reach every later event.

In code

Open a subscription checkout for three seats

TypeScript

// ducat(): the small fetch helper from the quickstart (/docs/quickstart)
const session = await ducat("POST", "/v1/checkout-sessions", {
  customer: customerId,
  mode: "subscription",
  line_items: [{ price: priceId, quantity: 3 }],
  success_url: "https://your.app/billing?session={CHECKOUT_SESSION_ID}",
  cancel_url: "https://your.app/pricing",
  metadata: { team: "org_acme" },
}, "checkout:org_acme:1");

return Response.redirect(session.url, 303); // Stripe's page

Python

# ducat(): the small helper from the quickstart (/docs/quickstart)
session = ducat("POST", "/v1/checkout-sessions", {
    "customer": customer_id,
    "mode": "subscription",
    "line_items": [{"price": price_id, "quantity": 3}],
    "success_url": "https://your.app/billing?session={CHECKOUT_SESSION_ID}",
    "cancel_url": "https://your.app/pricing",
    "metadata": {"team": "org_acme"},
}, idempotency_key="checkout:org_acme:1")

return redirect(session["url"], code=303)  # Stripe's page

curl

curl -s https://api.ducatpay.dev/v1/checkout-sessions \
  -H "authorization: Bearer $DUCAT_TOKEN" \
  -H "content-type: application/json" \
  -H "idempotency-key: checkout:org_acme:1" \
  -d '{"customer": "cus_…", "mode": "subscription",
       "line_items": [{"price": "price_…", "quantity": 3}],
       "success_url": "https://your.app/billing?session={CHECKOUT_SESSION_ID}",
       "cancel_url": "https://your.app/pricing",
       "metadata": {"team": "org_acme"}}'
Checkout endpoints
EndpointWhat
POST /v1/checkout-sessionscustomer, mode, line_items, success_url, cancel_url, metadata, promotion_code
GET /v1/checkout-sessions/{id}status, payment_status, subscription
POST /v1/checkout-sessions/{id}/expireclose an open session's page
POST /v1/pricesa fixed price, monthly, yearly or once
POST /v1/payment-linksa reusable link to a price; list, read, deactivate

Good to know

Available in test mode Works today on Stripe's test mode.

Related: Subscriptions, Webhooks, Selling guide, section 3

More features

Start building in test mode

Sign up, make a key, and take a test payment in a few minutes. No card needed.