Create and Update an Invoice

Overview

As we know, an invoice is a bill to the client(s) against the servicesIt is a time tracking that tells the clients how much time has been spent doing their work. and/or items we offer. It states the details of the amount that is owed by a client. Invoices help us maintain the record of our income in FreshBooks.

In this lesson, we’ll see how to create an invoice and update it. We’ll also see how to upload a logo and use it on the invoice. We use the following endpoints to achieve these tasks:

  • Create an invoice: https://api.freshbooks.com/accounting/account/{ACCOUNT_ID}/invoices/invoices
  • Upload a logo: https://api.freshbooks.com/uploads/account/{ACCOUNT_ID}/images
  • Update an invoice: https://api.freshbooks.com/accounting/account/{ACCOUNT_ID}/invoices/invoices/{INVOICE_ID}

The endpoints we study for invoice-related operations require the following scope permissions:

  • user:invoices:read
  • user:invoices:write
  • user:uploads:read
  • user:uploads:write

A single invoice with line items

In this section, we’ll create an invoice with line items. This means that we’ll provide details of the items in our HTTP POST request. We can use items that we added previously, or list new items in the lines array.

Request parameters

Let’s see some important parameters in the table below:

Get hands-on with 1200+ tech skills courses.