Warehouse

Warehouses in Space Invoices represent the various locations where your inventory is stored. Items can be stored across multiple warehouses, with each warehouse maintaining its own inventory quantities for each item.

When you make the first change to an inventory, a default Warehouse is automatically added to your organization. This default Warehouse will be used whenever a specific warehouse is not explicitly mentioned in API calls related to inventory management.

In addition to serving as storage locations for your inventory, warehouses can also represent consignment locations, allowing you to efficiently manage consigned goods within your system. By utilizing the Warehouse feature, you can effectively track and manage your inventory across different locations, ensuring accurate and up-to-date information for your organization.

Endpoints:

  • POST /v1/Organizations/:id/warehouses
  • GET /v1/Warehouses/:id
  • GET /v1/Organizations/:id/warehouses
  • GET /v1/Organizations/:id/warehouses/count
  • PUT /v1/Warehouses/:id
  • PATCH /v1/Warehouses/:id
  • DELETE /v1/Warehouses/:id

The Warehouse object

Parameters

  • id string readonly

  • name string

  • Additional propertiesExpand all
    
      {
  "name": "string",
  "default": false,
  "id": "string",
  "organizationId": "string",
  "deletedAt": "2022-04-20T10:10:30+00:00Z",
  "_isDeleted": false,
  "deletedId": "string",
  "createdAt": "2022-04-20T10:10:30+00:00Z",
  "updatedAt": "2022-04-20T10:10:30+00:00Z",
  "custom": {}
}    
  

Create Warehouse

POST /v1/Organizations/:id/warehouses

Parameters

Path
  • id string required

    Organization id

Properties

  • name string required

  • Additional propertiesExpand all
      
        const response = await fetch('https://api.spaceinvoices.com/v1/Organizations/{id}/warehouses', {
  method: 'POST',
  headers: {
    'Authorization': 'ACCESS_TOKEN',
    'content-type': 'application/json'
  },
  body: JSON.stringify({
    name: 'string',
    default: false,
    custom: {}
  })
});      
    

Your access token is displayed in examples.

Prerequisite: npm install node-fetch

        
          curl -X POST https://api.spaceinvoices.com/v1/Organizations/{id}/warehouses \
  -H 'Authorization: ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "string", \
    "default": false, \
    "custom": {}
  }'        
      

Your access token displayed in examples.

        
          import requests
url = 'https://api.spaceinvoices.com/v1/Organizations/{id}/warehouses'
headers = {
  'Authorization': 'ACCESS_TOKEN',
  'content-type': 'application/json',
}
params = {
  'name': 'string',
  'default': False,
  'custom': {}
}
response = requests.post(url, json=params, headers=headers)        
      

Your access token displayed in examples.

Response:

    
      {
  "name": "string",
  "default": false,
  "id": "string",
  "organizationId": "string",
  "deletedAt": "2022-04-20T10:10:30+00:00Z",
  "_isDeleted": false,
  "deletedId": "string",
  "createdAt": "2022-04-20T10:10:30+00:00Z",
  "updatedAt": "2022-04-20T10:10:30+00:00Z",
  "custom": {}
}    
  

Get Warehouse

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

Your access token displayed in examples.

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

Your access token displayed in examples.

Response:

    
      {
  "name": "string",
  "default": false,
  "id": "string",
  "organizationId": "string",
  "deletedAt": "2022-04-20T10:10:30+00:00Z",
  "_isDeleted": false,
  "deletedId": "string",
  "createdAt": "2022-04-20T10:10:30+00:00Z",
  "updatedAt": "2022-04-20T10:10:30+00:00Z",
  "custom": {}
}    
  

Find Warehouses

GET /v1/Organizations/:id/warehouses

Parameters

Path
  • id string required

    Organization id

Query
  • filter string optional

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

Your access token displayed in examples.

Response:

    
      [
  {
    "name": "string",
    "default": false,
    "id": "string",
    "organizationId": "string",
    "deletedAt": "2022-04-20T10:10:30+00:00Z",
    "_isDeleted": false,
    "deletedId": "string",
    "createdAt": "2022-04-20T10:10:30+00:00Z",
    "updatedAt": "2022-04-20T10:10:30+00:00Z",
    "custom": {}
  }
]    
  

Count Warehouses

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

PUT /v1/Warehouses/:id

Parameters

Path
  • id string required

    Model id

Properties

  • name string required

  • Additional propertiesExpand all
      
        const response = await fetch('https://api.spaceinvoices.com/v1/Warehouses/{id}', {
  method: 'PUT',
  headers: {
    'Authorization': 'ACCESS_TOKEN',
    'content-type': 'application/json'
  },
  body: JSON.stringify({
    name: 'string',
    default: false,
    custom: {}
  })
});      
    

Your access token is displayed in examples.

Prerequisite: npm install node-fetch

        
          curl -X PUT https://api.spaceinvoices.com/v1/Warehouses/{id} \
  -H 'Authorization: ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "string", \
    "default": false, \
    "custom": {}
  }'        
      

Your access token displayed in examples.

        
          import requests
url = 'https://api.spaceinvoices.com/v1/Warehouses/{id}'
headers = {
  'Authorization': 'ACCESS_TOKEN',
  'content-type': 'application/json',
}
params = {
  'name': 'string',
  'default': False,
  'custom': {}
}
response = requests.put(url, json=params, headers=headers)        
      

Your access token displayed in examples.

Response:

    
      {
  "name": "string",
  "default": false,
  "id": "string",
  "organizationId": "string",
  "deletedAt": "2022-04-20T10:10:30+00:00Z",
  "_isDeleted": false,
  "deletedId": "string",
  "createdAt": "2022-04-20T10:10:30+00:00Z",
  "updatedAt": "2022-04-20T10:10:30+00:00Z",
  "custom": {}
}    
  

Patch Warehouse

PATCH /v1/Warehouses/:id

Parameters

Path
  • id string required

    Warehouse id

Properties

  • name string required

  • Additional propertiesExpand all
      
        const response = await fetch('https://api.spaceinvoices.com/v1/Warehouses/{id}', {
  method: 'PATCH',
  headers: {
    'Authorization': 'ACCESS_TOKEN',
    'content-type': 'application/json'
  },
  body: JSON.stringify({
    name: 'string',
    default: false,
    custom: {}
  })
});      
    

Your access token is displayed in examples.

Prerequisite: npm install node-fetch

        
          curl -X PATCH https://api.spaceinvoices.com/v1/Warehouses/{id} \
  -H 'Authorization: ACCESS_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "string", \
    "default": false, \
    "custom": {}
  }'        
      

Your access token displayed in examples.

        
          import requests
url = 'https://api.spaceinvoices.com/v1/Warehouses/{id}'
headers = {
  'Authorization': 'ACCESS_TOKEN',
  'content-type': 'application/json',
}
params = {
  'name': 'string',
  'default': False,
  'custom': {}
}
response = requests.patch(url, json=params, headers=headers)        
      

Your access token displayed in examples.

Response:

    
      {
  "name": "string",
  "default": false,
  "id": "string",
  "organizationId": "string",
  "deletedAt": "2022-04-20T10:10:30+00:00Z",
  "_isDeleted": false,
  "deletedId": "string",
  "createdAt": "2022-04-20T10:10:30+00:00Z",
  "updatedAt": "2022-04-20T10:10:30+00:00Z",
  "custom": {}
}    
  

Delete Warehouse

DELETE /v1/Warehouses/:id

Parameters

Path
  • id string required

    Model id

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

Your access token displayed in examples.

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