Integration with SaaS product

New to Freeagent API so just looking for some pointers.

I use Freeagent already for invoicing, and now have a SaaS service and Stripe to pay for it, and I would ideally like to integrate Freeagent for the invoicing side.

Can anyone who’s done this suggest the best mechanism - is it to get my product to create the invoice and associated Stripe subscription? Or get Freeagent to take care of the Stripe side of things? Or something else?

Grateful for any advice!

So you run a SaaS service which your customers pay you for via Stripe?

I do this too and I integrate it with FreeAgent using DoubleAgent, which I built partly for this very purpose. Every time a Stripe payout to you shows up in your bank transactions in FreeAgent, DoubleAgent gets from Stripe the breakdown of customer payments and fees making up the payout, and find/creates contacts in FreeAgent for each customer, and finds/creates invoices in FreeAgent for each customer payment and settles them from the payout. All the fees get booked correctly too.

You end up with contacts automatically created (if necessary) in FreeAgent for your Stripe customers, and invoices automatically created (if necessary) and settled for each customer payment. So you can accurately track the customer lifetime value for all your customers.

Hope that helps!

Andrew Stewart

That sounds interesting Andrew.

How does it collect contact info to create the contact?

Also, how does it work with the Stripe integration and/or Stripe payments from other sources?

How does it collect contact info to create the contact?

First it looks for a contact in FreeAgent with the same email address as the customer in Stripe. If it doesn’t find one, it creates a contact using the Stripe customer shipping information.

…how does it work with the Stripe integration…

I’m sorry, which Stripe integration?

…and/or Stripe payments from other sources?

You can link DoubleAgent to as many Stripe accounts as you want. In each case when DoubleAgent sees a payout from Stripe in your FreeAgent bank transactions, it looks for the corresponding payout in your connected Stripe account(s) and goes from there. Does that answer your question?

I’m sorry, which Stripe integration?

The Freeagent Stripe integration. So if, for instance a customer pays for an invoice for something other than my SaaS product, that was raised in Freeagent, will Doubleagent try to create another invoice? Hope that makes sense, trying to get my head around it :wink:

DoubleAgent will look for an existing invoice whose due value is equal to the amount paid via Stripe. If it doesn’t find one, it will create one.

So if you invoiced your customer for something in FreeAgent, assuming that invoice’s amount differs from the customer’s payment amount via Stripe, DoubleAgent will create a new invoice for the Stripe payment and leave the existing invoice alone.

Hi Andrew,

Nice work!

Is the assumption that the entire shopping cart process is managed via Stripe Elements? So invoices are created line by line in Stripe with all sales tax applied, etc? Then Double Agent makes a copy of that invoice in FreeAgent?

Some of my customers pay on account by BACs, so ideally, I want to create ALL my invoices in FreeAgent via the API - then I can enable the Stripe and / or Paypal payment methods according to my needs.

Hi Sii,

DoubleAgent is flexible: if you have an invoice in Stripe with line items and sales tax etc, DA will copy that invoice into FreeAgent. On the other hand, if your customers make payments via Stripe against an invoice from FreeAgent, DA will find the FA invoice and settle it from the payout.

So however you arrange things, DA should work for you.