...

/

Send and Delete an Invoice

Send and Delete an Invoice

Learn to send an invoice via email and delete an invoice using the FreshBooks API.

In this lesson, we’ll discuss two very important operations on invoices using FreshBooks API—sending and deleting an invoice. Both operations use the same endpoint:

  • /accounting/account/{ACCOUNT_ID}/invoices/invoices/{INVOICE_ID}

Send an invoice by email

In this section, we’ll see how we can email clients an invoice. When an invoice is created, it’s in draft mode and hence, not visible to the clients. We can send the invoice to the client by making an HTTP PUT request. This endpoint also lets us send an invoice to multiple clients.

Request parameters

The table below shows the parameters that are wrapped in the bodyParameters object of this call:

Parameter Name

Type

Category

Description

email_recipients

Array

Optional

Contains the email ID(s) of the client(s)

invoice_customized_email

Object

Optional

Defines the subject and the body of the email

action_email

Boolean

Required

Its value should be true so the invoice can be sent to the client

Let’s see the code in the widget below to send the invoice to the client by email.

...