Client

Clients in Space Invoices represent businesses, end users, organizations, or any other entities that can receive a document from an Organization. Clients can be saved and later referenced using their unique ID or email address. This feature simplifies the process of creating and managing documents, allowing you to efficiently associate documents with specific clients and maintain a clear record of all transactions. Storing client information also streamlines future interactions, enabling you to easily access and update client details as needed.

When creating a document in Space Invoices, you can easily reference a client by including the clientId property in the root of the create Document API call. Alternatively, you can pass the client's email address in _documentClient.email property of the same API call. Both methods allow you to associate the document with the specified client, ensuring accurate record-keeping and seamless communication. This approach simplifies document management and helps maintain an organized history of transactions with each client.

Endpoints:

  • POST /v1/Organizations/:id/clients
  • GET /v1/Clients/:id
  • GET /v1/Organizations/:id/clients
  • GET /v1/Organizations/:id/clients/count
  • GET /v1/Organizations/:id/clients/search
  • PUT /v1/Clients/:id
  • PATCH /v1/Clients/:id
  • DELETE /v1/Clients/:id
  • POST /v1/Clients/:id/send-reminder

The Client object

Parameters

  • id string readonly

  • name string

  • address string

  • address2 string

  • city string

  • zip string

  • state string

  • country string

  • taxNumber string

  • taxSubject boolean

  • companyNumber string

  • Additional propertiesExpand all
    
      {
  "contact": "string",
  "note": "string",
  "isEndCustomer": false,
  "type": "string",
  "name": "string",
  "address": "string",
  "address2": "string",
  "city": "string",
  "zip": "string",
  "state": "string",
  "country": "string",
  "countryAlpha2Code": "string",
  "taxNumber": "string",
  "taxSubject": true,
  "companyNumber": "string",
  "IBAN": "string",
  "bank": "string",
  "SWIFT": "string",
  "website": "string",
  "email": "string",
  "phone": "string",
  "businessType": "string",
  "id": "string",
  "createdAt": "2022-04-20T10:10:30+00:00Z",
  "updatedAt": "2022-04-20T10:10:30+00:00Z",
  "custom": {},
  "deletedAt": "2022-04-20T10:10:30+00:00Z",
  "_isDeleted": false,
  "deletedId": "string",
  "organizationId": "string",
  "unitId": "string",
  "unitIds": ["string"],
  "_data": [{
    "id": "string",
    "name": "string",
    "value": {},
    "options": {}
  }]
}    
  

Create Client

POST /v1/Organizations/:id/clients

Parameters

Path
  • id string required

    Organization id

Properties

  • name string required

  • address string optional

  • address2 string optional

  • city string optional

  • zip string optional

  • state string optional

  • country string optional

  • taxNumber string optional

  • taxSubject boolean optional

  • companyNumber string optional

  • Additional propertiesExpand all
      
        const response = await fetch('https://api.spaceinvoices.com/v1/Organizations/{id}/clients', {
  method: 'POST',
  headers: {
    'Authorization': 'ACCESS_TOKEN',
    'content-type': 'application/json'
  },
  body: JSON.stringify({
    contact: 'string',
    note: 'string',
    isEndCustomer: false,
    type: 'string',
    name: 'string',
    address: 'string',
    address2: 'string',
    city: 'string',
    zip: 'string',
    state: 'string',
    country: 'string',
    countryAlpha2Code: 'string',
    taxNumber: 'string',
    taxSubject: true,
    companyNumber: 'string',
    IBAN: 'string',
    bank: 'string',
    SWIFT: 'string',
    website: 'string',
    email: 'string',
    phone: 'string',
    businessType: 'string',
    custom: {},
    _data: [{
      name: 'string',
      value: {},
      options: {}
    }]
  })
});      
    

Your access token is displayed in examples.

