...

/

List, Update and Delete Expenses

List, Update and Delete Expenses

Learn about listing, updating, and deleting expenses using the FreshBooks API.

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: ...