Skip to content

Taxes

Taxes

Tax rate management with support for historical rate changes. Each tax can have multiple rates with different valid_from dates to track rate changes over time.

The Taxe object

object

Attributes

idstring
namestring
classificationstring

Classification for API tax lookups (e.g., "standard", "reduced", "zero"). Unique per entity. Can be used instead of rate when creating documents.

is_defaultboolean

Whether this is the default tax for new documents. Only one tax per entity can be default.

tax_ratesarray of objects

Tax rate history

metadata
Other attributes
pt_exemption_codestring
pt_exemption_reasonstring
entity_idstring
deleted_atstring<date-time>
created_atstring<date-time>
updated_atstring<date-time>

Create a new tax

POST/taxes

Create a new tax with one or more tax rates.
Each rate can specify a valid_from date to track historical changes (defaults to 1970-01-01 if not provided).
Rates are automatically sorted by valid_from date (newest first).

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

namestringoptional
classificationstringoptional

Classification for API tax lookups (e.g., "standard", "reduced", "zero"). Unique per entity. Can be used instead of rate when creating documents.

is_defaultbooleanoptional

Whether this is the default tax for new documents. Only one tax per entity can be default.

tax_ratesarray of objectsrequired
metadataobjectoptional

Custom key-value data for your own use. Store any JSON object up to 50 properties. Values must be strings up to 250 characters. Useful for storing external IDs, tags, or integration data.

Other parameters
pt_exemption_codestringoptional
pt_exemption_reasonstringoptional
curl -X POST "https://eu.spaceinvoices.com/taxes" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-entity-id: YOUR_ENTITY_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "tax_rates": [
      {
        "rate": 22
      }
    ]
  }'
Example:

Returns

idstring
namestring
classificationstring

Classification for API tax lookups (e.g., "standard", "reduced", "zero"). Unique per entity. Can be used instead of rate when creating documents.

is_defaultboolean

Whether this is the default tax for new documents. Only one tax per entity can be default.

tax_ratesarray of objects

Tax rate history

metadata
Other parameters
pt_exemption_codestring
pt_exemption_reasonstring
entity_idstring
deleted_atstring<date-time>
created_atstring<date-time>
updated_atstring<date-time>
json
{
  "id": "tax_6595a27b5d35015c3ef0c3fd",
  "name": "22%",
  "entity_id": "ent_6595a27b5d35015c3ef0c3fd",
  "tax_rates": [
    {
      "rate": 22,
      "valid_from": "1970-01-01T00:00:00.000Z"
    }
  ],
  "metadata": {},
  "created_at": "2024-01-01T00:00:00.000Z",
  "updated_at": "2024-01-01T00:00:00.000Z",
  "deleted_at": null
}
Example:

List all taxes

GET/taxes

Retrieve a paginated list of taxes with optional filtering and sorting. Supports cursor-based pagination, flexible JSON querying with MongoDB-style operators, and sorting. Each tax may contain multiple historical rates.

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 by one field or provide a repeated array for multi-column ordering. Prefix a 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.

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, name, is_default, created_at, updated_at

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.

deletedbooleanoptional

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

curl "https://eu.spaceinvoices.com/taxes" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-entity-id: YOUR_ENTITY_ID"

Returns

dataarray of objects
paginationobject

Pagination metadata including cursors and result counts

json
{
  "data": [
    {
      "id": "tax_6595a27b5d35015c3ef0c3fd",
      "name": "22%",
      "entity_id": "ent_6595a27b5d35015c3ef0c3fd",
      "tax_rates": [
        {
          "rate": 22,
          "valid_from": "1970-01-01T00:00:00.000Z"
        }
      ],
      "metadata": {},
      "created_at": "2024-01-01T00:00:00.000Z",
      "updated_at": "2024-01-01T00:00:00.000Z",
      "deleted_at": null
    },
    {
      "id": "tax_6595a27b5d35015c3ef0c3fe",
      "name": "Standard VAT",
      "entity_id": "ent_6595a27b5d35015c3ef0c3fd",
      "tax_rates": [
        {
          "rate": 22,
          "valid_from": "1970-01-01T00:00:00.000Z"
        }
      ],
      "metadata": {},
      "created_at": "2024-01-01T00:00:00.000Z",
      "updated_at": "2024-01-01T00:00:00.000Z",
      "deleted_at": null
    }
  ],
  "pagination": {
    "total": 2,
    "next_cursor": null,
    "prev_cursor": null,
    "has_more": false
  }
}

Add new tax rate(s)

PATCH/taxes/{id}

Add one or more new tax rates to an existing tax.
New rates are merged with existing rates and automatically sorted by valid_from date (newest first).
Use this to track historical tax rate changes.

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

Body parameters

is_defaultbooleanoptional

Set to true to make this the default tax (unsets other defaults)

tax_ratesarray of objectsrequired
curl -X PATCH "https://eu.spaceinvoices.com/taxes/{id}" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-entity-id: YOUR_ENTITY_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "tax_rates": [
      {
        "rate": 25,
        "valid_from": "2025-01-01T00:00:00.000Z"
      }
    ]
  }'

Returns

idstring
namestring
classificationstring

Classification for API tax lookups (e.g., "standard", "reduced", "zero"). Unique per entity. Can be used instead of rate when creating documents.

is_defaultboolean