Prerequisite: npm install node-fetch

        
          curl -X POST https://api.spaceinvoices.com/v1/Organizations/{id}/clients \
  -H 'Authorization: ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "contact": "string", \
    "note": "string", \
    "isEndCustomer": false, \
    "type": "string", \
    "name": "string", \
    "address": "string", \
    "address2": "string", \
    "city": "string", \
    "zip": "string", \
    "state": "string", \
    "country": "string", \
    "countryAlpha2Code": "string", \
    "taxNumber": "string", \
    "taxSubject": true, \
    "companyNumber": "string", \
    "IBAN": "string", \
    "bank": "string", \
    "SWIFT": "string", \
    "website": "string", \
    "email": "string", \
    "phone": "string", \
    "businessType": "string", \
    "custom": {}, \
    "_data": [{ \
      "name": "string", \
      "value": {}, \
      "options": {}
    }]
  }'        
      

Your access token displayed in examples.

        
          import requests
url = 'https://api.spaceinvoices.com/v1/Organizations/{id}/clients'
headers = {
  'Authorization': 'ACCESS_TOKEN',
  'content-type': 'application/json',
}
params = {
  'contact': 'string',
  'note': 'string',
  'isEndCustomer': False,
  'type': 'string',
  'name': 'string',
  'address': 'string',
  'address2': 'string',
  'city': 'string',
  'zip': 'string',
  'state': 'string',
  'country': 'string',
  'countryAlpha2Code': 'string',
  'taxNumber': 'string',
  'taxSubject': True,
  'companyNumber': 'string',
  'IBAN': 'string',
  'bank': 'string',
  'SWIFT': 'string',
  'website': 'string',
  'email': 'string',
  'phone': 'string',
  'businessType': 'string',
  'custom': {},
  '_data': [{
    'name': 'string',
    'value': {},
    'options': {}
  }]
}
response = requests.post(url, json=params, headers=headers)        
      

Your access token displayed in examples.

Response:

    
      {
  "contact": "string",
  "note": "string",
  "isEndCustomer": false,
  "type": "string",
  "name": "string",
  "address": "string",
  "address2": "string",
  "city": "string",
  "zip": "string",
  "state": "string",
  "country": "string",
  "countryAlpha2Code": "string",
  "taxNumber": "string",
  "taxSubject": true,
  "companyNumber": "string",
  "IBAN": "string",
  "bank": "string",
  "SWIFT": "string",
  "website": "string",
  "email": "string",
  "phone": "string",
  "businessType": "string",
  "id": "string",
  "createdAt": "2022-04-20T10:10:30+00:00Z",
  "updatedAt": "2022-04-20T10:10:30+00:00Z",
  "custom": {},
  "deletedAt": "2022-04-20T10:10:30+00:00Z",
  "_isDeleted": false,
  "deletedId": "string",
  "organizationId": "string",
  "unitId": "string",
  "unitIds": ["string"],
  "_data": [{
    "id": "string",
    "name": "string",
    "value": {},
    "options": {}
  }]
}    
  

Get Client

