Skip to main content

Fake Inventory & Warehouse API

MOCK DATA

Generate warehouse inventory with exact location sums, stock-status arithmetic, reorder decisions and bounded incoming stock.

Generated test data for fixtures and development

Base URL
/api/inventory
Capabilities
1 route Seedable
Last updated
July 29, 2026

GET /api/inventory

Live requestRuns against the public API
No key required
GET/api/inventory?category=electronics&warehouse=central&stockStatus=lowStock&locationCount=3&count=8&seed=42

Request parameters

Only generate products in this category.

Pin the exact fictional warehouse.

Pin the arithmetic stock state.

Minimum total available units. Positive values exclude outOfStock/backorder.

Exact number of storage-bin locations.

Whether bounded incoming purchase orders may be included.

Snapshot instant. Defaults to the end of the current UTC day.

Advanced response options7 options

How many records to generate (1–100).

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

Return all fields except these (comma-separated).

Response format: json envelope, ndjson (one record per line) or csv.

Pretty-print the JSON response.

Drop the envelope: return the raw array/object without data/meta wrapper.

Response

Example parameters are ready. Send the request to inspect the live response.

Route reference

Code samples Ready-to-copy requests in 4 languages
Choose a code sample language
curl "https://randomapi.dev/api/inventory?category=electronics&warehouse=central&stockStatus=lowStock&locationCount=3&count=8&seed=42"
const res = await fetch("https://randomapi.dev/api/inventory?category=electronics&warehouse=central&stockStatus=lowStock&locationCount=3&count=8&seed=42");
const { data, meta } = await res.json();
import requests

data = requests.get("https://randomapi.dev/api/inventory?category=electronics&warehouse=central&stockStatus=lowStock&locationCount=3&count=8&seed=42").json()["data"]
$json = json_decode(file_get_contents(
  "https://randomapi.dev/api/inventory?category=electronics&warehouse=central&stockStatus=lowStock&locationCount=3&count=8&seed=42"
), true);
$data = $json["data"];
Parameters Route-specific request inputs 7
category enum

Only generate products in this category.

allowed: electronics | apparel | home | books | grocery
example: category=electronics
warehouse enum

Pin the exact fictional warehouse.

allowed: north | east | central | west
example: warehouse=central
stockStatus enum

Pin the arithmetic stock state.

allowed: inStock | lowStock | outOfStock | backorder
example: stockStatus=lowStock
minAvailable int

Minimum total available units. Positive values exclude outOfStock/backorder.

default: 0
allowed: 0 – 100
example: minAvailable=10
locationCount int

Exact number of storage-bin locations.

default: 2
allowed: 1 – 4
example: locationCount=3
includeIncoming boolean

Whether bounded incoming purchase orders may be included.

default: true
example: includeIncoming=false
asOf date

Snapshot instant. Defaults to the end of the current UTC day.

example: asOf=2026-06-15T23:59:59.999Z
Universal parameters Shared response and formatting options 7
count int

How many records to generate (1–100).

default: 10
allowed: 1 – 100
example: count=3
seed int

Deterministic output: the same seed always returns the same records. Omit for random (the used seed is echoed in meta.seed).

example: seed=42
fields list

Return only these fields (comma-separated). Mutually exclusive with 'exclude'.

example: fields=id,sku
exclude list

Return all fields except these (comma-separated).

example: exclude=asOf
format enum

Response format: json envelope, ndjson (one record per line) or csv.

default: json
allowed: json | ndjson | csv
example: format=csv
pretty boolean

Pretty-print the JSON response.

default: false
example: pretty=true
unwrap boolean

Drop the envelope: return the raw array/object without data/meta wrapper.

default: false
example: unwrap=true
Response schema Fields returned in each record 16
id string

Distinct fictional inventory-record ID.

example: invstk_8b1d4900_00

sku string

Synthetic SKU.

example: SKU-ABCD2345

product object

Synthetic product id, name and category.

example: {"id":"prd_demo","name":"Demo USB Hub","category":"electronics"}

warehouse object

Selected fictional warehouse id and name.

example: {"id":"central","name":"Central Example Warehouse"}

stockStatus string

inStock | lowStock | outOfStock | backorder.

example: lowStock

onHand integer

Exact sum of location onHand.

example: 34

reserved integer

Exact sum of location reserved.

example: 12

available integer

onHand - reserved and exact sum of location available.

example: 22

backordered integer

Positive only for backorder status.

example: 0

reorderPoint integer

Threshold used by stockStatus and needsReorder.

example: 25

needsReorder boolean

False only when availability exceeds reorderPoint.

example: true

incomingQuantity integer

Exact sum of incoming quantities.

example: 80

nextRestockAt string (ISO 8601) nullable

Earliest incoming arrival, else null.

example: 2026-06-18T23:59:59.999Z

locations object[]

One to four reconciled storage bins.

example: [{"id":"central-A01","onHand":20,"reserved":5,"available":15}]

incoming object[]

Zero to two synthetic purchase-order arrivals.

example: [{"purchaseOrderId":"po_demo","quantity":80,"expectedAt":"2026-06-18T23:59:59.999Z"}]

asOf string (ISO 8601)

