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

Features

Customer portal Available in test mode

Ducat's own portal needs no setup in Stripe: one request makes a link for one customer, valid for an hour, offering exactly the plans and actions you choose.

What it does

The plans you offer

own.prices lists what the customer may switch to; they see a preview of the cost first.

Seats

own.max_quantity lets them set seats from 1 up to your maximum, on any item of the subscription.

Cancel and undo

own.cancel: cancel at the period's end, and take it back.

Card and details

own.card replaces the card on Stripe's page; own.details sets the billing address and tax IDs.

Promotion codes

own.codes applies a code your team may use, where there's no discount already.

No nod needed

What the customer does in the portal is theirs to do: no approval, and every change reaches you as an event.

In code

A portal link offering monthly and yearly, up to 50 seats

TypeScript

// ducat(): the small fetch helper from the quickstart (/docs/quickstart)
const portal = await ducat("POST", `/v1/customers/${cus}/portal-sessions`, {
  return_url: "https://your.app/billing",
  own: { prices: [monthly, yearly], max_quantity: 50, cancel: true, card: true, details: true },
});
return Response.redirect(portal.url, 303); // valid for an hour

Python

# ducat(): the small helper from the quickstart (/docs/quickstart)
portal = ducat("POST", f"/v1/customers/{cus}/portal-sessions", {
    "return_url": "https://your.app/billing",
    "own": {"prices": [monthly, yearly], "max_quantity": 50,
            "cancel": True, "card": True, "details": True},
})
return redirect(portal["url"], code=303)  # valid for an hour

curl

curl -s https://api.ducatpay.dev/v1/customers/cus_…/portal-sessions \
  -H "authorization: Bearer $DUCAT_TOKEN" \
  -H "content-type: application/json" \
  -d '{"return_url": "https://your.app/billing",
       "own": {"prices": ["price_monthly…", "price_yearly…"],
               "max_quantity": 50, "cancel": true, "card": true, "details": true}}'
Customer portal endpoints
EndpointWhat
POST /v1/customers/{id}/portal-sessions{return_url, own: {prices, max_quantity, cancel, card, details, codes}}
POST /v1/customers/{id}/portal-sessionswithout own: Stripe's hosted portal (needs its configuration saved in Stripe)

Good to know

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

Related: Subscriptions, Invoices, Selling guide, section 5

More features

Start building in test mode

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