Expense categories
Expense categories describe what an expense was for, such as Travel or Meals. A category can also have a unit and a price per unit (for example mileage at 0.45 per mile); people then enter a number of units and the amount is calculated.
Who can use it
Section titled “Who can use it”Every team member can read the business’s expense categories with their personal access token, because they need them to log expenses. Creating, changing, archiving and deleting categories needs the permission to manage settings. Administrators have it; members and managers only when their permission profile grants it. A token whose person is not an active member of the business is refused with 403.
The expense category object
Section titled “The expense category object”One expense category.
| Field | Type | Description |
|---|---|---|
id |
string | The category’s id. Read only. |
name |
string | The category’s name, 1 to 120 characters, unique within the business (archived categories included). |
unitName |
string | The unit, in the singular, such as mile. Null when the category has no unit. Can be null. |
unitPrice |
decimal | The price per unit, in currency, up to three decimals. The category is unit-priced only when both unitName and unitPrice are set; null otherwise. A new price applies to expenses logged afterwards only; expenses already logged keep the price they were saved with. Can be null. |
currency |
string | ISO code of the business’s currency, in which the unit price is given. Read only. |
isArchived |
boolean | Whether the category is archived. An archived category cannot be chosen for new expenses; expenses that already use it keep it. |
createdAt |
datetime | When the category was created. Read only. |
updatedAt |
datetime | When the category last changed, including being reordered in the app. Read only. |
Endpoints
Section titled “Endpoints”List expense categories
Section titled “List expense categories”Returns the business’s expense categories in the order the app shows them. Archived categories are left out unless you ask for them.
GET /v1/expense-categoriesParameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
page |
query | integer | No | Page number, default 1. |
limit |
query | integer | No | Rows per page, default 20, max 1000. |
isArchived |
query | boolean | No | false (default): active categories only. true: archived categories only. For both, leave this out and send includeArchived=true. |
includeArchived |
query | boolean | No | true returns active and archived categories together. Default false. |
search |
query | string | No | Matches part of the name. |
updatedSince |
query | datetime | No | Only categories changed at or after this moment. Records deleted since then are not reported. |
sortField |
query | string | No | position (default, the app’s order), name, createdAt or updatedAt. |
sortOrder |
query | string | No | asc (default) or desc. |
Rules
403when the token’s person is not an active member of the business.
Example request
curl "https://api.onesuite.io/v1/expense-categories?limit=2" \ -H "X-API-Key: $ONESUITE_TOKEN"const response = await fetch("https://api.onesuite.io/v1/expense-categories?limit=2", { headers: { "X-API-Key": process.env.ONESUITE_TOKEN, },});const data = await response.json();Example response — status 200
{ "data": [ { "id": "cm2cat0001ab12cdef00001", "name": "Mileage", "unitName": "mile", "unitPrice": 0.45, "currency": "GBP", "isArchived": false, "createdAt": "2026-03-02T10:00:00.000Z", "updatedAt": "2026-09-14T08:21:37.442Z" }, { "id": "cm2cat0002ab12cdef00002", "name": "Travel", "unitName": null, "unitPrice": null, "currency": "GBP", "isArchived": false, "createdAt": "2026-03-02T10:00:00.000Z", "updatedAt": "2026-03-02T10:00:00.000Z" } ], "totalCount": 6, "page": 1, "limit": 2}Get an expense category
Section titled “Get an expense category”Returns one expense category, archived or not.
GET /v1/expense-categories/:idParameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | Yes | The category’s id. |
Rules
404when no category with this id exists in the business.403when the token’s person is not an active member of the business.
Example request
curl "https://api.onesuite.io/v1/expense-categories/cm2cat0001ab12cdef00001" \ -H "X-API-Key: $ONESUITE_TOKEN"const response = await fetch("https://api.onesuite.io/v1/expense-categories/cm2cat0001ab12cdef00001", { headers: { "X-API-Key": process.env.ONESUITE_TOKEN, },});const data = await response.json();Example response — status 200
{ "data": { "id": "cm2cat0001ab12cdef00001", "name": "Mileage", "unitName": "mile", "unitPrice": 0.45, "currency": "GBP", "isArchived": false, "createdAt": "2026-03-02T10:00:00.000Z", "updatedAt": "2026-09-14T08:21:37.442Z" }}Create an expense category
Section titled “Create an expense category”Adds a category at the end of the list. Send both unitName and unitPrice to make it unit-priced.
POST /v1/expense-categoriesParameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
name |
body | string | Yes | 1 to 120 characters, unique within the business (archived categories included). |
unitName |
body | string | No | The unit, in the singular, up to 60 characters. |
unitPrice |
body | decimal | No | Price per unit in the business’s currency, 0 or more, up to three decimals. |
isArchived |
body | boolean | No | Create the category already archived. Default false. |
Rules
409when another category, active or archived, already has this name. To bring back an archived one, restore it with Update an expense category instead.400when the name is missing or longer than 120 characters, the unit name is longer than 60 characters, or the unit price is negative.403when the token’s person may not manage settings.- Answers 201 with the new category.
Example request
curl "https://api.onesuite.io/v1/expense-categories" \ -X POST \ -H "X-API-Key: $ONESUITE_TOKEN" \ -H "Content-Type: application/json" \ -d '{"name":"Mileage","unitName":"mile","unitPrice":0.45}'const response = await fetch("https://api.onesuite.io/v1/expense-categories", { method: "POST", headers: { "X-API-Key": process.env.ONESUITE_TOKEN, "Content-Type": "application/json", }, body: JSON.stringify({ name: "Mileage", unitName: "mile", unitPrice: 0.45, }),});const data = await response.json();Example response — status 201
{ "data": { "id": "cm2cat0001ab12cdef00001", "name": "Mileage", "unitName": "mile", "unitPrice": 0.45, "currency": "GBP", "isArchived": false, "createdAt": "2026-11-20T09:00:00.000Z", "updatedAt": "2026-11-20T09:00:00.000Z" }}Update an expense category
Section titled “Update an expense category”Changes the fields you send. Send isArchived: true to archive the category or false to restore it. A new unit price applies only to expenses logged afterwards.
PATCH /v1/expense-categories/:idParameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | Yes | The category’s id. |
| body | body | object | Yes | Any of name, unitName, unitPrice and isArchived, with the same limits as on create. Send at least one. |
Rules
409when the new name is already used by another category, active or archived.400when no field is sent or a value is invalid.404when no category with this id exists in the business.403when the token’s person may not manage settings.- Answers 200 with the updated category.
Example request
curl "https://api.onesuite.io/v1/expense-categories/cm2cat0001ab12cdef00001" \ -X PATCH \ -H "X-API-Key: $ONESUITE_TOKEN" \ -H "Content-Type: application/json" \ -d '{"unitPrice":0.48}'const response = await fetch("https://api.onesuite.io/v1/expense-categories/cm2cat0001ab12cdef00001", { method: "PATCH", headers: { "X-API-Key": process.env.ONESUITE_TOKEN, "Content-Type": "application/json", }, body: JSON.stringify({ unitPrice: 0.48, }),});const data = await response.json();Example response — status 200
{ "data": { "id": "cm2cat0001ab12cdef00001", "name": "Mileage", "unitName": "mile", "unitPrice": 0.48, "currency": "GBP", "isArchived": false, "createdAt": "2026-03-02T10:00:00.000Z", "updatedAt": "2026-11-20T09:12:05.118Z" }}Delete an expense category
Section titled “Delete an expense category”Deletes a category that no expense uses. A category with expenses logged to it cannot be deleted; archive it instead.
DELETE /v1/expense-categories/:idParameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id |
path | string | Yes | The category’s id. |
Rules
409when any expense uses the category; archive it instead.404when no category with this id exists in the business.403when the token’s person may not manage settings.
Example request
curl "https://api.onesuite.io/v1/expense-categories/cm2cat0009ab12cdef00009" \ -X DELETE \ -H "X-API-Key: $ONESUITE_TOKEN"const response = await fetch("https://api.onesuite.io/v1/expense-categories/cm2cat0009ab12cdef00009", { method: "DELETE", headers: { "X-API-Key": process.env.ONESUITE_TOKEN, },});const data = await response.json();Example response — status 200
{ "message": "Expense category deleted successfully"}