Auto payment integration

Hi FreeAgent Team,

Hope you find this day resourceful. I was integrating your API in my application and I was facing issues regarding auto payment (stripe, PayPal). I’m sending stripe and paypal as true in payment_methods key. Stripe & PayPal are enabled in my application but still I cannot get payment_url in response. I have to send this url along with Invoice to my customers via email. Any kind of help regarding this issue would be much appreciated.

Thank You

Hi Salman,

Thanks for raising this question, and welcome to our API forum :wave: Sorry to hear you’ve had some trouble getting online invoice payment links to work, and I’ll so my best to help. The payment_url isn’t generated until you send the invoice for the first time, which is why you don’t see it in the API response for Draft invoices. All you need to do to include the payment link in the invoice e-mail is to put the [online_payment_link] tag in your e-mail body, which will get automatically turned into the actual payment URL in the sent e-mail’s content. If you’re interested in what other e-mail tags you can include, I’d recommend this article on our Knowledge Base: How to send an invoice to a contact – FreeAgent

Best wishes,

Ewa

Thanks Ewa for your response,

Please confirm me, will this tag [online_payment_link] work in api call for sending email i.e while sending email via https://api.freeagent.com/v2/invoices/:id/send_email this endpoint?

Hi Salman,

Yes it absolutely will, all you’ll need to do is include the [online_payment_link] tag in your e-mail’s body when you make a POST request to /v2/invoices/:id/send_email.

I hope this helps!

Best wishes,

Ewa

Hi Ewa, thank you for response & your support. My issue is resolved and everything working as expected now. Thanks for saving my day. :slight_smile:

1 Like

You’re most welcome, Salman!

Thanks for the post but i am still confused can anyone explain in detail.