API Reference

Inventory

Track stock items with SKU lookup and stock counts

Inventory items are physical goods you sell or use on jobs — replacement parts, accessories, consumables. Each item has an SKU, optional GTIN, weight, and a stock count that you can let Servicebay track for you.

Endpoints

  • GET/organisations/{orgId}/inventory — List inventory items (paginated)
  • POST/organisations/{orgId}/inventory — Create inventory item
  • GET/organisations/{orgId}/inventory/{itemId} — Get inventory item
  • PUT/organisations/{orgId}/inventory/{itemId} — Update inventory item
  • DELETE/organisations/{orgId}/inventory/{itemId} — Delete inventory item

Server-side SKU lookup

Pass ?sku=BAT-001 to the list endpoint to perform an exact-match SKU query in Firestore. This is much faster than fetching everything and filtering client-side, and it doesn't count against the 100-row page limit.

List filters

Query paramDescription
limitPage size (max 100, default 50)
startAfterCursor — pass the previous response's nextCursor
searchPartial match on itemName, description, or sku
skuExact SKU match (server-side query)
categoryIdFilter to a single category
GET
/organisations/{orgId}/inventory
X-API-Key<token>

API key for authentication. Get your key from the Developer Dashboard.

In: header

Path Parameters

orgId*string

Organisation ID

Query Parameters

limit?integer

Maximum number of items to return (max 100)

Default50
Range1 <= value <= 100
startAfter?string

Cursor for pagination - ID of the last item from previous page

categoryId?string
sku?string

Exact SKU lookup

search?string

Response Body

application/json

curl -X GET "https://developer.servicebay.io/api/v1/organisations/string/inventory"
{
  "success": true,
  "data": {
    "items": [
      {
        "id": "string",
        "itemName": "string",
        "description": "string",
        "categoryId": "string",
        "gtin": "string",
        "sku": "string",
        "price": 0,
        "weight": 0,
        "weightUnit": "g",
        "stockCount": 0,
        "tracksStock": true,
        "warranty": true,
        "warrantyPeriod": "day",
        "warrantyDuration": 0,
        "quantity": 0,
        "taxRateId": "string",
        "index": 0,
        "createdAt": "2019-08-24T14:15:22Z"
      }
    ],
    "pagination": {
      "limit": 0,
      "hasMore": true,
      "nextCursor": "string"
    }
  }
}
POST
/organisations/{orgId}/inventory
X-API-Key<token>

API key for authentication. Get your key from the Developer Dashboard.

In: header

Path Parameters

orgId*string

Organisation ID

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://developer.servicebay.io/api/v1/organisations/string/inventory" \  -H "Content-Type: application/json" \  -d '{    "itemName": "string"  }'
{
  "success": true,
  "data": {
    "id": "string",
    "itemName": "string",
    "description": "string",
    "categoryId": "string",
    "gtin": "string",
    "sku": "string",
    "price": 0,
    "weight": 0,
    "weightUnit": "g",
    "stockCount": 0,
    "tracksStock": true,
    "warranty": true,
    "warrantyPeriod": "day",
    "warrantyDuration": 0,
    "quantity": 0,
    "taxRateId": "string",
    "index": 0,
    "createdAt": "2019-08-24T14:15:22Z"
  }
}
{
  "success": false,
  "error": "An error occurred"
}
GET
/organisations/{orgId}/inventory/{itemId}
X-API-Key<token>

API key for authentication. Get your key from the Developer Dashboard.

In: header

Path Parameters

orgId*string

Organisation ID

itemId*string

Response Body

application/json

application/json

application/json

application/json

curl -X GET "https://developer.servicebay.io/api/v1/organisations/string/inventory/string"
{
  "success": true,
  "data": {
    "id": "string",
    "itemName": "string",
    "description": "string",
    "categoryId": "string",
    "gtin": "string",
    "sku": "string",
    "price": 0,
    "weight": 0,
    "weightUnit": "g",
    "stockCount": 0,
    "tracksStock": true,
    "warranty": true,
    "warrantyPeriod": "day",
    "warrantyDuration": 0,
    "quantity": 0,
    "taxRateId": "string",
    "index": 0,
    "createdAt": "2019-08-24T14:15:22Z"
  }
}
{
  "success": false,
  "error": "An error occurred"
}
{
  "success": false,
  "error": "An error occurred"
}
{
  "success": false,
  "error": "An error occurred"
}
PUT
/organisations/{orgId}/inventory/{itemId}
X-API-Key<token>

API key for authentication. Get your key from the Developer Dashboard.

In: header

Path Parameters

orgId*string

Organisation ID

itemId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://developer.servicebay.io/api/v1/organisations/string/inventory/string" \  -H "Content-Type: application/json" \  -d '{    "itemName": "string"  }'
{
  "success": true,
  "data": {
    "id": "string",
    "itemName": "string",
    "description": "string",
    "categoryId": "string",
    "gtin": "string",
    "sku": "string",
    "price": 0,
    "weight": 0,
    "weightUnit": "g",
    "stockCount": 0,
    "tracksStock": true,
    "warranty": true,
    "warrantyPeriod": "day",
    "warrantyDuration": 0,
    "quantity": 0,
    "taxRateId": "string",
    "index": 0,
    "createdAt": "2019-08-24T14:15:22Z"
  }
}
{
  "success": false,
  "error": "An error occurred"
}
{
  "success": false,
  "error": "An error occurred"
}
{
  "success": false,
  "error": "An error occurred"
}
{
  "success": false,
  "error": "An error occurred"
}
DELETE
/organisations/{orgId}/inventory/{itemId}
X-API-Key<token>

API key for authentication. Get your key from the Developer Dashboard.

In: header

Path Parameters

orgId*string

Organisation ID

itemId*string

Response Body

application/json

application/json

application/json

application/json

curl -X DELETE "https://developer.servicebay.io/api/v1/organisations/string/inventory/string"
{
  "success": true,
  "data": {
    "message": "Operation completed successfully"
  }
}
{
  "success": false,
  "error": "An error occurred"
}
{
  "success": false,
  "error": "An error occurred"
}
{
  "success": false,
  "error": "An error occurred"
}

Machine-readable version: OpenAPI 3.1 spec.

On this page