GET /v1/Clients/: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/Clients/{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/Clients/{id} \
  -H 'Authorization: ACCESS_TOKEN' \
  -H 'Content-Type: application/json'        
      

Your access token displayed in examples.

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

Your access token displayed in examples.

Response:

    
      {
  "contact": "string",
  "note": "string",
  "isEndCustomer": false,
  "type": "string",
  "name": "string",
  "address": "string",
  "address2": "string",
  "city": "string",
  "zip": "string",
  "state": "string",
  "country": "string",
  "countryAlpha2Code": "string",
  "taxNumber": "string",
  "taxSubject": true,
  "companyNumber": "string",
  "IBAN": "string",
  "bank": "string",
  "SWIFT": "string",
  "website": "string",
  "email": "string",
  "phone": "string",
  "businessType": "string",
  "id": "string",
  "createdAt": "2022-04-20T10:10:30+00:00Z",
  "updatedAt": "2022-04-20T10:10:30+00:00Z",
  "custom": {},
  "deletedAt": "2022-04-20T10:10:30+00:00Z",
  "_isDeleted": false,
  "deletedId": "string",
  "organizationId": "string",
  "unitId": "string",
  "unitIds": ["string"],
  "_data": [{
    "id": "string",
    "name": "string",
    "value": {},
    "options": {}
  }]
}    
  

Find Clients

GET /v1/Organizations/:id/clients

Parameters

Path
  • id string required

    Organization id

Query
  • filter string optional

      
        const response = await fetch('https://api.spaceinvoices.com/v1/Organizations/{id}/clients', {
  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}/clients \
  -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}/clients'
headers = {
  'Authorization': 'ACCESS_TOKEN',
  'content-type': 'application/json',
}
response = requests.get(url, params={}, headers=headers)        
      

Your access token displayed in examples.

Response:

    
      [
  {
    "contact": "string",
    "note": "string",
    "isEndCustomer": false,
    "type": "string",
    "name": "string",
    "address": "string",
    "address2": "string",
    "city": "string",
    "zip": "string",
    "state": "string",
    "country": "string",
    "countryAlpha2Code": "string",
    "taxNumber": "string",
    "taxSubject": true,
    "companyNumber": "string",
    "IBAN": "string",
    "bank": "string",
    "SWIFT": "string",
    "website": "string",
    "email": "string",
    "phone": "string",
    "businessType": "string",
    "id": "string",
    "createdAt": "2022-04-20T10:10:30+00:00Z",
    "updatedAt": "2022-04-20T10:10:30+00:00Z",
    "custom": {},
    "deletedAt": "2022-04-20T10:10:30+00:00Z",
    "_isDeleted": false,
    "deletedId": "string",
    "organizationId": "string",
    "unitId": "string",
    "unitIds": ["string"],
    "_data": [{
      "id": "string",
      "name": "string",
      "value": {},
      "options": {}
    }]
  }
]    
  

Count Clients

GET /v1/Organizations/:id/clients/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}/clients/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}/clients/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}/clients/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
}    
  

Search Clients

GET /v1/Organizations/:id/clients/search

Parameters

Path
  • id string required

    Organization id

Query
  • term string required

  • type string optional

    Optionally limit search to customer or supplier

      
        const response = await fetch('https://api.spaceinvoices.com/v1/Organizations/{id}/clients/search', {
  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}/clients/search \
  -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}/clients/search'
headers = {
  'Authorization': 'ACCESS_TOKEN',
  'content-type': 'application/json',
}
response = requests.get(url, params={}, headers=headers)        
      

Your access token displayed in examples.

Response:

    
      [
  {

  }
]    
  

Replace Client

PUT /v1/Clients/:id

Parameters

Path
  • id string required

    Model id

Properties

  • name string required

  • address string optional

  • address2 string optional

  • city string optional

  • zip string optional

  • state string optional

  • country string optional

  • taxNumber string optional

  • taxSubject boolean optional

  • companyNumber string optional

  • Additional propertiesExpand all
      
        const response = await fetch('https://api.spaceinvoices.com/v1/Clients/{id}', {
  method: 'PUT',
  headers: {
    'Authorization': 'ACCESS_TOKEN',
    'content-type': 'application/json'
  },
  body: JSON.stringify({
    contact: 'string',
    note: 'string',
    isEndCustomer: false,
    type: 'string',
    name: 'string',
    address: 'string',
    address2: 'string',
    city: 'string',
    zip: 'string',
    state: 'string',
    country: 'string',
    countryAlpha2Code: 'string',
    taxNumber: 'string',
    taxSubject: true,
    companyNumber: 'string',
    IBAN: 'string',
    bank: 'string',
    SWIFT: 'string',
    website: 'string',
    email: 'string',
    phone: 'string',
    businessType: 'string',
    custom: {},
    _data: [{
      name: 'string',
      value: {},
      options: {}
    }]
  })
});      
    

Your access token is displayed in examples.

Prerequisite: npm install node-fetch

        
          curl -X PUT https://api.spaceinvoices.com/v1/Clients/{id} \
  -H 'Authorization: ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "contact": "string", \
    "note": "string", \
    "isEndCustomer": false, \
    "type": "string", \
    "name": "string", \
    "address": "string", \
    "address2": "string", \
    "city": "string", \
    "zip": "string", \
    "state": "string", \
    "country": "string", \
    "countryAlpha2Code": "string", \
    "taxNumber": "string", \
    "taxSubject": true, \
    "companyNumber": "string", \
    "IBAN": "string", \
    "bank": "string", \
    "SWIFT": "string", \
    "website": "string", \
    "email": "string", \
    "phone": "string", \
    "businessType": "string", \
    "custom": {}, \
    "_data": [{ \
      "name": "string", \
      "value": {}, \
      "options": {}
    }]
  }'        
      

