Tax

Taxes in Space Invoices are stored for each Organization and are associated with Items on which tax is applicable. Each tax may have different rates and the rates can be set for a specific date range during which the rate is in effect. When creating a document, the system selects the appropriate tax rate based on the document's date, ensuring the correct tax rates are applied.

When you create a new Organization in Space Invoices, the system automatically pre-loads it with default taxes based on the country of the Organization. This feature saves time and effort, as you don't have to manually input common tax rates applicable in that country. You can start invoicing right away, knowing that your tax setup is accurate and compliant with local regulations.

When adding taxes to document items or items, you have the flexibility to reference the tax (in order of priority): by its ID, rate, or classification. This feature makes it easier for you to manage and apply taxes, keeping your invoicing process accurate and efficient.

Endpoints:

  • POST /v1/Organizations/:id/taxes
  • GET /v1/Taxes/:id
  • GET /v1/Organizations/:id/taxes
  • GET /v1/Organizations/:id/taxes/count
  • PUT /v1/Taxes/:id
  • DELETE /v1/Taxes/:id
  • POST /v1/Taxes/:id/taxRates
  • DELETE /v1/Taxes/:id/taxRates/:fk
  • POST /v1/Taxes/clause-type

The Tax object

Parameters

  • id string readonly

  • name string

  • abbreviation string

  • _taxRates array[object]

    show nested properties
  • Additional propertiesExpand all
    
      {
  "classification": "string",
  "country": "string",
  "countryAlpha2Code": "string",
  "name": "string",
  "abbreviation": "string",
  "recoverable": true,
  "compound": false,
  "taxNumber": "string",
  "id": "string",
  "_taxRates": [{
    "id": "string",
    "dateValidFrom": "2022-04-20T10:10:30+00:00Z",
    "rate": 42,
    "createdAt": "2022-04-20T10:10:30+00:00Z",
    "updatedAt": "2022-04-20T10:10:30+00:00Z",
    "custom": {}
  }],
  "createdAt": "2022-04-20T10:10:30+00:00Z",
  "updatedAt": "2022-04-20T10:10:30+00:00Z",
  "deletedAt": "2022-04-20T10:10:30+00:00Z",
  "_isDeleted": false,
  "deletedId": "string",
  "custom": {},
  "organizationId": "string"
}    
  

Create Tax

POST /v1/Organizations/:id/taxes

Parameters

Path
  • id string required

    Organization id

Properties

  • name string optional

  • abbreviation string optional

  • _taxRates array[object] optional

    show nested properties
  • Additional propertiesExpand all
      
        const response = await fetch('https://api.spaceinvoices.com/v1/Organizations/{id}/taxes', {
  method: 'POST',
  headers: {
    'Authorization': 'ACCESS_TOKEN',
    'content-type': 'application/json'
  },
  body: JSON.stringify({
    classification: 'string',
    country: 'string',
    countryAlpha2Code: 'string',
    name: 'string',
    abbreviation: 'string',
    recoverable: true,
    compound: false,
    taxNumber: 'string',
    _taxRates: [{
      dateValidFrom: '2022-04-20T10:10:30+00:00Z',
      rate: 42,
      custom: {}
    }],
    custom: {}
  })
});      
    

Your access token is displayed in examples.

Prerequisite: npm install node-fetch

        
          curl -X POST https://api.spaceinvoices.com/v1/Organizations/{id}/taxes \
  -H 'Authorization: ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "classification": "string", \
    "country": "string", \
    "countryAlpha2Code": "string", \
    "name": "string", \
    "abbreviation": "string", \
    "recoverable": true, \
    "compound": false, \
    "taxNumber": "string", \
    "_taxRates": [{ \
      "dateValidFrom": "2022-04-20T10:10:30+00:00Z", \
      "rate": 42, \
      "custom": {}
    }], \
    "custom": {}
  }'        
      

Your access token displayed in examples.

        
          import requests
url = 'https://api.spaceinvoices.com/v1/Organizations/{id}/taxes'
headers = {
  'Authorization': 'ACCESS_TOKEN',
  'content-type': 'application/json',
}
params = {
  'classification': 'string',
  'country': 'string',
  'countryAlpha2Code': 'string',
  'name': 'string',
  'abbreviation': 'string',
  'recoverable': True,
  'compound': False,
  'taxNumber': 'string',
  '_taxRates': [{
    'dateValidFrom': '2022-04-20T10:10:30+00:00Z',
    'rate': 42,
    'custom': {}
  }],
  'custom': {}
}
response = requests.post(url, json=params, headers=headers)        
      

Your access token displayed in examples.

