1. Rowfire
  2. Use cases

Ticket chargebacks before their evidence deadline

Open a Zendesk ticket five days before a chargeback's evidence is due, from Supabase, once per dispute, so no dispute is lost by default.

  • Supabase
  • Zendesk
  • Slack
  • Payments
  • once per dispute

The trigger

One read-only SELECT against Supabase. Rowfire polls it for new rows, and the rule fires once per dispute.

SELECT d.id AS dispute_id,
       d.charge_id,
       a.id AS account_id,
       a.name AS account,
       d.amount,
       d.currency,
       d.reason,
       d.evidence_due_by,
       greatest(d.evidence_due_by - interval '5 days',
                d.created_at) AS escalate_at
FROM disputes d
JOIN accounts a ON a.id = d.account_id
WHERE d.status = 'needs_response'
  AND d.evidence_submitted_at IS NULL
  AND a.is_test = false

A customer disputes a charge. Your app stores the dispute it got from the payment processor, with an evidence_due_by date, and then nothing else happens. No code runs as that date gets close. If nobody sends the receipts, the delivery proof and the customer’s emails in time, the dispute is lost by default and the money goes with it.

The query lists every dispute that still needs a response and has no evidence submitted. The key is dispute_id. The clock is escalate_at: five days before the deadline, or the moment the dispute was created if it arrived with less time than that. When a poll sees escalate_at pass, the rule fires once per dispute.

A dispute that gets its evidence before the mark drops out of the query and never fires. Disputes on test accounts are filtered out. Tables without a schema are read as public, which is where an app on Supabase usually keeps them. Table and column names are a sketch; adapt them to your schema.

The Zendesk side

Bind the Zendesk create ticket action so each dispute becomes one ticket someone on the payments team owns until the evidence is in:

Subject: Chargeback evidence due {{ evidence_due_by }}: {{ account }}
Body: Dispute {{ dispute_id }} on charge {{ charge_id }}, {{ amount }} {{ currency }}.
Reason: {{ reason }}. Evidence is due by {{ evidence_due_by }}.

Set the priority to high and add the tags your queue uses, such as payments and chargeback. The ticket carries the reason code, so whoever picks it up knows what evidence to gather before opening the app.

A Slack heads-up on the same trigger

Add a second rule on the same trigger with a Slack action that posts to #payments. Each rule keeps its own count, so the message and the ticket fire independently, and one can run in shadow while the other is live.

A last call two days out

Five days is the first warning. A second trigger with interval '2 days' catches the disputes that still have no evidence after that, with its own rule posting to whoever leads the team. A dispute that got its evidence in between never reaches it.

Backtest the rules over the last few months to see how many disputes each would have flagged, then watch them in shadow before they go live. For the charges that fail before they are ever disputed, see escalate the third declined charge in a month. For more on reading Supabase, see how to send Slack alerts from Supabase, or try a trigger on the live demo.

Questions

Nothing happens in the app five days before a deadline. How does this fire?

The clock is computed in the query: escalate_at, five days before evidence_due_by. When a poll sees escalate_at pass for a dispute that still has no evidence, the rule fires.

What if someone submits evidence before the five-day mark?

The dispute drops out of the query and never fires. Only disputes still waiting on evidence at the mark become tickets.

Will every open dispute fire when I switch it on?

No. The poller starts every trigger at now, so history never fires. A backtest shows what the rule would have done over past days, without sending anything.

Does Rowfire need my Supabase database password?

No. It sends the query to Supabase's read-only query endpoint, which runs it as Supabase's read-only user. You connect with OAuth (Projects: Read and Database: Read) or a personal access token.