Your access token displayed in examples.

        
          import requests
url = 'https://api.spaceinvoices.com/v1/Clients/{id}'
headers = {
  'Authorization': 'ACCESS_TOKEN',
  'content-type': 'application/json',
}
params = {
  'contact': 'string',
  'note': 'string',
  'isEndCustomer': False,
  'type': 'string',
  'name': 'string',
  'address': 'string',
  'address2': 'string',
  'city': 'string',
  'zip': 'string',
  'state': 'string',
  'country': 'string',
  'countryAlpha2Code': 'string',
  'taxNumber': 'string',
  'taxSubject': True,
  'companyNumber': 'string',
  'IBAN': 'string',
  'bank': 'string',
  'SWIFT': 'string',
  'website': 'string',
  'email': 'string',
  'phone': 'string',
  'businessType': 'string',
  'custom': {},
  '_data': [{
    'name': 'string',
    'value': {},
    'options': {}
  }]
}
response = requests.put(url, json=params, headers=headers)        
      

Your access token displayed in examples.

Response:

    
      {
  "contact": "string",
  "note": "string",
  "isEndCustomer": false,
  "type": "string",
  "name": "string",
  "address": "string",
  "address2": "string",
  "city": "string",
  "zip": "string",
  "state": "string",
  "country": "string",
  "countryAlpha2Code": "string",
  "taxNumber": "string",
  "taxSubject": true,
  "companyNumber": "string",
  "IBAN": "string",
  "bank": "string",
  "SWIFT": "string",
  "website": "string",
  "email": "string",
  "phone": "string",
  "businessType": "string",
  "id": "string",
  "createdAt": "2022-04-20T10:10:30+00:00Z",
  "updatedAt": "2022-04-20T10:10:30+00:00Z",
  "custom": {},
  "deletedAt": "2022-04-20T10:10:30+00:00Z",
  "_isDeleted": false,
  "deletedId": "string",
  "organizationId": "string",
  "unitId": "string",
  "unitIds": ["string"],
  "_data": [{
    "id": "string",
    "name": "string",
    "value": {},
    "options": {}
  }]
}    
  

Patch Client

PATCH /v1/Clients/:id

Parameters

Path
  • id string required

    Client id

Properties

  • name string required

  • address string optional

  • address2 string optional

  • city string optional

  • zip string optional

  • state string optional

  • country string optional

  • taxNumber string optional

  • taxSubject boolean optional

  • companyNumber string optional

  • Additional propertiesExpand all
      
        const response = await fetch('https://api.spaceinvoices.com/v1/Clients/{id}', {
  method: 'PATCH',
  headers: {
    'Authorization': 'ACCESS_TOKEN',
    'content-type': 'application/json'
  },
  body: JSON.stringify({
    contact: 'string',
    note: 'string',
    isEndCustomer: false,
    type: 'string',
    name: 'string',
    address: 'string',
    address2: 'string',
    city: 'string',
    zip: 'string',
    state: 'string',
    country: 'string',
    countryAlpha2Code: 'string',
    taxNumber: 'string',
    taxSubject: true,
    companyNumber: 'string',
    IBAN: 'string',
    bank: 'string',
    SWIFT: 'string',
    website: 'string',
    email: 'string',
    phone: 'string',
    businessType: 'string',
    custom: {},
    _data: [{
      name: 'string',
      value: {},
      options: {}
    }]
  })
});      
    

Your access token is displayed in examples.

Prerequisite: npm install node-fetch

        
          curl -X PATCH https://api.spaceinvoices.com/v1/Clients/{id} \
  -H 'Authorization: ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "contact": "string", \
    "note": "string", \
    "isEndCustomer": false, \
    "type": "string", \
    "name": "string", \
    "address": "string", \
    "address2": "string", \
    "city": "string", \
    "zip": "string", \
    "state": "string", \
    "country": "string", \
    "countryAlpha2Code": "string", \
    "taxNumber": "string", \
    "taxSubject": true, \
    "companyNumber": "string", \
    "IBAN": "string", \
    "bank": "string", \
    "SWIFT": "string", \
    "website": "string", \
    "email": "string", \
    "phone": "string", \
    "businessType": "string", \
    "custom": {}, \
    "_data": [{ \
      "name": "string", \
      "value": {}, \
      "options": {}
    }]
  }'        
      