Response:

    
      {
  "classification": "string",
  "country": "string",
  "countryAlpha2Code": "string",
  "name": "string",
  "abbreviation": "string",
  "recoverable": true,
  "compound": false,
  "taxNumber": "string",
  "id": "string",
  "_taxRates": [{
    "id": "string",
    "dateValidFrom": "2022-04-20T10:10:30+00:00Z",
    "rate": 42,
    "createdAt": "2022-04-20T10:10:30+00:00Z",
    "updatedAt": "2022-04-20T10:10:30+00:00Z",
    "custom": {}
  }],
  "createdAt": "2022-04-20T10:10:30+00:00Z",
  "updatedAt": "2022-04-20T10:10:30+00:00Z",
  "deletedAt": "2022-04-20T10:10:30+00:00Z",
  "_isDeleted": false,
  "deletedId": "string",
  "custom": {},
  "organizationId": "string"
}    
  

Get Tax

GET /v1/Taxes/:id

Parameters

Path
  • id string required

    Model id

Query
  • filter string optional

    Filter defining fields and include - must be a JSON-encoded string ({"something":"value"})

      
        const response = await fetch('https://api.spaceinvoices.com/v1/Taxes/{id}', {
  method: 'GET',
  headers: {
    'Authorization': 'ACCESS_TOKEN',
    'content-type': 'application/json'
  }
});      
    

Your access token is displayed in examples.

Prerequisite: npm install node-fetch

        
          curl -X GET https://api.spaceinvoices.com/v1/Taxes/{id} \
  -H 'Authorization: ACCESS_TOKEN' \
  -H 'Content-Type: application/json'        
      

Your access token displayed in examples.

        
          import requests
url = 'https://api.spaceinvoices.com/v1/Taxes/{id}'
headers = {
  'Authorization': 'ACCESS_TOKEN',
  'content-type': 'application/json',
}
response = requests.get(url, params={}, headers=headers)        
      

Your access token displayed in examples.

Response:

    
      {
  "classification": "string",
  "country": "string",
  "countryAlpha2Code": "string",
  "name": "string",
  "abbreviation": "string",
  "recoverable": true,
  "compound": false,
  "taxNumber": "string",
  "id": "string",
  "_taxRates": [{
    "id": "string",
    "dateValidFrom": "2022-04-20T10:10:30+00:00Z",
    "rate": 42,
    "createdAt": "2022-04-20T10:10:30+00:00Z",
    "updatedAt": "2022-04-20T10:10:30+00:00Z",
    "custom": {}
  }],
  "createdAt": "2022-04-20T10:10:30+00:00Z",
  "updatedAt": "2022-04-20T10:10:30+00:00Z",
  "deletedAt": "2022-04-20T10:10:30+00:00Z",
  "_isDeleted": false,
  "deletedId": "string",
  "custom": {},
  "organizationId": "string"
}    
  

Find Taxs

GET /v1/Organizations/:id/taxes

Parameters

Path
  • id string required

    Organization id

Query
  • filter string optional

      
        const response = await fetch('https://api.spaceinvoices.com/v1/Organizations/{id}/taxes', {
  method: 'GET',
  headers: {
    'Authorization': 'ACCESS_TOKEN',
    'content-type': 'application/json'
  }
});      
    

Your access token is displayed in examples.

Prerequisite: npm install node-fetch

        
          curl -X GET https://api.spaceinvoices.com/v1/Organizations/{id}/taxes \
  -H 'Authorization: ACCESS_TOKEN' \
  -H 'Content-Type: application/json'        
      

Your access token displayed in examples.

        
          import requests
url = 'https://api.spaceinvoices.com/v1/Organizations/{id}/taxes'
headers = {
  'Authorization': 'ACCESS_TOKEN',
  'content-type': 'application/json',
}
response = requests.get(url, params={}, headers=headers)        
      

Your access token displayed in examples.

Response:

    
      [
  {
    "classification": "string",
    "country": "string",
    "countryAlpha2Code": "string",
    "name": "string",
    "abbreviation": "string",
    "recoverable": true,
    "compound": false,
    "taxNumber": "string",
    "id": "string",
    "_taxRates": [{
      "id": "string",
      "dateValidFrom": "2022-04-20T10:10:30+00:00Z",
      "rate": 42,
      "createdAt": "2022-04-20T10:10:30+00:00Z",
      "updatedAt": "2022-04-20T10:10:30+00:00Z",
      "custom": {}
    }],
    "createdAt": "2022-04-20T10:10:30+00:00Z",
    "updatedAt": "2022-04-20T10:10:30+00:00Z",
    "deletedAt": "2022-04-20T10:10:30+00:00Z",
    "_isDeleted": false,
    "deletedId": "string",
    "custom": {},
    "organizationId": "string"
  }
]    
  

