Subscription Billing one renewal's payment history
Returns one renewal’s history for the day drawer’s expanded row: what the customer has actually paid, how often a charge has failed, and how often a failed day turned around.
This replaces a browser-side generator, which meant the card explaining why a renewal was flagged was itself invented.
Authorizations
Bearer token authentication. Requires a company-admin token
whose role holds reports.view.
Query Parameters
Token of the renewal to report on. A token belonging to another
company returns 404 rather than 403 — the caller should not
learn that it exists.
"sub_9f3c2a"
ISO alpha-2 code of one of the requesting company's configured
countries (see GET /countries). When present, every service
on this endpoint filters its data to that country and reports
money in the country's own currency. Omit (or send "all")
for the aggregate-across-countries view, which is the default
and matches pre-Phase-004 behavior. Unknown ISO codes or ones
the company is not configured for return 400.
"US"
Response
The renewal's history
One renewal's history, for the day drawer's expanded row.
Two figures the prototype's card showed are absent rather than
estimated. A count of scheduled smart retries has no source —
commerce_billing_events carries no retry marker, so after the
fact a retry is indistinguishable from a first attempt, and
retry_scheduled_at is the real fact instead. And no per-renewal
clearance likelihood is served; nothing in the platform produces
one, and the row's risk band says what is actually known.
Primary key of the subscription.
Token, for the link out to the subscription.
ISO code every amount on the response is quoted in.
"USD"
What this renewal charges, as price * quantity.
"8.92"
Variant display name, null when discarded.
Units on the renewal.
Human phrasing of the plan's interval.
"1 month"
Country the renewal bills in.
commerce_subscriptions.country_id is NOT NULL, so a renewal
always has exactly one market.
"United Kingdom"
ISO alpha-2 of the billing country.
"GB"
Money collected by this subscription's successful orders,
through the same Commerce::Order.successful gate the rest of
the app reads. Summed as orders.amount_in_base and converted
once, because orders carry no currency of their own.
"4.46"
Successful orders behind paid_to_date.
Earliest successful order, or null when there are none.
Most recent successful order, or null.
paid_to_date plus this renewal.
"13.38"
Failed billing events on this subscription, all time.
Billed dates that held a failure and then cleared. Counted per date rather than per event, so a day that retried three times before clearing is one recovery rather than three. Named for what it measures — a day that turned around — because billing events cannot say what turned it around.
When the dunning chain will next attempt, or null.
Live subscriptions this customer holds, including this one.
Scoped to the member, which is the association a subscription
carries; a renewal with no member reports 1.