Resolved snapshot instant.

example: 2026-06-15T23:59:59.999Z

Documented examples

Build-generated requests and complete responses
3
Low-stock electronics in Central
GET /api/inventory?category=electronics&warehouse=central&stockStatus=lowStock&locationCount=3&count=8&seed=42
{
  "data": [
    {
      "id": "invstk_728448a0b56b87_00",
      "sku": "SKU-3EKHCNBD",
      "product": {
        "id": "prd_0d14615edf3629",
        "name": "Fixture Headphones",
        "category": "electronics"
      },
      "warehouse": {
        "id": "central",
        "name": "Central Example Warehouse"
      },
      "stockStatus": "lowStock",
      "onHand": 71,
      "reserved": 38,
      "available": 33,
      "backordered": 0,
      "reorderPoint": 48,
      "needsReorder": true,
      "incomingQuantity": 464,
      "nextRestockAt": "2026-08-08T23:59:59.999Z",
      "locations": [
        {
          "id": "central-A01",
          "onHand": 11,
          "reserved": 2,
          "available": 9
        },
        {
          "id": "central-B02",
          "onHand": 32,
          "reserved": 12,
          "available": 20
        },
        {
          "id": "central-C03",
          "onHand": 28,
          "reserved": 24,
    …
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
Backorders with incoming stock
GET /api/inventory?stockStatus=backorder&includeIncoming=true&count=6&seed=17
{
  "data": [
    {
      "id": "invstk_6385bfa6772197_00",
      "sku": "SKU-2JZUDRKN",
      "product": {
        "id": "prd_615d4e9076dfe7",
        "name": "Example Storage Basket",
        "category": "home"
      },
      "warehouse": {
        "id": "central",
        "name": "Central Example Warehouse"
      },
      "stockStatus": "backorder",
      "onHand": 52,
      "reserved": 52,
      "available": 0,
      "backordered": 73,
      "reorderPoint": 50,
      "needsReorder": true,
      "incomingQuantity": 88,
      "nextRestockAt": "2026-08-08T23:59:59.999Z",
      "locations": [
        {
          "id": "central-A01",
          "onHand": 22,
          "reserved": 22,
          "available": 0
        },
        {
          "id": "central-B02",
          "onHand": 30,
          "reserved": 30,
          "available": 0
        }
      ],
      "incoming": [
        {
          "purchaseOrderId": "po_4f73252bc1d360_1",
    …
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}
In-stock snapshots without arrivals
GET /api/inventory?stockStatus=inStock&minAvailable=20&includeIncoming=false&count=10&seed=8
{
  "data": [
    {
      "id": "invstk_10ec498125864a_00",
      "sku": "SKU-A26Q74AM",
      "product": {
        "id": "prd_d64418bc8e6c2e",
        "name": "Fixture Towel Set",
        "category": "home"
      },
      "warehouse": {
        "id": "west",
        "name": "West Example Warehouse"
      },
      "stockStatus": "inStock",
      "onHand": 188,
      "reserved": 44,
      "available": 144,
      "backordered": 0,
      "reorderPoint": 77,
      "needsReorder": false,
      "incomingQuantity": 0,
      "nextRestockAt": null,
      "locations": [
        {
          "id": "west-A01",
          "onHand": 70,
          "reserved": 19,
          "available": 51
        },
        {
          "id": "west-B02",
          "onHand": 118,
          "reserved": 25,
          "available": 93
        }
      ],
      "incoming": [],
      "asOf": "2026-07-29T23:59:59.999Z"
    },
    …
    "generatedAt": "2026-07-29T08:13:22.000Z"
  }
}

About this API

Coverage & behavior

Generates fictional warehouse inventory snapshots whose quantities reconcile at every level. Each bin obeys available = onHand - reserved; top-level on-hand, reserved and available values are exact sums of the bins. Backordered quantity is separate and present only for backorder records.

Stock status is derived from the numbers: in-stock availability exceeds the reorder point, low stock is positive but at or below it, out-of-stock is zero without backorders, and backorder is zero available with a positive backordered quantity. needsReorder follows those rules rather than being generated independently.

warehouse, category, stockStatus, minAvailable, locationCount, includeIncoming and snapshot asOf are genuine constraints. Incoming entries are capped at two; disabling them produces an empty array, zero quantity and null restock date. All product, warehouse and purchase-order identifiers are synthetic and vendor-neutral.

Use it for

  • Populate warehouse and inventory-management dashboards
  • Test available, reserved, backorder and reorder calculations
  • Exercise incoming-stock and multi-bin table states reproducibly

Frequently asked questions

Do warehouse bin quantities add up?

Yes. Every bin satisfies available = onHand - reserved, and each top-level quantity is the exact sum of its corresponding bin values.

How is low stock different from out of stock?

Low stock has positive availability at or below reorderPoint; out of stock has zero availability and zero backordered units.

Can incoming stock be removed from the fixture?

Yes. includeIncoming=false guarantees an empty incoming array, incomingQuantity=0 and nextRestockAt=null.

Are these real warehouse or supplier records?

No. Every warehouse, SKU, bin and purchase-order value is synthetic fixture data.