SET API · Analytics
Invoices: invoiced, received, outstanding, refunded
GET/v1/analytics/sales
Invoice totals for invoices created in the window: per currency invoices (the count), invoiced, received, outstanding and refunded, and byState, one row per invoice state and currency. It reads invoices and refunds, not balance transactions.
Query parameters
sincestring- A UTC date,
YYYY-MM-DD: the first day counted, on each invoice's creation time. With neithersincenoruntil, the window is the last 30 days ending tomorrow at 00:00 UTC. untilstring- A UTC date,
YYYY-MM-DD, exclusive. It must be aftersinceand at most 366 days later.
Notes
- Needs the
readscope. Any account type; no deployment switch. - An account with no invoices answers 200 with empty
totalsandbyState. - A window longer than 366 days answers
400 window_too_long; a malformed date, or anuntilthat is not aftersince, answers400 window_invalid. outstandingis invoiced minus received, for open invoices only.receivedincludes the payment tag, so it can exceedinvoiced: in the example INV-9001 was invoiced 250.00 and paid at itspayableAmount, 250.004741.- The example was made with a sandbox key on a business account, with one invoice paid and one left open.
- This example is a recorded run of SET's own code (wallet release
e9b03447) with a sandbox key; ids and times are that run's.
Errors
400 window_invalid400 window_too_long