Ready for a billing page
number, status, total, currency, created, hosted_invoice_url and invoice_pdf on each, paged with a cursor.
Test modeDucat runs on Stripe's test mode for now, so no real card is charged.
Features
Subscriptions make invoices; Ducat lists a customer's with their number, status, total and Stripe's hosted page and PDF, so your billing page needs no Stripe code of its own.
number, status, total, currency, created, hosted_invoice_url and invoice_pdf on each, paged with a cursor.
Try the customer's card on an open invoice straight away (past your limit, a nod).
Preview and issue a credit note on an invoice, by line or amount, refunded or left on the customer's balance; list and void them.
With tax on, each invoice line carries its tax, worked out by Stripe Tax.
TypeScript
// ducat(): the small fetch helper from the quickstart (/docs/quickstart)
const { invoices, next } = await ducat("GET", `/v1/customers/${cus}/invoices?limit=10`);
for (const i of invoices) {
console.log(i.number, i.status, i.total, i.currency, i.hosted_invoice_url);
}Python
# ducat(): the small helper from the quickstart (/docs/quickstart)
page = ducat("GET", f"/v1/customers/{cus}/invoices?limit=10")
for i in page["invoices"]:
print(i["number"], i["status"], i["total"], i["currency"], i["hosted_invoice_url"])curl
curl -s "https://api.ducatpay.dev/v1/customers/cus_…/invoices?limit=10" \
-H "authorization: Bearer $DUCAT_TOKEN"| Endpoint | What |
|---|---|
GET /v1/customers/{id}/invoices | limit, after: paged |
GET /v1/invoices/{id} | one invoice |
POST /v1/invoices/{id}/pay | try the card now |
POST /v1/credit-notes/preview, POST /v1/credit-notes | invoice, lines or amount, to: refund or balance |
GET /v1/credit-notes, POST /v1/credit-notes/{id}/void | list by customer or invoice; void |
Available in test mode Works today on Stripe's test mode.
Related: Subscriptions, Customer portal, Tax
Sign up, make a key, and take a test payment in a few minutes. No card needed.