Expense Categories
FreshBooks supplies Expense Categories to group expenses together to aid in expense tracking.
Access Requirements
Access | Requires Authorization |
Scopes | user:expenses:read user:expenses:write |
Includes
Include Name | Description |
---|---|
expense_usage_all_time | include expense usage across all time in category |
expense_usage_this_year | include expense usage across this year in category |
Filters
Filter Type | Name | Field | Description |
---|---|---|---|
In | categoryids | categoryid | matches list of categoryids, one specified per query arg |
Like | name | category | category name containing parameter |
BooleanEquals | is_cogs | is_cogs | true/false cost of goods sold |
BooleanEquals | is_editable | is_editable | true/false |
Equals | parentid | parentid | matches exact parentid |
Field Descriptions
Field | Type | Description |
---|---|---|
category | string | name for this category, e.g. “Advertising” |
categoryid | int | unique to this business id for this category |
id | int | duplicate of categoryid |
is_editable | bool | true/false can be edited |
is_cogs | bool | true/false represents cost of goods sold |
parentid | int | categorid of parent category |
vis_state | int | 0 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/<accountid>/expenses/categories/<id>
url = "https://api.freshbooks.com/accounting/account/<accountid>/expenses/categories/<id>"
headers = {'Authorization': 'Bearer <Bearer Token>', '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/<accountid>/expenses/categories
url = "https://api.freshbooks.com/accounting/account/<accountid>/expenses/categories"
headers = {'Authorization': 'Bearer <Bearer Token>', '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
}
}