Inventory Inventory API
A simple and powerful API to programmatically access and manage your inventory data. This guide is designed to be understood by both human developers and AI agents. For example if you have an e-commerce website, you can directly load your products, and once sold, your API can update the quantity in your inventory.

Base URL

All API requests should be made to the following base URL:

https://us-central1-studio-9300027708-1f0ae.cloudfunctions.net/getInventory

Authentication

The API uses a Bearer Token for authentication. You must include your personal API key in the `Authorization` header for all requests. You can generate and manage your API key from your profile page.

Authorization: Bearer YOUR_API_KEY_HERE

Endpoints

GETFetch Inventory Items

Retrieves a list of all inventory items that have been explicitly marked for inclusion in the API. If the business has enabled custom item fields (SKU, cost price, reorder level, supplier, expiry date, or their own fields), each item includes them in an optional `fields` object.

Example Request

curl -X GET "https://us-central1-studio-9300027708-1f0ae.cloudfunctions.net/getInventory" \
     -H "Authorization: Bearer YOUR_API_KEY_HERE"

Success Response (200 OK)

Returns a JSON array of `InventoryItem` objects.

[
  {
    "id": "1N3RTWf049jLR8jyN4p5",
    "name": "potato",
    "description": "A root vegetable",
    "quantity": 2,
    "includeInApi": true,
    "createdAt": "2026-02-04T16:46:21.372Z",
    "updatedAt": "2026-02-05T16:04:34.537Z"
  },
  {
    "id": "X0qno0rSbD9CnrirCudG",
    "name": "carrot",
    "description": "A fresh carrot",
    "quantity": 6,
    "price": 90,
    "includeInApi": true,
    "fields": { "sku": "CAR-001", "costPrice": 45, "expiryDate": "2026-08-01" },
    "createdAt": "2026-02-04T16:46:21.522Z",
    "updatedAt": "2026-02-05T16:42:02.945Z"
  }
]

POSTUpdate Item Quantities

Updates the quantity of one or more items, typically after a sale. The request body must be a JSON object containing an `items` array. Each object in the array must have an `itemId` and the `quantity` to subtract.

Every update is also recorded in your Activity Log (attributed to “Developer API”), so API-driven stock movements show up alongside scans and edits — and can trigger any AI Alert rules you’ve set up (low stock, item watches, and so on).

For batch-tracked items (the optional `batches` array), quantity subtractions are applied FEFO — First Expired, First Out: the soonest-expiring batch is consumed first, the item's `fields.expiryDate` rolls forward to the next-soonest batch automatically, and the Activity Log records exactly which lots were consumed.

Request Body

{
  "items": [
    { "itemId": "ID_OF_ITEM_1", "quantity": 1 },
    { "itemId": "ID_OF_ITEM_2", "quantity": 5 }
  ]
}

Example Request

curl -X POST "https://us-central1-studio-9300027708-1f0ae.cloudfunctions.net/getInventory" \
     -H "Authorization: Bearer YOUR_API_KEY_HERE" \
     -H "Content-Type: application/json" \
     -d '{
           "items": [
             { "itemId": "1N3RTWf049jLR8jyN4p5", "quantity": 1 },
             { "itemId": "X0qno0rSbD9CnrirCudG", "quantity": 2 }
           ]
         }'

Success Response (200 OK)

{
  "success": true,
  "message": "2 item(s) updated successfully."
}

Error Responses

400 Bad Request - Insufficient stock for the requested quantity.

Bad Request: Insufficient stock for item "potato".

404 Not Found - One of the provided `itemId` values does not exist.

Bad Request: Item with ID "INVALID_ID_HERE" not found.

Data Models

InventoryItem Object

The structure for a single item in your inventory.

{
  "id": "X0qno0rSbD9CnrirCudG",
  "name": "carrot",
  "description": "A fresh carrot",
  "quantity": 6,
  "price": 90,
  "barcode": "6441494753334",
  "userId": "H1S3hTMYYeZoP7SHuhaPMfjggqR2",
  "imageUrl": "https://path/to/image.jpg",
  "includeInApi": true,
  "fields": {
    "sku": "CAR-001",
    "costPrice": 45,
    "reorderLevel": 10,
    "supplier": "Pandacat Inc.",
    "expiryDate": "2026-08-01"
  },
  "batches": [
    { "id": "a1b2c3d4", "qty": 4, "expiryDate": "2026-08-01", "lotNumber": "A123" },
    { "id": "e5f6g7h8", "qty": 2, "expiryDate": "2026-08-15" }
  ],
  "createdAt": "2026-02-04T16:46:21.522Z",
  "updatedAt": "2026-02-05T16:42:02.945Z"
}

Connect an AI assistant (MCP)

Inventory Inventory is also an MCP server (Model Context Protocol) — the standard way AI assistants such as Claude, ChatGPT and Cursor plug into outside systems. Once connected, you can ask your assistant things like “what is running low?”, “which items expire this month?” or “record that we sold 3 paint roller sets”, and it uses your live inventory. No API key to paste: you sign in with Google and approve, and you can disconnect any time from your Profile under Connected AI apps. MCP access is part of the Pro plan.

Server URL

https://inventoryinventory.com/api/mcp

Transport: Streamable HTTP. Authentication: OAuth 2.1 with PKCE (discovered automatically from the URL). Scopes: inventory:read, inventory:write.

How to connect

  • Claude (web, desktop): in Settings, open Connectors and add a custom connector with the server URL above, then approve the sign-in.
  • Claude Code: claude mcp add --transport http inventory-inventory https://inventoryinventory.com/api/mcp, then run /mcp to sign in.
  • ChatGPT: in Settings, open Connectors, create a connector with the server URL and complete the sign-in.
  • Cursor and other MCP clients: add a remote MCP server with the URL; OAuth sign-in opens in your browser.

Tools

  • list_inventory — items with quantity, price, cost, supplier, barcode, SKU, expiry and location; optional search and tag filter.
  • get_item — one item by id, barcode, SKU or name.
  • low_stock — items at or below their reorder level, or out of stock.
  • expiring_soon — items and batches expiring within N days.
  • inventory_summary — counts, units on hand, stock value at price and at cost.
  • record_sale — deduct sold units (asks for confirmation; never below zero; FEFO on batches; logged; triggers alerts, auto-reorder and store sync). Requires the inventory:write scope.

Only items with Include in API enabled are visible, the same rule as the REST API. Every sale recorded through MCP appears in the Activity Log attributed to the connected app.