Your access token displayed in examples.

        
          import requests
url = 'https://api.spaceinvoices.com/v1/Clients/{id}'
headers = {
  'Authorization': 'ACCESS_TOKEN',
  'content-type': 'application/json',
}
params = {
  'contact': 'string',
  'note': 'string',
  'isEndCustomer': False,
  'type': 'string',
  'name': 'string',
  'address': 'string',
  'address2': 'string',
  'city': 'string',
  'zip': 'string',
  'state': 'string',
  'country': 'string',
  'countryAlpha2Code': 'string',
  'taxNumber': 'string',
  'taxSubject': True,
  'companyNumber': 'string',
  'IBAN': 'string',
  'bank': 'string',
  'SWIFT': 'string',
  'website': 'string',
  'email': 'string',
  'phone': 'string',
  'businessType': 'string',
  'custom': {},
  '_data': [{
    'name': 'string',
    'value': {},
    'options': {}
  }]
}
response = requests.patch(url, json=params, headers=headers)        
      

Your access token displayed in examples.

Response:

    
      {
  "contact": "string",
  "note": "string",
  "isEndCustomer": false,
  "type": "string",
  "name": "string",
  "address": "string",
  "address2": "string",
  "city": "string",
  "zip": "string",
  "state": "string",
  "country": "string",
  "countryAlpha2Code": "string",
  "taxNumber": "string",
  "taxSubject": true,
  "companyNumber": "string",
  "IBAN": "string",
  "bank": "string",
  "SWIFT": "string",
  "website": "string",
  "email": "string",
  "phone": "string",
  "businessType": "string",
  "id": "string",
  "createdAt": "2022-04-20T10:10:30+00:00Z",
  "updatedAt": "2022-04-20T10:10:30+00:00Z",
  "custom": {},
  "deletedAt": "2022-04-20T10:10:30+00:00Z",
  "_isDeleted": false,
  "deletedId": "string",
  "organizationId": "string",
  "unitId": "string",
  "unitIds": ["string"],
  "_data": [{
    "id": "string",
    "name": "string",
    "value": {},
    "options": {}
  }]
}    
  

Delete Client

DELETE /v1/Clients/:id

Parameters

Path
  • id string required

    Model id

      
        const response = await fetch('https://api.spaceinvoices.com/v1/Clients/{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/Clients/{id} \
  -H 'Authorization: ACCESS_TOKEN' \
  -H 'Content-Type: application/json'        
      

Your access token displayed in examples.

        
          import requests
url = 'https://api.spaceinvoices.com/v1/Clients/{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
}    
  

Send Reminder to Client

POST /v1/Clients/:id/send-reminder

Parameters

Path
  • id string required

    Client id

Properties

      
        const response = await fetch('https://api.spaceinvoices.com/v1/Clients/{id}/send-reminder', {
  method: 'POST',
  headers: {
    'Authorization': 'ACCESS_TOKEN',
    'content-type': 'application/json'
  },
  body: JSON.stringify({
    email: 'string',
    l: 'string'
  })
});      
    

Your access token is displayed in examples.

Prerequisite: npm install node-fetch

        
          curl -X POST https://api.spaceinvoices.com/v1/Clients/{id}/send-reminder \
  -H 'Authorization: ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "email": "string", \
    "l": "string"
  }'        
      

Your access token displayed in examples.

        
          import requests
url = 'https://api.spaceinvoices.com/v1/Clients/{id}/send-reminder'
headers = {
  'Authorization': 'ACCESS_TOKEN',
  'content-type': 'application/json',
}
params = {
  'email': 'string',
  'l': 'string'
}
response = requests.post(url, json=params, headers=headers)        
      

Your access token displayed in examples.

Response:

    
      {
  "success": true
}