Skip to content

Record usage

Usage endpoint

How the platform records counted estimates on Stripe's meter, and what every error means.

Record counted estimates

The platform calls this to tell Stripe's meter how many estimates were counted for a customer. Recording usage never charges anyone: Stripe drafts the invoice at the end of the period, and a person sends it.

Fields

FieldTypeRules
stripeCustomerIdstringRequired. Starts with cus_.
quantityintegerOptional, defaults to 1. From 1 to 1000.
occurredAtISO 8601 date-time with offsetOptional. Within the last 35 days and no more than 5 minutes ahead.
identifierstringOptional, up to 200 characters. An idempotency key, like the platform's estimate event id. Stripe drops repeats for 24 hours.

Example request

bash
curl -X POST https://xtimates.com/api/estimates/usage \
  -H "Authorization: Bearer $PLATFORM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "stripeCustomerId": "cus_123",
    "quantity": 1,
    "occurredAt": "2026-10-20T14:05:00-04:00",
    "identifier": "estimate_evt_8841"
  }'

Response

A good call answers with the meter event Stripe recorded:

json
{ "ok": true, "id": "<meter event id>", "eventName": "<meter event name>", "quantity": 1 }

Errors

Every error answers with a JSON body that says what went wrong in plain words: { "error": "…" }.

StatusMeans
400The body isn't JSON, or a field breaks a rule. The message names the field.
401The bearer key is missing or wrong.
429Too many requests. The body carries retryAfterSeconds; wait that long and retry.
503The endpoint isn't configured on this deployment yet.
500Something broke on our side. Retry later with the same identifier.

Using these means you agree to the Developer Terms. Questions: support@xtimates.com.