Financial Categories
Financial Categories
Entity-scoped reporting categories shared by saved items, document lines, revenue analytics, and future expense reporting.
The Financial Category object
Attributes
Create a financial category
/financial-categoriesCreate a financial category
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Body parameters
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.financialCategories.create({
name: "Mission services",
color: "#93c5fd",
sort_order: 0
}, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"id": "fcat_abc123",
"entity_id": "ent_abc123",
"name": "Mission services",
"key": "mission-services",
"color": "#93c5fd",
"sort_order": 0,
"archived_at": null,
"created_at": "2026-04-15T10:00:00.000Z",
"updated_at": "2026-04-15T10:00:00.000Z"
}List financial categories
/financial-categoriesList financial categories
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Query parameters
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.financialCategories.list({
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"data": [
{
"id": "fcat_abc123",
"entity_id": "ent_abc123",
"name": "Mission services",
"key": "mission-services",
"color": "#93c5fd",
"sort_order": 0,
"archived_at": null,
"created_at": "2026-04-15T10:00:00.000Z",
"updated_at": "2026-04-15T10:00:00.000Z"
}
]
}Get accrued revenue grouped by financial category
/financial-categories/revenue-summaryGet accrued revenue grouped by financial category
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Query parameters
Start date filter (ISO 8601 date).
End date filter (ISO 8601 date).
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.financialCategories.getRevenueByFinancialCategory({
date_from: "2026-01-01",
date_to: "2026-12-31"
}, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"data": [
{
"financial_category_id": "fcat_abc123",
"name": "Mission services",
"color": "#93c5fd",
"amount": 12000,
"percentage": 75,
"currency_code": "EUR"
},
{
"financial_category_id": null,
"name": "Uncategorized",
"color": null,
"amount": 4000,
"percentage": 25,
"currency_code": "EUR"
}
],
"total": 16000,
"currency_code": "EUR",
"date_from": "2026-01-01",
"date_to": "2026-12-31"
}Update a financial category
/financial-categories/{id}Update a financial category
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Unique resource identifier. Prefix depends on the resource, for example inv_, cus_, or ent_.
Body parameters
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.financialCategories.update('FINANCIAL_CATEGORY_ID', {
name: "Mission services retainer",
color: "#60a5fa"
}, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"id": "fcat_abc123",
"entity_id": "ent_abc123",
"name": "Mission services retainer",
"key": "mission-services",
"color": "#60a5fa",
"sort_order": 0,
"archived_at": null,
"created_at": "2026-04-15T10:00:00.000Z",
"updated_at": "2026-04-15T12:00:00.000Z"
}Atomically update saved categories for multiple document line items
/financial-categories/document-items/batchAtomically update saved categories for multiple document line items
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Body parameters
Atomic batch of saved document line category updates.
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.financialCategories.updateDocumentItemFinancialCategories({
assignments: [
{
id: "item_abc123",
financial_category_id: "fcat_abc123"
},
{
id: "item_def456",
financial_category_id: null
}
]
}, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);[
{
"document_item_id": "item_abc123",
"financial_category_id": "fcat_abc123"
},
{
"document_item_id": "item_def456",
"financial_category_id": null
}
]Update the saved category for a document line item
/financial-categories/document-items/{id}Update the saved category for a document line item
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Unique resource identifier. Prefix depends on the resource, for example inv_, cus_, or ent_.
Body parameters
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.financialCategories.updateDocumentItemFinancialCategory('FINANCIAL_CATEGORY_ID', {
financial_category_id: "fcat_abc123"
}, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"document_item_id": "item_abc123",
"financial_category_id": "fcat_abc123"
}Archive a financial category
/financial-categories/{id}Archive a financial category
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Unique resource identifier. Prefix depends on the resource, for example inv_, cus_, or ent_.
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
await sdk.financialCategories.delete('FINANCIAL_CATEGORY_ID', {
entity_id: "YOUR_ENTITY_ID"
});
console.log('Deleted successfully');