Search⌘ K
AI Features

List, Update and Delete Expenses

Explore how to manage expenses programmatically using FreshBooks API. Learn to list all expenses, update details like notes, and delete expenses by setting appropriate parameters. This lesson equips you with practical skills for handling expense data effectively through API calls.

This lesson taught us to list, update, and delete an expense. We use the following endpoints for these tasks:

  • List all expenses: /accounting/account/{ACCOUNT_ID}/expenses/expenses

  • Update and delete an expense: /accounting/account/{ACCOUNT_ID}/expenses/expenses/{EXPENSE_ID}

List all expenses

In this section, we list all the expenses available in our FreshBooks account by using the /accounting/account/{ACCOUNT_ID}/expenses/expenses endpoint.

Request parameters

It does not take any request parameters, but we can add query parameters using include[]. Let’s see some of the values that we can use as query parameters in the table below:

Parameter Name

Description

attachment

Passing this value includes the attachment details associated with the expense receipts

category

If we pass this value to the include parameter, the response includes the category of the expense

account

Includes the account information in the expense

The syntax to use the query parameter is as follows: ...