Revenue is part of product analytics, which is coming soon. Projects without product analytics get
403 with the code coming_soon or plan_upgrade_required. Call analytics.status to see the
state of a project.Operations
The
read and write key shortcuts do not include the revenue scopes: give a key revenue:read
or revenue:write explicitly. In the dashboard, only owners and admins can see revenue.
The read operations take from and to (ISO 8601). The default range is the last 30 days; a range
can be at most 400 days. The overview also returns the previous period of the same length.
Revenue impact
revenue.impact takes target (issue, incident, release, or page) and id (the issue,
incident, or release id, or a page path such as /checkout). It returns an estimate as a range
(low to high) in the reporting currency, the method, and a status:
An estimate is kept for up to 5 minutes; new revenue or another change in the project starts a
fresh one. See Revenue impact for the two methods.
Revenue attribution
revenue.attribution takes from and to, model (last_touch, the default, or first_touch),
and dimension (source, the default, medium, or campaign). It returns rows with the value,
kind, net in the reporting currency, share (percent of the net revenue in the range),
payments, and people:
Touch values come first, by net revenue, at most 100 (
truncated is true when more exist).
lookback_days is how far before from touches are read. A result is kept for up to 5 minutes.
A range with too many events for one request returns 422 with RANGE_TOO_LARGE; narrow from
and to. The API never returns a partial total.
See Revenue attribution.
Amounts
amount_minorand the*_minorfields are integers in the smallest unit of their own currency. Divide by10 ^ currency_exponentfor the decimal amount.- Other amounts are decimals in the reporting currency (
currencyin the response). - Refunds and disputes are negative; dispute reversals are positive.
fx.missing_currencieslists currencies without a reference rate. Their amounts are inby_currencybut not in converted totals.
Send money movements
POST /revenue/events takes { "events": [...] } with up to 100 items:
The response is
202 with accepted (items in the request) and written (rows that changed).
Send subscription states
POST /revenue/subscriptions takes { "subscriptions": [...] } with up to 100 items: id,
status, mrr (monthly amount in the smallest currency unit, 0 when it does not pay), currency,
effective_at, and optional customer_id and plan. Send a new state each time a subscription
changes; Squasher keeps every state, so MRR movements work for any range.
CLI
send-events and send-subscriptions read a JSON array (or the request body) from a file; use
--file - for stdin. Add --json to any command to print the API response.