Skip to content

Invoices

The Invoice object

object

Attributes

idstring
numberstring
itemsarray of objects
datestring<date-time>

Date the invoice was created (ISO 8601 datetime at midnight UTC)

date_duestring<date-time>nullable

Date the invoice is due (ISO 8601 datetime at midnight UTC)

date_servicestringnullable

Service date in YYYY-MM-DD format. For invoices and credit notes. When it (or date_service_to, if later) falls on or before date, foreign-currency conversion uses it as the exchange-rate reference date instead of date.

currency_codestring
issuerobject

Document issuer (entity) information

customer_idstringnullable
customerobjectnullable

Customer information snapshot stored on the document. Null means no customer. When present, known customer fields are returned with null for omitted values.

notestringnullable

Note for the document. If not provided, defaults to entity's document-type-specific note setting. Pass empty string to explicitly set no note.

totalnumber

Document total before tax in the currency's major unit. For EUR, 29.90 means €29.90, not 2,990 cents.

total_with_taxnumber

Document total after tax in the currency's major unit. For EUR, 29.90 means €29.90, not 2,990 cents.

taxesarray of objects

Applied taxes summary

metadataobjectnullable

Custom string key-value data for your own use, with up to 50 properties. Keys are opaque and may contain periods. Useful for storing external IDs, tags, or integration data.

Other attributes
footerstringnullable
entity_idstring
date_yearinteger
shareable_idstringnullable
voided_atstring<date-time>nullable
total_convertednumbernullable
total_with_tax_convertednumbernullable
created_atstring<date-time>
updated_atstring<date-time>
total_paidnumber
total_duenumber
paid_in_fullboolean
Country-specific attributes
Examplejson
{
  "id": "inv_6595a27b5d35015c3ef0c402",
  "entity_id": "ent_6595a27b5d35015c3ef0c3fd",
  "number": "DOC-2025-001",
  "date": "2025-03-15T00:00:00.000Z",
  "currency_code": "USD",
  "issuer": {
    "name": "Starward Equipment Co.",
    "address": "1 Launchpad Way",
    "city": "Cape Canaveral",
    "state": "FL",
    "post_code": "32920",
    "country": "USA",
    "country_code": "US",
    "tax_number": "59-8765432"
  },
  "customer_id": "cus_6595a27b5d35015c3ef0c403",
  "customer": {
    "name": "Horizon Launch Systems Inc.",
    "address": "100 Rocket Row",
    "city": "Houston",
    "state": "TX",
    "post_code": "77058",
    "country": "USA",
    "country_code": "US",
    "tax_number": "74-1234567"
  },
  "items": [
    {
      "id": "inv_item_6595a27b5d35015c3ef0c402",
      "invoice_id": "inv_6595a27b5d35015c3ef0c402",
      "advance_invoice_id": null,
      "expense_id": null,
      "item_id": null,
      "name": "Ground Station Antenna Array",
      "description": "Deep space tracking antenna with 12m dish",
      "translations": {
        "name": {
          "de-DE": "Bodenstations-Antennenanlage"
        },
        "description": {
          "de-DE": "Tiefraum-Tracking-Antenne mit 12-m-Parabolspiegel"
        }
      },
      "quantity": 2,
      "price": 12500,
      "gross_price": null,
      "taxes": [
        {
          "rate": 22,
          "tax_id": "tax_6595a27b5d35015c3ef0c402"
        }
      ],
      "discounts": [],
      "type": null,
      "unit": null,
      "total": 25000,
      "total_with_tax": 30500,
      "total_converted": null,
      "total_with_tax_converted": null,
      "metadata": {
        "project_code": "MSN-2025-001",
        "department": "Ground Operations"
      },
      "created_at": "2025-03-15T00:00:00.000Z",
      "updated_at": "2025-03-15T00:00:00.000Z"
    },
    {
      "id": "inv_item_6595a27b5d35015c3ef0c403",
      "invoice_id": "inv_6595a27b5d35015c3ef0c402",
      "advance_invoice_id": null,
      "expense_id": null,
      "item_id": null,
      "name": "Orbital Navigation License",
      "description": "Annual software license for orbital trajectory planning",
      "translations": {
        "name": {
          "de-DE": "Orbitale Navigationslizenz"
        },
        "description": {
          "de-DE": "Jaehrliche Softwarelizenz fuer die Planung von Orbitaltrajektorien"
        }
      },
      "quantity": 1,
      "price": 5000,
      "gross_price": null,
      "taxes": [
        {
          "rate": 22,
          "tax_id": "tax_6595a27b5d35015c3ef0c402"
        }
      ],
      "discounts": [],
      "type": null,
      "unit": null,
      "total": 5000,
      "total_with_tax": 6100,
      "total_converted": null,
      "total_with_tax_converted": null,
      "metadata": {
        "license_type": "enterprise",
        "seats": "50"
      },
      "created_at": "2025-03-15T00:00:00.000Z",
      "updated_at": "2025-03-15T00:00:00.000Z"
    }
  ],
  "note": "Thank you for your order. Equipment ships within 5 business days.",
  "translations": {
    "note": {
      "de-DE": "Vielen Dank fuer Ihre Bestellung. Die Ausruestung wird innerhalb von 5 Werktagen versendet."
    },
    "payment_terms": {
      "de-DE": "Zahlbar innerhalb von 30 Tagen."
    },
    "footer": {
      "de-DE": "Fragen? Kontaktieren Sie billing@starward.example."
    },
    "signature": {
      "de-DE": "Starward Equipment Team"
    }
  },
  "reference": "PO-2025-001",
  "total": 30000,
  "total_with_tax": 36600,
  "total_discount": 0,
  "total_converted": null,
  "total_with_tax_converted": null,
  "shareable_id": null,
  "taxes": [
    {
      "base": 30000,
      "rate": 22,
      "amount": 6600,
      "reverse_charge": false,
      "tax_id": null
    }
  ],
  "date_year": 2025,
  "metadata": {
    "project_id": "MSN-2025-001",
    "contract_id": "ORB-2024-789"
  },
  "created_at": "2025-03-15T00:00:00.000Z",
  "updated_at": "2025-03-15T00:00:00.000Z",
  "voided_at": null,
  "deleted_at": null,
  "exchange_rate": null,
  "crypto_equivalents": null,
  "rounding_correction": null,
  "transaction_type": "domestic",
  "tax_clause": null,
  "signature": "{entity_name}",
  "payment_terms": null,
  "date_due": "2025-04-15T00:00:00.000Z",
  "total_paid": 0,
  "total_due": 36600,
  "paid_in_full": false
}

Create a new invoice

POST/invoices

Create a new invoice with line items.
This is the recommended endpoint for normal invoice creation. Use it when Space Invoices should calculate line totals, taxes, discounts, document totals, numbering, fiscalization, customer handling, payments, and lifecycle hooks from the supplied business inputs.
Customer is optional - can be omitted for retail/convenience store sales where customer information isn't needed, or added inline without referencing a customer_id.
The invoice number is auto-generated based on the entity's number format settings.
Taxes are calculated automatically based on the tax rates provided.
For a Hungarian entity with NAV dispatch enabled, creating a non-draft invoice maps it to a NAV Online Számla submission; data that cannot be mapped responds 422 NAV_INVOICE_DATA_INVALID with an issues array.
Polish B2B issuance returns 422 KSEF_AUTH_FAILED when KSeF rejects the entity's KSeF token; no number is used.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Body parameters

itemsarray of objectsrequired

Line items for the invoice. At least one item is required.

datestringoptionalnullable

Document date in YYYY-MM-DD format

date_duestringoptionalnullable

Document due date in YYYY-MM-DD format

date_servicestringoptionalnullable

Service date in YYYY-MM-DD format. For invoices and credit notes. When it (or date_service_to, if later) falls on or before date, foreign-currency conversion uses it as the exchange-rate reference date instead of date.

currency_codestringoptionalnullable
issuerobjectoptionalnullable

Document issuer (entity) information

customer_idstringoptionalnullable

Referenced Customer ID. Required if customer is not provided.

customerobjectoptionalnullable

Customer recipient of the document.
Both customer and customer_id are optional - documents can be created without customer information.
If only customer_id is provided, the document customer snapshot is populated from the saved customer.
If customer is provided, the document customer snapshot is built from the explicit payload; saved customer fields are not backfilled into omitted snapshot fields.
If both customer_id and customer are provided with save_customer=true, the existing customer will be updated from explicit customer fields only. Omitted fields remain unchanged on the saved customer, and explicit null clears nullable saved customer fields.
If only customer is provided with save_customer=true (or by default), the system checks for duplicate customers using customer identifiers and reuses the existing customer if found, otherwise creates a new customer.

notestringoptionalnullable

Note for the document. If not provided, defaults to entity settings. Pass empty string to explicitly set no note.

metadataobjectoptionalnullable

Custom string key-value data for your own use, with up to 50 properties. Keys are opaque and may contain periods. Useful for storing external IDs, tags, or integration data.

