Reporting API for Sales Summary

New to Square development and am looking for an API to allow me to pull summarised sales figures based on a set of filter parameters (e.g. net sales for a specific day, for a specific item, location etc.). Wanting to tie this into some custom displays to show this live. Basically similar data that the Sellers Dashboard Reporting section uses.

Couldn’t find any other discussions on this recently so wondering if this on the roadmap at all?

2 Likes

At this time there isn’t a Reporting API that would pull all the data in with one API call. You’ll have to use the Orders, Payments, and Catalog APIs to get this data with our existing API offering. This is a very popular feature request and we hope to have more for you soon. :slightly_smiling_face:

We are trying to get the sold items from walk ins sales. We don’t see them in the Orders API. Is there a way to get them? We need to total sold items per day but the only way is to pull the whole orders and get the sold items from there, but walk ins sales are missing there. The only place we see them is in the Items Reports as part of ‘Register’. Is there any way to get those details with any API?

How were these walk-in orders taken? Are they itemized orders? If so all that information is available with the Orders API. :slightly_smiling_face:

Bump, a reporting API would be very handy.

1 Like

We’re constantly working to improve our features based on feedback like this, so I’ll be sure to share your request to the API product team. :slightly_smiling_face:

how do i do that? Say i wanted to find out how many “dine in” cups of coffee were sold within specific time parameters?

If a dine in cup of coffee is it’s own item you can query for all the orders for a given timeframe and parse the results for items with dine in catalog_object_id. :slightly_smiling_face:

Hi, everyone. I just wanted to check in and confirm this feature has not been implemented, is that right?

For context, I’m looking for an API endpoint that can provide aggregate sales data split by categories over a period of time (e.g., Daily, Weekly)

At this time there isn’t any additional updates on this feature. :slightly_smiling_face:

Chiming in to add color to the need for an API like this… The current automated reports are not sufficient for our needs, they are too broad and shouldn’t be sent to employees. At our establishment, the kitchen staff needs to know how many of each item in a particular category have sold the prior day so that they can plan accordingly. This is currently not possible without calling many different APIs and hitting rate limits, since category information is not provided in order data, and there is no way to filter orders by category. An ideal solution would involve being able to generate a custom report on demand, so that developers could programmatically run this report as needed.

_Alternately_ a way to fetch order counts by item filtered by category ID with a single API endpoint.

Thanks for outlining your use case—helping your kitchen staff see “yesterday’s sold-by-category” numbers is a great example of a custom report that isn’t a one-size-fits-all fit for our out-of-the-box reporting. Here are a few best-practice recommendations on how to build exactly the report you need, without running into unhandled 429s:

Pull raw order data and catalog data, then do your own aggregation-
• Use the Orders API SearchOrders to fetch all orders for your date range. You can filter by location and date to keep the result set as narrow as possible.
• Use the Catalog API BatchRetrieveCatalogObjects with include_related_objects set to true to fetch all item variations plus their category assignments. Cache this locally—categories rarely change—which dramatically reduces calls to Square and keeps you safely under rate limits. Also subscribe to catalog.update webhook events to keep track of any changes.
• In your own service, join each order’s line items to your local catalog data, filter by the category IDs you care about, and sum up the quantity sold for each item.

Handle rate limits gracefully-
• Whenever you receive a 429, pause and retry according to the Retry-After header or implement an exponential-backoff strategy (e.g., 500 ms → 1 s → 2 s … up to a cap).
• Batch your catalog retrieves and your order queries at sensible page sizes (e.g. 100–200 objects per request) to reduce the total number of API calls.
• If you need near-real-time counts, consider subscribing to the Orders webhooks. Capture each new or updated order in your own datastore, update your running totals on the fly, and serve your “day’s totals by category” report from that database rather than re-querying Square every time.

Why Square’s built-in reports may not match your use case-
• Our standard reports are designed to give broad overviews and cover many businesses’ needs. They aren’t customizable down to “item counts within a specific category” on demand.
• Whenever you need something very tailored—like “for kitchen staff, only these categories, yesterday’s total per menu item”—you’ll get the raw data via our APIs and build the report logic yourself.

We do track feature requests internally, so I’ve passed your requirement along to our product team. :slight_smile:

1 Like