Count Taxs

GET /v1/Organizations/:id/taxes/count

Parameters

Path
  • id string required

    Organization id

Query
  • where string optional

    Criteria to match model instances

      
        const response = await fetch('https://api.spaceinvoices.com/v1/Organizations/{id}/taxes/count', {
  method: 'GET',
  headers: {
    'Authorization': 'ACCESS_TOKEN',
    'content-type': 'application/json'
  }
});      
    

Your access token is displayed in examples.

Prerequisite: npm install node-fetch

        
          curl -X GET https://api.spaceinvoices.com/v1/Organizations/{id}/taxes/count \
  -H 'Authorization: ACCESS_TOKEN' \
  -H 'Content-Type: application/json'        
      

Your access token displayed in examples.

        
          import requests
url = 'https://api.spaceinvoices.com/v1/Organizations/{id}/taxes/count'
headers = {
  'Authorization': 'ACCESS_TOKEN',
  'content-type': 'application/json',
}
response = requests.get(url, params={}, headers=headers)        
      

Your access token displayed in examples.

Response:

    
      {
  "count": 42
}    
  

Replace Tax

PUT /v1/Taxes/:id

Parameters

Path
  • id string required

    Model id

Properties

  • name string optional

  • abbreviation string optional

  • _taxRates array[object] optional

    show nested properties
  • Additional propertiesExpand all
      
        const response = await fetch('https://api.spaceinvoices.com/v1/Taxes/{id}', {
  method: 'PUT',
  headers: {
    'Authorization': 'ACCESS_TOKEN',
    'content-type': 'application/json'
  },
  body: JSON.stringify({
    classification: 'string',
    country: 'string',
    countryAlpha2Code: 'string',
    name: 'string',
    abbreviation: 'string',
    recoverable: true,
    compound: false,
    taxNumber: 'string',
    _taxRates: [{
      dateValidFrom: '2022-04-20T10:10:30+00:00Z',
      rate: 42,
      custom: {}
    }],
    custom: {}
  })
});      
    

Your access token is displayed in examples.

Prerequisite: npm install node-fetch

        
          curl -X PUT https://api.spaceinvoices.com/v1/Taxes/{id} \
  -H 'Authorization: ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "classification": "string", \
    "country": "string", \
    "countryAlpha2Code": "string", \
    "name": "string", \
    "abbreviation": "string", \
    "recoverable": true, \
    "compound": false, \
    "taxNumber": "string", \
    "_taxRates": [{ \
      "dateValidFrom": "2022-04-20T10:10:30+00:00Z", \
      "rate": 42, \
      "custom": {}
    }], \
    "custom": {}
  }'        
      

Your access token displayed in examples.

        
          import requests
url = 'https://api.spaceinvoices.com/v1/Taxes/{id}'
headers = {
  'Authorization': 'ACCESS_TOKEN',
  'content-type': 'application/json',
}
params = {
  'classification': 'string',
  'country': 'string',
  'countryAlpha2Code': 'string',
  'name': 'string',
  'abbreviation': 'string',
  'recoverable': True,
  'compound': False,
  'taxNumber': 'string',
  '_taxRates': [{
    'dateValidFrom': '2022-04-20T10:10:30+00:00Z',
    'rate': 42,
    'custom': {}
  }],
  'custom': {}
}
response = requests.put(url, json=params, headers=headers)        
      

Your access token displayed in examples.

Response:

    
      {
  "classification": "string",
  "country": "string",
  "countryAlpha2Code": "string",
  "name": "string",
  "abbreviation": "string",
  "recoverable": true,
  "compound": false,
  "taxNumber": "string",
  "id": "string",
  "_taxRates": [{
    "id": "string",
    "dateValidFrom": "2022-04-20T10:10:30+00:00Z",
    "rate": 42,
    "createdAt": "2022-04-20T10:10:30+00:00Z",
    "updatedAt": "2022-04-20T10:10:30+00:00Z",
    "custom": {}
  }],
  "createdAt": "2022-04-20T10:10:30+00:00Z",
  "updatedAt": "2022-04-20T10:10:30+00:00Z",
  "deletedAt": "2022-04-20T10:10:30+00:00Z",
  "_isDeleted": false,
  "deletedId": "string",
  "custom": {},
  "organizationId": "string"
}    
  

Delete Tax

DELETE /v1/Taxes/:id

Parameters

Path
  • id string required

    Model id

      
        const response = await fetch('https://api.spaceinvoices.com/v1/Taxes/{id}', {
  method: 'DELETE',
  headers: {
    'Authorization': 'ACCESS_TOKEN',
    'content-type': 'application/json'
  }
});      
    

