FlowRunner
Features Pricing
Theme
Start Free

Stripe payments recorded on FreshBooks invoices

When a Stripe payment comes in, this flow finds the FreshBooks invoice it pays and records the payment there. Payments it cannot match go to finance in Slack.

The prompt

When a payment succeeds in Stripe, look up the Stripe customer and find their client in FreshBooks by email. Among the client's open invoices, find the one the payment is for: first by an invoice number in the payment's description, otherwise by an invoice whose balance equals the amount. Record the payment on that invoice in FreshBooks with the amount, the date and the Stripe payment ID. If there's no customer, no client or no matching invoice, post the payment to our finance channel in Slack so someone records it by hand.

FlowRunner Prompt to Flow built this flow from that request. Here it is as it opens in the editor.

The flow

Yes No No Yes Yes No Action Find the client inFreshBooks Code Match the payment toan invoice Condition Customer on thepayment? Condition Client inFreshBooks? Condition Open invoice found? Action Record the paymentin FreshBooks Action Get the Stripecustomer Action Send unmatchedpayment to finance Starts the flow Payment receivedin Stripe Action Find the client'sinvoices Code Read the payment Code Match the client byemail

Download the file, then in FlowRunner click + beside Flows, pick it under Import a Flow Version and click Create. How importing works

What each step does

  1. Payment received in Stripe Checks Stripe every 5 minutes for payments that went through, and reads the amount, date and payment method.
  2. Get the Stripe customer Reads the customer on the payment to get their email address. A payment with no customer goes to finance in Slack.
  3. Find the client in FreshBooks Finds the FreshBooks client with the same email address. When there is none, the payment goes to finance in Slack.
  4. Match the payment to an invoice Looks through the client's open invoices for one whose number appears in the payment's description or metadata. Failing that, it takes the oldest open invoice whose balance equals the payment, in the same currency.
  5. Open invoice found? A payment that matches no open invoice goes to finance in Slack with the amount, the Stripe payment ID and the customer's email, and nothing is recorded.
  6. Record the payment in FreshBooks Records the payment against the invoice with the amount, the payment date and method, and the Stripe payment and charge IDs in the note.

Before you turn it on

  • Connect your FreshBooks, Stripe and Slack accounts, and enter your Stripe secret key and client ID.
  • Pick your finance channel in Send unmatched payment to finance.