Meters
sum of the values, count of the events, or the last value; deactivate a meter when a plan retires.
Test modeDucat runs on Stripe's test mode for now, so no real card is charged.
Features
Charge for what customers use: report usage against a meter, put a per-unit price on it, and Stripe Billing Meters total it on the invoice. Each report counts once, even when your job retries.
sum of the values, count of the events, or the last value; deactivate a meter when a plan retires.
A per-unit price on a meter, monthly or on another interval; subscribe a customer to it like any price.
Each report carries an identifier, or an Idempotency-Key: a retry never bills twice, even past Stripe's own 24 hours.
A customer's aggregated usage over any range, for a usage page in your product.
TypeScript
// ducat(): the small fetch helper from the quickstart (/docs/quickstart)
await ducat("POST", `/v1/meters/${meterId}/events`, {
customer: customerId,
value: callsToday,
identifier: `acme-${day}`, // the same day reported twice counts once
});Python
# ducat(): the small helper from the quickstart (/docs/quickstart)
ducat("POST", f"/v1/meters/{meter_id}/events", {
"customer": customer_id,
"value": calls_today,
"identifier": f"acme-{day}", # the same day reported twice counts once
})curl
curl -s https://api.ducatpay.dev/v1/meters/mtr_…/events \
-H "authorization: Bearer $DUCAT_TOKEN" \
-H "content-type: application/json" \
-d '{"customer": "cus_…", "value": 6200, "identifier": "acme-2026-12-05"}'| Endpoint | What |
|---|---|
POST /v1/meters | {name, display_name, aggregation: sum | count | last} |
POST /v1/meters/{id}/prices | a metered price |
POST /v1/meters/{id}/events | {customer, value, identifier, timestamp} |
GET /v1/meters/{id}/usage?customer&start&end | the total over a range |
POST /v1/meters/{id}/deactivate | take no more events |
Beta Built and tested against a simulated Stripe; not yet run on Stripe's test mode.
Related: Subscriptions, SaaS subscriptions, Agents guide, story 4c
Sign up, make a key, and take a test payment in a few minutes. No card needed.