Post yesterday's Square sales into QuickBooks every night

By General Input

Every day at 2am, yesterday's Square takings are booked in QuickBooks with processing fees split out, so your books match what actually lands in the bank.

Integrations

  • Square
  • QuickBooks Online
  • Slack Bot

Type

Deterministic Code

Categories

  • Finance
  • Operations

Every day at 2am, post yesterday's Square takings into QuickBooks Online so the books reconcile without any manual data entry. Trigger this on a cron schedule.

Start with the Square List Payments action, filtered to the previous calendar day. Use the full day in the business's local timezone, from 00:00:00 to 23:59:59, not a rolling 24 hour window. If the day returned no payments at all, skip the run entirely and post nothing. Do not create a zero value sales receipt on days the business was closed.

From that list of payments, total four figures for the day: gross sales, processing fees, refunds, and net deposit. Gross sales is the sum of the payment amounts. Processing fees come from the processing_fee amounts on each payment. Refunds come from the refunded_money on each payment. Net deposit is gross sales minus fees minus refunds, and should represent what actually reaches the bank.

Important: Square returns all monetary amounts using its Money object, where the value is in the smallest currency unit. For USD that means cents, so 1000 means $10.00. Convert every amount from cents to dollars before posting anything to QuickBooks or reporting it in Slack. Getting this wrong posts figures inflated by 100x, so do the conversion once, in one place, immediately after totalling.

Record the day's sales total in QuickBooks using the Create Sales Receipt action. Date the receipt to the day being reconciled rather than the day the workflow runs, and label it clearly as the Square daily sales summary for that date so it is easy to find at month end.

Then book the processing fees as a separate expense line using the QuickBooks Create Journal Entry action, debiting the merchant fees expense account and crediting the account the sales receipt was deposited to. Keeping fees on their own line is what makes the net in QuickBooks match the actual bank deposit instead of the headline sales figure.

Finally, confirm the run in Slack using the Slack Bot Send a Message action. Show the date being reconciled plus all four figures: gross sales, processing fees, refunds, and net deposit, formatted as currency. If the run was skipped because there were no payments, either stay silent or send a brief note saying there were no sales to post, rather than reporting zeros as if they were real.

Two accuracy notes worth handling. First, details from offline point of sale orders can take up to 72 hours to appear in Square, so a given day's figures can be slightly incomplete if the business trades offline; mention this caveat in the setup notes. Second, a refund issued yesterday against a payment taken last week will not appear in yesterday's payment list, so if refund accuracy matters, also pull Square List Payment Refunds for the same day window and use that as the refunds figure instead of the per payment refunded_money.

The Square connection needs the PAYMENTS_READ scope. If the seller uses Xero rather than QuickBooks, the same structure applies with the equivalent Xero sales and journal actions.

Related prompts

Explore more prompts
A brand asset library your marketing team actually searchesTurn Mailjet email clicks into ranked HubSpot follow-upsClean out the Looker dashboards and Looks nobody opensLiveKit live operations console for room moderationWake up dormant Keap leads with a researched reasonLiveChat coverage board for planning next week's shiftsPhone routing control panel for LiveKit voice agentsLinkedIn Ads budget pacing dashboard for every client accountGive your team Looker numbers without buying more seatsPause marketing emails to escalated customers, then restore them