Pull Square sales summary reports for automated reporting and analysis
Programatically Pull Square Report Data Into N8N What It Does This sub-workflow connects to the Square API and generates a daily sales summary report for all of your Square locations. The report matches the figures di...
Template notes
Programatically Pull Square Report Data Into N8N
What It Does This sub-workflow connects to the Square API and generates a daily sales summary report for all of your Square locations. The report matches the figures displayed in the Square Dashboard > Reports > Sales Summary.
It’s designed to be reused in other workflows, ideal for reporting, data storage, accounting, or automation.
Prerequisites To use this workflow, you'll need: - Square API credentials (configured as a Header Auth credential)
How to Set Up Square Credentials: - Go to Credentials > Create New - Choose Header Auth - Set the Name to "Authorization" - Set the Value to your Square Access Token (e.g., Bearer <your-api-key>)
How It Works 1. Trigger: The workflow is triggered as a sub-workflow, requiring a reportdate input. 2. Fetch Locations: An HTTP request gets all Square locations linked to your account. 3. Fetch Orders: For each location, an HTTP request pulls completed orders for the specified reportdate. 4. Filter Empty Locations: Locations with no sales are ignored. 5. Aggregate Sales Data: A Code node processes the order data and produces a summary identical to Square’s built-in Sales Summary report. 6. Output: A cleaned, consistent summary that can be consumed by parent workflows or other nodes.
Example Use Cases - Automatically store daily sales data in Google Sheets, MySQL, or PostgreSQL for analysis and historical tracking - Automatically send daily email or Slack reports to managers or finance teams - Build weekly/monthly reports by looping over multiple dates - Push sales data into accounting software like QuickBooks or Xero for automated bookkeeping - Calculate commissions or rent payments based on sales volume
How to Use - Configure both HTTP Request nodes to use your Square API credential. - If you are not in the Toronto/New York Timezone, please change the "startat" and "endat" parameters in the second HTTP node from "-05:00" to your local timezone - Use as a sub-workflow inside a main workflow. - Pass a reportdate (formatted as YYYY-MM-DD) to the sub-workflow when you call it.