Hi,
According to the post Auto payment integration, it’s necessary to add the [online_payment_link] tag in the email body so that the payment URL is included the first time the invoice is sent. However, it’s not clear if the payment URL will be added in the email body or in the PDF of the invoice.
I have an active connection with Stripe, and I am adding it this way in the body, but the payment link has not yet been included in the invoice or the body of the email to which the invoice is attached.
Can anyone explain what might be wrong?
{
"invoice": {
"email": {
"to": "email@email.com",
"from": "Test. <test@test.com>",
"subject": "Testing",
"body": "Your invoice is here. Payment using link below: [online_payment_link]"
}
}
}
Hi Aguinele, thanks for posting your question on our API forum. Firstly, if you are including the [online_payment_link]
tag within the body
attribute in your payload like this, we would expect the link to show up in the body of the email which has the invoice attached.
From your post, am I correct in understanding that your email is sending successfully, however, with the copy within it missing the payment link? I can’t see anything wrong with the example payload you’ve provided if this is being posted to the POST https://api.freeagent.com/v2/invoices/:id/send_email
endpoint. However, the link being missing could be related to the setup of the invoice in question. For example, it is not enough to have an active Stripe connection, each invoice needs to have Stripe listed as a payment method before the payment link can be displayed.
If you are creating your invoices via the API, then you can do this by setting "stripe": true
within the payment_methods
hash when creating an invoice (see Create an Invoice) .
If you are creating your invoices via the web app, then you can set Stripe as the default payment method on future invoices (see Setting default payment options for your invoices).
Best Wishes,
Andrew