Other parameters
footerstringoptionalnullable
Country-specific parameters
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.invoices.create({
  items: [
    {
      name: "Satellite Communication Module",
      quantity: 1,
      price: 1500
    }
  ]
}, {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);
Country:
Example:

Returns

idstring
numberstring
itemsarray of objects
datestring<date-time>

Date the invoice was created (ISO 8601 datetime at midnight UTC)

date_duestring<date-time>nullable

Date the invoice is due (ISO 8601 datetime at midnight UTC)

date_servicestringnullable

Service date in YYYY-MM-DD format. For invoices and credit notes. When it (or date_service_to, if later) falls on or before date, foreign-currency conversion uses it as the exchange-rate reference date instead of date.

currency_codestring
issuerobject

Document issuer (entity) information

customer_idstringnullable
customerobjectnullable

Customer information snapshot stored on the document. Null means no customer. When present, known customer fields are returned with null for omitted values.

notestringnullable

Note for the document. If not provided, defaults to entity's document-type-specific note setting. Pass empty string to explicitly set no note.

totalnumber

Document total before tax in the currency's major unit. For EUR, 29.90 means €29.90, not 2,990 cents.

total_with_taxnumber

Document total after tax in the currency's major unit. For EUR, 29.90 means €29.90, not 2,990 cents.

taxesarray of objects

Applied taxes summary

metadataobjectnullable

Custom string key-value data for your own use, with up to 50 properties. Keys are opaque and may contain periods. Useful for storing external IDs, tags, or integration data.

Other parameters
footerstringnullable
entity_idstring
date_yearinteger
shareable_idstringnullable
voided_atstring<date-time>nullable
total_convertednumbernullable
total_with_tax_convertednumbernullable
created_atstring<date-time>
updated_atstring<date-time>
total_paidnumber
total_duenumber
paid_in_fullboolean
Country-specific parameters
json
{
  "id": "inv_6595a27b5d35015c3ef0c3fd",
  "entity_id": "ent_6595a27b5d35015c3ef0c3fd",
  "number": "2026-00001",
  "date": "2026-01-01T00:00:00.000Z",
  "currency_code": "USD",
  "issuer": {
    "name": "Starward Equipment Co.",
    "country": "United States",
    "country_code": "US"
  },
  "customer_id": null,
  "customer": null,
  "items": [
    {
      "id": "inv_item_6595a27b5d35015c3ef0c3fd",
      "invoice_id": "inv_6595a27b5d35015c3ef0c3fd",
      "advance_invoice_id": null,
      "expense_id": null,
      "item_id": null,
      "name": "Satellite Communication Module",
      "description": null,
      "translations": {},
      "quantity": 1,
      "price": 1500,
      "gross_price": null,
      "taxes": [],
      "discounts": [],
      "type": null,
      "unit": null,
      "total": 1500,
      "total_with_tax": 1500,
      "total_converted": null,
      "total_with_tax_converted": null,
      "metadata": {},
      "created_at": "2026-01-01T00:00:00.000Z",
      "updated_at": "2026-01-01T00:00:00.000Z"
    }
  ],
  "note": null,
  "translations": {},
  "reference": null,
  "total": 1500,
  "total_with_tax": 1500,
  "total_discount": 0,
  "total_converted": null,
  "total_with_tax_converted": null,
  "shareable_id": null,
  "taxes": [
    {
      "rate": null,
      "tax_id": null,
      "base": 1500,
      "amount": 0,
      "reverse_charge": false
    }
  ],
  "date_year": 2026,
  "metadata": {},
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z",
  "voided_at": null,
  "deleted_at": null,
  "exchange_rate": null,
  "crypto_equivalents": null,
  "rounding_correction": null,
  "transaction_type": "domestic",
  "tax_clause": null,
  "signature": "{entity_name}",
  "payment_terms": null,
  "date_due": "2026-02-01T00:00:00.000Z",
  "total_paid": 0,
  "total_due": 1500,
  "paid_in_full": false
}
Example:

Create invoice with pre-calculated totals

POST/invoices/custom

Unavailable for Spanish entities, including drafts; use the standard document routes. Spanish fiscalization input is not accepted. Advanced endpoint for importing invoices that already have authoritative pre-calculated totals. Do not use this for normal invoice creation. Prefer the standard create endpoint unless your integration must preserve exact external totals from an ERP, OCR, migration, or accounting system.
The caller provides total, total_with_tax, total_discount, and taxes at the document level, and total/total_with_tax on each line item.
When calculation_mode is omitted, Space Invoices preserves pass-through behavior and accepts the supplied totals as-is.
When calculation_mode is provided, Space Invoices validates the supplied totals against that calculation mode before creating the document.
Portugal: ordinary custom creation is unavailable (422). Dedicated manual recovery requires pt.manual: true, an active manual series, and the original paper-document reference; the manual flag alone is insufficient. This does not enable importing invoices issued by another invoicing system.
All other logic (numbering, fiscalization, customer handling, payments, lifecycle hooks) is identical to the standard create endpoint.
For a Hungarian entity with NAV dispatch enabled, creating a non-draft invoice maps it to a NAV Online Számla submission; data that cannot be mapped responds 422 NAV_INVOICE_DATA_INVALID with an issues array.
Polish B2B issuance returns 422 KSEF_AUTH_FAILED when KSeF rejects the entity's KSeF token; no number is used.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Body parameters

itemsarray of objectsrequired

Line items with pre-calculated totals. At least one item is required.

datestringoptionalnullable
date_duestringoptionalnullable
date_servicestringoptionalnullable
currency_codestringoptionalnullable
issuerobjectoptionalnullable

Document party snapshot accepted on create and update requests. Same shape as DocumentEntity; an explicit null bank account type is treated as omitted.

customer_idstringoptionalnullable

Referenced Customer ID.

customerobjectoptionalnullable

Customer recipient of the document.
Both customer and customer_id are optional - documents can be created without customer information.
If only customer_id is provided, the document customer snapshot is populated from the saved customer.
If customer is provided, the document customer snapshot is built from the explicit payload; saved customer fields are not backfilled into omitted snapshot fields.
If both customer_id and customer are provided with save_customer=true, the existing customer will be updated from explicit customer fields only. Omitted fields remain unchanged on the saved customer, and explicit null clears nullable saved customer fields.
If only customer is provided with save_customer=true (or by default), the system checks for duplicate customers using customer identifiers and reuses the existing customer if found, otherwise creates a new customer.

notestringoptionalnullable

Note for the document. If not provided, defaults to entity settings. Pass empty string to explicitly set no note.

totalnumberrequired

Pre-calculated document total (before tax).

total_with_taxnumberrequired

Pre-calculated document total (after tax).

taxesarray of objectsoptionalnullable
metadataobjectoptionalnullable

Custom string key-value data for your own use, with up to 50 properties. Keys are opaque and may contain periods. Useful for storing external IDs, tags, or integration data.

Other parameters
is_draftbooleanoptionalnullable
footerstringoptionalnullable
date_service_tostringoptionalnullable
Country-specific parameters
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.invoices.createCustom({
  total: 1500,
  total_with_tax: 1830,
  taxes: [
    {
      rate: 22,
      base: 1500,
      amount: 330
    }
  ],
  items: [
    {
      name: "Imported Service",
      quantity: 1,
      price: 1500,
      total: 1500,
      total_with_tax: 1830,
      taxes: [
        {
          rate: 22
        }
      ]
    }
  ]
}, {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);
Country:

Returns

idstring
numberstring
itemsarray of objects
datestring<date-time>

Date the invoice was created (ISO 8601 datetime at midnight UTC)

date_duestring<date-time>nullable

Date the invoice is due (ISO 8601 datetime at midnight UTC)

date_servicestringnullable

Service date in YYYY-MM-DD format. For invoices and credit notes. When it (or date_service_to, if later) falls on or before date, foreign-currency conversion uses it as the exchange-rate reference date instead of date.

currency_codestring
issuerobject

Document issuer (entity) information

customer_idstringnullable
customerobjectnullable

Customer information snapshot stored on the document. Null means no customer. When present, known customer fields are returned with null for omitted values.

notestringnullable

Note for the document. If not provided, defaults to entity's document-type-specific note setting. Pass empty string to explicitly set no note.

totalnumber

Document total before tax in the currency's major unit. For EUR, 29.90 means €29.90, not 2,990 cents.

total_with_taxnumber

Document total after tax in the currency's major unit. For EUR, 29.90 means €29.90, not 2,990 cents.

taxesarray of objects

Applied taxes summary

metadataobjectnullable

Custom string key-value data for your own use, with up to 50 properties. Keys are opaque and may contain periods. Useful for storing external IDs, tags, or integration data.

Other parameters
footerstringnullable
entity_idstring
date_yearinteger
shareable_idstringnullable
voided_atstring<date-time>nullable
total_convertednumbernullable
total_with_tax_convertednumbernullable
created_atstring<date-time>
updated_atstring<date-time>
total_paidnumber
total_duenumber
paid_in_fullboolean
Country-specific parameters
json
{
  "id": "inv_6595a27b5d35015c3ef0c3fd",
  "entity_id": "ent_6595a27b5d35015c3ef0c3fd",
  "number": "2026-00001",
  "date": "2026-01-01T00:00:00.000Z",
  "currency_code": "USD",
  "issuer": {
    "name": "Starward Equipment Co.",
    "country": "United States",
    "country_code": "US"
  },
  "customer_id": null,
  "customer": null,
  "items": [
    {
      "id": "inv_item_6595a27b5d35015c3ef0c3fd",
      "invoice_id": "inv_6595a27b5d35015c3ef0c3fd",
      "advance_invoice_id": null,
      "expense_id": null,
      "item_id": null,
      "name": "Satellite Communication Module",
      "description": null,
      "translations": {},
      "quantity": 1,
      "price": 1500,
      "gross_price": null,
      "taxes": [],
      "discounts": [],
      "type": null,
      "unit": null,
      "total": 1500,
      "total_with_tax": 1500,
      "total_converted": null,
      "total_with_tax_converted": null,
      "metadata": {},
      "created_at": "2026-01-01T00:00:00.000Z",
      "updated_at": "2026-01-01T00:00:00.000Z"
    }
  ],
  "note": null,
  "translations": {},
  "reference": null,
  "total": 1500,
  "total_with_tax": 1500,
  "total_discount": 0,
  "total_converted": null,
  "total_with_tax_converted": null,
  "shareable_id": null,
  "taxes": [
    {
      "rate": null,
      "tax_id": null,
      "base": 1500,
      "amount": 0,
      "reverse_charge": false
    }
  ],
  "date_year": 2026,
  "metadata": {},
  "created_at": "2026-01-01T00:00:00.000Z",
  "updated_at": "2026-01-01T00:00:00.000Z",
  "voided_at": null,
  "deleted_at": null,
  "exchange_rate": null,
  "crypto_equivalents": null,
  "rounding_correction": null,
  "transaction_type": "domestic",
  "tax_clause": null,
  "signature": "{entity_name}",
  "payment_terms": null,
  "date_due": "2026-02-01T00:00:00.000Z",
  "total_paid": 0,
  "total_due": 1500,
  "paid_in_full": false
}
Example:

List all invoices

GET/invoices

Retrieve a paginated list of invoices with optional filtering and sorting.
Supports cursor-based pagination, flexible JSON querying with MongoDB-style operators, full-text search, and sorting. Filter invoices that contain a saved catalog item with {"items.item_id":"item_..."}.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Query parameters

limitintegeroptional

Number of results per request.

Default: 10

next_cursorstringoptional

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.

prev_cursorstringoptional

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.

include_total_countbooleanoptional

Whether to include the total count of items in pagination.total.
Default is true.
When false, pagination.total returns -1 for better performance.

order_byoptional

Sort invoices by one field or provide a repeated array for multi-column ordering. Use total_due for the smallest outstanding amount first or -total_due for the largest outstanding amount first. Prefix any supported field with - for descending order. When paginating, reuse cursors only with the same effective ordering.

querystring<json>optional

JSON query object for filtering results. Supports MongoDB-style operators.

Array columns (such as an item's categories) compare as sets: a direct value asks whether the list contains it, contains takes an array and requires all of them, in matches any of them, and notIn matches none. Scalar operators such as gt do not apply and are ignored.

Supported operators:
- equals or direct value - Exact match (default)
- gte - Greater than or equal
- lte - Less than or equal
- gt - Greater than
- lt - Less than
- in - Value in array
- notIn - Value not in array
- contains - String contains (case-insensitive)
- startsWith - String starts with
- endsWith - String ends with
- between - Value between two numbers/dates [min, max]

Allowed fields: id, number, customer_id, date, customer, customer.name, customer.email, customer.address, customer.city, customer.country, total, total_with_tax, items.name, items.description, payments.type, payments.date, document_relations.relation_type, document_relations.target_type, metadata, created_at, updated_at, paid_in_full, voided_at, is_draft, date_due, paid_in_full, total_due, total_paid, voided_at, items.item_id

Examples:
- {"total": {"gte": 1000}} - Invoices over 1000
- {"customer.name": {"contains": "Acme"}} - Customer name contains "Acme"
- {"date": {"between": ["2025-01-01", "2025-12-31"]}} - Date range

searchstringoptional

Full-text search query to filter results across multiple fields.
Searches are case-insensitive and match partial strings.
Searches across all text fields including names, descriptions, addresses, and metadata values.

includestringoptional

Comma-separated list of relations to include in the response.

Available relations:
- payments - Payment records linked to this invoice
- document_relations - Linked documents (credit notes, advance invoices, etc.)

Usage:
?include=payments
?include=payments,document_relations

deletedbooleanoptional

When true, returns only soft-deleted (trashed) items. Default false excludes deleted items.

import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.invoices.list({
  limit: 20,
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);

Returns

dataarray of objects
paginationobject

Pagination metadata including cursors and result counts

json
{
  "data": [
    {
      "id": "inv_6595a27b5d35015c3ef0c402",
      "entity_id": "ent_6595a27b5d35015c3ef0c3fd",
      "number": "DOC-2025-001",
      "date": "2025-03-15T00:00:00.000Z",
      "currency_code": "USD",
      "issuer": {
        "name": "Starward Equipment Co.",
        "address": "1 Launchpad Way",
        "city": "Cape Canaveral",
        "state": "FL",
        "post_code": "32920",
        "country": "USA",
        "country_code": "US",
        "tax_number": "59-8765432"
      },
      "customer_id": "cus_6595a27b5d35015c3ef0c403",
      "customer": {
        "name": "Horizon Launch Systems Inc.",
        "address": "100 Rocket Row",
        "city": "Houston",
        "state": "TX",
        "post_code": "77058",
        "country": "USA",
        "country_code": "US",
        "tax_number": "74-1234567"
      },
      "items": [
        {
          "id": "inv_item_6595a27b5d35015c3ef0c402",
          "invoice_id": "inv_6595a27b5d35015c3ef0c402",
          "advance_invoice_id": null,
          "expense_id": null,
          "item_id": null,
          "name": "Ground Station Antenna Array",
          "description": "Deep space tracking antenna with 12m dish",
          "translations": {
            "name": {
              "de-DE": "Bodenstations-Antennenanlage"
            },
            "description": {
              "de-DE": "Tiefraum-Tracking-Antenne mit 12-m-Parabolspiegel"
            }
          },
          "quantity": 2,
          "price": 12500,
          "gross_price": null,
          "taxes": [
            {
              "rate": 22,
              "tax_id": "tax_6595a27b5d35015c3ef0c402"
            }
          ],
          "discounts": [],
          "type": null,
          "unit": null,
          "total": 25000,
          "total_with_tax": 30500,
          "total_converted": null,
          "total_with_tax_converted": null,
          "metadata": {
            "project_code": "MSN-2025-001",
            "department": "Ground Operations"
          },
          "created_at": "2025-03-15T00:00:00.000Z",
          "updated_at": "2025-03-15T00:00:00.000Z"
        },
        {
          "id": "inv_item_6595a27b5d35015c3ef0c403",
          "invoice_id": "inv_6595a27b5d35015c3ef0c402",
          "advance_invoice_id": null,
          "expense_id": null,
          "item_id": null,
          "name": "Orbital Navigation License",
          "description": "Annual software license for orbital trajectory planning",
          "translations": {
            "name": {
              "de-DE": "Orbitale Navigationslizenz"
            },
            "description": {
              "de-DE": "Jaehrliche Softwarelizenz fuer die Planung von Orbitaltrajektorien"
            }
          },
          "quantity": 1,
          "price": 5000,
          "gross_price": null,
          "taxes": [
            {
              "rate": 22,
              "tax_id": "tax_6595a27b5d35015c3ef0c402"
            }
          ],
          "discounts": [],
          "type": null,
          "unit": null,
          "total": 5000,
          "total_with_tax": 6100,
          "total_converted": null,
          "total_with_tax_converted": null,
          "metadata": {
            "license_type": "enterprise",
            "seats": "50"
          },
          "created_at": "2025-03-15T00:00:00.000Z",
          "updated_at": "2025-03-15T00:00:00.000Z"
        }
      ],
      "note": "Thank you for your order. Equipment ships within 5 business days.",
      "translations": {
        "note": {
          "de-DE": "Vielen Dank fuer Ihre Bestellung. Die Ausruestung wird innerhalb von 5 Werktagen versendet."
        },
        "payment_terms": {
          "de-DE": "Zahlbar innerhalb von 30 Tagen."
        },
        "footer": {
          "de-DE": "Fragen? Kontaktieren Sie billing@starward.example."
        },
        "signature": {
          "de-DE": "Starward Equipment Team"
        }
      },
      "reference": "PO-2025-001",
      "total": 30000,
      "total_with_tax": 36600,
      "total_discount": 0,
      "total_converted": null,
      "total_with_tax_converted": null,
      "shareable_id": null,
      "taxes": [
        {
          "base": 30000,
          "rate": 22,
          "amount": 6600,
          "reverse_charge": false,
          "tax_id": null
        }
      ],
      "date_year": 2025,
      "metadata": {
        "project_id": "MSN-2025-001",
        "contract_id": "ORB-2024-789"
      },
      "created_at": "2025-03-15T00:00:00.000Z",
      "updated_at": "2025-03-15T00:00:00.000Z",
      "voided_at": null,
      "deleted_at": null,
      "exchange_rate": null,
      "crypto_equivalents": null,
      "rounding_correction": null,
      "transaction_type": "domestic",
      "tax_clause": null,
      "signature": "{entity_name}",
      "payment_terms": null,
      "date_due": "2025-04-15T00:00:00.000Z",
      "total_paid": 0,
      "total_due": 36600,
      "paid_in_full": false
    }
  ],
  "pagination": {
    "total": 1,
    "next_cursor": null,
    "prev_cursor": null,
    "has_more": false
  }
}

Get invoice by ID

GET/invoices/{id}

Retrieve a single invoice by its unique identifier. Returns the complete invoice details including all line items, customer information, and calculated totals.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

Unique resource identifier. Prefix depends on the resource, for example inv_, cus_, or ent_.

Query parameters

includestringoptional

Comma-separated list of relations to include in the response.

Available relations:
- payments - Payment records linked to this invoice
- document_relations - Linked documents (credit notes, advance invoices, etc.)

Usage:
?include=payments
?include=payments,document_relations

import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.invoices.get('inv_6595a27b5d35015c3ef0c3fd', undefined, {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);

Returns

idstring
numberstring
itemsarray of objects
datestring<date-time>

Date the invoice was created (ISO 8601 datetime at midnight UTC)

date_duestring<date-time>nullable

Date the invoice is due (ISO 8601 datetime at midnight UTC)

date_servicestringnullable

Service date in YYYY-MM-DD format. For invoices and credit notes. When it (or date_service_to, if later) falls on or before date, foreign-currency conversion uses it as the exchange-rate reference date instead of date.

currency_codestring
issuerobject

Document issuer (entity) information

customer_idstringnullable
customerobjectnullable

Customer information snapshot stored on the document. Null means no customer. When present, known customer fields are returned with null for omitted values.

notestringnullable

Note for the document. If not provided, defaults to entity's document-type-specific note setting. Pass empty string to explicitly set no note.

totalnumber

Document total before tax in the currency's major unit. For EUR, 29.90 means €29.90, not 2,990 cents.

total_with_taxnumber

Document total after tax in the currency's major unit. For EUR, 29.90 means €29.90, not 2,990 cents.

taxesarray of objects

Applied taxes summary

metadataobjectnullable

Custom string key-value data for your own use, with up to 50 properties. Keys are opaque and may contain periods. Useful for storing external IDs, tags, or integration data.

Other parameters
footerstringnullable
entity_idstring
date_yearinteger
shareable_idstringnullable
voided_atstring<date-time>nullable
total_convertednumbernullable
total_with_tax_convertednumbernullable
created_atstring<date-time>
updated_atstring<date-time>
total_paidnumber
total_duenumber
paid_in_fullboolean
Country-specific parameters
json
{
  "id": "inv_6595a27b5d35015c3ef0c402",
  "entity_id": "ent_6595a27b5d35015c3ef0c3fd",
  "number": "DOC-2025-001",
  "date": "2025-03-15T00:00:00.000Z",
  "currency_code": "USD",
  "issuer": {
    "name": "Starward Equipment Co.",
    "address": "1 Launchpad Way",
    "city": "Cape Canaveral",
    "state": "FL",
    "post_code": "32920",
    "country": "USA",
    "country_code": "US",
    "tax_number": "59-8765432"
  },
  "customer_id": "cus_6595a27b5d35015c3ef0c403",
  "customer": {
    "name": "Horizon Launch Systems Inc.",
    "address": "100 Rocket Row",
    "city": "Houston",
    "state": "TX",
    "post_code": "77058",
    "country": "USA",
    "country_code": "US",
    "tax_number": "74-1234567"
  },
  "items": [
    {
      "id": "inv_item_6595a27b5d35015c3ef0c402",
      "invoice_id": "inv_6595a27b5d35015c3ef0c402",
      "advance_invoice_id": null,
      "expense_id": null,
      "item_id": null,
      "name": "Ground Station Antenna Array",
      "description": "Deep space tracking antenna with 12m dish",
      "translations": {
        "name": {
          "de-DE": "Bodenstations-Antennenanlage"
        },
        "description": {
          "de-DE": "Tiefraum-Tracking-Antenne mit 12-m-Parabolspiegel"
        }
      },
      "quantity": 2,
      "price": 12500,
      "gross_price": null,
      "taxes": [
        {
          "rate": 22,
          "tax_id": "tax_6595a27b5d35015c3ef0c402"
        }
      ],
      "discounts": [],
      "type": null,
      "unit": null,
      "total": 25000,
      "total_with_tax": 30500,
      "total_converted": null,
      "total_with_tax_converted": null,
      "metadata": {
        "project_code": "MSN-2025-001",
        "department": "Ground Operations"
      },
      "created_at": "2025-03-15T00:00:00.000Z",
      "updated_at": "2025-03-15T00:00:00.000Z"
    },
    {
      "id": "inv_item_6595a27b5d35015c3ef0c403",
      "invoice_id": "inv_6595a27b5d35015c3ef0c402",
      "advance_invoice_id": null,
      "expense_id": null,
      "item_id": null,
      "name": "Orbital Navigation License",
      "description": "Annual software license for orbital trajectory planning",
      "translations": {
        "name": {
          "de-DE": "Orbitale Navigationslizenz"
        },
        "description": {
          "de-DE": "Jaehrliche Softwarelizenz fuer die Planung von Orbitaltrajektorien"
        }
      },
      "quantity": 1,
      "price": 5000,
      "gross_price": null,
      "taxes": [
        {
          "rate": 22,
          "tax_id": "tax_6595a27b5d35015c3ef0c402"
        }
      ],
      "discounts": [],
      "type": null,
      "unit": null,
      "total": 5000,
      "total_with_tax": 6100,
      "total_converted": null,
      "total_with_tax_converted": null,
      "metadata": {
        "license_type": "enterprise",
        "seats": "50"
      },
      "created_at": "2025-03-15T00:00:00.000Z",
      "updated_at": "2025-03-15T00:00:00.000Z"
    }
  ],
  "note": "Thank you for your order. Equipment ships within 5 business days.",
  "translations": {
    "note": {
      "de-DE": "Vielen Dank fuer Ihre Bestellung. Die Ausruestung wird innerhalb von 5 Werktagen versendet."
    },
    "payment_terms": {
      "de-DE": "Zahlbar innerhalb von 30 Tagen."
    },
    "footer": {
      "de-DE": "Fragen? Kontaktieren Sie billing@starward.example."
    },
    "signature": {
      "de-DE": "Starward Equipment Team"
    }
  },
  "reference": "PO-2025-001",
  "total": 30000,
  "total_with_tax": 36600,
  "total_discount": 0,
  "total_converted": null,
  "total_with_tax_converted": null,
  "shareable_id": null,
  "taxes": [
    {
      "base": 30000,
      "rate": 22,
      "amount": 6600,
      "reverse_charge": false,
      "tax_id": null
    }
  ],
  "date_year": 2025,
  "metadata": {
    "project_id": "MSN-2025-001",
    "contract_id": "ORB-2024-789"
  },
  "created_at": "2025-03-15T00:00:00.000Z",
  "updated_at": "2025-03-15T00:00:00.000Z",
  "voided_at": null,
  "deleted_at": null,
  "exchange_rate": null,
  "crypto_equivalents": null,
  "rounding_correction": null,
  "transaction_type": "domestic",
  "tax_clause": null,
  "signature": "{entity_name}",
  "payment_terms": null,
  "date_due": "2025-04-15T00:00:00.000Z",
  "total_paid": 0,
  "total_due": 36600,
  "paid_in_full": false
}

Update an invoice

PATCH/invoices/{id}

Update an existing invoice.
Creates a version snapshot before applying changes.
Cannot update voided or FURS-fiscalized invoices. Italian invoices and credit notes are immutable once issued, including pending or rejected SdI submissions; use the supported correction flow. Draft item edits use rate-level VAT rounding, and edits or finalization based on a concurrently changed Italian draft fail with 422 until reloaded.
If items are provided, they replace all existing items.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

Unique resource identifier. Prefix depends on the resource, for example inv_, cus_, or ent_.

Body parameters

itemsarray of objectsoptionalnullable
datestringoptionalnullable
date_duestringoptionalnullable

Payment due date (YYYY-MM-DD or ISO datetime format). Set to null to clear.

date_servicestringoptionalnullable

Service/work date or start of service period. Set to null to clear. When it (or date_service_to, if later) falls on or before date, foreign-currency conversion uses it as the exchange-rate reference date instead of date. Changing it re-derives the rate on drafts and estimates; issued documents and manual rates keep their stored rate.

currency_codestringoptionalnullable
issuerobjectoptionalnullable

Document party snapshot accepted on create and update requests. Same shape as DocumentEntity; an explicit null bank account type is treated as omitted.

customer_idstringoptionalnullable

Referenced Customer ID. Set to null to remove customer reference.

customerobjectoptionalnullable

Customer recipient of the document.
Both customer and customer_id are optional - documents can be created without customer information.
If only customer_id is provided, the document customer snapshot is populated from the saved customer.
If customer is provided, the document customer snapshot is built from the explicit payload; saved customer fields are not backfilled into omitted snapshot fields.
If both customer_id and customer are provided with save_customer=true, the existing customer will be updated from explicit customer fields only. Omitted fields remain unchanged on the saved customer, and explicit null clears nullable saved customer fields.
If only customer is provided with save_customer=true (or by default), the system checks for duplicate customers using customer identifiers and reuses the existing customer if found, otherwise creates a new customer.

notestringoptionalnullable

Document note/memo. Set to null to clear.

metadataobjectoptionalnullable

Custom metadata object. Set to null to clear.

Other parameters
change_reasonstringoptionalnullable
force_linked_documentsbooleanoptionalnullable
Country-specific parameters
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.invoices.update('inv_6595a27b5d35015c3ef0c3fd', {
  note: "Payment received. Thank you!",
  change_reason: "Added thank you note after payment"
}, {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);
Example:

Returns

idstring
numberstring
itemsarray of objects
datestring<date-time>

Date the invoice was created (ISO 8601 datetime at midnight UTC)

date_duestring<date-time>nullable

Date the invoice is due (ISO 8601 datetime at midnight UTC)

date_servicestringnullable

Service date in YYYY-MM-DD format. For invoices and credit notes. When it (or date_service_to, if later) falls on or before date, foreign-currency conversion uses it as the exchange-rate reference date instead of date.

currency_codestring
issuerobject

Document issuer (entity) information

customer_idstringnullable
customerobjectnullable

Customer information snapshot stored on the document. Null means no customer. When present, known customer fields are returned with null for omitted values.

notestringnullable

Note for the document. If not provided, defaults to entity's document-type-specific note setting. Pass empty string to explicitly set no note.

totalnumber

Document total before tax in the currency's major unit. For EUR, 29.90 means €29.90, not 2,990 cents.

total_with_taxnumber

Document total after tax in the currency's major unit. For EUR, 29.90 means €29.90, not 2,990 cents.

taxesarray of objects

Applied taxes summary

metadataobjectnullable

Custom string key-value data for your own use, with up to 50 properties. Keys are opaque and may contain periods. Useful for storing external IDs, tags, or integration data.

Other parameters
footerstringnullable
entity_idstring
date_yearinteger
shareable_idstringnullable
voided_atstring<date-time>nullable
total_convertednumbernullable
total_with_tax_convertednumbernullable
created_atstring<date-time>
updated_atstring<date-time>
total_paidnumber
total_duenumber
paid_in_fullboolean
Country-specific parameters
json
{
  "id": "inv_6595a27b5d35015c3ef0c402",
  "entity_id": "ent_6595a27b5d35015c3ef0c3fd",
  "number": "DOC-2025-001",
  "date": "2025-03-15T00:00:00.000Z",
  "currency_code": "USD",
  "issuer": {
    "name": "Starward Equipment Co.",
    "address": "1 Launchpad Way",
    "city": "Cape Canaveral",
    "state": "FL",
    "post_code": "32920",
    "country": "USA",
    "country_code": "US",
    "tax_number": "59-8765432"
  },
  "customer_id": "cus_6595a27b5d35015c3ef0c403",
  "customer": {
    "name": "Horizon Launch Systems Inc.",
    "address": "100 Rocket Row",
    "city": "Houston",
    "state": "TX",
    "post_code": "77058",
    "country": "USA",
    "country_code": "US",
    "tax_number": "74-1234567"
  },
  "items": [
    {
      "id": "inv_item_6595a27b5d35015c3ef0c402",
      "invoice_id": "inv_6595a27b5d35015c3ef0c402",
      "advance_invoice_id": null,
      "expense_id": null,
      "item_id": null,
      "name": "Ground Station Antenna Array",
      "description": "Deep space tracking antenna with 12m dish",
      "translations": {
        "name": {
          "de-DE": "Bodenstations-Antennenanlage"
        },
        "description": {
          "de-DE": "Tiefraum-Tracking-Antenne mit 12-m-Parabolspiegel"
        }
      },
      "quantity": 2,
      "price": 12500,
      "gross_price": null,
      "taxes": [
        {
          "rate": 22,
          "tax_id": "tax_6595a27b5d35015c3ef0c402"
        }
      ],
      "discounts": [],
      "type": null,
      "unit": null,
      "total": 25000,
      "total_with_tax": 30500,
      "total_converted": null,
      "total_with_tax_converted": null,
      "metadata": {
        "project_code": "MSN-2025-001",
        "department": "Ground Operations"
      },
      "created_at": "2025-03-15T00:00:00.000Z",
      "updated_at": "2025-03-15T00:00:00.000Z"
    },
    {
      "id": "inv_item_6595a27b5d35015c3ef0c403",
      "invoice_id": "inv_6595a27b5d35015c3ef0c402",
      "advance_invoice_id": null,
      "expense_id": null,
      "item_id": null,
      "name": "Orbital Navigation License",
      "description": "Annual software license for orbital trajectory planning",
      "translations": {
        "name": {
          "de-DE": "Orbitale Navigationslizenz"
        },
        "description": {
          "de-DE": "Jaehrliche Softwarelizenz fuer die Planung von Orbitaltrajektorien"
        }
      },
      "quantity": 1,
      "price": 5000,
      "gross_price": null,
      "taxes": [
        {
          "rate": 22,
          "tax_id": "tax_6595a27b5d35015c3ef0c402"
        }
      ],
      "discounts": [],
      "type": null,
      "unit": null,
      "total": 5000,
      "total_with_tax": 6100,
      "total_converted": null,
      "total_with_tax_converted": null,
      "metadata": {
        "license_type": "enterprise",
        "seats": "50"
      },
      "created_at": "2025-03-15T00:00:00.000Z",
      "updated_at": "2025-03-15T00:00:00.000Z"
    }
  ],
  "note": "Thank you for your order. Equipment ships within 5 business days.",
  "translations": {
    "note": {
      "de-DE": "Vielen Dank fuer Ihre Bestellung. Die Ausruestung wird innerhalb von 5 Werktagen versendet."
    },
    "payment_terms": {
      "de-DE": "Zahlbar innerhalb von 30 Tagen."
    },
    "footer": {
      "de-DE": "Fragen? Kontaktieren Sie billing@starward.example."
    },
    "signature": {
      "de-DE": "Starward Equipment Team"
    }
  },
  "reference": "PO-2025-001",
  "total": 30000,
  "total_with_tax": 36600,
  "total_discount": 0,
  "total_converted": null,
  "total_with_tax_converted": null,
  "shareable_id": null,
  "taxes": [
    {
      "base": 30000,
      "rate": 22,
      "amount": 6600,
      "reverse_charge": false,
      "tax_id": null
    }
  ],
  "date_year": 2025,
  "metadata": {
    "project_id": "MSN-2025-001",
    "contract_id": "ORB-2024-789"
  },
  "created_at": "2025-03-15T00:00:00.000Z",
  "updated_at": "2025-03-15T00:00:00.000Z",
  "voided_at": null,
  "deleted_at": null,
  "exchange_rate": null,
  "crypto_equivalents": null,
  "rounding_correction": null,
  "transaction_type": "domestic",
  "tax_clause": null,
  "signature": "{entity_name}",
  "payment_terms": null,
  "date_due": "2025-04-15T00:00:00.000Z",
  "total_paid": 0,
  "total_due": 36600,
  "paid_in_full": false
}

Void an invoice

POST/invoices/{id}/void

Void an invoice for technical reasons (duplicate, error, etc.). For FURS-fiscalized invoices, automatically submits technical cancellation to FURS and creates a credit note. For TicketBAI, requires a reason and retains a signed annulment for an eligible unpaid ordinary invoice with confirmed delivery. Returns the invoice with ticketbai.cancellation status; repeated calls reuse the cancellation. Uncertain original delivery returns 409; ineligible invoices return 422. For business corrections, create a credit note instead.
Polish B2B issuance returns 422 KSEF_AUTH_FAILED when KSeF rejects the entity's KSeF token; no number is used.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

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.invoices.void('inv_6595a27b5d35015c3ef0c3fd', {
  reason: "Duplicate invoice created by mistake"
}, {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);

Returns

idstring
numberstring
itemsarray of objects
datestring<date-time>

Date the invoice was created (ISO 8601 datetime at midnight UTC)

date_duestring<date-time>nullable

Date the invoice is due (ISO 8601 datetime at midnight UTC)

date_servicestringnullable

Service date in YYYY-MM-DD format. For invoices and credit notes. When it (or date_service_to, if later) falls on or before date, foreign-currency conversion uses it as the exchange-rate reference date instead of date.

currency_codestring
issuerobject

Document issuer (entity) information

customer_idstringnullable
customerobjectnullable

Customer information snapshot stored on the document. Null means no customer. When present, known customer fields are returned with null for omitted values.

notestringnullable

Note for the document. If not provided, defaults to entity's document-type-specific note setting. Pass empty string to explicitly set no note.

totalnumber

Document total before tax in the currency's major unit. For EUR, 29.90 means €29.90, not 2,990 cents.

total_with_taxnumber

Document total after tax in the currency's major unit. For EUR, 29.90 means €29.90, not 2,990 cents.

taxesarray of objects

Applied taxes summary

metadataobjectnullable

Custom string key-value data for your own use, with up to 50 properties. Keys are opaque and may contain periods. Useful for storing external IDs, tags, or integration data.

Other parameters
footerstringnullable
entity_idstring
date_yearinteger
shareable_idstringnullable
voided_atstring<date-time>nullable
total_convertednumbernullable
total_with_tax_convertednumbernullable
created_atstring<date-time>
updated_atstring<date-time>
total_paidnumber
total_duenumber
paid_in_fullboolean
Country-specific parameters
json
{
  "id": "inv_abc123",
  "voided_at": "2026-01-20T12:00:00.000Z"
}
Country:

Get invoice version history

GET/invoices/{id}/versions

Retrieve the version history for an invoice. Each version represents the document state before an update was applied.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

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.invoices.getVersions('inv_6595a27b5d35015c3ef0c3fd', {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);

Returns

json
{
  "versions": [
    {
      "id": "ver_abc123",
      "document_type": "invoice",
      "document_id": "inv_6595a27b5d35015c3ef0c3fd",
      "version": 2,
      "snapshot": {
        "id": "inv_6595a27b5d35015c3ef0c3fd",
        "entity_id": "ent_6595a27b5d35015c3ef0c3fd",
        "number": "2026-00001",
        "date": "2026-01-01T00:00:00.000Z",
        "currency_code": "USD",
        "issuer": {
          "name": "Starward Equipment Co.",
          "country": "United States",
          "country_code": "US"
        },
        "customer_id": null,
        "customer": null,
        "items": [
          {
            "id": "inv_item_6595a27b5d35015c3ef0c3fd",
            "invoice_id": "inv_6595a27b5d35015c3ef0c3fd",
            "advance_invoice_id": null,
            "expense_id": null,
            "item_id": null,
            "name": "Satellite Communication Module",
            "description": null,
            "translations": {},
            "quantity": 1,
            "price": 1500,
            "gross_price": null,
            "taxes": [],
            "discounts": [],
            "type": null,
            "unit": null,
            "total": 1500,
            "total_with_tax": 1500,
            "total_converted": null,
            "total_with_tax_converted": null,
            "metadata": {},
            "created_at": "2026-01-01T00:00:00.000Z",
            "updated_at": "2026-01-01T00:00:00.000Z"
          }
        ],
        "note": null,
        "translations": {},
        "reference": null,
        "total": 1500,
        "total_with_tax": 1500,
        "total_discount": 0,
        "total_converted": null,
        "total_with_tax_converted": null,
        "shareable_id": null,
        "taxes": [
          {
            "rate": null,
            "tax_id": null,
            "base": 1500,
            "amount": 0,
            "reverse_charge": false
          }
        ],
        "date_year": 2026,
        "metadata": {},
        "created_at": "2026-01-01T00:00:00.000Z",
        "updated_at": "2026-01-01T00:00:00.000Z",
        "voided_at": null,
        "deleted_at": null,
        "exchange_rate": null,
        "crypto_equivalents": null,
        "rounding_correction": null,
        "transaction_type": "domestic",
        "vies": null,
        "tax_clause": null,
        "signature": "{entity_name}",
        "payment_terms": null,
        "date_due": "2026-02-01T00:00:00.000Z",
        "total_paid": 0,
        "total_due": 1500,
        "paid_in_full": false,
        "furs": null,
        "fina": null
      },
      "changed_fields": [
        "note"
      ],
      "user": {
        "id": "usr_123",
        "name": "Alex Carter",
        "email": "alex.carter@starward.example"
      },
      "reason": "Added payment confirmation",
      "created_at": "2025-01-15T10:30:00.000Z"
    },
    {
      "id": "ver_xyz789",
      "document_type": "invoice",
      "document_id": "inv_6595a27b5d35015c3ef0c3fd",
      "version": 1,
      "snapshot": {
        "id": "inv_6595a27b5d35015c3ef0c3fd",
        "entity_id": "ent_6595a27b5d35015c3ef0c3fd",
        "number": "2026-00001",
        "date": "2026-01-01T00:00:00.000Z",
        "currency_code": "USD",
        "issuer": {
          "name": "Starward Equipment Co.",
          "country": "United States",
          "country_code": "US"
        },
        "customer_id": null,
        "customer": null,
        "items": [
          {
            "id": "inv_item_6595a27b5d35015c3ef0c3fd",
            "invoice_id": "inv_6595a27b5d35015c3ef0c3fd",
            "advance_invoice_id": null,
            "expense_id": null,
            "item_id": null,
            "name": "Satellite Communication Module",
            "description": null,
            "translations": {},
            "quantity": 1,
            "price": 1500,
            "gross_price": null,
            "taxes": [],
            "discounts": [],
            "type": null,
            "unit": null,
            "total": 1500,
            "total_with_tax": 1500,
            "total_converted": null,
            "total_with_tax_converted": null,
            "metadata": {},
            "created_at": "2026-01-01T00:00:00.000Z",
            "updated_at": "2026-01-01T00:00:00.000Z"
          }
        ],
        "note": null,
        "translations": {},
        "reference": null,
        "total": 1500,
        "total_with_tax": 1500,
        "total_discount": 0,
        "total_converted": null,
        "total_with_tax_converted": null,
        "shareable_id": null,
        "taxes": [
          {
            "rate": null,
            "tax_id": null,
            "base": 1500,
            "amount": 0,
            "reverse_charge": false
          }
        ],
        "date_year": 2026,
        "metadata": {},
        "created_at": "2026-01-01T00:00:00.000Z",
        "updated_at": "2026-01-01T00:00:00.000Z",
        "voided_at": null,
        "deleted_at": null,
        "exchange_rate": null,
        "crypto_equivalents": null,
        "rounding_correction": null,
        "transaction_type": "domestic",
        "vies": null,
        "tax_clause": null,
        "signature": "{entity_name}",
        "payment_terms": null,
        "date_due": "2026-02-01T00:00:00.000Z",
        "total_paid": 0,
        "total_due": 1500,
        "paid_in_full": false,
        "furs": null,
        "fina": null
      },
      "changed_fields": [
        "items"
      ],
      "user": {
        "id": "usr_123",
        "name": "Alex Carter",
        "email": "alex.carter@starward.example"
      },
      "reason": "Corrected line items",
      "created_at": "2025-01-14T15:00:00.000Z"
    }
  ],
  "count": 2
}

Get specific invoice version

GET/invoices/{id}/versions/{version}

Retrieve a specific version snapshot of an invoice.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstringrequired

Invoice ID

versionintegerrequired

Version number

import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.invoices.getVersion('inv_6595a27b5d35015c3ef0c3fd', 1, {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);

Returns

idstring

Version record ID

Other parameters
json
{
  "id": "ver_abc123",
  "document_type": "invoice",
  "document_id": "inv_6595a27b5d35015c3ef0c3fd",
  "version": 1,
  "snapshot": {
    "id": "inv_6595a27b5d35015c3ef0c3fd",
    "entity_id": "ent_6595a27b5d35015c3ef0c3fd",
    "number": "2026-00001",
    "date": "2026-01-01T00:00:00.000Z",
    "currency_code": "USD",
    "issuer": {
      "name": "Starward Equipment Co.",
      "country": "United States",
      "country_code": "US"
    },
    "customer_id": null,
    "customer": null,
    "items": [
      {
        "id": "inv_item_6595a27b5d35015c3ef0c3fd",
        "invoice_id": "inv_6595a27b5d35015c3ef0c3fd",
        "advance_invoice_id": null,
        "expense_id": null,
        "item_id": null,
        "name": "Satellite Communication Module",
        "description": null,
        "translations": {},
        "quantity": 1,
        "price": 1500,
        "gross_price": null,
        "taxes": [],
        "discounts": [],
        "type": null,
        "unit": null,
        "total": 1500,
        "total_with_tax": 1500,
        "total_converted": null,
        "total_with_tax_converted": null,
        "metadata": {},
        "created_at": "2026-01-01T00:00:00.000Z",
        "updated_at": "2026-01-01T00:00:00.000Z"
      }
    ],
    "note": null,
    "translations": {},
    "reference": null,
    "total": 1500,
    "total_with_tax": 1500,
    "total_discount": 0,
    "total_converted": null,
    "total_with_tax_converted": null,
    "shareable_id": null,
    "taxes": [
      {
        "rate": null,
        "tax_id": null,
        "base": 1500,
        "amount": 0,
        "reverse_charge": false
      }
    ],
    "date_year": 2026,
    "metadata": {},
    "created_at": "2026-01-01T00:00:00.000Z",
    "updated_at": "2026-01-01T00:00:00.000Z",
    "voided_at": null,
    "deleted_at": null,
    "exchange_rate": null,
    "crypto_equivalents": null,
    "rounding_correction": null,
    "transaction_type": "domestic",
    "vies": null,
    "tax_clause": null,
    "signature": "{entity_name}",
    "payment_terms": null,
    "date_due": "2026-02-01T00:00:00.000Z",
    "total_paid": 0,
    "total_due": 1500,
    "paid_in_full": false,
    "furs": null,
    "fina": null
  },
  "changed_fields": [
    "items"
  ],
  "user": {
    "id": "usr_123",
    "name": "Alex Carter",
    "email": "alex.carter@starward.example"
  },
  "reason": "Corrected line items",
  "created_at": "2025-01-14T15:00:00.000Z"
}

Preview next document number

GET/documents/next-number

Preview the next auto-generated document number for the specified type without incrementing the sequence. Useful for showing users what number will be assigned before creating a document.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Query parameters

typestringrequired

Document type

Possible values: "invoice", "estimate", "credit_note", "advance_invoice", "delivery_note", "purchase_order"

business_unit_idstringoptional

Optional business unit scope for unit-specific numbering sequences.

business_premise_namestringoptional

Business premise name (FURS or FINA). If provided with electronic_device_name, returns fiscalization-format number.

electronic_device_namestringoptional

Electronic device name (FURS or FINA). Required if business_premise_name is provided. When provided, returns fiscalization-format number.

import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.documents.getNextNumber({
  type: "invoice"
}, {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);

Returns

Country-specific parameters
json
{
  "number": "2026-00042"
}

Render invoice preview

POST/invoices/render

Render an HTML preview of an invoice without saving to the database. Perfect for displaying live previews in invoice creation/edit forms. Supports both partial mode (allows incomplete data for drafts) and complete mode (validates all required fields).

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Query parameters

templatestringoptional

Document template design to use. When not specified, uses the entity's configured template.

Possible values: "modern", "classic", "condensed", "minimal", "fashion"

localestringoptionalnullable

Locale for number and date formatting (decimal separators, date order). When not specified, uses the entity's configured locale. For example, 'sl-SI' formats decimals with commas (5,5%) and dates as DD. MM. YYYY.

languagestringoptionalnullable

Language for document labels and translations (e.g., 'Invoice', 'Tax', 'Total'). When not specified, uses the same value as locale. Use this to get entity-locale formatting with different-language labels — for example, a Slovenian entity (sl-SI formatting with commas) but English labels.

partialstringoptional

Whether to treat the document as partial (allows incomplete data) or complete (validates all required fields)

Possible values: "true", "false"

Default: "true"

upn_qr_enabledstringoptional

Override UPN QR enabled setting for preview

Possible values: "true", "false"

upn_qr_display_modestringoptional

Override UPN QR display mode for preview

Possible values: "qr_only", "full_slip"

epc_qr_enabledstringoptional

Override EPC QR enabled setting for preview

Possible values: "true", "false"

hub3_qr_enabledstringoptional

Override Croatian HUB3 PDF417 barcode enabled setting for preview

Possible values: "true", "false"

hub3_qr_purpose_codestringoptional

Override HUB3 purpose code for preview

hub3_qr_reference_modelstringoptional

Override HUB3 Croatian reference model for preview

swiss_qr_bill_enabledstringoptional

Override Swiss QR-bill enabled setting for preview

Possible values: "true", "false"

Body parameters

idstringoptionalnullable

Preview only: id of the stored document being edited. The preview shows that document's stored number (and reuses its issued snapshot where supported). Omit when creating.

itemsarray of objectsrequired
datestringoptionalnullable

Document date in YYYY-MM-DD format

date_duestringoptionalnullable

Document due date in YYYY-MM-DD format

date_servicestringoptionalnullable

Service date in YYYY-MM-DD format. For invoices and credit notes. When it (or date_service_to, if later) falls on or before date, foreign-currency conversion uses it as the exchange-rate reference date instead of date.

currency_codestringoptionalnullable
issuerobjectoptionalnullable

Document issuer (entity) information

customer_idstringoptionalnullable

Referenced Customer ID. Required if customer is not provided.

customerobjectoptionalnullable

Customer recipient of the document.
Both customer and customer_id are optional - documents can be created without customer information.
If only customer_id is provided, the document customer snapshot is populated from the saved customer.
If customer is provided, the document customer snapshot is built from the explicit payload; saved customer fields are not backfilled into omitted snapshot fields.
If both customer_id and customer are provided with save_customer=true, the existing customer will be updated from explicit customer fields only. Omitted fields remain unchanged on the saved customer, and explicit null clears nullable saved customer fields.
If only customer is provided with save_customer=true (or by default), the system checks for duplicate customers using customer identifiers and reuses the existing customer if found, otherwise creates a new customer.

notestringoptionalnullable

Note for the document. If not provided, defaults to entity settings. Pass empty string to explicitly set no note.

totalnumberoptionalnullable
total_with_taxnumberoptionalnullable
taxesarray of objectsoptionalnullable
metadataobjectoptionalnullable

Custom string key-value data for your own use, with up to 50 properties. Keys are opaque and may contain periods. Useful for storing external IDs, tags, or integration data.

Other parameters
footerstringoptionalnullable
total_discountnumberoptionalnullable
Country-specific parameters
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.invoices.renderInvoicePreview({
  items: [
    {
      name: "Mission Planning Services",
      quantity: 5,
      price: 150
    }
  ],
  customer: {
    name: "Nebula Propulsion Labs"
  }
}, undefined, {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);
Example:

Preview document calculation

POST/documents/calculate

Calculate document totals, taxes, and transaction type without creating the document. Useful for showing live totals in forms or validating data before submission.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Query parameters

typestringrequired

Document type

Possible values: "invoice", "estimate", "credit_note", "advance_invoice", "delivery_note", "purchase_order"

Body parameters

itemsarray of objectsrequired

Document line items to calculate. At least one item is required.

Other parameters
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.documents.calculateDocumentPreview({
  items: [
    {
      name: "Mission Planning Services",
      quantity: 10,
      price: 100,
      taxes: [
        {
          rate: 22
        }
      ]
    }
  ]
}, {
  type: "invoice"
}, {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);

Returns

Country-specific parameters
json
{
  "items": [
    {
      "name": "Mission Planning Services",
      "description": null,
      "type": null,
      "price": 100,
      "gross_price": null,
      "quantity": 10,
      "unit": null,
      "taxes": [
        {
          "name": "VAT",
          "rate": 22,
          "base": 1000,
          "amount": 220
        }
      ],
      "discounts": [],
      "total": 1000,
      "total_with_tax": 1220,
      "total_converted": null,
      "total_with_tax_converted": null
    }
  ],
  "total": 1000,
  "total_with_tax": 1220,
  "total_discount": 0,
  "taxes": [
    {
      "name": "VAT",
      "rate": 22,
      "base": 1000,
      "amount": 220,
      "reverse_charge": false
    }
  ],
  "transaction_type": "domestic",
  "currency_code": "EUR",
  "exchange_rate": null,
  "total_converted": null,
  "total_with_tax_converted": null,
  "rounding_correction": null
}

Render HTML

GET/documents/{id}/html

Render a saved document by its ID as HTML. The document type is automatically detected from the ID prefix (inv_, est_, cre_, adv_). The output is styled for professional presentation and optimized for display in web applications.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

Document identifier. Prefix depends on the document type: inv_, est_, crn_, adv_, dln_ or po_ (purchase order).

Query parameters

templatestringoptional

Document template design to use. When not specified, uses the entity's configured template.

Possible values: "modern", "classic", "condensed", "minimal", "fashion"

localestringoptionalnullable

Locale for number and date formatting (decimal separators, date order). When not specified, uses the entity's configured locale. For example, 'sl-SI' formats decimals with commas (5,5%) and dates as DD. MM. YYYY.

languagestringoptionalnullable

Language for document labels and translations (e.g., 'Invoice', 'Tax', 'Total'). When not specified, uses the same value as locale. Use this to get entity-locale formatting with different-language labels — for example, a Slovenian entity (sl-SI formatting with commas) but English labels.

import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.invoices.renderHtml('inv_6595a27b5d35015c3ef0c3fd', undefined, {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);

Render PDF

GET/documents/{id}/pdf

Render a saved document by its ID as PDF. The document type is automatically detected from the ID prefix (inv_, est_, cre_, adv_). The output is styled for professional presentation and optimized for printing. Ideal for downloads and archival.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

Document identifier. Prefix depends on the document type: inv_, est_, crn_, adv_, dln_ or po_ (purchase order).

Query parameters

templatestringoptional

Document template design to use. When not specified, uses the entity's configured template.

Possible values: "modern", "classic", "condensed", "minimal", "fashion"

localestringoptionalnullable

Locale for number and date formatting (decimal separators, date order). When not specified, uses the entity's configured locale. For example, 'sl-SI' formats decimals with commas (5,5%) and dates as DD. MM. YYYY.

languagestringoptionalnullable

Language for document labels and translations (e.g., 'Invoice', 'Tax', 'Total'). When not specified, uses the same value as locale. Use this to get entity-locale formatting with different-language labels — for example, a Slovenian entity (sl-SI formatting with commas) but English labels.


Finalize a draft document

POST/documents/{id}/finalize

Finalize a draft document by assigning a document number, running fiscalization (if applicable), and optionally sending it electronically. Only draft documents can be finalized. Draft advance invoices must first have payments covering their full total. After finalization, the document cannot be deleted. For a Hungarian invoice, credit note or advance invoice whose entity has NAV dispatch enabled, finalizing maps it to a NAV Online Számla submission; data that cannot be mapped responds 422 NAV_INVOICE_DATA_INVALID with an issues array.
Polish B2B issuance returns 422 KSEF_AUTH_FAILED when KSeF rejects the entity's KSeF token; no number is used.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstringrequired

Document ID

Query parameters

typestringoptional

Document type. Optional — automatically inferred from the document ID prefix.

Possible values: "invoice", "estimate", "credit_note", "advance_invoice", "delivery_note", "purchase_order"

Body parameters

Country-specific parameters
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.documents.finalizeDocument("inv_clx1234567890", {
  e_invoicing: {
    send_enabled: true
  }
}, undefined, {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);
Example:
json
null

Delete a draft document

DELETE/documents/{id}

Delete a draft document. Only draft documents can be deleted. Finalized documents cannot be deleted - use void instead.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstringrequired

Document ID

Query parameters

typestringoptional

Document type. Optional — automatically inferred from the document ID prefix.

Possible values: "invoice", "estimate", "credit_note", "advance_invoice", "delivery_note", "purchase_order"

import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

await sdk.documents.delete("inv_clx1234567890", undefined, {
  entity_id: "YOUR_ENTITY_ID"
});

console.log('Deleted successfully');

Permanently delete a document

DELETE/documents/{id}/permanent

Permanently delete a soft-deleted document. Only documents in the trash can be permanently deleted. Only draft documents and estimates can be permanently deleted.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstringrequired

Document ID

Query parameters

typestringoptional

Document type. Optional — automatically inferred from the document ID prefix.

Possible values: "invoice", "estimate", "credit_note", "advance_invoice", "delivery_note", "purchase_order"

import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

await sdk.documents.permanentDeleteDocument("inv_clx1234567890", undefined, {
  entity_id: "YOUR_ENTITY_ID"
});

console.log('Deleted successfully');

Make document shareable

POST/documents/{id}/share

Generate a shareable token for a document. Document type is automatically detected from the ID prefix (inv_, est_, cre_, adv_). If the document is already shared, returns the existing token. Can be used to re-share a document that was previously unshared.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

Document identifier. Prefix depends on the document type: inv_, est_, crn_, adv_, dln_ or po_ (purchase order).

import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.documents.shareDocument('inv_6595a27b5d35015c3ef0c3fd', {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);

Returns

json
{
  "shareable_id": "shareable-id"
}

Unshare document

DELETE/documents/{id}/share

Remove the shareable token from a document. The document will no longer be accessible via public link. Document type is automatically detected from the ID prefix (inv_, est_, cre_, adv_).

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

Document identifier. Prefix depends on the document type: inv_, est_, crn_, adv_, dln_ or po_ (purchase order).

import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

await sdk.documents.unshareDocument('inv_6595a27b5d35015c3ef0c3fd', {
  entity_id: "YOUR_ENTITY_ID"
});

console.log('Deleted successfully');

Get shareable token

GET/documents/{id}/share

Retrieve the shareable token for a document if one exists. Document type is automatically detected from the ID prefix (inv_, est_, cre_, adv_).

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

Document identifier. Prefix depends on the document type: inv_, est_, crn_, adv_, dln_ or po_ (purchase order).

import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.documents.getShareableId('inv_6595a27b5d35015c3ef0c3fd', {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);

Returns

json
{
  "shareable_id": "shareable-id"
}

View shareable invoice

GET/invoices/shareable/{shareableId}

Retrieve invoice data using a shareable token. No authentication required. Returns full invoice data for rendering.

Path parameters

shareableIdstringrequired

Shareable document token

import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.invoices.getShareableInvoice('SHAREABLE_ID', {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);

Returns

idstring
numberstring
itemsarray of objects
datestring<date-time>

Date the invoice was created (ISO 8601 datetime at midnight UTC)

date_duestring<date-time>nullable

Date the invoice is due (ISO 8601 datetime at midnight UTC)

date_servicestringnullable

Service date in YYYY-MM-DD format. For invoices and credit notes. When it (or date_service_to, if later) falls on or before date, foreign-currency conversion uses it as the exchange-rate reference date instead of date.

currency_codestring
issuerobject

Document issuer (entity) information

customer_idstringnullable
customerobjectnullable

Customer information snapshot stored on the document. Null means no customer. When present, known customer fields are returned with null for omitted values.

notestringnullable

Note for the document. If not provided, defaults to entity's document-type-specific note setting. Pass empty string to explicitly set no note.

totalnumber

Document total before tax in the currency's major unit. For EUR, 29.90 means €29.90, not 2,990 cents.

total_with_taxnumber

Document total after tax in the currency's major unit. For EUR, 29.90 means €29.90, not 2,990 cents.

taxesarray of objects

Applied taxes summary

metadataobjectnullable

Custom string key-value data for your own use, with up to 50 properties. Keys are opaque and may contain periods. Useful for storing external IDs, tags, or integration data.

Other parameters
footerstringnullable
entity_idstring
date_yearinteger
shareable_idstringnullable
voided_atstring<date-time>nullable
total_convertednumbernullable
total_with_tax_convertednumbernullable
created_atstring<date-time>
updated_atstring<date-time>
total_paidnumber
total_duenumber
paid_in_fullboolean
Country-specific parameters
json
{
  "id": "inv_6595a27b5d35015c3ef0c402",
  "entity_id": "ent_6595a27b5d35015c3ef0c3fd",
  "number": "DOC-2025-001",
  "date": "2025-03-15T00:00:00.000Z",
  "currency_code": "USD",
  "issuer": {
    "name": "Starward Equipment Co.",
    "address": "1 Launchpad Way",
    "city": "Cape Canaveral",
    "state": "FL",
    "post_code": "32920",
    "country": "USA",
    "country_code": "US",
    "tax_number": "59-8765432"
  },
  "customer_id": "cus_6595a27b5d35015c3ef0c403",
  "customer": {
    "name": "Horizon Launch Systems Inc.",
    "address": "100 Rocket Row",
    "city": "Houston",
    "state": "TX",
    "post_code": "77058",
    "country": "USA",
    "country_code": "US",
    "tax_number": "74-1234567"
  },
  "items": [
    {
      "id": "inv_item_6595a27b5d35015c3ef0c402",
      "invoice_id": "inv_6595a27b5d35015c3ef0c402",
      "advance_invoice_id": null,
      "expense_id": null,
      "item_id": null,
      "name": "Ground Station Antenna Array",
      "description": "Deep space tracking antenna with 12m dish",
      "translations": {
        "name": {
          "de-DE": "Bodenstations-Antennenanlage"
        },
        "description": {
          "de-DE": "Tiefraum-Tracking-Antenne mit 12-m-Parabolspiegel"
        }
      },
      "quantity": 2,
      "price": 12500,
      "gross_price": null,
      "taxes": [
        {
          "rate": 22,
          "tax_id": "tax_6595a27b5d35015c3ef0c402"
        }
      ],
      "discounts": [],
      "type": null,
      "unit": null,
      "total": 25000,
      "total_with_tax": 30500,
      "total_converted": null,
      "total_with_tax_converted": null,
      "metadata": {
        "project_code": "MSN-2025-001",
        "department": "Ground Operations"
      },
      "created_at": "2025-03-15T00:00:00.000Z",
      "updated_at": "2025-03-15T00:00:00.000Z"
    },
    {
      "id": "inv_item_6595a27b5d35015c3ef0c403",
      "invoice_id": "inv_6595a27b5d35015c3ef0c402",
      "advance_invoice_id": null,
      "expense_id": null,
      "item_id": null,
      "name": "Orbital Navigation License",
      "description": "Annual software license for orbital trajectory planning",
      "translations": {
        "name": {
          "de-DE": "Orbitale Navigationslizenz"
        },
        "description": {
          "de-DE": "Jaehrliche Softwarelizenz fuer die Planung von Orbitaltrajektorien"
        }
      },
      "quantity": 1,
      "price": 5000,
      "gross_price": null,
      "taxes": [
        {
          "rate": 22,
          "tax_id": "tax_6595a27b5d35015c3ef0c402"
        }
      ],
      "discounts": [],
      "type": null,
      "unit": null,
      "total": 5000,
      "total_with_tax": 6100,
      "total_converted": null,
      "total_with_tax_converted": null,
      "metadata": {
        "license_type": "enterprise",
        "seats": "50"
      },
      "created_at": "2025-03-15T00:00:00.000Z",
      "updated_at": "2025-03-15T00:00:00.000Z"
    }
  ],
  "note": "Thank you for your order. Equipment ships within 5 business days.",
  "translations": {
    "note": {
      "de-DE": "Vielen Dank fuer Ihre Bestellung. Die Ausruestung wird innerhalb von 5 Werktagen versendet."
    },
    "payment_terms": {
      "de-DE": "Zahlbar innerhalb von 30 Tagen."
    },
    "footer": {
      "de-DE": "Fragen? Kontaktieren Sie billing@starward.example."
    },
    "signature": {
      "de-DE": "Starward Equipment Team"
    }
  },
  "reference": "PO-2025-001",
  "total": 30000,
  "total_with_tax": 36600,
  "total_discount": 0,
  "total_converted": null,
  "total_with_tax_converted": null,
  "shareable_id": null,
  "taxes": [
    {
      "base": 30000,
      "rate": 22,
      "amount": 6600,
      "reverse_charge": false,
      "tax_id": null
    }
  ],
  "date_year": 2025,
  "metadata": {
    "project_id": "MSN-2025-001",
    "contract_id": "ORB-2024-789"
  },
  "created_at": "2025-03-15T00:00:00.000Z",
  "updated_at": "2025-03-15T00:00:00.000Z",
  "voided_at": null,
  "deleted_at": null,
  "exchange_rate": null,
  "crypto_equivalents": null,
  "rounding_correction": null,
  "transaction_type": "domestic",
  "tax_clause": null,
  "signature": "{entity_name}",
  "payment_terms": null,
  "date_due": "2025-04-15T00:00:00.000Z",
  "total_paid": 0,
  "total_due": 36600,
  "paid_in_full": false
}

Get shareable invoice as HTML

GET/invoices/shareable/{shareableId}/html

Get invoice as HTML preview using a shareable token. No authentication required. Supports multiple languages via locale query parameter.

Path parameters

shareableIdstringrequired

Shareable document token

Query parameters

localestringoptional

Locale for number and date formatting (decimal separators, date order). Defaults to entity locale.

Possible values: "en-US", "en-GB", "de-DE", "it-IT", "fr-FR", "es-ES", "sl-SI", "pt-PT", "nl-NL", "pl-PL", "hr-HR", "sv-SE", "fi-FI", "et-EE", "bg-BG", "cs-CZ", "sk-SK", "nb-NO", "is-IS", "hu-HU"

languagestringoptional

Language for document labels/translations. Defaults to locale value. Use to get entity-locale formatting with different-language labels.

Possible values: "en-US", "en-GB", "de-DE", "it-IT", "fr-FR", "es-ES", "sl-SI", "pt-PT", "nl-NL", "pl-PL", "hr-HR", "sv-SE", "fi-FI", "et-EE", "bg-BG", "cs-CZ", "sk-SK", "nb-NO", "is-IS", "hu-HU"

import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.invoices.getShareableInvoiceHtml('SHAREABLE_ID', undefined, {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);

Download shareable invoice as PDF

GET/invoices/shareable/{shareableId}/pdf

Download invoice as PDF using a shareable token. No authentication required. Supports multiple languages via locale query parameter.

Path parameters

shareableIdstringrequired

Shareable document token

Query parameters

localestringoptional

Locale for number and date formatting (decimal separators, date order). Defaults to entity locale.

Possible values: "en-US", "en-GB", "de-DE", "it-IT", "fr-FR", "es-ES", "sl-SI", "pt-PT", "nl-NL", "pl-PL", "hr-HR", "sv-SE", "fi-FI", "et-EE", "bg-BG", "cs-CZ", "sk-SK", "nb-NO", "is-IS", "hu-HU"

languagestringoptional

Language for document labels/translations. Defaults to locale value. Use to get entity-locale formatting with different-language labels.

Possible values: "en-US", "en-GB", "de-DE", "it-IT", "fr-FR", "es-ES", "sl-SI", "pt-PT", "nl-NL", "pl-PL", "hr-HR", "sv-SE", "fi-FI", "et-EE", "bg-BG", "cs-CZ", "sk-SK", "nb-NO", "is-IS", "hu-HU"

import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const blob = await sdk.invoices.getShareableInvoicePdf('SHAREABLE_ID', undefined, {
  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');

Download shareable invoice as e-SLOG XML

GET/invoices/shareable/{shareableId}/eslog

Download invoice as e-SLOG 2.0 XML (Slovenian electronic invoice format) using a shareable token. No authentication required. Only available for Slovenian entities with valid e-SLOG validation.

Path parameters

shareableIdstringrequired

Shareable document token

import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.invoices.getShareableInvoiceEslog('SHAREABLE_ID', {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);

Retry a NAV submission for a invoice

POST/invoices/{id}/nav/retry

Retries the current NAV Online Számla submission, either after it failed or was aborted by NAV, or after its technical annulment has been verified by NAV (nav.status is annulled) — in that case the annulled submission and its annulment are superseded and the report is re-submitted under the same invoice number: an invoice or advance invoice is rebuilt as a new CREATE from the document's current data; a credit note re-sends its original MODIFY/STORNO report. Available exactly when nav.retry_available is true (409 NAV_RETRY_NOT_AVAILABLE otherwise). Starts a new dispatch attempt; previous attempts are kept for audit as superseded. Data that cannot be re-mapped to a NAV Online Számla submission responds 422 NAV_INVOICE_DATA_INVALID with an issues array.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

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.invoices.retryInvoiceNav('inv_6595a27b5d35015c3ef0c3fd', {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);

Returns

idstring
numberstring
itemsarray of objects
datestring<date-time>

Date the invoice was created (ISO 8601 datetime at midnight UTC)

date_duestring<date-time>nullable

Date the invoice is due (ISO 8601 datetime at midnight UTC)

date_servicestringnullable

Service date in YYYY-MM-DD format. For invoices and credit notes. When it (or date_service_to, if later) falls on or before date, foreign-currency conversion uses it as the exchange-rate reference date instead of date.

currency_codestring
issuerobject

Document issuer (entity) information

customer_idstringnullable
customerobjectnullable

Customer information snapshot stored on the document. Null means no customer. When present, known customer fields are returned with null for omitted values.

notestringnullable

Note for the document. If not provided, defaults to entity's document-type-specific note setting. Pass empty string to explicitly set no note.

totalnumber

Document total before tax in the currency's major unit. For EUR, 29.90 means €29.90, not 2,990 cents.

total_with_taxnumber

Document total after tax in the currency's major unit. For EUR, 29.90 means €29.90, not 2,990 cents.

taxesarray of objects

Applied taxes summary

metadataobjectnullable

Custom string key-value data for your own use, with up to 50 properties. Keys are opaque and may contain periods. Useful for storing external IDs, tags, or integration data.

Other parameters
footerstringnullable
entity_idstring
date_yearinteger
shareable_idstringnullable
voided_atstring<date-time>nullable
total_convertednumbernullable
total_with_tax_convertednumbernullable
created_atstring<date-time>
updated_atstring<date-time>
total_paidnumber
total_duenumber
paid_in_fullboolean
ptstringnullable
json
{
  "id": "id",
  "number": "number",
  "is_draft": true,
  "date": "2025-01-15T10:30:00.000Z",
  "issuer": {
    "name": "name",
    "unit_name": "unit-name",
    "email": "user@example.com",
    "address": "address",
    "address_2": "address-2",
    "post_code": "post-code",
    "city": "city",
    "state": "state",
    "country": "country",
    "country_code": "country-code",
    "tax_number": "tax-number",
    "tax_number_2": "tax-number-2",
    "company_number": "company-number",
    "phone": "phone",
    "peppol_id": "peppol-id",
    "peppol_scheme_id": "peppol-scheme-id",
    "e_invoicing": {
      "buyer_reference": "991-12345-67"
    },
    "delivery_address": {
      "address": "12 rue de la Livraison",
      "address_2": "Bâtiment B",
      "post_code": "75008",
      "city": "Paris",
      "country_code": "FR"
    },
    "bank_accounts": [
      {
        "type": "iban",
        "name": "Main Business Account",
        "bank_name": "NLB d.d.",
        "iban": "SI56012345678901234",
        "account_number": "123456789",
        "bic": "LJBASI2X",
        "routing_number": "021000021",
        "sort_code": "12-34-56",
        "is_default": true
      }
    ],
    "is_end_consumer": true,
    "is_tax_subject": true,
    "ujp": {
      "receiver_name": "Obcina Ljubljana",
      "receiver_identifier": "12345678",
      "receiver_agent": "UJPLSI2DICL",
      "receiver_mailbox": "SI56011006030707507"
    },
    "sdi": {
      "recipient_code": "ABC1234",
      "pec": "cliente@example.pec.it",
      "fiscal_code": "fiscal-code",
      "fiscal_regime": "fiscal-regime"
    },
    "bank_account": {
      "type": "iban",
      "name": "Main Business Account",
      "bank_name": "NLB d.d.",
      "iban": "SI56012345678901234",
      "account_number": "123456789",
      "bic": "LJBASI2X",
      "routing_number": "021000021",
      "sort_code": "12-34-56"
    },
    "crypto_wallet": {
      "code": "BTC",
      "address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
      "network": "Ethereum"
    }
  },
  "business_unit_id": "business-unit-id",
  "business_unit": {
    "id": "id",
    "name": "name",
    "deleted_at": "2025-01-15T10:30:00.000Z",
    "address": "address",
    "address_2": "address-2",
    "post_code": "post-code",
    "city": "city",
    "state": "state",
    "country": "country",
    "country_code": "country-code",
    "email": "user@example.com",
    "phone": "phone",
    "website": "https://example.com",
    "settings": {
      "pdf_template": "modern",
      "primary_color": "primary-color",
      "logo_scale_percent": 70,
      "email_defaults": {
        "invoice_subject": "Invoice {document_number} from {entity_name}",
        "invoice_body": "Please find invoice {document_number} attached.\nDue date: {document_due_date}.",
        "estimate_subject": "Estimate {document_number} from {entity_name}",
        "estimate_body": "Please find estimate {document_number} attached.\nValid until: {document_valid_until}.",
        "credit_note_subject": "Credit note {document_number} from {entity_name}",
        "credit_note_body": "Please find credit note {document_number} attached.",
        "advance_invoice_subject": "Advance invoice {document_number} from {entity_name}",
        "advance_invoice_body": "Please find advance invoice {document_number} attached.",
        "delivery_note_subject": "Delivery note {document_number} from {entity_name}",
        "delivery_note_body": "Please find delivery note {document_number} attached.",
        "purchase_order_subject": "Purchase order {document_number} from {entity_name}",
        "purchase_order_body": "Please find purchase order {document_number} attached."
      },
      "translations": {
        "default_invoice_note": {
          "de-DE": "Beispieltext"
        },
        "default_invoice_payment_terms": {
          "de-DE": "Beispieltext"
        },
        "default_estimate_note": {
          "de-DE": "Beispieltext"
        },
        "default_estimate_payment_terms": {
          "de-DE": "Beispieltext"
        },
        "default_credit_note_note": {
          "de-DE": "Beispieltext"
        },
        "default_credit_note_payment_terms": {
          "de-DE": "Beispieltext"
        },
        "default_advance_invoice_note": {
          "de-DE": "Beispieltext"
        },
        "default_delivery_note_note": {
          "de-DE": "Beispieltext"
        },
        "document_footer": {
          "de-DE": "Beispieltext"
        },
        "default_document_signature": {
          "de-DE": "Beispieltext"
        },
        "email_defaults": {
          "invoice_subject": {
            "de-DE": "Beispieltext"
          },
          "invoice_body": {
            "de-DE": "Beispieltext"
          },
          "estimate_subject": {
            "de-DE": "Beispieltext"
          },
          "estimate_body": {
            "de-DE": "Beispieltext"
          },
          "credit_note_subject": {
            "de-DE": "Beispieltext"
          },
          "credit_note_body": {
            "de-DE": "Beispieltext"
          },
          "advance_invoice_subject": {
            "de-DE": "Beispieltext"
          },
          "advance_invoice_body": {
            "de-DE": "Beispieltext"
          },
          "delivery_note_subject": {
            "de-DE": "Beispieltext"
          },
          "delivery_note_body": {
            "de-DE": "Beispieltext"
          },
          "purchase_order_subject": {
            "de-DE": "Beispieltext"
          },
          "purchase_order_body": {
            "de-DE": "Beispieltext"
          }
        },
        "payment_reminders": {
          "email_subject": {
            "de-DE": "Beispieltext"
          },
          "email_body": {
            "de-DE": "Beispieltext"
          },
          "payment_instructions": {
            "de-DE": "Beispieltext"
          }
        },
        "tax_clause_defaults": {
          "domestic": {
            "de-DE": "Beispieltext"
          },
          "article_76a": {
            "de-DE": "Beispieltext"
          },
          "intra_eu_b2b": {
            "de-DE": "Beispieltext"
          },
          "intra_eu_b2b_goods": {
            "de-DE": "Beispieltext"
          },
          "intra_eu_b2c": {
            "de-DE": "Beispieltext"
          },
          "3w_b2b": {
            "de-DE": "Beispieltext"
          },
          "3w_b2c": {
            "de-DE": "Beispieltext"
          },
          "export": {
            "de-DE": "Beispieltext"
          }
        }
      },
      "default_invoice_note": "Payment due by {document_due_date}. Please reference invoice {document_number} when making payment.",
      "default_invoice_payment_terms": "Please remit payment using the bank details shown on the document.",
      "default_estimate_note": "This estimate is valid until {document_valid_until}.",
      "default_estimate_payment_terms": "Payment due upon acceptance.",
      "default_credit_note_note": "Credit note for invoice {document_number}.",
      "default_credit_note_payment_terms": "Credit will be applied to your account.",
      "default_advance_invoice_note": "Advance payment requested for {document_number}.",
      "default_delivery_note_note": "Goods delivered under delivery note {document_number}.",
      "document_footer": "{entity_name} | Due Date: {document_due_date} | Invoice #{document_number}",
      "default_document_signature": "{entity_name}",
      "bank_accounts": [
        {
          "type": "iban",
          "name": "Main Business Account",
          "bank_name": "NLB d.d.",
          "iban": "SI56012345678901234",
          "account_number": "123456789",
          "bic": "LJBASI2X",
          "routing_number": "021000021",
          "sort_code": "12-34-56",
          "is_default": true
        }
      ],
      "delivery_note_hide_prices": false,
      "purchase_order_hide_prices": false,
      "credit_note_negative_values": true,
      "show_payment_amounts": false,
      "hide_tax_when_untaxed": false,
      "tax_clause_defaults": {
        "domestic": null,
        "article_76a": "Obrnjena davčna obveznost po 76.a členu ZDDV-1.",
        "intra_eu_b2b": "VAT reverse charge - Article 194 of Directive 2006/112/EC. The customer is liable for VAT.",
        "intra_eu_b2b_goods": "Tax-exempt intra-Community supply - Article 138 of Directive 2006/112/EC.",
        "intra_eu_b2c": null,
        "3w_b2b": "Export - VAT exempt under Article 146 of Directive 2006/112/EC.",
        "3w_b2c": "Export - VAT exempt under Article 146 of Directive 2006/112/EC.",
        "export": "Export - VAT exempt under Article 146 of Directive 2006/112/EC."
      },
      "default_warehouse_id": "wh_6595a27b5d35015c3ef0c3fd"
    },
    "logo_url": "https://example.com",
    "signature_url": "https://example.com"
  },
  "warehouse_id": "warehouse-id",
  "customer_id": "customer-id",
  "customer": {
    "name": "name",
    "unit_name": "unit-name",
    "email": "user@example.com",
    "address": "address",
    "address_2": "address-2",
    "post_code": "post-code",
    "city": "city",
    "state": "state",
    "country": "country",
    "country_code": "country-code",
    "tax_number": "tax-number",
    "tax_number_2": "tax-number-2",
    "company_number": "company-number",
    "phone": "phone",
    "peppol_id": "peppol-id",
    "peppol_scheme_id": "peppol-scheme-id",
    "e_invoicing": {
      "buyer_reference": "991-12345-67"
    },
    "delivery_address": {
      "address": "12 rue de la Livraison",
      "address_2": "Bâtiment B",
      "post_code": "75008",
      "city": "Paris",
      "country_code": "FR"
    },
    "bank_accounts": [
      {
        "type": "iban",
        "name": "Main Business Account",
        "bank_name": "NLB d.d.",
        "iban": "SI56012345678901234",
        "account_number": "123456789",
        "bic": "LJBASI2X",
        "routing_number": "021000021",
        "sort_code": "12-34-56",
        "is_default": true
      }
    ],
    "is_end_consumer": true,
    "is_tax_subject": true,
    "ujp": {
      "receiver_name": "Obcina Ljubljana",
      "receiver_identifier": "12345678",
      "receiver_agent": "UJPLSI2DICL",
      "receiver_mailbox": "SI56011006030707507"
    },
    "sdi": {
      "recipient_code": "ABC1234",
      "pec": "cliente@example.pec.it",
      "fiscal_code": "fiscal-code",
      "fiscal_regime": "fiscal-regime"
    },
    "bank_account": {
      "type": "iban",
      "name": "Main Business Account",
      "bank_name": "NLB d.d.",
      "iban": "SI56012345678901234",
      "account_number": "123456789",
      "bic": "LJBASI2X",
      "routing_number": "021000021",
      "sort_code": "12-34-56"
    }
  },
  "note": "note",
  "payment_terms": "payment-terms",
  "tax_clause": "tax-clause",
  "footer": "footer",
  "signature": "signature",
  "translations": {
    "note": {
      "de-DE": "Vielen Dank fuer Ihren Auftrag."
    },
    "payment_terms": {
      "de-DE": "Zahlbar innerhalb von 30 Tagen."
    }
  },
  "total": 0,
  "total_with_tax": 0,
  "total_discount": 0,
  "creation_source": "standard",
  "calculation_mode": "b2b_standard",
  "taxes": [
    {
      "rate": 0,
      "tax_id": "tax-id",
      "base": 0,
      "amount": 0,
      "base_converted": 0,
      "amount_converted": 0,
      "reverse_charge": true
    }
  ],
  "currency_code": "currency-code",
  "entity_id": "entity-id",
  "date_year": 0,
  "shareable_id": "shareable-id",
  "voided_at": "2025-01-15T10:30:00.000Z",
  "transaction_type": "domestic",
  "metadata": {
    "external_id": "123",
    "source": "shopify"
  },
  "exchange_rate": {
    "rate": 0,
    "source": "source",
    "date": "2025-01-15T10:30:00.000Z",
    "quote_currency": "quote-currency"
  },
  "crypto_equivalents": [
    {
      "code": "BTC",
      "amount": 0.01342958,
      "rate": 0,
      "quote_currency": "EUR",
      "source": "auto",
      "date": "2025-01-15T10:30:00.000Z",
      "wallet_address": "wallet-address",
      "network": "network"
    }
  ],
  "total_converted": 0,
  "total_with_tax_converted": 0,
  "rounding_correction": 0,
  "eslog": {
    "validation_enabled": true,
    "validation_required": true,
    "validation_status": "valid",
    "validation_errors": [
      "validation-errors"
    ],
    "validated_at": "validated-at",
    "validation_version": "validation-version",
    "validation_cache_key": "validation-cache-key"
  },
  "reference": "reference",
  "vies": {
    "warning": "warning",
    "skipped": true,
    "request_id": "request-id"
  },
  "deleted_at": "2025-01-15T10:30:00.000Z",
  "created_at": "2025-01-15T10:30:00.000Z",
  "updated_at": "2025-01-15T10:30:00.000Z",
  "created_by_user_id": "created-by-user-id",
  "date_due": "2025-01-15T10:30:00.000Z",
  "total_paid": 0,
  "total_due": 0,
  "paid_in_full": true,
  "verifactu": {
    "record_id": "record-id",
    "status": "pending",
    "hash": "hash",
    "generated_at": "generated-at",
    "qr_url": "https://example.com",
    "software_version": "software-version",
    "csv": "csv",
    "error_code": "error-code",
    "error_message": "error-message"
  },
  "furs": {
    "status": "pending",
    "fiscalized_at": "2025-01-15T10:30:00.000Z",
    "error": "error",
    "cancellation_reason": "cancellation-reason",
    "data": {
      "zoi": "zoi",
      "reason": "reason",
      "eor": "eor",
      "qr_code": "qr-code",
      "business_premise_name": "business-premise-name",
      "electronic_device_name": "electronic-device-name",
      "invoice_number": "invoice-number",
      "iteration": 0,
      "issue_date_time": "issue-date-time",
      "payload": {},
      "issuer_tax_number": "issuer-tax-number",
      "operator_tax_number": "operator-tax-number",
      "operator_label": "operator-label",
      "foreign_operator": true,
      "print_count": 0,
      "cancelled": true,
      "cancelled_eor": "cancelled-eor",
      "cancellation_payload": {}
    }
  },
  "fina": {
    "status": "pending",
    "fiscalized_at": "2025-01-15T10:30:00.000Z",
    "error": "error",
    "data": {
      "zki": "zki",
      "jir": "jir",
      "qr_code_url": "https://example.com",
      "business_premise_name": "business-premise-name",
      "electronic_device_name": "electronic-device-name",
      "invoice_number": "invoice-number",
      "operator_oib": "operator-oib",
      "payment_type": "payment-type",
      "payment_type_changed_at": "2025-01-15T10:30:00.000Z",
      "buyer_oib": "buyer-oib",
      "payment_change_unconfirmed": {
        "attempt_id": "attempt-id",
        "payment_type": "payment-type",
        "buyer_oib": "buyer-oib",
        "payment_id": "payment-id",
        "attempted_at": "2025-01-15T10:30:00.000Z",
        "reason": "sent"
      },
      "numbering_sequence": "numbering-sequence",
      "issue_date_time": "issue-date-time",
      "issue_date_time_iso": "2025-01-15T10:30:00.000Z",
      "payload": {},
      "cis_record": {},
      "subsequent_submit": true,
      "issuer_oib": "issuer-oib",
      "operator_label": "operator-label",
      "print_count": 0
    }
  },
  "pt": "pt",
  "ticketbai": {
    "lroe_income_epigraphs": [
      "lroe-income-epigraphs"
    ],
    "simplified": true,
    "description": "description",
    "tax_treatment": "taxable",
    "vat_regime": "01",
    "exemption_cause": "E1",
    "non_subject_cause": "OT",
    "recipient_id_type": "02",
    "operation_type": "goods",
    "rectification_code": "R1",
    "cancellation": {
      "record_id": "record-id",
      "status": "pending",
      "reason": "reason"
    },
    "record_id": "record-id",
    "identifier": "identifier",
    "qr_url": "https://example.com",
    "status": "pending"
  },
  "ksef": {
    "submission_id": "submission-id",
    "status": "reserved",
    "revision": 0,
    "error_code": "error-code",
    "error_message": "error-message",
    "ksef_number": "ksef-number",
    "invoice_hash": "invoice-hash",
    "upo_available": true,
    "recovery_available": true
  },
  "early_payment_discount": {
    "terms_id": "terms-id",
    "percentage": 0,
    "days": 0,
    "deadline": "deadline",
    "timezone": "timezone",
    "currency_precision": 0,
    "eligible_base": 0,
    "discount_amount": 0,
    "discounted_payable": 0,
    "remaining_discounted_payable": 0,
    "discount_taken": 0,
    "total_cash_received": 0,
    "total_non_cash_applied": 0,
    "qualification_base": 0,
    "total_settled": 0,
    "qualifying_payment_id": "qualifying-payment-id"
  },
  "xrechnung": {
    "validation_enabled": true,
    "validation_required": true,
    "validation_status": "valid",
    "validation_errors": [
      "validation-errors"
    ],
    "validated_at": "validated-at",
    "validation_version": "validation-version",
    "validation_cache_key": "validation-cache-key"
  },
  "zugferd": {
    "validation_enabled": true,
    "validation_required": true,
    "validation_status": "valid",
    "validation_errors": [
      "validation-errors"
    ],
    "validated_at": "validated-at",
    "validation_version": "validation-version",
    "validation_cache_key": "validation-cache-key"
  },
  "ujp": {
    "validation_enabled": true,
    "validation_required": true,
    "validation_status": "valid",
    "validation_errors": [
      "validation-errors"
    ],
    "validated_at": "validated-at",
    "validation_version": "validation-version",
    "validation_cache_key": "validation-cache-key"
  },
  "nav": {
    "status": "done",
    "operation": "CREATE",
    "submission_id": "navsub_abc123",
    "environment": "production",
    "invoice_number": "INV-2026-001",
    "original_invoice_number": null,
    "modification_index": null,
    "transaction_id": null,
    "submitted_at": null,
    "completed_at": null,
    "error_code": null,
    "error_message": null,
    "messages": [
      {
        "severity": "warning",
        "code": "INVALID_TAX_NUMBER",
        "message": null,
        "tag": null,
        "line": null
      }
    ],
    "retry_available": false,
    "reconcile_available": false,
    "annulment_available": false
  },
  "sdi": {
    "country_code": "IT",
    "status": "pending",
    "latest_submission_id": "latest-submission-id",
    "file_name": "file-name",
    "sdi_identifier": "sdi-identifier",
    "submitted_at": "2025-01-15T10:30:00.000Z",
    "accepted_at": "2025-01-15T10:30:00.000Z",
    "delivered_at": "2025-01-15T10:30:00.000Z",
    "rejected_at": "2025-01-15T10:30:00.000Z",
    "non_deliverable_at": "2025-01-15T10:30:00.000Z",
    "failed_at": "2025-01-15T10:30:00.000Z",
    "next_retry_at": "2025-01-15T10:30:00.000Z",
    "retry_attempts": 0,
    "last_error": {
      "code": "code",
      "message": "message",
      "source": "validation"
    },
    "diagnostics": {
      "requires_reconciliation": true,
      "preparation_retry_count": 0,
      "certificate_warnings": [
        "certificate-warnings"
      ],
      "endpoint": "endpoint",
      "certificate_fingerprint": "certificate-fingerprint",
      "certificate_expires_at": "2025-01-15T10:30:00.000Z"
    }
  },
  "date_service": "2024-01-15",
  "date_service_to": "2024-01-31",
  "tax_rules": {
    "slovenia": {
      "article_76a": false
    }
  },
  "items": [
    {
      "id": "id",
      "type": "separator",
      "name": "name",
      "description": "description",
      "classification": "service",
      "price": 100,
      "gross_price": 122,
      "quantity": 1,
      "unit": "hours",
      "e_invoicing": {
        "unit_code": "C62",
        "vat_category": {
          "code": "K",
          "exemption_reason_code": "VATEX-EU-IC",
          "exemption_reason": "Intra-community supply"
        },
        "italy": {
          "nature": "N2.1",
          "legal_reference": "legal-reference"
        },
        "hungary": {
          "vat_treatment": {
            "type": "exemption",
            "case": "AAM",
            "reason": "Intra-Community exempt supply of goods."
          }
        }
      },
      "taxes": [
        {
          "rate": 0,
          "tax_id": "tax-id",
          "classification": "classification",
          "reverse_charge": true,
          "amount": 0,
          "is_deductible": true,
          "deductible_percentage": 0,
          "pt_exemption_code": "pt-exemption-code",
          "pt_exemption_reason": "pt-exemption-reason",
          "destination_vat_country_code": "DE"
        }
      ],
      "discounts": [
        {
          "value": 10,
          "type": "percent"
        }
      ],
      "total": 100,
      "total_with_tax": 122,
      "total_converted": 0,
      "total_with_tax_converted": 0,
      "invoice_id": "invoice-id",
      "advance_invoice_id": "advance-invoice-id",
      "delivery_note_id": "delivery-note-id",
      "expense_id": "expense-id",
      "item_id": "item-id",
      "metadata": {
        "external_id": "123",
        "source": "shopify"
      },
      "revenue_recognition": {
        "method": "service_period_daily",
        "date_from": "2026-05-15",
        "date_to": "2027-05-14"
      },
      "translations": {
        "name": {
          "de-DE": "Beratungsleistungen"
        },
        "description": {
          "de-DE": "Retainer fuer Maerz"
        }
      },
      "created_at": "2025-01-15T10:30:00.000Z",
      "updated_at": "2025-01-15T10:30:00.000Z",
      "financial_category_id": "fcat_abc123"
    }
  ],
  "document_relations": [
    {
      "id": "id",
      "source_type": "invoice",
      "source_id": "source-id",
      "target_type": "invoice",
      "target_id": "target-id",
      "relation_type": "relation-type",
      "entity_id": "entity-id",
      "created_at": "2025-01-15T10:30:00.000Z",
      "linked_document_voided_at": "2025-01-15T10:30:00.000Z",
      "related_document": {
        "id": "id",
        "type": "invoice",
        "number": "number",
        "date": "date",
        "total_with_tax": 0,
        "currency_code": "currency-code",
        "is_draft": true,
        "voided_at": "voided-at",
        "paid_in_full": true,
        "title_type": "estimate",
        "hide_prices": true
      }
    }
  ],
  "payments": [
    {
      "id": "id",
      "invoice_id": "invoice-id",
      "credit_note_id": "credit-note-id",
      "advance_invoice_id": "advance-invoice-id",
      "expense_id": "expense-id",
      "applied_to_expense_id": "applied-to-expense-id",
      "amount": 29.9,
      "currency_code": "currency-code",
      "amount_converted": 0,
      "type": "cash",
      "date": "2025-01-15T10:30:00.000Z",
      "tag": "tag",
      "reference": "reference",
      "note": "note",
      "entity_id": "entity-id",
      "metadata": {
        "external_id": "123",
        "source": "shopify"
      },
      "deleted_at": "2025-01-15T10:30:00.000Z",
      "created_at": "2025-01-15T10:30:00.000Z",
      "updated_at": "2025-01-15T10:30:00.000Z",
      "Invoice": {
        "id": "id",
        "number": "number",
        "voided_at": "2025-01-15T10:30:00.000Z"
      },
      "CreditNote": {
        "id": "id",
        "number": "number",
        "voided_at": "2025-01-15T10:30:00.000Z"
      },
      "AdvanceInvoice": {
        "id": "id",
        "number": "number",
        "is_draft": true,
        "voided_at": "2025-01-15T10:30:00.000Z"
      },
      "Expense": {
        "id": "id",
        "type": "invoice",
        "supplier_document_number": "supplier-document-number",
        "date": "date",
        "total_with_tax": 0
      },
      "AppliedToExpense": {
        "id": "id",
        "type": "invoice",
        "supplier_document_number": "supplier-document-number",
        "date": "date",
        "total_with_tax": 0
      }
    }
  ]
}

Reconcile a invoice's NAV submission with NAV now

POST/invoices/{id}/nav/reconcile

Runs NAV reconciliation for this document's current submission immediately instead of waiting for the next scheduled poll/reconciliation pass. For a submitted submission this polls queryTransactionStatus; for an ambiguous submission this searches queryTransactionList for a matching prior dispatch. Only available for submitted/ambiguous submissions (409 NAV_RECONCILE_NOT_AVAILABLE otherwise). Never sends anything to NAV.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

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.invoices.reconcileInvoiceNav('inv_6595a27b5d35015c3ef0c3fd', {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);

Returns

idstring
numberstring
itemsarray of objects
datestring<date-time>

Date the invoice was created (ISO 8601 datetime at midnight UTC)

date_duestring<date-time>nullable

Date the invoice is due (ISO 8601 datetime at midnight UTC)

date_servicestringnullable

Service date in YYYY-MM-DD format. For invoices and credit notes. When it (or date_service_to, if later) falls on or before date, foreign-currency conversion uses it as the exchange-rate reference date instead of date.

currency_codestring
issuerobject

Document issuer (entity) information

customer_idstringnullable
customerobjectnullable

Customer information snapshot stored on the document. Null means no customer. When present, known customer fields are returned with null for omitted values.

notestringnullable

Note for the document. If not provided, defaults to entity's document-type-specific note setting. Pass empty string to explicitly set no note.

totalnumber

Document total before tax in the currency's major unit. For EUR, 29.90 means €29.90, not 2,990 cents.

total_with_taxnumber

Document total after tax in the currency's major unit. For EUR, 29.90 means €29.90, not 2,990 cents.

taxesarray of objects

Applied taxes summary

metadataobjectnullable

Custom string key-value data for your own use, with up to 50 properties. Keys are opaque and may contain periods. Useful for storing external IDs, tags, or integration data.

Other parameters
footerstringnullable
entity_idstring
date_yearinteger
shareable_idstringnullable
voided_atstring<date-time>nullable
total_convertednumbernullable
total_with_tax_convertednumbernullable
created_atstring<date-time>
updated_atstring<date-time>
total_paidnumber
total_duenumber
paid_in_fullboolean
ptstringnullable
json
{
  "id": "id",
  "number": "number",
  "is_draft": true,
  "date": "2025-01-15T10:30:00.000Z",
  "issuer": {
    "name": "name",
    "unit_name": "unit-name",
    "email": "user@example.com",
    "address": "address",
    "address_2": "address-2",
    "post_code": "post-code",
    "city": "city",
    "state": "state",
    "country": "country",
    "country_code": "country-code",
    "tax_number": "tax-number",
    "tax_number_2": "tax-number-2",
    "company_number": "company-number",
    "phone": "phone",
    "peppol_id": "peppol-id",
    "peppol_scheme_id": "peppol-scheme-id",
    "e_invoicing": {
      "buyer_reference": "991-12345-67"
    },
    "delivery_address": {
      "address": "12 rue de la Livraison",
      "address_2": "Bâtiment B",
      "post_code": "75008",
      "city": "Paris",
      "country_code": "FR"
    },
    "bank_accounts": [
      {
        "type": "iban",
        "name": "Main Business Account",
        "bank_name": "NLB d.d.",
        "iban": "SI56012345678901234",
        "account_number": "123456789",
        "bic": "LJBASI2X",
        "routing_number": "021000021",
        "sort_code": "12-34-56",
        "is_default": true
      }
    ],
    "is_end_consumer": true,
    "is_tax_subject": true,
    "ujp": {
      "receiver_name": "Obcina Ljubljana",
      "receiver_identifier": "12345678",
      "receiver_agent": "UJPLSI2DICL",
      "receiver_mailbox": "SI56011006030707507"
    },
    "sdi": {
      "recipient_code": "ABC1234",
      "pec": "cliente@example.pec.it",
      "fiscal_code": "fiscal-code",
      "fiscal_regime": "fiscal-regime"
    },
    "bank_account": {
      "type": "iban",
      "name": "Main Business Account",
      "bank_name": "NLB d.d.",
      "iban": "SI56012345678901234",
      "account_number": "123456789",
      "bic": "LJBASI2X",
      "routing_number": "021000021",
      "sort_code": "12-34-56"
    },
    "crypto_wallet": {
      "code": "BTC",
      "address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
      "network": "Ethereum"
    }
  },
  "business_unit_id": "business-unit-id",
  "business_unit": {
    "id": "id",
    "name": "name",
    "deleted_at": "2025-01-15T10:30:00.000Z",
    "address": "address",
    "address_2": "address-2",
    "post_code": "post-code",
    "city": "city",
    "state": "state",
    "country": "country",
    "country_code": "country-code",
    "email": "user@example.com",
    "phone": "phone",
    "website": "https://example.com",
    "settings": {
      "pdf_template": "modern",
      "primary_color": "primary-color",
      "logo_scale_percent": 70,
      "email_defaults": {
        "invoice_subject": "Invoice {document_number} from {entity_name}",
        "invoice_body": "Please find invoice {document_number} attached.\nDue date: {document_due_date}.",
        "estimate_subject": "Estimate {document_number} from {entity_name}",
        "estimate_body": "Please find estimate {document_number} attached.\nValid until: {document_valid_until}.",
        "credit_note_subject": "Credit note {document_number} from {entity_name}",
        "credit_note_body": "Please find credit note {document_number} attached.",
        "advance_invoice_subject": "Advance invoice {document_number} from {entity_name}",
        "advance_invoice_body": "Please find advance invoice {document_number} attached.",
        "delivery_note_subject": "Delivery note {document_number} from {entity_name}",
        "delivery_note_body": "Please find delivery note {document_number} attached.",
        "purchase_order_subject": "Purchase order {document_number} from {entity_name}",
        "purchase_order_body": "Please find purchase order {document_number} attached."
      },
      "translations": {
        "default_invoice_note": {
          "de-DE": "Beispieltext"
        },
        "default_invoice_payment_terms": {
          "de-DE": "Beispieltext"
        },
        "default_estimate_note": {
          "de-DE": "Beispieltext"
        },
        "default_estimate_payment_terms": {
          "de-DE": "Beispieltext"
        },
        "default_credit_note_note": {
          "de-DE": "Beispieltext"
        },
        "default_credit_note_payment_terms": {
          "de-DE": "Beispieltext"
        },
        "default_advance_invoice_note": {
          "de-DE": "Beispieltext"
        },
        "default_delivery_note_note": {
          "de-DE": "Beispieltext"
        },
        "document_footer": {
          "de-DE": "Beispieltext"
        },
        "default_document_signature": {
          "de-DE": "Beispieltext"
        },
        "email_defaults": {
          "invoice_subject": {
            "de-DE": "Beispieltext"
          },
          "invoice_body": {
            "de-DE": "Beispieltext"
          },
          "estimate_subject": {
            "de-DE": "Beispieltext"
          },
          "estimate_body": {
            "de-DE": "Beispieltext"
          },
          "credit_note_subject": {
            "de-DE": "Beispieltext"
          },
          "credit_note_body": {
            "de-DE": "Beispieltext"
          },
          "advance_invoice_subject": {
            "de-DE": "Beispieltext"
          },
          "advance_invoice_body": {
            "de-DE": "Beispieltext"
          },
          "delivery_note_subject": {
            "de-DE": "Beispieltext"
          },
          "delivery_note_body": {
            "de-DE": "Beispieltext"
          },
          "purchase_order_subject": {
            "de-DE": "Beispieltext"
          },
          "purchase_order_body": {
            "de-DE": "Beispieltext"
          }
        },
        "payment_reminders": {
          "email_subject": {
            "de-DE": "Beispieltext"
          },
          "email_body": {
            "de-DE": "Beispieltext"
          },
          "payment_instructions": {
            "de-DE": "Beispieltext"
          }
        },
        "tax_clause_defaults": {
          "domestic": {
            "de-DE": "Beispieltext"
          },
          "article_76a": {
            "de-DE": "Beispieltext"
          },
          "intra_eu_b2b": {
            "de-DE": "Beispieltext"
          },
          "intra_eu_b2b_goods": {
            "de-DE": "Beispieltext"
          },
          "intra_eu_b2c": {
            "de-DE": "Beispieltext"
          },
          "3w_b2b": {
            "de-DE": "Beispieltext"
          },
          "3w_b2c": {
            "de-DE": "Beispieltext"
          },
          "export": {
            "de-DE": "Beispieltext"
          }
        }
      },
      "default_invoice_note": "Payment due by {document_due_date}. Please reference invoice {document_number} when making payment.",
      "default_invoice_payment_terms": "Please remit payment using the bank details shown on the document.",
      "default_estimate_note": "This estimate is valid until {document_valid_until}.",
      "default_estimate_payment_terms": "Payment due upon acceptance.",
      "default_credit_note_note": "Credit note for invoice {document_number}.",
      "default_credit_note_payment_terms": "Credit will be applied to your account.",
      "default_advance_invoice_note": "Advance payment requested for {document_number}.",
      "default_delivery_note_note": "Goods delivered under delivery note {document_number}.",
      "document_footer": "{entity_name} | Due Date: {document_due_date} | Invoice #{document_number}",
      "default_document_signature": "{entity_name}",
      "bank_accounts": [
        {
          "type": "iban",
          "name": "Main Business Account",
          "bank_name": "NLB d.d.",
          "iban": "SI56012345678901234",
          "account_number": "123456789",
          "bic": "LJBASI2X",
          "routing_number": "021000021",
          "sort_code": "12-34-56",
          "is_default": true
        }
      ],
      "delivery_note_hide_prices": false,
      "purchase_order_hide_prices": false,
      "credit_note_negative_values": true,
      "show_payment_amounts": false,
      "hide_tax_when_untaxed": false,
      "tax_clause_defaults": {
        "domestic": null,
        "article_76a": "Obrnjena davčna obveznost po 76.a členu ZDDV-1.",
        "intra_eu_b2b": "VAT reverse charge - Article 194 of Directive 2006/112/EC. The customer is liable for VAT.",
        "intra_eu_b2b_goods": "Tax-exempt intra-Community supply - Article 138 of Directive 2006/112/EC.",
        "intra_eu_b2c": null,
        "3w_b2b": "Export - VAT exempt under Article 146 of Directive 2006/112/EC.",
        "3w_b2c": "Export - VAT exempt under Article 146 of Directive 2006/112/EC.",
        "export": "Export - VAT exempt under Article 146 of Directive 2006/112/EC."
      },
      "default_warehouse_id": "wh_6595a27b5d35015c3ef0c3fd"
    },
    "logo_url": "https://example.com",
    "signature_url": "https://example.com"
  },
  "warehouse_id": "warehouse-id",
  "customer_id": "customer-id",
  "customer": {
    "name": "name",
    "unit_name": "unit-name",
    "email": "user@example.com",
    "address": "address",
    "address_2": "address-2",
    "post_code": "post-code",
    "city": "city",
    "state": "state",
    "country": "country",
    "country_code": "country-code",
    "tax_number": "tax-number",
    "tax_number_2": "tax-number-2",
    "company_number": "company-number",
    "phone": "phone",
    "peppol_id": "peppol-id",
    "peppol_scheme_id": "peppol-scheme-id",
    "e_invoicing": {
      "buyer_reference": "991-12345-67"
    },
    "delivery_address": {
      "address": "12 rue de la Livraison",
      "address_2": "Bâtiment B",
      "post_code": "75008",
      "city": "Paris",
      "country_code": "FR"
    },
    "bank_accounts": [
      {
        "type": "iban",
        "name": "Main Business Account",
        "bank_name": "NLB d.d.",
        "iban": "SI56012345678901234",
        "account_number": "123456789",
        "bic": "LJBASI2X",
        "routing_number": "021000021",
        "sort_code": "12-34-56",
        "is_default": true
      }
    ],
    "is_end_consumer": true,
    "is_tax_subject": true,
    "ujp": {
      "receiver_name": "Obcina Ljubljana",
      "receiver_identifier": "12345678",
      "receiver_agent": "UJPLSI2DICL",
      "receiver_mailbox": "SI56011006030707507"
    },
    "sdi": {
      "recipient_code": "ABC1234",
      "pec": "cliente@example.pec.it",
      "fiscal_code": "fiscal-code",
      "fiscal_regime": "fiscal-regime"
    },
    "bank_account": {
      "type": "iban",
      "name": "Main Business Account",
      "bank_name": "NLB d.d.",
      "iban": "SI56012345678901234",
      "account_number": "123456789",
      "bic": "LJBASI2X",
      "routing_number": "021000021",
      "sort_code": "12-34-56"
    }
  },
  "note": "note",
  "payment_terms": "payment-terms",
  "tax_clause": "tax-clause",
  "footer": "footer",
  "signature": "signature",
  "translations": {
    "note": {
      "de-DE": "Vielen Dank fuer Ihren Auftrag."
    },
    "payment_terms": {
      "de-DE": "Zahlbar innerhalb von 30 Tagen."
    }
  },
  "total": 0,
  "total_with_tax": 0,
  "total_discount": 0,
  "creation_source": "standard",
  "calculation_mode": "b2b_standard",
  "taxes": [
    {
      "rate": 0,
      "tax_id": "tax-id",
      "base": 0,
      "amount": 0,
      "base_converted": 0,
      "amount_converted": 0,
      "reverse_charge": true
    }
  ],
  "currency_code": "currency-code",
  "entity_id": "entity-id",
  "date_year": 0,
  "shareable_id": "shareable-id",
  "voided_at": "2025-01-15T10:30:00.000Z",
  "transaction_type": "domestic",
  "metadata": {
    "external_id": "123",
    "source": "shopify"
  },
  "exchange_rate": {
    "rate": 0,
    "source": "source",
    "date": "2025-01-15T10:30:00.000Z",
    "quote_currency": "quote-currency"
  },
  "crypto_equivalents": [
    {
      "code": "BTC",
      "amount": 0.01342958,
      "rate": 0,
      "quote_currency": "EUR",
      "source": "auto",
      "date": "2025-01-15T10:30:00.000Z",
      "wallet_address": "wallet-address",
      "network": "network"
    }
  ],
  "total_converted": 0,
  "total_with_tax_converted": 0,
  "rounding_correction": 0,
  "eslog": {
    "validation_enabled": true,
    "validation_required": true,
    "validation_status": "valid",
    "validation_errors": [
      "validation-errors"
    ],
    "validated_at": "validated-at",
    "validation_version": "validation-version",
    "validation_cache_key": "validation-cache-key"
  },
  "reference": "reference",
  "vies": {
    "warning": "warning",
    "skipped": true,
    "request_id": "request-id"
  },
  "deleted_at": "2025-01-15T10:30:00.000Z",
  "created_at": "2025-01-15T10:30:00.000Z",
  "updated_at": "2025-01-15T10:30:00.000Z",
  "created_by_user_id": "created-by-user-id",
  "date_due": "2025-01-15T10:30:00.000Z",
  "total_paid": 0,
  "total_due": 0,
  "paid_in_full": true,
  "verifactu": {
    "record_id": "record-id",
    "status": "pending",
    "hash": "hash",
    "generated_at": "generated-at",
    "qr_url": "https://example.com",
    "software_version": "software-version",
    "csv": "csv",
    "error_code": "error-code",
    "error_message": "error-message"
  },
  "furs": {
    "status": "pending",
    "fiscalized_at": "2025-01-15T10:30:00.000Z",
    "error": "error",
    "cancellation_reason": "cancellation-reason",
    "data": {
      "zoi": "zoi",
      "reason": "reason",
      "eor": "eor",
      "qr_code": "qr-code",
      "business_premise_name": "business-premise-name",
      "electronic_device_name": "electronic-device-name",
      "invoice_number": "invoice-number",
      "iteration": 0,
      "issue_date_time": "issue-date-time",
      "payload": {},
      "issuer_tax_number": "issuer-tax-number",
      "operator_tax_number": "operator-tax-number",
      "operator_label": "operator-label",
      "foreign_operator": true,
      "print_count": 0,
      "cancelled": true,
      "cancelled_eor": "cancelled-eor",
      "cancellation_payload": {}
    }
  },
  "fina": {
    "status": "pending",
    "fiscalized_at": "2025-01-15T10:30:00.000Z",
    "error": "error",
    "data": {
      "zki": "zki",
      "jir": "jir",
      "qr_code_url": "https://example.com",
      "business_premise_name": "business-premise-name",
      "electronic_device_name": "electronic-device-name",
      "invoice_number": "invoice-number",
      "operator_oib": "operator-oib",
      "payment_type": "payment-type",
      "payment_type_changed_at": "2025-01-15T10:30:00.000Z",
      "buyer_oib": "buyer-oib",
      "payment_change_unconfirmed": {
        "attempt_id": "attempt-id",
        "payment_type": "payment-type",
        "buyer_oib": "buyer-oib",
        "payment_id": "payment-id",
        "attempted_at": "2025-01-15T10:30:00.000Z",
        "reason": "sent"
      },
      "numbering_sequence": "numbering-sequence",
      "issue_date_time": "issue-date-time",
      "issue_date_time_iso": "2025-01-15T10:30:00.000Z",
      "payload": {},
      "cis_record": {},
      "subsequent_submit": true,
      "issuer_oib": "issuer-oib",
      "operator_label": "operator-label",
      "print_count": 0
    }
  },
  "pt": "pt",
  "ticketbai": {
    "lroe_income_epigraphs": [
      "lroe-income-epigraphs"
    ],
    "simplified": true,
    "description": "description",
    "tax_treatment": "taxable",
    "vat_regime": "01",
    "exemption_cause": "E1",
    "non_subject_cause": "OT",
    "recipient_id_type": "02",
    "operation_type": "goods",
    "rectification_code": "R1",
    "cancellation": {
      "record_id": "record-id",
      "status": "pending",
      "reason": "reason"
    },
    "record_id": "record-id",
    "identifier": "identifier",
    "qr_url": "https://example.com",
    "status": "pending"
  },
  "ksef": {
    "submission_id": "submission-id",
    "status": "reserved",
    "revision": 0,
    "error_code": "error-code",
    "error_message": "error-message",
    "ksef_number": "ksef-number",
    "invoice_hash": "invoice-hash",
    "upo_available": true,
    "recovery_available": true
  },
  "early_payment_discount": {
    "terms_id": "terms-id",
    "percentage": 0,
    "days": 0,
    "deadline": "deadline",
    "timezone": "timezone",
    "currency_precision": 0,
    "eligible_base": 0,
    "discount_amount": 0,
    "discounted_payable": 0,
    "remaining_discounted_payable": 0,
    "discount_taken": 0,
    "total_cash_received": 0,
    "total_non_cash_applied": 0,
    "qualification_base": 0,
    "total_settled": 0,
    "qualifying_payment_id": "qualifying-payment-id"
  },
  "xrechnung": {
    "validation_enabled": true,
    "validation_required": true,
    "validation_status": "valid",
    "validation_errors": [
      "validation-errors"
    ],
    "validated_at": "validated-at",
    "validation_version": "validation-version",
    "validation_cache_key": "validation-cache-key"
  },
  "zugferd": {
    "validation_enabled": true,
    "validation_required": true,
    "validation_status": "valid",
    "validation_errors": [
      "validation-errors"
    ],
    "validated_at": "validated-at",
    "validation_version": "validation-version",
    "validation_cache_key": "validation-cache-key"
  },
  "ujp": {
    "validation_enabled": true,
    "validation_required": true,
    "validation_status": "valid",
    "validation_errors": [
      "validation-errors"
    ],
    "validated_at": "validated-at",
    "validation_version": "validation-version",
    "validation_cache_key": "validation-cache-key"
  },
  "nav": {
    "status": "done",
    "operation": "CREATE",
    "submission_id": "navsub_abc123",
    "environment": "production",
    "invoice_number": "INV-2026-001",
    "original_invoice_number": null,
    "modification_index": null,
    "transaction_id": null,
    "submitted_at": null,
    "completed_at": null,
    "error_code": null,
    "error_message": null,
    "messages": [
      {
        "severity": "warning",
        "code": "INVALID_TAX_NUMBER",
        "message": null,
        "tag": null,
        "line": null
      }
    ],
    "retry_available": false,
    "reconcile_available": false,
    "annulment_available": false
  },
  "sdi": {
    "country_code": "IT",
    "status": "pending",
    "latest_submission_id": "latest-submission-id",
    "file_name": "file-name",
    "sdi_identifier": "sdi-identifier",
    "submitted_at": "2025-01-15T10:30:00.000Z",
    "accepted_at": "2025-01-15T10:30:00.000Z",
    "delivered_at": "2025-01-15T10:30:00.000Z",
    "rejected_at": "2025-01-15T10:30:00.000Z",
    "non_deliverable_at": "2025-01-15T10:30:00.000Z",
    "failed_at": "2025-01-15T10:30:00.000Z",
    "next_retry_at": "2025-01-15T10:30:00.000Z",
    "retry_attempts": 0,
    "last_error": {
      "code": "code",
      "message": "message",
      "source": "validation"
    },
    "diagnostics": {
      "requires_reconciliation": true,
      "preparation_retry_count": 0,
      "certificate_warnings": [
        "certificate-warnings"
      ],
      "endpoint": "endpoint",
      "certificate_fingerprint": "certificate-fingerprint",
      "certificate_expires_at": "2025-01-15T10:30:00.000Z"
    }
  },
  "date_service": "2024-01-15",
  "date_service_to": "2024-01-31",
  "tax_rules": {
    "slovenia": {
      "article_76a": false
    }
  },
  "items": [
    {
      "id": "id",
      "type": "separator",
      "name": "name",
      "description": "description",
      "classification": "service",
      "price": 100,
      "gross_price": 122,
      "quantity": 1,
      "unit": "hours",
      "e_invoicing": {
        "unit_code": "C62",
        "vat_category": {
          "code": "K",
          "exemption_reason_code": "VATEX-EU-IC",
          "exemption_reason": "Intra-community supply"
        },
        "italy": {
          "nature": "N2.1",
          "legal_reference": "legal-reference"
        },
        "hungary": {
          "vat_treatment": {
            "type": "exemption",
            "case": "AAM",
            "reason": "Intra-Community exempt supply of goods."
          }
        }
      },
      "taxes": [
        {
          "rate": 0,
          "tax_id": "tax-id",
          "classification": "classification",
          "reverse_charge": true,
          "amount": 0,
          "is_deductible": true,
          "deductible_percentage": 0,
          "pt_exemption_code": "pt-exemption-code",
          "pt_exemption_reason": "pt-exemption-reason",
          "destination_vat_country_code": "DE"
        }
      ],
      "discounts": [
        {
          "value": 10,
          "type": "percent"
        }
      ],
      "total": 100,
      "total_with_tax": 122,
      "total_converted": 0,
      "total_with_tax_converted": 0,
      "invoice_id": "invoice-id",
      "advance_invoice_id": "advance-invoice-id",
      "delivery_note_id": "delivery-note-id",
      "expense_id": "expense-id",
      "item_id": "item-id",
      "metadata": {
        "external_id": "123",
        "source": "shopify"
      },
      "revenue_recognition": {
        "method": "service_period_daily",
        "date_from": "2026-05-15",
        "date_to": "2027-05-14"
      },
      "translations": {
        "name": {
          "de-DE": "Beratungsleistungen"
        },
        "description": {
          "de-DE": "Retainer fuer Maerz"
        }
      },
      "created_at": "2025-01-15T10:30:00.000Z",
      "updated_at": "2025-01-15T10:30:00.000Z",
      "financial_category_id": "fcat_abc123"
    }
  ],
  "document_relations": [
    {
      "id": "id",
      "source_type": "invoice",
      "source_id": "source-id",
      "target_type": "invoice",
      "target_id": "target-id",
      "relation_type": "relation-type",
      "entity_id": "entity-id",
      "created_at": "2025-01-15T10:30:00.000Z",
      "linked_document_voided_at": "2025-01-15T10:30:00.000Z",
      "related_document": {
        "id": "id",
        "type": "invoice",
        "number": "number",
        "date": "date",
        "total_with_tax": 0,
        "currency_code": "currency-code",
        "is_draft": true,
        "voided_at": "voided-at",
        "paid_in_full": true,
        "title_type": "estimate",
        "hide_prices": true
      }
    }
  ],
  "payments": [
    {
      "id": "id",
      "invoice_id": "invoice-id",
      "credit_note_id": "credit-note-id",
      "advance_invoice_id": "advance-invoice-id",
      "expense_id": "expense-id",
      "applied_to_expense_id": "applied-to-expense-id",
      "amount": 29.9,
      "currency_code": "currency-code",
      "amount_converted": 0,
      "type": "cash",
      "date": "2025-01-15T10:30:00.000Z",
      "tag": "tag",
      "reference": "reference",
      "note": "note",
      "entity_id": "entity-id",
      "metadata": {
        "external_id": "123",
        "source": "shopify"
      },
      "deleted_at": "2025-01-15T10:30:00.000Z",
      "created_at": "2025-01-15T10:30:00.000Z",
      "updated_at": "2025-01-15T10:30:00.000Z",
      "Invoice": {
        "id": "id",
        "number": "number",
        "voided_at": "2025-01-15T10:30:00.000Z"
      },
      "CreditNote": {
        "id": "id",
        "number": "number",
        "voided_at": "2025-01-15T10:30:00.000Z"
      },
      "AdvanceInvoice": {
        "id": "id",
        "number": "number",
        "is_draft": true,
        "voided_at": "2025-01-15T10:30:00.000Z"
      },
      "Expense": {
        "id": "id",
        "type": "invoice",
        "supplier_document_number": "supplier-document-number",
        "date": "date",
        "total_with_tax": 0
      },
      "AppliedToExpense": {
        "id": "id",
        "type": "invoice",
        "supplier_document_number": "supplier-document-number",
        "date": "date",
        "total_with_tax": 0
      }
    }
  ]
}

Technically annul a invoice's NAV submission

POST/invoices/{id}/nav/annulment

Submits a technical annulment (manageAnnulment) for this document's NAV submission. Only available once the current submission is done/done_with_warnings and no annulment is already pending/done (409 NAV_ANNULMENT_NOT_AVAILABLE otherwise; 409 NAV_ANNULMENT_CONFLICT if a concurrent annulment request for this document was just accepted — reload and retry). A technical annulment does not correct business errors — issue a credit note (MODIFY/STORNO) for those.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

Unique resource identifier. Prefix depends on the resource, for example inv_, cus_, or ent_.

Body parameters

annulment_codestringrequired

NAV technical annulment code (annulmentCode, invoiceAnnulment.xsd).

Possible values: "ERRATIC_DATA", "ERRATIC_INVOICE_NUMBER", "ERRATIC_INVOICE_ISSUE_DATE", "ERRATIC_ELECTRONIC_HASH_VALUE"

reasonstringrequired

Technical annulment reason (annulmentReason, invoiceAnnulment.xsd, type common:SimpleText1024NotBlankType: max 1024 characters, non-blank).

import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.invoices.annulInvoiceNav('inv_6595a27b5d35015c3ef0c3fd', {
  annulment_code: "ERRATIC_DATA",
  reason: "Duplicate submission cancelled."
}, {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);

Returns

idstring
numberstring
itemsarray of objects
datestring<date-time>

Date the invoice was created (ISO 8601 datetime at midnight UTC)

date_duestring<date-time>nullable

Date the invoice is due (ISO 8601 datetime at midnight UTC)

date_servicestringnullable

Service date in YYYY-MM-DD format. For invoices and credit notes. When it (or date_service_to, if later) falls on or before date, foreign-currency conversion uses it as the exchange-rate reference date instead of date.

currency_codestring
issuerobject

Document issuer (entity) information

customer_idstringnullable
customerobjectnullable

Customer information snapshot stored on the document. Null means no customer. When present, known customer fields are returned with null for omitted values.

notestringnullable

Note for the document. If not provided, defaults to entity's document-type-specific note setting. Pass empty string to explicitly set no note.

totalnumber

Document total before tax in the currency's major unit. For EUR, 29.90 means €29.90, not 2,990 cents.

total_with_taxnumber

Document total after tax in the currency's major unit. For EUR, 29.90 means €29.90, not 2,990 cents.

taxesarray of objects

Applied taxes summary

metadataobjectnullable

Custom string key-value data for your own use, with up to 50 properties. Keys are opaque and may contain periods. Useful for storing external IDs, tags, or integration data.

Other parameters
footerstringnullable
entity_idstring
date_yearinteger
shareable_idstringnullable
voided_atstring<date-time>nullable
total_convertednumbernullable
total_with_tax_convertednumbernullable
created_atstring<date-time>
updated_atstring<date-time>
total_paidnumber
total_duenumber
paid_in_fullboolean
ptstringnullable
json
{
  "id": "id",
  "number": "number",
  "is_draft": true,
  "date": "2025-01-15T10:30:00.000Z",
  "issuer": {
    "name": "name",
    "unit_name": "unit-name",
    "email": "user@example.com",
    "address": "address",
    "address_2": "address-2",
    "post_code": "post-code",
    "city": "city",
    "state": "state",
    "country": "country",
    "country_code": "country-code",
    "tax_number": "tax-number",
    "tax_number_2": "tax-number-2",
    "company_number": "company-number",
    "phone": "phone",
    "peppol_id": "peppol-id",
    "peppol_scheme_id": "peppol-scheme-id",
    "e_invoicing": {
      "buyer_reference": "991-12345-67"
    },
    "delivery_address": {
      "address": "12 rue de la Livraison",
      "address_2": "Bâtiment B",
      "post_code": "75008",
      "city": "Paris",
      "country_code": "FR"
    },
    "bank_accounts": [
      {
        "type": "iban",
        "name": "Main Business Account",
        "bank_name": "NLB d.d.",
        "iban": "SI56012345678901234",
        "account_number": "123456789",
        "bic": "LJBASI2X",
        "routing_number": "021000021",
        "sort_code": "12-34-56",
        "is_default": true
      }
    ],
    "is_end_consumer": true,
    "is_tax_subject": true,
    "ujp": {
      "receiver_name": "Obcina Ljubljana",
      "receiver_identifier": "12345678",
      "receiver_agent": "UJPLSI2DICL",
      "receiver_mailbox": "SI56011006030707507"
    },
    "sdi": {
      "recipient_code": "ABC1234",
      "pec": "cliente@example.pec.it",
      "fiscal_code": "fiscal-code",
      "fiscal_regime": "fiscal-regime"
    },
    "bank_account": {
      "type": "iban",
      "name": "Main Business Account",
      "bank_name": "NLB d.d.",
      "iban": "SI56012345678901234",
      "account_number": "123456789",
      "bic": "LJBASI2X",
      "routing_number": "021000021",
      "sort_code": "12-34-56"
    },
    "crypto_wallet": {
      "code": "BTC",
      "address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
      "network": "Ethereum"
    }
  },
  "business_unit_id": "business-unit-id",
  "business_unit": {
    "id": "id",
    "name": "name",
    "deleted_at": "2025-01-15T10:30:00.000Z",
    "address": "address",
    "address_2": "address-2",
    "post_code": "post-code",
    "city": "city",
    "state": "state",
    "country": "country",
    "country_code": "country-code",
    "email": "user@example.com",
    "phone": "phone",
    "website": "https://example.com",
    "settings": {
      "pdf_template": "modern",
      "primary_color": "primary-color",
      "logo_scale_percent": 70,
      "email_defaults": {
        "invoice_subject": "Invoice {document_number} from {entity_name}",
        "invoice_body": "Please find invoice {document_number} attached.\nDue date: {document_due_date}.",
        "estimate_subject": "Estimate {document_number} from {entity_name}",
        "estimate_body": "Please find estimate {document_number} attached.\nValid until: {document_valid_until}.",
        "credit_note_subject": "Credit note {document_number} from {entity_name}",
        "credit_note_body": "Please find credit note {document_number} attached.",
        "advance_invoice_subject": "Advance invoice {document_number} from {entity_name}",
        "advance_invoice_body": "Please find advance invoice {document_number} attached.",
        "delivery_note_subject": "Delivery note {document_number} from {entity_name}",
        "delivery_note_body": "Please find delivery note {document_number} attached.",
        "purchase_order_subject": "Purchase order {document_number} from {entity_name}",
        "purchase_order_body": "Please find purchase order {document_number} attached."
      },
      "translations": {
        "default_invoice_note": {
          "de-DE": "Beispieltext"
        },
        "default_invoice_payment_terms": {
          "de-DE": "Beispieltext"
        },
        "default_estimate_note": {
          "de-DE": "Beispieltext"
        },
        "default_estimate_payment_terms": {
          "de-DE": "Beispieltext"
        },
        "default_credit_note_note": {
          "de-DE": "Beispieltext"
        },
        "default_credit_note_payment_terms": {
          "de-DE": "Beispieltext"
        },
        "default_advance_invoice_note": {
          "de-DE": "Beispieltext"
        },
        "default_delivery_note_note": {
          "de-DE": "Beispieltext"
        },
        "document_footer": {
          "de-DE": "Beispieltext"
        },
        "default_document_signature": {
          "de-DE": "Beispieltext"
        },
        "email_defaults": {
          "invoice_subject": {
            "de-DE": "Beispieltext"
          },
          "invoice_body": {
            "de-DE": "Beispieltext"
          },
          "estimate_subject": {
            "de-DE": "Beispieltext"
          },
          "estimate_body": {
            "de-DE": "Beispieltext"
          },
          "credit_note_subject": {
            "de-DE": "Beispieltext"
          },
          "credit_note_body": {
            "de-DE": "Beispieltext"
          },
          "advance_invoice_subject": {
            "de-DE": "Beispieltext"
          },
          "advance_invoice_body": {
            "de-DE": "Beispieltext"
          },
          "delivery_note_subject": {
            "de-DE": "Beispieltext"
          },
          "delivery_note_body": {
            "de-DE": "Beispieltext"
          },
          "purchase_order_subject": {
            "de-DE": "Beispieltext"
          },
          "purchase_order_body": {
            "de-DE": "Beispieltext"
          }
        },
        "payment_reminders": {
          "email_subject": {
            "de-DE": "Beispieltext"
          },
          "email_body": {
            "de-DE": "Beispieltext"
          },
          "payment_instructions": {
            "de-DE": "Beispieltext"
          }
        },
        "tax_clause_defaults": {
          "domestic": {
            "de-DE": "Beispieltext"
          },
          "article_76a": {
            "de-DE": "Beispieltext"
          },
          "intra_eu_b2b": {
            "de-DE": "Beispieltext"
          },
          "intra_eu_b2b_goods": {
            "de-DE": "Beispieltext"
          },
          "intra_eu_b2c": {
            "de-DE": "Beispieltext"
          },
          "3w_b2b": {
            "de-DE": "Beispieltext"
          },
          "3w_b2c": {
            "de-DE": "Beispieltext"
          },
          "export": {
            "de-DE": "Beispieltext"
          }
        }
      },
      "default_invoice_note": "Payment due by {document_due_date}. Please reference invoice {document_number} when making payment.",
      "default_invoice_payment_terms": "Please remit payment using the bank details shown on the document.",
      "default_estimate_note": "This estimate is valid until {document_valid_until}.",
      "default_estimate_payment_terms": "Payment due upon acceptance.",
      "default_credit_note_note": "Credit note for invoice {document_number}.",
      "default_credit_note_payment_terms": "Credit will be applied to your account.",
      "default_advance_invoice_note": "Advance payment requested for {document_number}.",
      "default_delivery_note_note": "Goods delivered under delivery note {document_number}.",
      "document_footer": "{entity_name} | Due Date: {document_due_date} | Invoice #{document_number}",
      "default_document_signature": "{entity_name}",
      "bank_accounts": [
        {
          "type": "iban",
          "name": "Main Business Account",
          "bank_name": "NLB d.d.",
          "iban": "SI56012345678901234",
          "account_number": "123456789",
          "bic": "LJBASI2X",
          "routing_number": "021000021",
          "sort_code": "12-34-56",
          "is_default": true
        }
      ],
      "delivery_note_hide_prices": false,
      "purchase_order_hide_prices": false,
      "credit_note_negative_values": true,
      "show_payment_amounts": false,
      "hide_tax_when_untaxed": false,
      "tax_clause_defaults": {
        "domestic": null,
        "article_76a": "Obrnjena davčna obveznost po 76.a členu ZDDV-1.",
        "intra_eu_b2b": "VAT reverse charge - Article 194 of Directive 2006/112/EC. The customer is liable for VAT.",
        "intra_eu_b2b_goods": "Tax-exempt intra-Community supply - Article 138 of Directive 2006/112/EC.",
        "intra_eu_b2c": null,
        "3w_b2b": "Export - VAT exempt under Article 146 of Directive 2006/112/EC.",
        "3w_b2c": "Export - VAT exempt under Article 146 of Directive 2006/112/EC.",
        "export": "Export - VAT exempt under Article 146 of Directive 2006/112/EC."
      },
      "default_warehouse_id": "wh_6595a27b5d35015c3ef0c3fd"
    },
    "logo_url": "https://example.com",
    "signature_url": "https://example.com"
  },
  "warehouse_id": "warehouse-id",
  "customer_id": "customer-id",
  "customer": {
    "name": "name",
    "unit_name": "unit-name",
    "email": "user@example.com",
    "address": "address",
    "address_2": "address-2",
    "post_code": "post-code",
    "city": "city",
    "state": "state",
    "country": "country",
    "country_code": "country-code",
    "tax_number": "tax-number",
    "tax_number_2": "tax-number-2",
    "company_number": "company-number",
    "phone": "phone",
    "peppol_id": "peppol-id",
    "peppol_scheme_id": "peppol-scheme-id",
    "e_invoicing": {
      "buyer_reference": "991-12345-67"
    },
    "delivery_address": {
      "address": "12 rue de la Livraison",
      "address_2": "Bâtiment B",
      "post_code": "75008",
      "city": "Paris",
      "country_code": "FR"
    },
    "bank_accounts": [
      {
        "type": "iban",
        "name": "Main Business Account",
        "bank_name": "NLB d.d.",
        "iban": "SI56012345678901234",
        "account_number": "123456789",
        "bic": "LJBASI2X",
        "routing_number": "021000021",
        "sort_code": "12-34-56",
        "is_default": true
      }
    ],
    "is_end_consumer": true,
    "is_tax_subject": true,
    "ujp": {
      "receiver_name": "Obcina Ljubljana",
      "receiver_identifier": "12345678",
      "receiver_agent": "UJPLSI2DICL",
      "receiver_mailbox": "SI56011006030707507"
    },
    "sdi": {
      "recipient_code": "ABC1234",
      "pec": "cliente@example.pec.it",
      "fiscal_code": "fiscal-code",
      "fiscal_regime": "fiscal-regime"
    },
    "bank_account": {
      "type": "iban",
      "name": "Main Business Account",
      "bank_name": "NLB d.d.",
      "iban": "SI56012345678901234",
      "account_number": "123456789",
      "bic": "LJBASI2X",
      "routing_number": "021000021",
      "sort_code": "12-34-56"
    }
  },
  "note": "note",
  "payment_terms": "payment-terms",
  "tax_clause": "tax-clause",
  "footer": "footer",
  "signature": "signature",
  "translations": {
    "note": {
      "de-DE": "Vielen Dank fuer Ihren Auftrag."
    },
    "payment_terms": {
      "de-DE": "Zahlbar innerhalb von 30 Tagen."
    }
  },
  "total": 0,
  "total_with_tax": 0,
  "total_discount": 0,
  "creation_source": "standard",
  "calculation_mode": "b2b_standard",
  "taxes": [
    {
      "rate": 0,
      "tax_id": "tax-id",
      "base": 0,
      "amount": 0,
      "base_converted": 0,
      "amount_converted": 0,
      "reverse_charge": true
    }
  ],
  "currency_code": "currency-code",
  "entity_id": "entity-id",
  "date_year": 0,
  "shareable_id": "shareable-id",
  "voided_at": "2025-01-15T10:30:00.000Z",
  "transaction_type": "domestic",
  "metadata": {
    "external_id": "123",
    "source": "shopify"
  },
  "exchange_rate": {
    "rate": 0,
    "source": "source",
    "date": "2025-01-15T10:30:00.000Z",
    "quote_currency": "quote-currency"
  },
  "crypto_equivalents": [
    {
      "code": "BTC",
      "amount": 0.01342958,
      "rate": 0,
      "quote_currency": "EUR",
      "source": "auto",
      "date": "2025-01-15T10:30:00.000Z",
      "wallet_address": "wallet-address",
      "network": "network"
    }
  ],
  "total_converted": 0,
  "total_with_tax_converted": 0,
  "rounding_correction": 0,
  "eslog": {
    "validation_enabled": true,
    "validation_required": true,
    "validation_status": "valid",
    "validation_errors": [
      "validation-errors"
    ],
    "validated_at": "validated-at",
    "validation_version": "validation-version",
    "validation_cache_key": "validation-cache-key"
  },
  "reference": "reference",
  "vies": {
    "warning": "warning",
    "skipped": true,
    "request_id": "request-id"
  },
  "deleted_at": "2025-01-15T10:30:00.000Z",
  "created_at": "2025-01-15T10:30:00.000Z",
  "updated_at": "2025-01-15T10:30:00.000Z",
  "created_by_user_id": "created-by-user-id",
  "date_due": "2025-01-15T10:30:00.000Z",
  "total_paid": 0,
  "total_due": 0,
  "paid_in_full": true,
  "verifactu": {
    "record_id": "record-id",
    "status": "pending",
    "hash": "hash",
    "generated_at": "generated-at",
    "qr_url": "https://example.com",
    "software_version": "software-version",
    "csv": "csv",
    "error_code": "error-code",
    "error_message": "error-message"
  },
  "furs": {
    "status": "pending",
    "fiscalized_at": "2025-01-15T10:30:00.000Z",
    "error": "error",
    "cancellation_reason": "cancellation-reason",
    "data": {
      "zoi": "zoi",
      "reason": "reason",
      "eor": "eor",
      "qr_code": "qr-code",
      "business_premise_name": "business-premise-name",
      "electronic_device_name": "electronic-device-name",
      "invoice_number": "invoice-number",
      "iteration": 0,
      "issue_date_time": "issue-date-time",
      "payload": {},
      "issuer_tax_number": "issuer-tax-number",
      "operator_tax_number": "operator-tax-number",
      "operator_label": "operator-label",
      "foreign_operator": true,
      "print_count": 0,
      "cancelled": true,
      "cancelled_eor": "cancelled-eor",
      "cancellation_payload": {}
    }
  },
  "fina": {
    "status": "pending",
    "fiscalized_at": "2025-01-15T10:30:00.000Z",
    "error": "error",
    "data": {
      "zki": "zki",
      "jir": "jir",
      "qr_code_url": "https://example.com",
      "business_premise_name": "business-premise-name",
      "electronic_device_name": "electronic-device-name",
      "invoice_number": "invoice-number",
      "operator_oib": "operator-oib",
      "payment_type": "payment-type",
      "payment_type_changed_at": "2025-01-15T10:30:00.000Z",
      "buyer_oib": "buyer-oib",
      "payment_change_unconfirmed": {
        "attempt_id": "attempt-id",
        "payment_type": "payment-type",
        "buyer_oib": "buyer-oib",
        "payment_id": "payment-id",
        "attempted_at": "2025-01-15T10:30:00.000Z",
        "reason": "sent"
      },
      "numbering_sequence": "numbering-sequence",
      "issue_date_time": "issue-date-time",
      "issue_date_time_iso": "2025-01-15T10:30:00.000Z",
      "payload": {},
      "cis_record": {},
      "subsequent_submit": true,
      "issuer_oib": "issuer-oib",
      "operator_label": "operator-label",
      "print_count": 0
    }
  },
  "pt": "pt",
  "ticketbai": {
    "lroe_income_epigraphs": [
      "lroe-income-epigraphs"
    ],
    "simplified": true,
    "description": "description",
    "tax_treatment": "taxable",
    "vat_regime": "01",
    "exemption_cause": "E1",
    "non_subject_cause": "OT",
    "recipient_id_type": "02",
    "operation_type": "goods",
    "rectification_code": "R1",
    "cancellation": {
      "record_id": "record-id",
      "status": "pending",
      "reason": "reason"
    },
    "record_id": "record-id",
    "identifier": "identifier",
    "qr_url": "https://example.com",
    "status": "pending"
  },
  "ksef": {
    "submission_id": "submission-id",
    "status": "reserved",
    "revision": 0,
    "error_code": "error-code",
    "error_message": "error-message",
    "ksef_number": "ksef-number",
    "invoice_hash": "invoice-hash",
    "upo_available": true,
    "recovery_available": true
  },
  "early_payment_discount": {
    "terms_id": "terms-id",
    "percentage": 0,
    "days": 0,
    "deadline": "deadline",
    "timezone": "timezone",
    "currency_precision": 0,
    "eligible_base": 0,
    "discount_amount": 0,
    "discounted_payable": 0,
    "remaining_discounted_payable": 0,
    "discount_taken": 0,
    "total_cash_received": 0,
    "total_non_cash_applied": 0,
    "qualification_base": 0,
    "total_settled": 0,
    "qualifying_payment_id": "qualifying-payment-id"
  },
  "xrechnung": {
    "validation_enabled": true,
    "validation_required": true,
    "validation_status": "valid",
    "validation_errors": [
      "validation-errors"
    ],
    "validated_at": "validated-at",
    "validation_version": "validation-version",
    "validation_cache_key": "validation-cache-key"
  },
  "zugferd": {
    "validation_enabled": true,
    "validation_required": true,
    "validation_status": "valid",
    "validation_errors": [
      "validation-errors"
    ],
    "validated_at": "validated-at",
    "validation_version": "validation-version",
    "validation_cache_key": "validation-cache-key"
  },
  "ujp": {
    "validation_enabled": true,
    "validation_required": true,
    "validation_status": "valid",
    "validation_errors": [
      "validation-errors"
    ],
    "validated_at": "validated-at",
    "validation_version": "validation-version",
    "validation_cache_key": "validation-cache-key"
  },
  "nav": {
    "status": "done",
    "operation": "CREATE",
    "submission_id": "navsub_abc123",
    "environment": "production",
    "invoice_number": "INV-2026-001",
    "original_invoice_number": null,
    "modification_index": null,
    "transaction_id": null,
    "submitted_at": null,
    "completed_at": null,
    "error_code": null,
    "error_message": null,
    "messages": [
      {
        "severity": "warning",
        "code": "INVALID_TAX_NUMBER",
        "message": null,
        "tag": null,
        "line": null
      }
    ],
    "retry_available": false,
    "reconcile_available": false,
    "annulment_available": false
  },
  "sdi": {
    "country_code": "IT",
    "status": "pending",
    "latest_submission_id": "latest-submission-id",
    "file_name": "file-name",
    "sdi_identifier": "sdi-identifier",
    "submitted_at": "2025-01-15T10:30:00.000Z",
    "accepted_at": "2025-01-15T10:30:00.000Z",
    "delivered_at": "2025-01-15T10:30:00.000Z",
    "rejected_at": "2025-01-15T10:30:00.000Z",
    "non_deliverable_at": "2025-01-15T10:30:00.000Z",
    "failed_at": "2025-01-15T10:30:00.000Z",
    "next_retry_at": "2025-01-15T10:30:00.000Z",
    "retry_attempts": 0,
    "last_error": {
      "code": "code",
      "message": "message",
      "source": "validation"
    },
    "diagnostics": {
      "requires_reconciliation": true,
      "preparation_retry_count": 0,
      "certificate_warnings": [
        "certificate-warnings"
      ],
      "endpoint": "endpoint",
      "certificate_fingerprint": "certificate-fingerprint",
      "certificate_expires_at": "2025-01-15T10:30:00.000Z"
    }
  },
  "date_service": "2024-01-15",
  "date_service_to": "2024-01-31",
  "tax_rules": {
    "slovenia": {
      "article_76a": false
    }
  },
  "items": [
    {
      "id": "id",
      "type": "separator",
      "name": "name",
      "description": "description",
      "classification": "service",
      "price": 100,
      "gross_price": 122,
      "quantity": 1,
      "unit": "hours",
      "e_invoicing": {
        "unit_code": "C62",
        "vat_category": {
          "code": "K",
          "exemption_reason_code": "VATEX-EU-IC",
          "exemption_reason": "Intra-community supply"
        },
        "italy": {
          "nature": "N2.1",
          "legal_reference": "legal-reference"
        },
        "hungary": {
          "vat_treatment": {
            "type": "exemption",
            "case": "AAM",
            "reason": "Intra-Community exempt supply of goods."
          }
        }
      },
      "taxes": [
        {
          "rate": 0,
          "tax_id": "tax-id",
          "classification": "classification",
          "reverse_charge": true,
          "amount": 0,
          "is_deductible": true,
          "deductible_percentage": 0,
          "pt_exemption_code": "pt-exemption-code",
          "pt_exemption_reason": "pt-exemption-reason",
          "destination_vat_country_code": "DE"
        }
      ],
      "discounts": [
        {
          "value": 10,
          "type": "percent"
        }
      ],
      "total": 100,
      "total_with_tax": 122,
      "total_converted": 0,
      "total_with_tax_converted": 0,
      "invoice_id": "invoice-id",
      "advance_invoice_id": "advance-invoice-id",
      "delivery_note_id": "delivery-note-id",
      "expense_id": "expense-id",
      "item_id": "item-id",
      "metadata": {
        "external_id": "123",
        "source": "shopify"
      },
      "revenue_recognition": {
        "method": "service_period_daily",
        "date_from": "2026-05-15",
        "date_to": "2027-05-14"
      },
      "translations": {
        "name": {
          "de-DE": "Beratungsleistungen"
        },
        "description": {
          "de-DE": "Retainer fuer Maerz"
        }
      },
      "created_at": "2025-01-15T10:30:00.000Z",
      "updated_at": "2025-01-15T10:30:00.000Z",
      "financial_category_id": "fcat_abc123"
    }
  ],
  "document_relations": [
    {
      "id": "id",
      "source_type": "invoice",
      "source_id": "source-id",
      "target_type": "invoice",
      "target_id": "target-id",
      "relation_type": "relation-type",
      "entity_id": "entity-id",
      "created_at": "2025-01-15T10:30:00.000Z",
      "linked_document_voided_at": "2025-01-15T10:30:00.000Z",
      "related_document": {
        "id": "id",
        "type": "invoice",
        "number": "number",
        "date": "date",
        "total_with_tax": 0,
        "currency_code": "currency-code",
        "is_draft": true,
        "voided_at": "voided-at",
        "paid_in_full": true,
        "title_type": "estimate",
        "hide_prices": true
      }
    }
  ],
  "payments": [
    {
      "id": "id",
      "invoice_id": "invoice-id",
      "credit_note_id": "credit-note-id",
      "advance_invoice_id": "advance-invoice-id",
      "expense_id": "expense-id",
      "applied_to_expense_id": "applied-to-expense-id",
      "amount": 29.9,
      "currency_code": "currency-code",
      "amount_converted": 0,
      "type": "cash",
      "date": "2025-01-15T10:30:00.000Z",
      "tag": "tag",
      "reference": "reference",
      "note": "note",
      "entity_id": "entity-id",
      "metadata": {
        "external_id": "123",
        "source": "shopify"
      },
      "deleted_at": "2025-01-15T10:30:00.000Z",
      "created_at": "2025-01-15T10:30:00.000Z",
      "updated_at": "2025-01-15T10:30:00.000Z",
      "Invoice": {
        "id": "id",
        "number": "number",
        "voided_at": "2025-01-15T10:30:00.000Z"
      },
      "CreditNote": {
        "id": "id",
        "number": "number",
        "voided_at": "2025-01-15T10:30:00.000Z"
      },
      "AdvanceInvoice": {
        "id": "id",
        "number": "number",
        "is_draft": true,
        "voided_at": "2025-01-15T10:30:00.000Z"
      },
      "Expense": {
        "id": "id",
        "type": "invoice",
        "supplier_document_number": "supplier-document-number",
        "date": "date",
        "total_with_tax": 0
      },
      "AppliedToExpense": {
        "id": "id",
        "type": "invoice",
        "supplier_document_number": "supplier-document-number",
        "date": "date",
        "total_with_tax": 0
      }
    }
  ]
}

Return an unaccepted KSeF document to draft

POST/invoices/{id}/ksef/recover

No request body. Archives the previous attempt and returns the document to draft only after definitive authority rejection, no dispatch, or verified empty cancelled session. Accepted, duplicate and unresolved ambiguous submissions remain immutable. Repeated completed recovery is idempotent. Returns 422 KSEF_AUTH_FAILED if KSeF rejects the entity's token.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

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.invoices.recoverInvoiceFromKsef("inv_6595a27b5d35015c3ef0c3fd", {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);

Returns

submission_idstring
revisioninteger
error_messagestringnullable
ksef_numberstringnullable
invoice_hashstringnullable
upo_availableboolean
json
{
  "submission_id": "submission-id",
  "status": "reserved",
  "revision": 0,
  "error_code": "error-code",
  "error_message": "error-message",
  "ksef_number": "ksef-number",
  "invoice_hash": "invoice-hash",
  "upo_available": true,
  "recovery_available": true
}

Get KSeF submission status

GET/invoices/{id}/ksef

Read persisted KSeF lifecycle state and reconcile pending authority results. Polling is rate limited. This does not resend invoices. When KSeF rejects the entity's token or is unavailable, this read returns the stored state (error_code KSEF_AUTH_FAILED for a rejected token) instead of failing.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

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.invoices.getInvoiceKsefState("inv_6595a27b5d35015c3ef0c3fd", {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);

Returns

submission_idstring
revisioninteger
error_messagestringnullable
ksef_numberstringnullable
invoice_hashstringnullable
upo_availableboolean
json
{
  "submission_id": "submission-id",
  "status": "reserved",
  "revision": 0,
  "error_code": "error-code",
  "error_message": "error-message",
  "ksef_number": "ksef-number",
  "invoice_hash": "invoice-hash",
  "upo_available": true,
  "recovery_available": true
}

Submit or resume a KSeF invoice

POST/invoices/{id}/ksef/submit

Submit an issued Polish B2B invoice or credit note within the supported KSeF scope: standard online documents from active-VAT sellers, or documents from VAT-exempt (art. 113) sellers: domestic invoices, and cross-border invoices to business buyers, meaning documents whose transaction_type is intra_eu_b2b (an EU buyer with a VAT number that VIES did not reject) or 3w_b2b (a non-EU buyer with a tax number), where every line has classification product or service. The invoice tax clause, stating the exemption's legal basis, is required when the document has exempt (zw) lines: every domestic document and any cross-border goods line; a cross-border services-only document needs none (services are reported as outside Polish VAT). A clause longer than 256 characters is always refused. Exempt sellers cannot submit invoices to consumers abroad or to buyers whose EU VAT number VIES rejected (intra_eu_b2c, 3w_b2c). See the Poland compliance guide for currency and scope rules. Advances, offline24 and domestic totals above PLN 15,000 are outside this route. KSeF is required unless an explicit exemption reason is configured; disabling KSeF does not bypass that obligation. Uses the existing reservation on repeat calls. Ambiguous dispatches reconcile without resending; rejected invoices are terminal. Returns 422 with code KSEF_AUTH_FAILED when KSeF rejects the entity's KSeF token; the submission stays queued with error_code KSEF_AUTH_FAILED and resumes automatically once the token is replaced. No request body.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

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.invoices.submitInvoiceToKsef("inv_6595a27b5d35015c3ef0c3fd", {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);

Returns

submission_idstring
revisioninteger
error_messagestringnullable
ksef_numberstringnullable
invoice_hashstringnullable
upo_availableboolean
json
{
  "submission_id": "submission-id",
  "status": "reserved",
  "revision": 0,
  "error_code": "error-code",
  "error_message": "error-message",
  "ksef_number": "ksef-number",
  "invoice_hash": "invoice-hash",
  "upo_available": true,
  "recovery_available": true
}

Download verified KSeF UPO

GET/invoices/{id}/ksef/upo

Download the authority receipt after verified acceptance. Returns 409 while the receipt is pending.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

Space Invoices resource identifier (format: {prefix}_{hex24})

import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const blob = await sdk.invoices.getInvoiceKsefUpo("inv_6595a27b5d35015c3ef0c3fd", {
  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');

Get remaining Portuguese invoice quantities for a credit note

GET/invoices/{id}/credit-options

Returns remaining uncredited line quantities for an active issued Portuguese invoice. Excludes voided credits and accounts for prior partial corrections. This is a read-only preparation snapshot, not a reservation: credit-note creation validates and reserves the balance again. Returns 422 for non-Portuguese entities, ineligible originals, or historical credits requiring reconciliation.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

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.invoices.getCreditOptions('inv_6595a27b5d35015c3ef0c3fd', {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);

Returns

itemsarray of objects
Other parameters
json
{
  "items": [
    {
      "invoice_item_id": "invoice-item-id",
      "remaining_quantity": 0
    }
  ],
  "fully_credited": true
}

Download invoice as XRechnung XML

GET/invoices/{id}/xrechnung

Download a finalized German invoice as XRechnung XML. Requires a German entity with XRechnung enabled. The stored validation result is used when it is still current for the document; otherwise the current document is re-validated at export time.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

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.invoices.downloadInvoiceXRechnung('inv_6595a27b5d35015c3ef0c3fd', {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);

Download invoice as ZUGFeRD PDF

GET/invoices/{id}/zugferd

Download a finalized German invoice as a ZUGFeRD/Factur-X PDF with embedded CII XML. Requires a German entity with ZUGFeRD enabled. The stored validation result is used when it is still current for the document; otherwise the current document is re-validated at export time.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

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 blob = await sdk.invoices.downloadInvoiceZugferd('inv_6595a27b5d35015c3ef0c3fd', {
  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');

Fiscalize an old invoice (deprecated)

POST/invoices/{id}/fiscalize

Deprecated. Use POST /documents/{id}/fiscalize instead. Manually fiscalize an invoice that was created before FURS was enabled. Creates or reuses a dedicated "OLD" device under an existing active FURS premise, assigns a new sequential FURS number (Premise-OLD-N), and submits to FURS with SubsequentSubmit=true and SpecialNotes=#OLDINV;. The original invoice number remains unchanged.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

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.invoices.fiscalizeInvoice('inv_6595a27b5d35015c3ef0c3fd', {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);

Returns

idstring
numberstring
itemsarray of objects
datestring<date-time>

Date the invoice was created (ISO 8601 datetime at midnight UTC)

date_duestring<date-time>nullable

Date the invoice is due (ISO 8601 datetime at midnight UTC)

date_servicestringnullable

Service date in YYYY-MM-DD format. For invoices and credit notes. When it (or date_service_to, if later) falls on or before date, foreign-currency conversion uses it as the exchange-rate reference date instead of date.

currency_codestring
issuerobject

Document issuer (entity) information

customer_idstringnullable
customerobjectnullable

Customer information snapshot stored on the document. Null means no customer. When present, known customer fields are returned with null for omitted values.

notestringnullable

Note for the document. If not provided, defaults to entity's document-type-specific note setting. Pass empty string to explicitly set no note.

totalnumber

Document total before tax in the currency's major unit. For EUR, 29.90 means €29.90, not 2,990 cents.

total_with_taxnumber

Document total after tax in the currency's major unit. For EUR, 29.90 means €29.90, not 2,990 cents.

taxesarray of objects

Applied taxes summary

metadataobjectnullable

Custom string key-value data for your own use, with up to 50 properties. Keys are opaque and may contain periods. Useful for storing external IDs, tags, or integration data.

Other parameters
footerstringnullable
entity_idstring
date_yearinteger
shareable_idstringnullable
voided_atstring<date-time>nullable
total_convertednumbernullable
total_with_tax_convertednumbernullable
created_atstring<date-time>
updated_atstring<date-time>
total_paidnumber
total_duenumber
paid_in_fullboolean
ptstringnullable
json
{
  "id": "inv_abc123",
  "furs": {
    "country_code": "SI",
    "status": "success",
    "fiscalized_at": "2026-01-20T12:00:00.000Z",
    "data": {
      "zoi": "a1b2c3d4e5f6...",
      "eor": "EOR-12345",
      "business_premise_name": "P1",
      "electronic_device_name": "OLD",
      "invoice_number": "1"
    }
  }
}

Change the buyer OIB of a fiscalized Croatian invoice

POST/invoices/{id}/change-buyer-oib

Croatia (FINA/CIS) only. Reports a new buyer OIB for an issued, fiscalized invoice to CIS with promijeniPodatkeRacuna, or deletes it (fina.buyer_oib: null), and updates the invoice's customer snapshot tax_number to match. The fiscal record that was originally submitted (fina.data.cis_record) is never rewritten; the latest buyer OIB reported to CIS is kept in fina.data.buyer_oib. The saved customer record is not changed.

CIS accepts this only on the day the invoice was issued, before midnight in Europe/Zagreb. After that, issue a credit note and a corrected invoice instead. The last accepted message wins. Setting the OIB the invoice already carries is a no-op: 200, with no call to CIS and nothing written.

A buyer OIB is lawful only on a business-to-business invoice settled by exactly one cash or card payment covering the full total. Setting one requires that; a removed OIB makes the invoice an ordinary consumer invoice again.

422 refusals carry a stable cause.code:
- fina_buyer_oib_invalid — fina.buyer_oib is not a valid 11-digit OIB (checksum included).
- fina_buyer_oib_change_unavailable — the entity is not Croatian or has FINA disabled, or the document is a draft, voided, or not successfully fiscalized.
- fina_cis_record_unavailable — the invoice was fiscalized before its CIS record was retained, so it cannot be changed.
- fina_payment_change_window_expired — the issue day has passed.
- fina_buyer_oib_not_allowed — the customer is a consumer or foreign, so no buyer OIB may be reported.
- fina_b2b_payment_type_not_allowed — setting an OIB requires exactly one cash or card payment, matching the reported payment method, covering the full total.
- fiscalization_provider_error — CIS refused the change; nothing was changed.

A 503 with cause.code fina_unreachable means CIS could not be reached; the invoice is unchanged. CIS may nevertheless hold the change, so it is recorded on the invoice (fina.data.payment_change_unconfirmed): retry the same request, which clears it once CIS answers. A different change to this invoice, including a payment-method change, is refused with 409 fina_payment_change_unconfirmed until then. A 500 with cause.code fina_payment_change_unrecorded means CIS accepted the change but it could not be recorded locally; retry the same request. Changes to one invoice are serialized.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstring<resource-id>required

Unique resource identifier. Prefix depends on the resource, for example inv_, cus_, or ent_.

Body parameters

Country-specific parameters
import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.invoices.changeInvoiceBuyerOib('inv_6595a27b5d35015c3ef0c3fd', {
  fina: {
    buyer_oib: "12345678903"
  }
}, {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);
Example:

Returns

idstring
numberstring
itemsarray of objects
datestring<date-time>

Date the invoice was created (ISO 8601 datetime at midnight UTC)

date_duestring<date-time>nullable

Date the invoice is due (ISO 8601 datetime at midnight UTC)

date_servicestringnullable

Service date in YYYY-MM-DD format. For invoices and credit notes. When it (or date_service_to, if later) falls on or before date, foreign-currency conversion uses it as the exchange-rate reference date instead of date.

currency_codestring
issuerobject

Document issuer (entity) information

customer_idstringnullable
customerobjectnullable

Customer information snapshot stored on the document. Null means no customer. When present, known customer fields are returned with null for omitted values.

notestringnullable

Note for the document. If not provided, defaults to entity's document-type-specific note setting. Pass empty string to explicitly set no note.

totalnumber

Document total before tax in the currency's major unit. For EUR, 29.90 means €29.90, not 2,990 cents.

total_with_taxnumber

Document total after tax in the currency's major unit. For EUR, 29.90 means €29.90, not 2,990 cents.

taxesarray of objects

Applied taxes summary

metadataobjectnullable

Custom string key-value data for your own use, with up to 50 properties. Keys are opaque and may contain periods. Useful for storing external IDs, tags, or integration data.

Other parameters
footerstringnullable
entity_idstring
date_yearinteger
shareable_idstringnullable
voided_atstring<date-time>nullable
total_convertednumbernullable
total_with_tax_convertednumbernullable
created_atstring<date-time>
updated_atstring<date-time>
total_paidnumber
total_duenumber
paid_in_fullboolean
Country-specific parameters
json
{
  "id": "inv_abc123",
  "customer": {
    "name": "Acme d.o.o.",
    "country_code": "HR",
    "tax_number": "HR12345678903"
  },
  "fina": {
    "status": "success",
    "data": {
      "zki": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6",
      "jir": "11111111-2222-3333-4444-555555555555",
      "business_premise_name": "POSL1",
      "electronic_device_name": "1",
      "invoice_number": "1/POSL1/1",
      "payment_type": "K",
      "buyer_oib": "12345678903",
      "payload": {}
    }
  }
}

Fiscalize a document or retry fiscalization

POST/documents/{id}/fiscalize

Manually fiscalize a document. Retries failed FURS/FINA fiscalization, submits Slovenian FURS documents that were intentionally skipped and now need late fiscalization, or uses the old-FURS flow for no-status pre-FURS documents. For first FURS submission, payment_amount overrides only PaymentAmount; invoice totals and taxes are unchanged. On retries with stored payloads, repeat the same amount or omit it; a different resolved FURS amount is rejected.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstringrequired

Document ID

Query parameters

typestringoptional

Document type. Optional — automatically inferred from the document ID prefix.

Possible values: "invoice", "estimate", "credit_note", "advance_invoice", "delivery_note", "purchase_order"

Body parameters

json
null

Register fiscalized document output

POST/documents/{id}/register-output

Atomically reserve the next output number for a successfully FURS- or FINA-fiscalized document. The first output is the unmarked original; output two and later are rendered with their number. Preview operations must not call this endpoint.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstringrequired

Document ID

Query parameters

typestringoptional

Document type. Optional — automatically inferred from the document ID prefix.

Possible values: "invoice", "estimate", "credit_note", "advance_invoice", "delivery_note", "purchase_order"

import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.documents.registerDocumentOutput("inv_clx1234567890", undefined, {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);

Returns

json
{
  "print_count": 2,
  "fiscalization_provider": "furs"
}

Restore a deleted document

POST/documents/{id}/restore

Restore a soft-deleted document from the trash. The document will be returned to its original state.

Header parameters

entity_idstringoptional

Entity ID on which the request is made. Auto-selected when only one entity exists, required when multiple entities exist.

Path parameters

idstringrequired

Document ID

Query parameters

typestringoptional

Document type. Optional — automatically inferred from the document ID prefix.

Possible values: "invoice", "estimate", "credit_note", "advance_invoice", "delivery_note", "purchase_order"

import SpaceInvoices from '@spaceinvoices/js-sdk/sdk';

const sdk = new SpaceInvoices('YOUR_API_KEY');

const response = await sdk.documents.restoreDocument("inv_clx1234567890", undefined, {
  entity_id: "YOUR_ENTITY_ID"
});

console.log(response);
json
null