Skip to main content
GET
Subscription Billing one renewal's payment history

Authorizations

Authorization
string
header
required

Bearer token authentication. Requires a company-admin token whose role holds reports.view.

Query Parameters

subscription_token
string
required

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.

Example:

"sub_9f3c2a"

country
string

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.

Example:

"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.

subscription_id
integer
required

Primary key of the subscription.

subscription_token
string
required

Token, for the link out to the subscription.

currency
string
required

ISO code every amount on the response is quoted in.

Example:

"USD"

renewal_amount
string
required

What this renewal charges, as price * quantity.

Example:

"8.92"

product_name
string | null
required

Variant display name, null when discarded.

quantity
integer
required

Units on the renewal.

billing_frequency
string | null
required

Human phrasing of the plan's interval.

Example:

"1 month"

market_name
string
required

Country the renewal bills in. commerce_subscriptions.country_id is NOT NULL, so a renewal always has exactly one market.

Example:

"United Kingdom"

market_iso
string
required

ISO alpha-2 of the billing country.

Example:

"GB"

paid_to_date
string
required

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.

Example:

"4.46"

order_count
integer
required

Successful orders behind paid_to_date.

first_order_at
string<date-time> | null
required

Earliest successful order, or null when there are none.

last_order_at
string<date-time> | null
required

Most recent successful order, or null.

lifetime_value
string
required

paid_to_date plus this renewal.

Example:

"13.38"

failed_charge_count
integer
required

Failed billing events on this subscription, all time.

recovered_count
integer
required

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.

retry_scheduled_at
string<date-time> | null
required

When the dunning chain will next attempt, or null.

active_subscription_count
integer
required

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.