Daily Stripe revenue digest in Excel and Slack

By General Input

Every weekday morning, append yesterday's Stripe totals to your Excel finance log and post the same numbers to your finance Slack channel.

Integrations

  • Stripe
  • Microsoft Excel
  • Slack

Type

Deterministic Code

Categories

  • Finance
  • Operations

Build me a deterministic daily revenue ledger as a code workflow. There is no reasoning step. The flow is: list yesterday's Stripe charges, aggregate them, append one row to my Excel finance table, and post a short Slack summary.

Trigger: cron, every weekday at 08:00 America/New_York.

Step 1. Stripe "List Charges". Filter on created between 00:00:00 and 23:59:59 of yesterday in the Stripe account's timezone (convert to Unix epoch seconds for the created[gte] and created[lte] parameters). Set limit=100 and follow Stripe's cursor pagination (use the last item's id as starting_after, repeat while has_more is true) so a day with hundreds of charges still rolls up correctly. Collect every charge before aggregating.

Step 2. Aggregate the collected charges into: date (yesterday in ISO 8601), succeeded_count (status === "succeeded"), failed_count (status === "failed"), gross (sum of amount across succeeded charges, converted from minor units to major units, e.g. cents to dollars), refunded (sum of amount_refunded across all charges, same conversion), net (gross minus refunded), and top_3_customers (group succeeded charges by customer id, sum the amounts, take the top three, include customer id, billing email if available, and total).

Step 3. Microsoft Excel "Add Table Row". Append exactly one row to a table named "Daily Revenue" in my finance workbook in OneDrive for Business. Columns in order: Date, Gross, Net, Succeeded count, Failed count, Refunded amount. Make the workbook ID and table name configurable.

Step 4. Slack "Send a Message". Post to #finance using Slack mrkdwn. Include yesterday's date, gross, net, refunded, succeeded count, failed count, and the top 3 customers as a short list. Use the currency code from the Stripe charges (assume one currency for the day; if mixed, surface the count by currency).

Edge cases: if there are zero charges yesterday, still append a row of zeros to the Excel table and still post a Slack message saying there were no successful charges. Always run after the day has fully closed in the account timezone. Use idempotent date keying so a re-run for the same date does not double-write (skip if a row for that date already exists in the table).

Configurable inputs: trigger time and timezone, Excel workbook ID and table name, Slack channel, currency, and whether to include the top customers section in the Slack message.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentWin back LiveChat visitors whose chats went unansweredLet support send one-off Loops emails without an engineerCustomer lifecycle inspector for Loops, Stripe and PostHogChat quality review board for LiveChat support leadsWin back no-show and cancelled appointments every morningLive Loop returns analytics with product-level drill-downMonth-end Stripe finance pack, stored and shared in SlackNewsletter pre-flight and approval board for Mailjet sendsTurn a prospect spreadsheet into personalized sequence enrollments