Your access token is displayed in examples.

Prerequisite: npm install node-fetch

        
          curl -X DELETE https://api.spaceinvoices.com/v1/Taxes/{id} \
  -H 'Authorization: ACCESS_TOKEN' \
  -H 'Content-Type: application/json'        
      

Your access token displayed in examples.

        
          import requests
url = 'https://api.spaceinvoices.com/v1/Taxes/{id}'
headers = {
  'Authorization': 'ACCESS_TOKEN',
  'content-type': 'application/json',
}
response = requests.delete(url, params={}, headers=headers)        
      

Your access token displayed in examples.

Response:

    
      {
  "count": 1
}    
  

Create TaxRate for Tax

POST /v1/Taxes/:id/taxRates

Parameters

Path
  • id string required

    Tax id

Properties

  • dateValidFrom date required

  • rate number required

  • Additional propertiesExpand all
      
        const response = await fetch('https://api.spaceinvoices.com/v1/Taxes/{id}/taxRates', {
  method: 'POST',
  headers: {
    'Authorization': 'ACCESS_TOKEN',
    'content-type': 'application/json'
  },
  body: JSON.stringify({
    dateValidFrom: '2022-04-20T10:10:30+00:00Z',
    rate: 42,
    custom: {}
  })
});      
    

Your access token is displayed in examples.

Prerequisite: npm install node-fetch

        
          curl -X POST https://api.spaceinvoices.com/v1/Taxes/{id}/taxRates \
  -H 'Authorization: ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "dateValidFrom": "2022-04-20T10:10:30+00:00Z", \
    "rate": 42, \
    "custom": {}
  }'        
      

Your access token displayed in examples.

        
          import requests
url = 'https://api.spaceinvoices.com/v1/Taxes/{id}/taxRates'
headers = {
  'Authorization': 'ACCESS_TOKEN',
  'content-type': 'application/json',
}
params = {
  'dateValidFrom': '2022-04-20T10:10:30+00:00Z',
  'rate': 42,
  'custom': {}
}
response = requests.post(url, json=params, headers=headers)        
      

Your access token displayed in examples.

Response:

    
      {
  "id": "string",
  "dateValidFrom": "2022-04-20T10:10:30+00:00Z",
  "rate": 42,
  "createdAt": "2022-04-20T10:10:30+00:00Z",
  "updatedAt": "2022-04-20T10:10:30+00:00Z",
  "custom": {}
}    
  

Delete TaxRate for Tax

DELETE /v1/Taxes/:id/taxRates/:fk

Parameters

Path
  • id string required

    Tax id

  • fk string required

    Foreign key for taxRates

      
        const response = await fetch('https://api.spaceinvoices.com/v1/Taxes/{id}/taxRates/{fk}', {
  method: 'DELETE',
  headers: {
    'Authorization': 'ACCESS_TOKEN',
    'content-type': 'application/json'
  }
});      
    

Your access token is displayed in examples.

Prerequisite: npm install node-fetch

        
          curl -X DELETE https://api.spaceinvoices.com/v1/Taxes/{id}/taxRates/{fk} \
  -H 'Authorization: ACCESS_TOKEN' \
  -H 'Content-Type: application/json'        
      

Your access token displayed in examples.

        
          import requests
url = 'https://api.spaceinvoices.com/v1/Taxes/{id}/taxRates/{fk}'
headers = {
  'Authorization': 'ACCESS_TOKEN',
  'content-type': 'application/json',
}
response = requests.delete(url, params={}, headers=headers)        
      

Your access token displayed in examples.

Response:

    
      {

}    
  

Get tax clause Tax

Returns the aplicable tax clause type based on the provided _documentIssuer and _documentClient data.

POST /v1/Taxes/clause-type

Properties

      
        const response = await fetch('https://api.spaceinvoices.com/v1/Taxes/clause-type', {
  method: 'POST',
  headers: {
    'Authorization': 'ACCESS_TOKEN',
    'content-type': 'application/json'
  },
  body: JSON.stringify({

  })
});      
    

Your access token is displayed in examples.

Prerequisite: npm install node-fetch

        
          curl -X POST https://api.spaceinvoices.com/v1/Taxes/clause-type \
  -H 'Authorization: ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{

  }'        
      

Your access token displayed in examples.

        
          import requests
url = 'https://api.spaceinvoices.com/v1/Taxes/clause-type'
headers = {
  'Authorization': 'ACCESS_TOKEN',
  'content-type': 'application/json',
}
params = {

}
response = requests.post(url, json=params, headers=headers)        
      

Your access token displayed in examples.

Response:

    
      {
  "taxClauseType": "string",
  "issuerCountry": {},
  "clientCountry": {}
}