Sync Kushki settlement reports to PostgreSQL

ProductivitySales EnablementRecipe ToolsData ParserMarketingUtilitiesDatabase

What it does

When someone sends a settlement report email to Gmail, this automation downloads the attachment and parses it into lists. The flow extracts transaction, payout, and chargeback data, then stores totals in PostgreSQL so the database stays current with Kushki settlements.

Who it's for

Accounting teams who reconcile Kushki payment settlements and need reports synced to PostgreSQL without manual entry.

How teams use this

Automate daily settlement reconciliation

Receive the Kushki report each day, parse it, and load the data into PostgreSQL without opening the email or spreadsheet. Finance teams verify totals in the database instead of manually entering rows.

Route reports to a different inbox

Change the email filter to watch a shared settlement mailbox instead of a single person's inbox. The parsing and database sync remain the same, so multiple team members can send the report.

Add chargeback alerts to Slack

Include a Slack step after parsing so the team is notified when chargebacks exceed a threshold. Set a condition to only alert if the chargeback list contains disputes above a dollar amount.

Track fee trends over time

Store each settlement with a timestamp in PostgreSQL so finance can query fee totals by week or month. Add a date field to the record so historical analysis is possible without re-running old reports.

How it works

  1. Receive settlement report email. A new email arrives in Gmail from msantacruz@trytoku.com with a settlement report attachment ready to process.
  2. Download the attachment. Extract the Excel file from the email in Gmail so it can be converted and parsed into structured data for processing.
  3. Convert Excel to CSV format. Transform the Excel file into CSV using Workato Recipe Function so the parser can read rows and columns as structured records.
  4. Parse CSV into transaction lists. Extract transaction IDs, payments, chargebacks, and calculate totals for amounts, payouts, and fees using CSV Parser.
  5. Store settlement data in PostgreSQL. Write transaction lists, payout totals, and fee totals to PostgreSQL so the database reflects the latest Kushki settlement.