Skip to content
× FreshBooks App Logo
FreshBooks
Official App
Free - Google Play
Get it
You're currently on our US site. Select your regional site here:

Expense Categories

FreshBooks supplies Expense Categories to group expenses together to aid in expense tracking.

Access Requirements

AccessRequires Authorization
Scopesuser:expenses:read
user:expenses:write

Includes

Include NameDescription
expense_usage_all_timeinclude expense usage across all time in category
expense_usage_this_yearinclude expense usage across this year in category

Filters

Filter TypeNameFieldDescription
Incategoryidscategoryidmatches list of categoryids, one specified per query arg
Likenamecategorycategory name containing parameter
BooleanEqualsis_cogsis_cogstrue/false cost of goods sold
BooleanEqualsis_editableis_editabletrue/false
Equalsparentidparentidmatches exact parentid

Field Descriptions

FieldTypeDescription
categorystringname for this category, e.g. “Advertising”
categoryidintunique to this business id for this category
idintduplicate of categoryid
is_editablebooltrue/false can be edited
is_cogsbooltrue/false represents cost of goods sold
parentidintcategorid of parent category
vis_stateint0 for active, 1 for deleted

Get Single Expense Category

Request: GET https://api.freshbooks.com/accounting/account/<accountid>/expenses/categories/<id>

Response:

{
  "response": {
    "result": {
      "category": {
        "category": "Advertising",
        "categoryid": 93992990,
        "id": 93992990,
        "is_editable": false,
        "is_cogs": false,
        "parentid": 121904083,
        "vis_state": 0
      }
    }
  }
}

Create Single Expense Category

Creating Expense Categories is not supported by the API.

Update Single Expense Category

Updating Expense Categories is not supported by the API.

Delete Single Expense Category

Deleting Expense Categories is not supported by the API.

List Expense Categories

Request: GET https://api.freshbooks.com/accounting/account/<accountid>/expenses/categories

Response;

{
  "response": {
    "result": {
      "per_page": 15,
      "total": 3,
      "page": 1,
      "categories": [
        {
          // same format as single category
        },
        {
          // same format as single category
        },
        {
          // same format as single category
        }
      ],
      "pages": 1
    }
  }
}

Get Single Expense Category

Request: GET
https://api.freshbooks.com/accounting/account/&ltaccountid&gt/expenses/categories/&ltid&gt


url = "https://api.freshbooks.com/accounting/account/&ltaccountid&gt/expenses/categories/&ltid&gt"
headers = {'Authorization': 'Bearer &ltBearer Token&gt', 'Api-Version': 'alpha', 'Content-Type': 'application/json'}
res = requests.get(url, data=None, headers=headers)

Response:


{
  "response": {
    "result": {
      "category": {
        "category": "Advertising",
        "categoryid": 93992990,
        "id": 93992990,
        "is_editable": false,
        "is_cogs": false,
        "parentid": 121904083,
        "vis_state": 0
      }
    }
  }
}

Create Single Expense Category

Creating Expense Categories is not supported by the API.

Create Single Expense Category

Creating Expense Categories is not supported by the API.

Create Single Expense Category

Creating Expense Categories is not supported by the API.

List Expense Categories

Request: GET
https://api.freshbooks.com/accounting/account/&ltaccountid&gt/expenses/categories


url = "https://api.freshbooks.com/accounting/account/&ltaccountid&gt/expenses/categories"
headers = {'Authorization': 'Bearer &ltBearer Token&gt', 'Api-Version': 'alpha', 'Content-Type': 'application/json'}
res = requests.get(url, data=None, headers=headers)

Response:


{
  "response": {
      "result": {
        "per_page": 15,
        "total": 3,
        "page": 1,
        "categories": [
          {
            // same format as single category
          },
          {
            // same format as single category
          },
          {
            // same format as single category
          }
        ],
        "pages": 1
      }
  }