sondahub

sondahub / Store API / Inventory

Fake inventory API

6,000 inventory from the Store API, a fake e-commerce API. Stock of a product at a warehouse.

Reads with filters, sorting, search and relations; writes that answer like a real server and stay in your session token. Same ids on every build. Free, no key, CORS open.

Connect

List
https://api.sondahub.com/v1/store/inventory
One record
https://api.sondahub.com/v1/store/inventory/{id}
OpenAPI 3
https://api.sondahub.com/v1/store/openapi.json
GraphQL
https://api.sondahub.com/v1/store/graphql
JSON file
https://api.sondahub.com/data/store/inventory.json
MCP
https://api.sondahub.com/mcp · list_records
The first three inventory
curl "https://api.sondahub.com/v1/store/inventory?limit=3"

Sample records

Records 1 to 3 of 6,000, exactly as GET /v1/store/inventory/{id} answers them. The data file holds all of them.

[
  {
    "id": 1,
    "created_at": "2026-08-07T17:00:38Z",
    "updated_at": "2026-08-07T17:00:38Z",
    "product_id": 1,
    "warehouse_id": 1,
    "on_hand": 22,
    "reserved": 6,
    "reorder_point": 10,
    "bin": "A-25-4",
    "counted_at": "2026-08-07T17:00:38Z"
  },
  {
    "id": 2,
    "created_at": "2026-08-01T09:24:10Z",
    "updated_at": "2026-08-01T09:24:10Z",
    "product_id": 1,
    "warehouse_id": 2,
    "on_hand": 205,
    "reserved": 6,
    "reorder_point": 10,
    "bin": "B-24-5",
    "counted_at": "2026-08-01T09:24:10Z"
  },
  {
    "id": 3,
    "created_at": "2026-07-30T07:39:35Z",
    "updated_at": "2026-07-30T07:39:35Z",
    "product_id": 1,
    "warehouse_id": 3,
    "on_hand": 33,
    "reserved": 7,
    "reorder_point": 5,
    "bin": "F-5-1",
    "counted_at": "2026-07-30T07:39:35Z"
  }
]

Fields

FieldTypeNotes
idread-onlyintAssigned by the server. Seed records keep their ids across restarts; records you create continue after the seed.
created_atread-onlydatetimeWhen the record was created (ISO 8601, UTC).
updated_atread-onlydatetimeWhen the record last changed.
product_idrequiredint → products
warehouse_idrequiredint → warehouses
on_handrequiredintmin 0
reservedintmin 0
reorder_pointintmin 0
binstring
counted_atdatetime

Relations: product → one product through product_id; warehouse → one warehouse through warehouse_id. Use ?expand=product,warehouse to embed them, or the nested routes.

Endpoints

GET/v1/store/inventoryA page, with every filter, sort, search, field and expand option.
POST/v1/store/inventoryCreate one: 201 with the record, its id, a Location header and the session token that keeps it; 422 names each field that is wrong.
GET/v1/store/inventory/{id}One record, with an ETag; If-None-Match earns a 304.
PATCH/v1/store/inventory/{id}Change the fields you send.
PUT/v1/store/inventory/{id}Replace the record; required fields must all be there.
DELETE/v1/store/inventory/{id}Answers 200 with what was removed (a real server’s 204 lives at /v1/utils/status/204); gone for the session.
GET/v1/store/inventory/{id}/productThe product this record points at.
GET/v1/store/inventory/{id}/warehouseThe warehouse this record points at.

Try it

List with a filter
curl "https://api.sondahub.com/v1/store/inventory?on_hand_gte=1&expand=product&limit=3"
One record
curl https://api.sondahub.com/v1/store/inventory/1?expand=product
Create
curl -i -X POST https://api.sondahub.com/v1/store/inventory \
  -H "Content-Type: application/json" \
  -d '{"product_id":1,"warehouse_id":1,"on_hand":1,"bin":"A-14-3"}'
Read it back: newest first (send the session token)
curl "https://api.sondahub.com/v1/store/inventory?sort=-id&limit=3" \
  -H "X-Sondahub-Session: THE_TOKEN_FROM_THE_CREATE"
Change one field
curl -X PATCH https://api.sondahub.com/v1/store/inventory/1 \
  -H "Content-Type: application/json" \
  -d '{"on_hand":2}'
Delete the one you created
curl -X DELETE https://api.sondahub.com/v1/store/inventory/6001 \
  -H "X-Sondahub-Session: THE_TOKEN_FROM_THE_CREATE"

Query recipes

Every list option works on inventory; these are ready to paste. All the options.

WhatRequest
Page 2, 50 at a time (of 6,000)/v1/store/inventory?page=2&limit=50
On hand between two values, largest first/v1/store/inventory?on_hand_gte=1&on_hand_lte=500&sort=-on_hand
Newest first by created at/v1/store/inventory?sort=-created_at&limit=5
Bin contains “a”/v1/store/inventory?bin_like=a
Full-text search/v1/store/inventory?q=a
Only some fields/v1/store/inventory?fields=id,bin&limit=5
Embed the product/v1/store/inventory/1?expand=product
Just the count/v1/store/inventory?limit=1&fields=id

GraphQL

The same inventory as the inventory query on https://api.sondahub.com/v1/store/graphql, and one inventory level as inventory_level(id: 1). Introspection is on. More on the GraphQL API.

{
  inventory(limit: 3, sort: "-id") {
    total
    data {
      id product_id warehouse_id on_hand
      product { sku }
    }
  }
}
Run it
curl https://api.sondahub.com/v1/store/graphql -H "Content-Type: application/json" -d '{"query": "{ inventory(limit: 3, sort: \"-id\") { total data { id product_id warehouse_id on_hand product { sku } } } }"}'

From an AI agent (MCP)

The MCP server reaches the same rows with list_records, get_record, create_record, update_record and delete_record, and as the resource sondahub://store/inventory.

tools/call
curl https://api.sondahub.com/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"list_records","arguments":{"api":"store","collection":"inventory","limit":3}}}'

More in the Store API

categories (8) · products (2,000) · customers (800) · orders (3,000) · order items (6,219) · reviews (2,500) · warehouses (3) · carts (200)

The live streams, and the whole API on one page: Store API. Other worlds: fake IoT API, fake banking API, fake social media API, fake helpdesk API, fake flight booking API, fake user directory API.