API reference / Analytics
Sync revenue now
Reads new payments from every connected provider now. (The ticker also reads them every 5 minutes.) Then it ties each payment to the visitor who paid. It uses the troopy_visitor_id in the metadata, the checkout id that the script saw, or the email that the site gave to troopy("payment"). Each payment counts once.
/api/v1/analytics/revenue/syncOther ways to call it
troopy analytics revenue syncIdempotency-Key header. A retry with the same key gets the first answer back, and the operation runs one time.Query parameters
fromstringRead the history again from this day (YYYY-MM-DD), at most 2 years back. Payments that Troopy counted stay counted one time
date
Response
200 · application/jsondata*object7 properties
syncedAt*string | nullattributed*integerPayments that Troopy tied to a visitor, all time
unattributed*integerPayments of the last 30 days that Troopy could not tie to a visit
unattributedRevenue*integerThe sum of those payments, in minor units
missing*string | nullThe reads that the keys do not have, with the provider of each, like "Refunds in Polar". Give each key those reads, or replace it
error*string | nullsubscriptions*object | nullThe sum of the subscriptions of every connected provider. Troopy reads them once an hour at most. null before the first read
8 properties
mrr*integerMonthly recurring revenue, in minor units: active and past-due subscriptions, after their coupons
mrrBefore*integer | nullMRR about 30 days ago, if Troopy has that history
currency*string | nullsubscribers*integertrials*integer | nullSubscriptions in their free trial. null on a reading from before Troopy counted trials
churnRate*numberThe share of the subscriptions that paid 30 days ago and ended since, 0 to 1. A trial counts from its first payment
ltv*integer | nullRevenue per subscriber divided by the monthly churn, in minor units
at*stringISO 8601 date and time