Connect an analytics system
Read a shop's sales, cash register reports and stock into your own analytics tool (a data warehouse, a BI dashboard, a spreadsheet). It's read-only: you never change Wino's data.
Develop on staging with a staging key (see Environments), and read Pagination first: every list below is paginated.
What to read
| You want | Query | Main fields |
|---|---|---|
| Sales at the cash register | salesReceipts | createdAt, totalAmountIncludingTaxes, items, payments, taxes |
| Refunds at the cash register | refundReceipts | Subtract them from your sales |
| Invoices and credit notes | invoices, creditNotes | Sales billed to customers, and what was cancelled |
| End-of-day reports | cashRegisterReports | openedAt, closedAt, totals and breakdowns by payment, tax, category |
| Stock and its movements | variants { stock }, stockActivities | rawQuantity, movement kind and quantity |
| Customers and loyalty | customers, loyaltyActivities |
Every field is described in the GraphQL schema.
Read the sales of a period
query SalesOfPeriod($shopId: String!, $from: Datetime!, $to: Datetime!, $after: String) {
salesReceipts(
first: 50
after: $after
filterBy: { shopIds: { _in: [$shopId] }, createdAt: { _between: [$from, $to] } }
) {
pageInfo {
hasNextPage
endCursor
}
edges {
node {
id
name
createdAt
totalAmountIncludingTaxes
totalAmountExcludingTaxes
items {
... on SalesReceiptItem {
name
quantity
totalAmountIncludingTaxes
variant {
id
}
}
}
}
}
}
}
{ "shopId": "<shop id>", "from": "2026-10-01T00:00:00Z", "to": "2026-10-31T23:59:59.999Z" }
Repeat with after set to endCursor until hasNextPage is false. Dates are in UTC: shift them for the shop's time zone. _between includes both dates.
Keep your data up to date
- Read only what's new. Each run, read the receipts created since your last run (
createdAt: { _after: … }) and store theirid. - Start a little before your last run. A cash register can send its receipts to Wino some time after the sale, for example after a network outage. Start a few minutes, or more, before your last run, and skip the
ids you already have. - Keep requests light. A request that takes more than 30 seconds in production is stopped: ask for the fields you need, and avoid nesting lists inside lists.