Accounting
Accounting
Internal accounting module: filings calendar, Slovenian VAT returns and payroll, US ledger, journal entries and tax-year worksheets. Available to verified internal users only.
The Accounting object
Attributes
{
"id": "emp_abc123",
"entity_id": "ent_abc123",
"status": "active",
"first_name": "Ana",
"last_name": "Novak",
"email": "ana.novak@example.com",
"tax_number": "12345678",
"personal_id": null,
"address": "Dunajska cesta 1",
"post_code": "1000",
"city": "Ljubljana",
"country_code": "SI",
"iban": "SI56191000000123438",
"employment_start": "2024-03-01",
"employment_end": null,
"employment_type": "full_time",
"weekly_hours": 40,
"gross_salary_monthly": 1541.16,
"seniority_bonus_percent": 4,
"meal_allowance_per_day": null,
"commute_mode": "per_km",
"commute_km_one_way": 30,
"commute_amount_monthly": null,
"works_remotely": false,
"tax_residency": "resident",
"general_allowance_mode": "standard",
"metadata": {},
"deleted_at": null,
"created_at": "2026-04-15T10:00:00.000Z",
"updated_at": "2026-04-15T10:00:00.000Z"
}Create an employee
/employeesCreate an employee
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Body parameters
Slovenian tax number (davcna stevilka), 8 digits. An optional SI prefix is stripped.
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.registerEmployee({
first_name: "Ana",
last_name: "Novak",
tax_number: "12345678",
employment_start: "2024-03-01",
gross_salary_monthly: 1541.16
}, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"id": "emp_abc123",
"entity_id": "ent_abc123",
"status": "active",
"first_name": "Ana",
"last_name": "Novak",
"email": "ana.novak@example.com",
"tax_number": "12345678",
"personal_id": null,
"address": "Dunajska cesta 1",
"post_code": "1000",
"city": "Ljubljana",
"country_code": "SI",
"iban": "SI56191000000123438",
"employment_start": "2024-03-01",
"employment_end": null,
"employment_type": "full_time",
"weekly_hours": 40,
"gross_salary_monthly": 1541.16,
"seniority_bonus_percent": 4,
"meal_allowance_per_day": null,
"commute_mode": "per_km",
"commute_km_one_way": 30,
"commute_amount_monthly": null,
"works_remotely": false,
"tax_residency": "resident",
"general_allowance_mode": "standard",
"metadata": {},
"deleted_at": null,
"created_at": "2026-04-15T10:00:00.000Z",
"updated_at": "2026-04-15T10:00:00.000Z"
}Create a draft VAT return filing record for a period
/vat-returnsCreate a draft VAT return filing record for a period
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Body parameters
Year for the VAT return period.
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.draftVatReturn({
year: 2026,
month: 8,
quarter: 3
}, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"id": "id",
"entity_id": "entity-id",
"period": {
"year": 0,
"month": 0,
"quarter": 0,
"from": "from",
"to": "to",
"label": "label"
},
"vat_period_setting": "monthly",
"period_matches_setting": true,
"status": "draft",
"boxes": {
"11": "0.00",
"12": "0.00",
"13": "0.00",
"14": "0.00",
"15": "0.00",
"21": "0.00",
"22": "0.00",
"23": "0.00",
"24": "0.00",
"25": "0.00",
"26": "0.00",
"31": "0.00",
"32": "0.00",
"33": "0.00",
"34": "0.00",
"35": "0.00",
"41": "0.00",
"42": "0.00",
"43": "0.00",
"51": "0.00",
"52": "0.00",
"11a": "0.00",
"22a": "0.00",
"23a": "0.00",
"24a": "0.00",
"24b": "0.00",
"24c": "0.00",
"25a": "0.00",
"25b": "0.00",
"31a": "0.00",
"32a": "0.00",
"42a": "0.00"
},
"record_counts": {
"kir": 0,
"kpr": 0
},
"warnings": [
"warnings"
],
"computed_at": "2025-01-15T10:30:00.000Z",
"approved_by_user_id": "approved-by-user-id",
"approved_at": "2025-01-15T10:30:00.000Z",
"submitted_by_user_id": "submitted-by-user-id",
"submitted_at": "2025-01-15T10:30:00.000Z",
"notes": "notes",
"metadata": {},
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
}Record a journal entry
/journal-entriesBalanced double-entry lines (2-100): each line has exactly one of debit/credit greater than zero with at most 2 decimals, and total debits equal total credits. The date may not precede the books start date.
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.accounting.recordJournalEntry({
date: "2027-01-01",
kind: "opening_balance",
memo: "Opening balances",
lines: [
{
account_code: "1000",
debit: 5000,
description: "Cash at books start"
},
{
account_code: "3000",
credit: 5000,
description: "Founder capital",
related_party: true
}
]
}, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
Space Invoices resource identifier (format: {prefix}_{hex24})
{
"id": "jou_ent_6595a27b5d35015c3ef0c3fd",
"entity_id": "ent_6595a27b5d35015c3ef0c3fd",
"date": "2027-01-01",
"kind": "opening_balance",
"memo": "Opening balances",
"lines": [
{
"account_code": "1000",
"debit": "5000.00",
"credit": "0.00",
"description": "Cash at books start",
"related_party": false
},
{
"account_code": "3000",
"debit": "0.00",
"credit": "5000.00",
"description": "Founder capital",
"related_party": true
}
],
"total": "5000.00",
"created_by_user_id": "usr_6595a27b5d35015c3ef0c3fd",
"created_at": "2027-01-02T10:00:00.000Z",
"updated_at": "2027-01-02T10:00:00.000Z"
}List employees
/employeesList employees
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Query parameters
Number of results per request.
Default: 10
Opaque cursor to fetch the next page of results. Reuse only with the same effective ordering. Use the value from pagination.next_cursor in the previous response.
Opaque cursor to fetch the previous page of results. Reuse only with the same effective ordering. Use the value from pagination.prev_cursor in the previous response.
Whether to include the total count of items in pagination.total.
Default is true.
When false, pagination.total returns -1 for better performance.
Filter by employee status. Omit to return both active and inactive employees.
Possible values: "active", "inactive", "null"
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.listEmployees(undefined, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
Pagination metadata including cursors and result counts
{
"data": [
{
"id": "emp_abc123",
"entity_id": "ent_abc123",
"status": "active",
"first_name": "Ana",
"last_name": "Novak",
"email": "ana.novak@example.com",
"tax_number": "12345678",
"personal_id": null,
"address": "Dunajska cesta 1",
"post_code": "1000",
"city": "Ljubljana",
"country_code": "SI",
"iban": "SI56191000000123438",
"employment_start": "2024-03-01",
"employment_end": null,
"employment_type": "full_time",
"weekly_hours": 40,
"gross_salary_monthly": 1541.16,
"seniority_bonus_percent": 4,
"meal_allowance_per_day": null,
"commute_mode": "per_km",
"commute_km_one_way": 30,
"commute_amount_monthly": null,
"works_remotely": false,
"tax_residency": "resident",
"general_allowance_mode": "standard",
"metadata": {},
"deleted_at": null,
"created_at": "2026-04-15T10:00:00.000Z",
"updated_at": "2026-04-15T10:00:00.000Z"
}
],
"pagination": {
"total": 1,
"next_cursor": null,
"prev_cursor": null,
"has_more": false
}
}Get resolved payroll parameters effective on a date
/payroll/parametersGet resolved payroll parameters effective on a date
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Query parameters
Default: "SI"
Resolve parameters effective on this date. Defaults to today.
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.resolvePayrollParameters(undefined, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"country_code": "SI",
"as_of": "2026-08-01",
"parameters": {
"employee_contributions.piz": {
"value": 15.5,
"unit": "percent_of_gross",
"effective_from": "1999-01-01",
"effective_to": null,
"verified": true,
"source_url": "https://www.fu.gov.si/fileadmin/Internet/Davki_in_druge_dajatve/Podrocja/Prispevki_za_socialno_varnost/Opis/Brosura_o_placevanju_prispevkov_za_socialno_varnost.doc",
"source_title": "FURS - Brošura o plačevanju prispevkov za socialno varnost",
"is_override": false
},
"ozp_monthly": {
"value": 39.36,
"unit": "eur_flat_per_month",
"effective_from": "2026-03-01",
"effective_to": "2027-02-28",
"verified": false,
"source_url": "https://www.domzale-ooz.si/2026/03/02/povisanje-obveznega-zdravstvenega-prispevka-od-1-marca-2026/",
"source_title": "OOZ Domžale, citing ZZZS",
"is_override": false
}
}
}Get the full effective-dated history for a payroll parameter key
/payroll/parameters/historyGet the full effective-dated history for a payroll parameter key
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Query parameters
Default: "SI"
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.getPayrollParameterHistory({
key: "employee_contributions.piz"
}, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"data": [
{
"id": "ppar_abc123",
"country_code": "SI",
"key": "ozp_monthly",
"value_numeric": 39.36,
"value_json": null,
"unit": "eur_flat_per_month",
"effective_from": "2026-03-01",
"effective_to": "2027-02-28",
"source_url": "https://www.domzale-ooz.si/2026/03/02/povisanje-obveznega-zdravstvenega-prispevka-od-1-marca-2026/",
"source_title": "OOZ Domžale, citing ZZZS",
"verified": false,
"note": null,
"entity_id": null,
"created_at": "2026-09-16T10:00:00.000Z",
"updated_at": "2026-09-16T10:00:00.000Z"
}
]
}List VAT return filing records, newest period first
/vat-returnsList VAT return filing records, newest period first
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Query parameters
Number of results per request.
Default: 10
Opaque cursor to fetch the next page of results. Reuse only with the same effective ordering. Use the value from pagination.next_cursor in the previous response.
Opaque cursor to fetch the previous page of results. Reuse only with the same effective ordering. Use the value from pagination.prev_cursor in the previous response.
Whether to include the total count of items in pagination.total.
Default is true.
When false, pagination.total returns -1 for better performance.
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.listVatReturns(undefined, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
Pagination metadata including cursors and result counts
{
"data": [
{
"id": "id",
"entity_id": "entity-id",
"period": {
"year": 0,
"month": 0,
"quarter": 0,
"from": "from",
"to": "to",
"label": "label"
},
"vat_period_setting": "monthly",
"period_matches_setting": true,
"status": "draft",
"boxes": {
"11": "0.00",
"12": "0.00",
"13": "0.00",
"14": "0.00",
"15": "0.00",
"21": "0.00",
"22": "0.00",
"23": "0.00",
"24": "0.00",
"25": "0.00",
"26": "0.00",
"31": "0.00",
"32": "0.00",
"33": "0.00",
"34": "0.00",
"35": "0.00",
"41": "0.00",
"42": "0.00",
"43": "0.00",
"51": "0.00",
"52": "0.00",
"11a": "0.00",
"22a": "0.00",
"23a": "0.00",
"24a": "0.00",
"24b": "0.00",
"24c": "0.00",
"25a": "0.00",
"25b": "0.00",
"31a": "0.00",
"32a": "0.00",
"42a": "0.00"
},
"record_counts": {
"kir": 0,
"kpr": 0
},
"warnings": [
"warnings"
],
"computed_at": "2025-01-15T10:30:00.000Z",
"approved_by_user_id": "approved-by-user-id",
"approved_at": "2025-01-15T10:30:00.000Z",
"submitted_by_user_id": "submitted-by-user-id",
"submitted_at": "2025-01-15T10:30:00.000Z",
"notes": "notes",
"metadata": {},
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
}
],
"pagination": {
"total": 0,
"next_cursor": "next-cursor",
"prev_cursor": "prev-cursor",
"has_more": true
}
}List filing-calendar obligations for a date range, with computed status
/filingsMaterialises any missing obligations for the requested range from the entity's Slovenian tax profile, then returns them with a computed state (upcoming/due_soon/overdue/done/dismissed). The ddv_o obligation's status follows its linked vat_filings row.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Query parameters
Range start (inclusive), YYYY-MM-DD.
Range end (inclusive), YYYY-MM-DD.
Filter by computed state.
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.listFilings({
from: "2026-09-01",
to: "2026-12-31"
}, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"data": [
{
"id": "id",
"entity_id": "entity-id",
"type": "ddv_o",
"period_start": "period-start",
"period_end": "period-end",
"due_date": "due-date",
"kind": "filing",
"verification": "verified",
"source": "source",
"related_resource": {
"type": "vat_filing",
"period_key": "period-key",
"id": "id"
},
"status": "upcoming",
"state": "upcoming",
"done_at": "2025-01-15T10:30:00.000Z",
"done_by": "done-by",
"dismissed_at": "2025-01-15T10:30:00.000Z",
"dismissed_by": "dismissed-by",
"notes": "notes",
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
}
],
"summary": {
"overdue": 0,
"due_this_week": 0,
"upcoming": 0
}
}List filing-calendar obligations across the account's entities
/accounting/filings-calendarAccount-level view for accountants managing more than one entity: returns the filing obligations of the account's entities where the caller is the company's accountant and the accounting module is available, each tagged with its entity id and name; other entities are left out. Scoped to one environment (environment query param, defaults to "live"), so live and sandbox entities are not mixed in one response.
Header parameters
Account Id on which the request is made. Optional if user is part of only one account.
Query parameters
Range start (inclusive), YYYY-MM-DD.
Range end (inclusive), YYYY-MM-DD.
Filter to a single entity id.
Environment to scope entities to. Defaults to "live".
Possible values: "live", "sandbox", "null"
Default: "live"
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.listAccountFilingsCalendar({
from: "2026-09-01",
to: "2026-12-31"
}, {
account_id: "YOUR_ACCOUNT_ID"
});
console.log(response);Returns
{
"data": [
{
"id": "id",
"entity_id": "entity-id",
"type": "ddv_o",
"period_start": "period-start",
"period_end": "period-end",
"due_date": "due-date",
"kind": "filing",
"verification": "verified",
"source": "source",
"related_resource": {
"type": "vat_filing",
"period_key": "period-key",
"id": "id"
},
"status": "upcoming",
"state": "upcoming",
"done_at": "2025-01-15T10:30:00.000Z",
"done_by": "done-by",
"dismissed_at": "2025-01-15T10:30:00.000Z",
"dismissed_by": "dismissed-by",
"notes": "notes",
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z",
"entity_name": "entity-name"
}
]
}List the US chart of accounts
/ledger/accountsList the US chart of accounts
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.listLedgerAccounts({
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"data": [
{
"code": "1100",
"name": "Accounts receivable",
"type": "asset",
"form_1120_line": null,
"schedule_l_line": "2a",
"deductibility": "none",
"related_party": false
},
{
"code": "6850",
"name": "Meals",
"type": "expense",
"form_1120_line": "26",
"schedule_l_line": null,
"deductibility": "half",
"related_party": false
}
]
}Trial balance for a period within one calendar year
/ledger/trial-balanceDerived on read from invoices, credit notes, advance invoices, expenses, payments, categorized bank transactions and manual journal entries (accrual basis). Balances are in each account's normal direction; totals.debit always equals totals.credit.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Query parameters
Range start (inclusive), YYYY-MM-DD.
Range end (inclusive), YYYY-MM-DD.
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.getTrialBalance({
date_from: "2027-01-01",
date_to: "2027-03-31"
}, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"date_from": "2027-03-01",
"date_to": "2027-03-31",
"accounts": [
{
"code": "1000",
"name": "Cash - checking",
"type": "asset",
"opening_balance": "0.00",
"debit": "400.00",
"credit": "0.00",
"closing_balance": "400.00"
},
{
"code": "1100",
"name": "Accounts receivable",
"type": "asset",
"opening_balance": "0.00",
"debit": "1100.00",
"credit": "400.00",
"closing_balance": "700.00"
},
{
"code": "2200",
"name": "Sales tax payable",
"type": "liability",
"opening_balance": "0.00",
"debit": "0.00",
"credit": "100.00",
"closing_balance": "100.00"
},
{
"code": "4000",
"name": "Sales",
"type": "revenue",
"opening_balance": "0.00",
"debit": "0.00",
"credit": "1000.00",
"closing_balance": "1000.00"
}
],
"totals": {
"debit": "1500.00",
"credit": "1500.00"
}
}Profit and loss for a period within one calendar year
/ledger/profit-and-lossProfit and loss for a period within one calendar year
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Query parameters
Range start (inclusive), YYYY-MM-DD.
Range end (inclusive), YYYY-MM-DD.
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.getProfitAndLossReport({
date_from: "2027-01-01",
date_to: "2027-03-31"
}, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"date_from": "2027-01-01",
"date_to": "2027-03-31",
"income": {
"accounts": [
{
"code": "4000",
"name": "Sales",
"amount": "1000.00"
}
],
"total": "1000.00"
},
"cost_of_revenue": {
"accounts": [],
"total": "0.00"
},
"expenses": {
"accounts": [
{
"code": "6800",
"name": "Software and hosting",
"amount": "250.00"
}
],
"total": "250.00"
},
"income_tax": {
"accounts": [],
"total": "0.00"
},
"gross_profit": "1000.00",
"net_income_before_tax": "750.00",
"net_income": "750.00"
}Balance sheet as of a date
/ledger/balance-sheetEquity includes retained earnings (3200) with the earnings of prior calendar years rolled in, and the current year's earnings to date.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Query parameters
Balance sheet date, YYYY-MM-DD.
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.getBalanceSheet({
as_of: "2027-12-31"
}, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"as_of": "2027-03-31",
"assets": {
"accounts": [
{
"code": "1000",
"name": "Cash - checking",
"amount": "750.00"
}
],
"total": "750.00"
},
"liabilities": {
"accounts": [],
"total": "0.00"
},
"equity": {
"accounts": [
{
"code": "3000",
"name": "Common stock",
"amount": "0.00"
}
],
"current_year_earnings": "750.00",
"total": "750.00"
},
"total_liabilities_and_equity": "750.00",
"balanced": true
}General-ledger detail
/ledger/entriesPostings in date order for ranges of up to 400 days. With account_code, each entry carries the account's running balance.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Query parameters
Range start (inclusive), YYYY-MM-DD.
Range end (inclusive), YYYY-MM-DD.
Only entries on this account; adds a running balance to each entry.
Entries per page (1-500).
Default: 100
Opaque cursor from pagination.next_cursor / pagination.prev_cursor of a previous response.
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.listLedgerEntries({
date_from: "2027-01-01",
date_to: "2027-03-31"
}, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
Pagination metadata including cursors and result counts
{
"data": [
{
"date": "2027-03-10",
"account_code": "1100",
"debit": "1100.00",
"credit": "0.00",
"source": {
"type": "invoice",
"id": "inv_6595a27b5d35015c3ef0c3fd",
"number": "2027-0001"
},
"description": "Invoice 2027-0001",
"related_party": false,
"contact_id": "cus_6595a27b5d35015c3ef0c3fd",
"financial_category_id": null,
"running_balance": "1100.00"
}
],
"pagination": {
"total": 1,
"next_cursor": null,
"prev_cursor": null,
"has_more": false
}
}List manual journal entries in a date range
/journal-entriesList manual journal entries in a date range
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Query parameters
Range start (inclusive), YYYY-MM-DD.
Range end (inclusive), YYYY-MM-DD.
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.listJournalEntries({
date_from: "2027-01-01",
date_to: "2027-03-31"
}, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"data": [
{
"id": "jou_ent_6595a27b5d35015c3ef0c3fd",
"entity_id": "ent_6595a27b5d35015c3ef0c3fd",
"date": "2027-01-01",
"kind": "opening_balance",
"memo": "Opening balances",
"lines": [
{
"account_code": "1000",
"debit": "5000.00",
"credit": "0.00",
"description": "Cash at books start",
"related_party": false
},
{
"account_code": "3000",
"debit": "0.00",
"credit": "5000.00",
"description": "Founder capital",
"related_party": true
}
],
"total": "5000.00",
"created_by_user_id": "usr_6595a27b5d35015c3ef0c3fd",
"created_at": "2027-01-02T10:00:00.000Z",
"updated_at": "2027-01-02T10:00:00.000Z"
}
]
}List vendor tax profiles
/vendor-tax-profilesContacts that have a tax profile (US classification, W-9/W-8 on file, related-party flag).
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.listVendorTaxProfiles({
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"data": [
{
"contact_id": "cus_6595a27b5d35015c3ef0c3fd",
"contact_name": "Founder Consulting LLC",
"contact_country_code": "US",
"classification": "us_individual_or_llc",
"tax_form_on_file": true,
"is_related_party": false,
"updated_at": "2027-03-02T10:15:00.000Z"
}
]
}Get an employee
/employees/{id}Get an employee
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');
const response = await sdk.accounting.getEmployee('ACCOUNTING_ID', {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"id": "emp_abc123",
"entity_id": "ent_abc123",
"status": "active",
"first_name": "Ana",
"last_name": "Novak",
"email": "ana.novak@example.com",
"tax_number": "12345678",
"personal_id": null,
"address": "Dunajska cesta 1",
"post_code": "1000",
"city": "Ljubljana",
"country_code": "SI",
"iban": "SI56191000000123438",
"employment_start": "2024-03-01",
"employment_end": null,
"employment_type": "full_time",
"weekly_hours": 40,
"gross_salary_monthly": 1541.16,
"seniority_bonus_percent": 4,
"meal_allowance_per_day": null,
"commute_mode": "per_km",
"commute_km_one_way": 30,
"commute_amount_monthly": null,
"works_remotely": false,
"tax_residency": "resident",
"general_allowance_mode": "standard",
"metadata": {},
"deleted_at": null,
"created_at": "2026-04-15T10:00:00.000Z",
"updated_at": "2026-04-15T10:00:00.000Z"
}Get a VAT return filing record
/vat-returns/{id}Get a VAT return filing record
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Space Invoices resource identifier (format: {prefix}_{hex24})
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.getVatReturn("vatf_6595a27b5d35015c3ef0c3fd", {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"id": "id",
"entity_id": "entity-id",
"period": {
"year": 0,
"month": 0,
"quarter": 0,
"from": "from",
"to": "to",
"label": "label"
},
"vat_period_setting": "monthly",
"period_matches_setting": true,
"status": "draft",
"boxes": {
"11": "0.00",
"12": "0.00",
"13": "0.00",
"14": "0.00",
"15": "0.00",
"21": "0.00",
"22": "0.00",
"23": "0.00",
"24": "0.00",
"25": "0.00",
"26": "0.00",
"31": "0.00",
"32": "0.00",
"33": "0.00",
"34": "0.00",
"35": "0.00",
"41": "0.00",
"42": "0.00",
"43": "0.00",
"51": "0.00",
"52": "0.00",
"11a": "0.00",
"22a": "0.00",
"23a": "0.00",
"24a": "0.00",
"24b": "0.00",
"24c": "0.00",
"25a": "0.00",
"25b": "0.00",
"31a": "0.00",
"32a": "0.00",
"42a": "0.00"
},
"record_counts": {
"kir": 0,
"kpr": 0
},
"warnings": [
"warnings"
],
"computed_at": "2025-01-15T10:30:00.000Z",
"approved_by_user_id": "approved-by-user-id",
"approved_at": "2025-01-15T10:30:00.000Z",
"submitted_by_user_id": "submitted-by-user-id",
"submitted_at": "2025-01-15T10:30:00.000Z",
"notes": "notes",
"metadata": {},
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
}Get a journal entry
/journal-entries/{id}Get a journal entry
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Space Invoices resource identifier (format: {prefix}_{hex24})
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.getJournalEntry("jou_ent_6595a27b5d35015c3ef0c3fd", {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
Space Invoices resource identifier (format: {prefix}_{hex24})
{
"id": "jou_ent_6595a27b5d35015c3ef0c3fd",
"entity_id": "ent_6595a27b5d35015c3ef0c3fd",
"date": "2027-01-01",
"kind": "opening_balance",
"memo": "Opening balances",
"lines": [
{
"account_code": "1000",
"debit": "5000.00",
"credit": "0.00",
"description": "Cash at books start",
"related_party": false
},
{
"account_code": "3000",
"debit": "0.00",
"credit": "5000.00",
"description": "Founder capital",
"related_party": true
}
],
"total": "5000.00",
"created_by_user_id": "usr_6595a27b5d35015c3ef0c3fd",
"created_at": "2027-01-02T10:00:00.000Z",
"updated_at": "2027-01-02T10:00:00.000Z"
}US tax-year worksheet (Form 1120, Schedules L/M-1/M-2, Form 5472, Delaware, 1099-NEC)
/us-tax-years/{year}A worksheet for the company's own tax preparer, computed from the accrual ledger for the calendar year: Form 1120 page 1 lines, line 26 statement, Schedules L, M-1 and M-2, a Form 5472 Part IV summary, the Delaware franchise tax under both methods, and the Form 1099-NEC recipient list. It is not an e-file. Line 29a applies the net operating loss carryforward (the pre-2018 pool first, then post-2017 losses capped at 80% of line 28), starting from the amounts in the accounting settings and the losses the ledger generated; form_1120.nol_schedule shows the roll-forward. Equity flows with the related party are left to the preparer; warnings lists what needs attention.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Tax year (calendar year, 2000 through next year).
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.getUsTaxYearWorksheet(2027, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"year": 2027,
"company": {
"name": "Acme Inc.",
"ein": "12-3456789",
"address": "8 The Green, Dover DE 19901, United States",
"state_of_incorporation": "DE",
"business_activity_code": "518210"
},
"form_1120": {
"lines": [
{
"line": "1a",
"label": "Gross receipts or sales",
"amount": "1000.00"
},
{
"line": "26",
"label": "Other deductions (see statement)",
"amount": "120.00"
},
{
"line": "28",
"label": "Taxable income before NOL and special deductions",
"amount": "880.00"
},
{
"line": "29a",
"label": "Net operating loss deduction",
"amount": "0.00"
},
{
"line": "29c",
"label": "Add lines 29a and 29b",
"amount": "0.00"
},
{
"line": "30",
"label": "Taxable income",
"amount": "880.00"
},
{
"line": "31",
"label": "Total tax (21% of line 30)",
"amount": "184.80"
}
],
"other_deductions_statement": [
{
"label": "Software",
"financial_category_id": "fcat_6a44700764c334f34ad63f1d",
"account_code": "6800",
"amount": "120.00"
}
],
"nol_schedule": {
"available_start": {
"pre_2018": "0.00",
"post_2017": "0.00"
},
"generated": "0.00",
"used": {
"pre_2018": "0.00",
"post_2017": "0.00"
},
"available_end": {
"pre_2018": "0.00",
"post_2017": "0.00"
}
},
"small_corporation_exemption": {
"total_receipts": "1000.00",
"total_assets": "5980.00",
"schedules_l_m1_m2_required": false
}
},
"schedule_l": {
"lines": [
{
"line": "1",
"label": "Cash",
"beginning": "5000.00",
"end": "5980.00"
},
{
"line": "15",
"label": "Total assets",
"beginning": "5000.00",
"end": "5980.00"
},
{
"line": "25",
"label": "Retained earnings - unappropriated",
"beginning": "0.00",
"end": "880.00"
},
{
"line": "28",
"label": "Total liabilities and shareholders' equity",
"beginning": "5000.00",
"end": "5980.00"
}
],
"balanced": true
},
"schedule_m1": {
"lines": [
{
"line": "10",
"label": "Income (page 1, line 28): line 6 less line 9",
"amount": "880.00"
}
]
},
"schedule_m2": {
"lines": [
{
"line": "8",
"label": "Balance at end of year",
"amount": "880.00"
}
]
},
"form_5472": {
"required": false,
"reporting_corporation": {
"name": "Acme Inc.",
"ein": "12-3456789",
"total_assets": "5980.00",
"business_activity_code": "518210",
"country_of_incorporation": "US"
},
"foreign_shareholder": null,
"related_parties": [],
"forms_required": 0
},
"delaware_franchise_tax": {
"inputs": {
"share_classes": [
{
"name": "Common",
"authorized_shares": 10000000,
"par_value": "0.00001"
}
],
"authorized_shares": 10000000,
"issued_shares": 8000000,
"total_gross_assets": "10000.00"
},
"missing_inputs": [],
"authorized_shares_method": {
"tax": "85165.00"
},
"assumed_par_value_method": {
"assumed_par": "0.00125",
"assumed_par_value_capital": "12500.00",
"classes": [
{
"name": "Common",
"authorized_shares": 10000000,
"par_value": "0.00001",
"applied_par": "0.00125",
"capital": "12500.00"
}
],
"tax": "400.00"
},
"tax": "400.00",
"annual_report_fee": "50.00",
"total_due": "450.00",
"installments_required": false,
"due_date": "2028-03-01"
},
"form_1099_nec": {
"threshold": "2000.00",
"threshold_verified": false,
"due_date": "2028-01-31",
"recipients": []
},
"warnings": [
{
"code": "nol_carryforward_missing",
"message": "No net operating loss carryforward is recorded in the accounting settings, so line 29a only uses losses the ledger generated. Confirm prior-year losses with the preparer and enter them as the NOL carryforward.",
"amount": "880.00"
}
]
}Update an employee
/employees/{id}Update an employee
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.accounting.modifyEmployee('ACCOUNTING_ID', {
gross_salary_monthly: 1600
}, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"id": "emp_abc123",
"entity_id": "ent_abc123",
"status": "active",
"first_name": "Ana",
"last_name": "Novak",
"email": "ana.novak@example.com",
"tax_number": "12345678",
"personal_id": null,
"address": "Dunajska cesta 1",
"post_code": "1000",
"city": "Ljubljana",
"country_code": "SI",
"iban": "SI56191000000123438",
"employment_start": "2024-03-01",
"employment_end": null,
"employment_type": "full_time",
"weekly_hours": 40,
"gross_salary_monthly": 1600,
"seniority_bonus_percent": 4,
"meal_allowance_per_day": null,
"commute_mode": "per_km",
"commute_km_one_way": 30,
"commute_amount_monthly": null,
"works_remotely": false,
"tax_residency": "resident",
"general_allowance_mode": "standard",
"metadata": {},
"deleted_at": null,
"created_at": "2026-04-15T10:00:00.000Z",
"updated_at": "2026-04-15T12:00:00.000Z"
}Replace an employee's stored attendance days for a month
/employees/{id}/attendanceReplace an employee's stored attendance days for a month
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_.
Query parameters
Body parameters
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.replaceEmployeeAttendance('ACCOUNTING_ID', {
days: [
{
date: "2026-08-18",
kind: "sick",
sick_reason: "illness"
},
{
date: "2026-08-19",
kind: "sick",
sick_reason: "illness"
},
{
date: "2026-08-20",
kind: "sick",
sick_reason: "illness"
}
]
}, {
year: 2026,
month: 8
}, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"employee_id": "emp_abc123",
"year": 2026,
"month": 8,
"days": [
{
"date": "2026-08-01",
"kind": "weekend",
"hours": 0,
"sick_reason": null,
"note": null,
"stored": false
},
{
"date": "2026-08-03",
"kind": "worked",
"hours": 8,
"sick_reason": null,
"note": null,
"stored": false
},
{
"date": "2026-08-15",
"kind": "public_holiday",
"hours": 0,
"sick_reason": null,
"note": null,
"stored": false
}
],
"summary": {
"working_days": 21,
"worked": 18,
"sick": 3,
"vacation": 0,
"public_holiday": 0,
"paid_leave": 0,
"unpaid": 0,
"other": 0,
"weekend": 10
}
}Set an entity-specific override for a payroll parameter
/payroll/parameters/{key}Accountant only. Creates an effective-dated override row for the current entity.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Dotted payroll parameter key.
Query parameters
Default: "SI"
Body parameters
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.setPayrollParameterOverride("employee_contributions.piz", {
value: 8.5,
unit: "eur_per_working_day",
effective_from: "2026-09-01",
source_title: "Internal decision: higher meal allowance for this entity"
}, undefined, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"id": "ppar_def456",
"country_code": "SI",
"key": "meal_allowance_tax_free_per_day",
"value_numeric": 8.5,
"value_json": null,
"unit": "eur_per_working_day",
"effective_from": "2026-09-01",
"effective_to": null,
"source_url": null,
"source_title": "Internal decision: higher meal allowance for this entity",
"verified": true,
"note": null,
"entity_id": "ent_abc123",
"created_at": "2026-09-16T10:00:00.000Z",
"updated_at": "2026-09-16T10:00:00.000Z"
}Revise a journal entry
/journal-entries/{id}Omitted fields stay unchanged; lines replaces the whole set and must still balance.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Space Invoices resource identifier (format: {prefix}_{hex24})
Body parameters
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.reviseJournalEntry("jou_ent_6595a27b5d35015c3ef0c3fd", {
memo: "Corrected opening balances",
lines: [
{
account_code: "1000",
debit: 5500
},
{
account_code: "3000",
credit: 5500,
related_party: true
}
]
}, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
Space Invoices resource identifier (format: {prefix}_{hex24})
{
"id": "jou_ent_6595a27b5d35015c3ef0c3fd",
"entity_id": "ent_6595a27b5d35015c3ef0c3fd",
"date": "2027-01-01",
"kind": "opening_balance",
"memo": "Opening balances",
"lines": [
{
"account_code": "1000",
"debit": "5000.00",
"credit": "0.00",
"description": "Cash at books start",
"related_party": false
},
{
"account_code": "3000",
"debit": "0.00",
"credit": "5000.00",
"description": "Founder capital",
"related_party": true
}
],
"total": "5000.00",
"created_by_user_id": "usr_6595a27b5d35015c3ef0c3fd",
"created_at": "2027-01-02T10:00:00.000Z",
"updated_at": "2027-01-02T10:00:00.000Z"
}Set a vendor tax profile
/vendor-tax-profiles/{contact_id}Creates or updates the profile of a contact. Omitted fields stay unchanged (false on first save); classification: null clears the classification. 404 when the contact does not exist in the entity or is deleted.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Space Invoices resource identifier (format: {prefix}_{hex24})
Body parameters
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.setVendorTaxProfile("cus_6595a27b5d35015c3ef0c3fd", {
classification: "us_individual_or_llc",
tax_form_on_file: true
}, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"contact_id": "cus_6595a27b5d35015c3ef0c3fd",
"contact_name": "Founder Consulting LLC",
"contact_country_code": "US",
"classification": "us_individual_or_llc",
"tax_form_on_file": true,
"is_related_party": false,
"updated_at": "2027-03-02T10:15:00.000Z"
}Delete (soft) an employee
/employees/{id}Delete (soft) an employee
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.accounting.archiveEmployee('ACCOUNTING_ID', {
entity_id: "YOUR_ENTITY_ID"
});
console.log('Deleted successfully');Delete (soft) a journal entry
/journal-entries/{id}Delete (soft) a journal entry
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Space Invoices resource identifier (format: {prefix}_{hex24})
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
await sdk.accounting.archiveJournalEntry("jou_ent_6595a27b5d35015c3ef0c3fd", {
entity_id: "YOUR_ENTITY_ID"
});
console.log('Deleted successfully');Preview DDV-O box totals for a period
/vat-returns/previewNon-mutating: aggregates the existing KIR/KPR classifier output into DDV-O box totals. Does not persist a filing record.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Query parameters
Year for the VAT return period (e.g. 2026).
Month (1-12) for a monthly period. Cannot be used with quarter.
Quarter (1-4) for a quarterly period. Cannot be used with month.
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.preview({
year: "2026"
}, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"period": {
"year": 0,
"month": 0,
"quarter": 0,
"from": "from",
"to": "to",
"label": "label"
},
"vat_period_setting": "monthly",
"period_matches_setting": true,
"deadline": {
"due_date": "2026-09-30",
"kir_kpr_prefill_cutoff": "2026-09-25"
},
"rpo_required": true,
"boxes": {
"11": "0.00",
"12": "0.00",
"13": "0.00",
"14": "0.00",
"15": "0.00",
"21": "0.00",
"22": "0.00",
"23": "0.00",
"24": "0.00",
"25": "0.00",
"26": "0.00",
"31": "0.00",
"32": "0.00",
"33": "0.00",
"34": "0.00",
"35": "0.00",
"41": "0.00",
"42": "0.00",
"43": "0.00",
"51": "0.00",
"52": "0.00",
"11a": "0.00",
"22a": "0.00",
"23a": "0.00",
"24a": "0.00",
"24b": "0.00",
"24c": "0.00",
"25a": "0.00",
"25b": "0.00",
"31a": "0.00",
"32a": "0.00",
"42a": "0.00"
},
"record_counts": {
"kir": 0,
"kpr": 0
},
"warnings": [
"warnings"
]
}Get an employee's attendance calendar for a month
/employees/{id}/attendanceGet an employee's attendance calendar for a month
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_.
Query parameters
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.getEmployeeAttendance('ACCOUNTING_ID', {
year: 2026,
month: 8
}, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"employee_id": "emp_abc123",
"year": 2026,
"month": 8,
"days": [
{
"date": "2026-08-01",
"kind": "weekend",
"hours": 0,
"sick_reason": null,
"note": null,
"stored": false
},
{
"date": "2026-08-03",
"kind": "worked",
"hours": 8,
"sick_reason": null,
"note": null,
"stored": false
},
{
"date": "2026-08-15",
"kind": "public_holiday",
"hours": 0,
"sick_reason": null,
"note": null,
"stored": false
}
],
"summary": {
"working_days": 21,
"worked": 18,
"sick": 3,
"vacation": 0,
"public_holiday": 0,
"paid_leave": 0,
"unpaid": 0,
"other": 0,
"weekend": 10
}
}Recompute a draft VAT return's DDV-O box snapshot
/vat-returns/{id}/recomputeRecompute a draft VAT return's DDV-O box snapshot
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Space Invoices resource identifier (format: {prefix}_{hex24})
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.recomputeVatReturn("vatf_6595a27b5d35015c3ef0c3fd", {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"id": "id",
"entity_id": "entity-id",
"period": {
"year": 0,
"month": 0,
"quarter": 0,
"from": "from",
"to": "to",
"label": "label"
},
"vat_period_setting": "monthly",
"period_matches_setting": true,
"status": "draft",
"boxes": {
"11": "0.00",
"12": "0.00",
"13": "0.00",
"14": "0.00",
"15": "0.00",
"21": "0.00",
"22": "0.00",
"23": "0.00",
"24": "0.00",
"25": "0.00",
"26": "0.00",
"31": "0.00",
"32": "0.00",
"33": "0.00",
"34": "0.00",
"35": "0.00",
"41": "0.00",
"42": "0.00",
"43": "0.00",
"51": "0.00",
"52": "0.00",
"11a": "0.00",
"22a": "0.00",
"23a": "0.00",
"24a": "0.00",
"24b": "0.00",
"24c": "0.00",
"25a": "0.00",
"25b": "0.00",
"31a": "0.00",
"32a": "0.00",
"42a": "0.00"
},
"record_counts": {
"kir": 0,
"kpr": 0
},
"warnings": [
"warnings"
],
"computed_at": "2025-01-15T10:30:00.000Z",
"approved_by_user_id": "approved-by-user-id",
"approved_at": "2025-01-15T10:30:00.000Z",
"submitted_by_user_id": "submitted-by-user-id",
"submitted_at": "2025-01-15T10:30:00.000Z",
"notes": "notes",
"metadata": {},
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
}Approve a draft VAT return (accountant only)
/vat-returns/{id}/approveApprove a draft VAT return (accountant only)
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Space Invoices resource identifier (format: {prefix}_{hex24})
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.approveVatReturn("vatf_6595a27b5d35015c3ef0c3fd", {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"id": "id",
"entity_id": "entity-id",
"period": {
"year": 0,
"month": 0,
"quarter": 0,
"from": "from",
"to": "to",
"label": "label"
},
"vat_period_setting": "monthly",
"period_matches_setting": true,
"status": "draft",
"boxes": {
"11": "0.00",
"12": "0.00",
"13": "0.00",
"14": "0.00",
"15": "0.00",
"21": "0.00",
"22": "0.00",
"23": "0.00",
"24": "0.00",
"25": "0.00",
"26": "0.00",
"31": "0.00",
"32": "0.00",
"33": "0.00",
"34": "0.00",
"35": "0.00",
"41": "0.00",
"42": "0.00",
"43": "0.00",
"51": "0.00",
"52": "0.00",
"11a": "0.00",
"22a": "0.00",
"23a": "0.00",
"24a": "0.00",
"24b": "0.00",
"24c": "0.00",
"25a": "0.00",
"25b": "0.00",
"31a": "0.00",
"32a": "0.00",
"42a": "0.00"
},
"record_counts": {
"kir": 0,
"kpr": 0
},
"warnings": [
"warnings"
],
"computed_at": "2025-01-15T10:30:00.000Z",
"approved_by_user_id": "approved-by-user-id",
"approved_at": "2025-01-15T10:30:00.000Z",
"submitted_by_user_id": "submitted-by-user-id",
"submitted_at": "2025-01-15T10:30:00.000Z",
"notes": "notes",
"metadata": {},
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
}Record a VAT return as submitted to eDavki (accountant only)
/vat-returns/{id}/submitRecord a VAT return as submitted to eDavki (accountant only)
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Space Invoices resource identifier (format: {prefix}_{hex24})
Body parameters
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.submitVatReturn("vatf_6595a27b5d35015c3ef0c3fd", {
submitted_at: "2026-09-25T10:15:00.000Z",
notes: "notes"
}, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"id": "id",
"entity_id": "entity-id",
"period": {
"year": 0,
"month": 0,
"quarter": 0,
"from": "from",
"to": "to",
"label": "label"
},
"vat_period_setting": "monthly",
"period_matches_setting": true,
"status": "draft",
"boxes": {
"11": "0.00",
"12": "0.00",
"13": "0.00",
"14": "0.00",
"15": "0.00",
"21": "0.00",
"22": "0.00",
"23": "0.00",
"24": "0.00",
"25": "0.00",
"26": "0.00",
"31": "0.00",
"32": "0.00",
"33": "0.00",
"34": "0.00",
"35": "0.00",
"41": "0.00",
"42": "0.00",
"43": "0.00",
"51": "0.00",
"52": "0.00",
"11a": "0.00",
"22a": "0.00",
"23a": "0.00",
"24a": "0.00",
"24b": "0.00",
"24c": "0.00",
"25a": "0.00",
"25b": "0.00",
"31a": "0.00",
"32a": "0.00",
"42a": "0.00"
},
"record_counts": {
"kir": 0,
"kpr": 0
},
"warnings": [
"warnings"
],
"computed_at": "2025-01-15T10:30:00.000Z",
"approved_by_user_id": "approved-by-user-id",
"approved_at": "2025-01-15T10:30:00.000Z",
"submitted_by_user_id": "submitted-by-user-id",
"submitted_at": "2025-01-15T10:30:00.000Z",
"notes": "notes",
"metadata": {},
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
}Reopen an approved VAT return back to draft (accountant only)
/vat-returns/{id}/reopenReopen an approved VAT return back to draft (accountant only)
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Space Invoices resource identifier (format: {prefix}_{hex24})
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.reopenVatReturn("vatf_6595a27b5d35015c3ef0c3fd", {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"id": "id",
"entity_id": "entity-id",
"period": {
"year": 0,
"month": 0,
"quarter": 0,
"from": "from",
"to": "to",
"label": "label"
},
"vat_period_setting": "monthly",
"period_matches_setting": true,
"status": "draft",
"boxes": {
"11": "0.00",
"12": "0.00",
"13": "0.00",
"14": "0.00",
"15": "0.00",
"21": "0.00",
"22": "0.00",
"23": "0.00",
"24": "0.00",
"25": "0.00",
"26": "0.00",
"31": "0.00",
"32": "0.00",
"33": "0.00",
"34": "0.00",
"35": "0.00",
"41": "0.00",
"42": "0.00",
"43": "0.00",
"51": "0.00",
"52": "0.00",
"11a": "0.00",
"22a": "0.00",
"23a": "0.00",
"24a": "0.00",
"24b": "0.00",
"24c": "0.00",
"25a": "0.00",
"25b": "0.00",
"31a": "0.00",
"32a": "0.00",
"42a": "0.00"
},
"record_counts": {
"kir": 0,
"kpr": 0
},
"warnings": [
"warnings"
],
"computed_at": "2025-01-15T10:30:00.000Z",
"approved_by_user_id": "approved-by-user-id",
"approved_at": "2025-01-15T10:30:00.000Z",
"submitted_by_user_id": "submitted-by-user-id",
"submitted_at": "2025-01-15T10:30:00.000Z",
"notes": "notes",
"metadata": {},
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
}Export a VAT return filing as DDV-O eDavki XML
/vat-returns/{id}/exportNon-mutating: serializes the filing's stored DDV-O box snapshot into the eDavki 'Uvoz dokumenta' XML (validates against the committed DDV-O XSD). Only available once a filing is approved or submitted; a draft filing returns 409.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Space Invoices resource identifier (format: {prefix}_{hex24})
Query parameters
Export format for a VAT return filing.
Possible values: "ddv_o_xml"
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const blob = await sdk.accounting.exportVatReturn("vatf_6595a27b5d35015c3ef0c3fd", {
format: "ddv_o_xml"
}, {
entity_id: "YOUR_ENTITY_ID"
});
const arrayBuffer = await blob.arrayBuffer();
const { writeFile } = await import('node:fs/promises');
await writeFile('download.bin', Buffer.from(arrayBuffer));
console.log('Saved download.bin');Mark a filing obligation as done
/filings/{id}/completeMark a filing obligation as done
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Space Invoices resource identifier (format: {prefix}_{hex24})
Body parameters
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.completeFiling("flg_6595a27b5d35015c3ef0c3fd", {
note: "note"
}, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"id": "id",
"entity_id": "entity-id",
"type": "ddv_o",
"period_start": "period-start",
"period_end": "period-end",
"due_date": "due-date",
"kind": "filing",
"verification": "verified",
"source": "source",
"related_resource": {
"type": "vat_filing",
"period_key": "period-key",
"id": "id"
},
"status": "upcoming",
"state": "upcoming",
"done_at": "2025-01-15T10:30:00.000Z",
"done_by": "done-by",
"dismissed_at": "2025-01-15T10:30:00.000Z",
"dismissed_by": "dismissed-by",
"notes": "notes",
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
}Reopen a done or dismissed filing obligation back to upcoming
/filings/{id}/reopenReopen a done or dismissed filing obligation back to upcoming
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Space Invoices resource identifier (format: {prefix}_{hex24})
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.reopenFiling("flg_6595a27b5d35015c3ef0c3fd", {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"id": "id",
"entity_id": "entity-id",
"type": "ddv_o",
"period_start": "period-start",
"period_end": "period-end",
"due_date": "due-date",
"kind": "filing",
"verification": "verified",
"source": "source",
"related_resource": {
"type": "vat_filing",
"period_key": "period-key",
"id": "id"
},
"status": "upcoming",
"state": "upcoming",
"done_at": "2025-01-15T10:30:00.000Z",
"done_by": "done-by",
"dismissed_at": "2025-01-15T10:30:00.000Z",
"dismissed_by": "dismissed-by",
"notes": "notes",
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
}Dismiss a filing obligation that does not apply this period
/filings/{id}/dismissDismiss a filing obligation that does not apply this period
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Space Invoices resource identifier (format: {prefix}_{hex24})
Body parameters
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const response = await sdk.accounting.dismissFiling("flg_6595a27b5d35015c3ef0c3fd", {
reason: "reason"
}, {
entity_id: "YOUR_ENTITY_ID"
});
console.log(response);Returns
{
"id": "id",
"entity_id": "entity-id",
"type": "ddv_o",
"period_start": "period-start",
"period_end": "period-end",
"due_date": "due-date",
"kind": "filing",
"verification": "verified",
"source": "source",
"related_resource": {
"type": "vat_filing",
"period_key": "period-key",
"id": "id"
},
"status": "upcoming",
"state": "upcoming",
"done_at": "2025-01-15T10:30:00.000Z",
"done_by": "done-by",
"dismissed_at": "2025-01-15T10:30:00.000Z",
"dismissed_by": "dismissed-by",
"notes": "notes",
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
}Export the US tax-year worksheet to Excel
/us-tax-years/{year}/exportThe same worksheet as an Excel workbook (Summary, Form 1120, Line 26 statement, Schedule L, Schedule M-1, Schedule M-2, Form 5472, Delaware franchise tax, 1099-NEC) followed by the supporting profit and loss, balance sheet, trial balance and general ledger for the year. Amounts are numeric cells.
Header parameters
Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.
Path parameters
Tax year (calendar year, 2000 through next year).
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';
const sdk = new SpaceInvoices('YOUR_API_KEY');
const blob = await sdk.accounting.exportUsTaxYearWorksheet(2027, {
entity_id: "YOUR_ENTITY_ID"
});
const arrayBuffer = await blob.arrayBuffer();
const { writeFile } = await import('node:fs/promises');
await writeFile('download.bin', Buffer.from(arrayBuffer));
console.log('Saved download.bin');