The plans you offer
own.prices lists what the customer may switch to; they see a preview of the cost first.
Test modeDucat runs on Stripe's test mode for now, so no real card is charged.
Features
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.
own.prices lists what the customer may switch to; they see a preview of the cost first.
own.max_quantity lets them set seats from 1 up to your maximum, on any item of the subscription.
own.cancel: cancel at the period's end, and take it back.
own.card replaces the card on Stripe's page; own.details sets the billing address and tax IDs.
own.codes applies a code your team may use, where there's no discount already.
What the customer does in the portal is theirs to do: no approval, and every change reaches you as an event.
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 hourPython
# 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 hourcurl
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}}'| Endpoint | What |
|---|---|
POST /v1/customers/{id}/portal-sessions | {return_url, own: {prices, max_quantity, cancel, card, details, codes}} |
POST /v1/customers/{id}/portal-sessions | without own: Stripe's hosted portal (needs its configuration saved in Stripe) |
Available in test mode Works today on Stripe's test mode.
Related: Subscriptions, Invoices, Selling guide, section 5
Sign up, make a key, and take a test payment in a few minutes. No card needed.