Whether this is the default tax for new documents. Only one tax per entity can be default.

tax_ratesarray of objects

Tax rate history

metadata
Other parameters
pt_exemption_codestring
pt_exemption_reasonstring
entity_idstring
deleted_atstring<date-time>
created_atstring<date-time>
updated_atstring<date-time>
json
{
  "id": "tax_6595a27b5d35015c3ef0c3fd",
  "name": "22%",
  "entity_id": "ent_6595a27b5d35015c3ef0c3fd",
  "tax_rates": [
    {
      "rate": 25,
      "valid_from": "2025-01-01T00:00:00.000Z"
    },
    {
      "rate": 22,
      "valid_from": "2024-01-01T00:00:00.000Z"
    },
    {
      "rate": 20,
      "valid_from": "2020-01-01T00:00:00.000Z"
    }
  ],
  "metadata": {},
  "created_at": "2024-01-01T00:00:00.000Z",
  "updated_at": "2025-01-15T10:30:00.000Z",
  "deleted_at": null
}

Replace tax rates

PUT/taxes/{id}

Replace all tax rates on a tax with a new set of rates.
This completely replaces the existing tax_rates array.
Use this when you need to remove rates or completely restructure the rate history.
Optionally update the name as well.

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

Body parameters

namestringoptional
classificationstringoptional

Classification for API tax lookups (e.g., "standard", "reduced", "zero"). Unique per entity. Can be used instead of rate when creating documents.

is_defaultbooleanoptional

Whether this is the default tax for new documents. Only one tax per entity can be default.

tax_ratesarray of objectsrequired
metadataobjectoptional

Custom key-value data for your own use. Store any JSON object up to 50 properties. Values must be strings up to 250 characters. Useful for storing external IDs, tags, or integration data.

Other parameters
pt_exemption_codestringoptional
pt_exemption_reasonstringoptional
curl -X PUT "https://eu.spaceinvoices.com/taxes/{id}" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-entity-id: YOUR_ENTITY_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated VAT",
    "tax_rates": [
      {
        "rate": 21,
        "valid_from": "2025-01-01T00:00:00.000Z"
      },
      {
        "rate": 19,
        "valid_from": "2020-01-01T00:00:00.000Z"
      }
    ],
    "metadata": {
      "category": "vat",
      "region": "EU"
    }
  }'

Returns

idstring
namestring
classificationstring

Classification for API tax lookups (e.g., "standard", "reduced", "zero"). Unique per entity. Can be used instead of rate when creating documents.

is_defaultboolean

Whether this is the default tax for new documents. Only one tax per entity can be default.

tax_ratesarray of objects

Tax rate history

metadata
Other parameters
pt_exemption_codestring
pt_exemption_reasonstring
entity_idstring
deleted_atstring<date-time>
created_atstring<date-time>
updated_atstring<date-time>
json
{
  "id": "tax_6595a27b5d35015c3ef0c3fd",
  "name": "Updated VAT",
  "entity_id": "ent_6595a27b5d35015c3ef0c3fd",
  "tax_rates": [
    {
      "rate": 21,
      "valid_from": "2025-01-01T00:00:00.000Z"
    },
    {
      "rate": 19,
      "valid_from": "2020-01-01T00:00:00.000Z"
    }
  ],
  "metadata": {
    "category": "vat",
    "region": "EU"
  },
  "created_at": "2024-01-01T00:00:00.000Z",
  "updated_at": "2025-01-15T10:30:00.000Z",
  "deleted_at": null
}

Delete a tax

DELETE/taxes/{id}

Soft delete a tax. The tax will be moved to the trash and can be restored later.

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

curl -X DELETE "https://eu.spaceinvoices.com/taxes/{id}" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-entity-id: YOUR_ENTITY_ID"

Permanently delete a tax

DELETE/taxes/{id}/permanent

Permanently delete a soft-deleted tax. Only taxes in the trash 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

idstring<resource-id>required

Unique resource identifier

curl -X DELETE "https://eu.spaceinvoices.com/taxes/{id}/permanent" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-entity-id: YOUR_ENTITY_ID"

Restore a deleted tax

POST/taxes/{id}/restore

Restore a soft-deleted tax from the trash.

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

curl -X POST "https://eu.spaceinvoices.com/taxes/{id}/restore" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "x-entity-id: YOUR_ENTITY_ID"

Returns

idstring
namestring
classificationstring

Classification for API tax lookups (e.g., "standard", "reduced", "zero"). Unique per entity. Can be used instead of rate when creating documents.

is_defaultboolean

Whether this is the default tax for new documents. Only one tax per entity can be default.

tax_ratesarray of objects

Tax rate history

metadata
Other parameters
pt_exemption_codestring
pt_exemption_reasonstring
entity_idstring
deleted_atstring<date-time>
created_atstring<date-time>
updated_atstring<date-time>
json
{
  "id": "tax_6595a27b5d35015c3ef0c3fd",
  "name": "22%",
  "entity_id": "ent_6595a27b5d35015c3ef0c3fd",
  "tax_rates": [
    {
      "rate": 22,
      "valid_from": "1970-01-01T00:00:00.000Z"
    }
  ],
  "metadata": {},
  "created_at": "2024-01-01T00:00:00.000Z",
  "updated_at": "2024-01-01T00:00:00.000Z",
  "deleted_at": null
}
Example: