Total the payments of a site over time
get_site_payment_analytics
Totals the payments a site took over a period, per currency, with refunds, disputes and failed payments.
Payments are open on a few sites while we test them. On any other site this tool is refused with Payments are not available on this site yet!. To ask for access, use the support chat.
Totals the payments a site took over a period, the way the Analytics sub-tab of its Payments tab does. currencies holds one entry per currency, with Payments (how many went through), PaidCents (what they took, in the currency's smallest unit), RefundedCents and Refunds, Disputes, and Failed, the attempts that did not go through, which never count as paid. primaryCurrency is the currency with the most payments, and series charts it, one entry per hour, day or month as interval says, with zeros where nothing was paid. Leave period, from and to out for the last 30 days. Payments stay in the list for 1 year, so a longer window only totals the ones still kept. Only the workspace owner can read them, so any other caller is refused.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
projectId |
string | Yes | The site id. |
period |
string | No | One of day, 24h, 7d, 30d, 90d, 12mo or all. day is today so far, from midnight UTC, 24h is the current hour and the 23 before it, 7d, 30d and 90d are the last 7, 30 and 90 days counting today, 12mo is this month and the 11 before it, and all reaches back to the first record. Defaults to 30d. |
from |
string | No | The first day of a custom range as YYYY-MM-DD in UTC, sent together with to. |
to |
string | No | The last day of a custom range as YYYY-MM-DD in UTC, included in the range and sent together with from. |