Expense categories let you organise expenses by type. Rebill seeds a set of default categories the first time you list them. You can add custom categories and delete any you no longer need.
List categories
GET /expense-category
Returns all expense categories for your account, sorted with defaults first and custom categories alphabetically after.
curl https://rebill-api-896466068278.africa-south1.run.app/expense-category \ -H "Authorization: Bearer sk_your_secret_key"
Response:
{
"categories": [
{
"id": "cat-001",
"name": "Materials & Stock",
"is_default": true
},
{
"id": "cat-002",
"name": "Travel & Transport",
"is_default": true
},
{
"id": "cat-010",
"name": "Marketing",
"is_default": false
}
]
}Category object
| Field | Type | Description |
|---|---|---|
| id | string | Unique identifier |
| name | string | Category name |
| is_default | boolean | Whether this is a system-provided default category |
Create a category
POST /expense-category
| Field | Required | Type | Description |
|---|---|---|---|
| name | Yes | string | Name for the new category |
curl -X POST https://rebill-api-896466068278.africa-south1.run.app/expense-category \
-H "Authorization: Bearer sk_your_secret_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Marketing"
}'Response (201 Created):
{
"id": "cat-010"
}Delete a category
DELETE /expense-category/:id
Deletes a category. Any expenses using this category are automatically reassigned to the "Other" category. The "Other" category itself cannot be deleted.
curl -X DELETE https://rebill-api-896466068278.africa-south1.run.app/expense-category/cat-010 \ -H "Authorization: Bearer sk_your_secret_key"
Response (200 OK):
{
"reassigned": 3
}The reassigned field indicates how many expenses were moved to "Other".
Note
The "Other" category cannot be deleted. Attempting to do so returns 422 Unprocessable Entity.