Log yesterday's PayPal payments to Sheets and post a digest

By General Input

Every morning at 7am, yesterday's PayPal payments land in a running spreadsheet ledger and a short Slack digest shows what you actually took in.

Integrations

  • PayPal
  • Google Sheets
  • Slack

Type

Deterministic Code

Categories

  • Finance
  • Operations

Every morning at 7am, close out yesterday's PayPal activity for me: log every transaction to a running Google Sheets ledger, then post a short summary to Slack. Use a cron trigger set to 7am in my business timezone.

Start with PayPal List Transactions, scoped to the previous calendar day only, from 00:00:00 to 23:59:59 in my account timezone. Request the full field set so payer details come back alongside the transaction itself, and page through the results until every transaction for the day has been collected rather than stopping at the first page. PayPal's transaction reporting can lag behind real time by a few hours, which is exactly why this runs the next morning instead of at midnight.

Append one row per transaction to my Google Sheets ledger using Append Values, in a fixed column order: date, transaction ID, gross amount, PayPal fee, net amount, currency, buyer name, status. Write the amounts as plain numbers in their own columns and keep the currency code in a separate column, so the sheet stays sortable and filterable. Do not convert or combine currencies inside the ledger.

Be careful with the money fields. PayPal returns every monetary amount as an object carrying a currency_code plus a decimal string value, so read the value and the currency separately rather than assuming a single number, and parse the string instead of treating it as an integer or minor units. Fee amounts come back negative, so net is gross plus fee, not gross minus fee. Refunds and reversals arrive as their own transactions with negative gross amounts; log them as they come.

Then aggregate the day and post a digest to Slack with Send a Message. Group every total by currency code and report each currency on its own line, never adding different currencies into one combined number. For each currency, show total gross, total PayPal fees, net total, and the transaction count. Finish with the single largest payment received that day, including its amount and the buyer name. Only completed, positive transactions are eligible to be the largest payment, so a refund never wins that slot.

Two edge cases matter. If PayPal returns no transactions at all for the day, stop quietly: write nothing to the sheet and post nothing to Slack, because an empty digest every morning just trains people to ignore the channel. And if the workflow runs twice for the same day, do not append the same transactions again; read the transaction IDs already present in the ledger and skip any that are already logged.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentLocal listing health board for every location you manageWin back LiveChat visitors whose chats went unansweredLet support send one-off Loops emails without an engineerStop cold emails to anyone with a live deal in PipedriveiMessage campaign console with pre-flight checks and delivery boardChat quality review board for LiveChat support leadsLinkedIn Ads budget pacing dashboard for every client accountFront desk appointment confirmation board for the next 3 daysGive your team Looker numbers without buying more seats