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';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.financialCategories.create({
name: "Mission services",
color: "#93c5fd",
sort_order: 0
});
console.log(response);Returns
{
"id": "fcat_abc123",
"entity_id": "ent_abc123",
"name": "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';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.financialCategories.list();
console.log(response);Returns
{
"data": [
{
"id": "fcat_abc123",
"entity_id": "ent_abc123",
"name": "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';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.financialCategories.getRevenueByFinancialCategory({
date_from: "2026-01-01",
date_to: "2026-12-31"
});
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
Body parameters
import SpaceInvoices from '@spaceinvoices/js-sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.financialCategories.update("inv_6595a27b5d35015c3ef0c3fd", {
name: "Mission services retainer",
color: "#60a5fa"
});
console.log(response);Returns
{
"id": "fcat_abc123",
"entity_id": "ent_abc123",
"name": "Mission services retainer",
"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
import SpaceInvoices from '@spaceinvoices/js-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
}
]
});
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
Body parameters
Category to assign to this saved document line. Use null to explicitly mark the line as uncategorized.
import SpaceInvoices from '@spaceinvoices/js-sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.financialCategories.updateDocumentItemFinancialCategory("inv_6595a27b5d35015c3ef0c3fd", {
financial_category_id: "fcat_abc123"
});
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
import SpaceInvoices from '@spaceinvoices/js-sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
await sdk.financialCategories.delete("inv_6595a27b5d35015c3ef0c3fd");
console.log('Deleted successfully');