sondahub

sondahub / Store API / Order Items

Fake order items API

6,219 order items from the Store API, a fake e-commerce API. One product line on an order.

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/order_items
One record
https://api.sondahub.com/v1/store/order_items/{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/order_items.json
MCP
https://api.sondahub.com/mcp · list_records
The first three order items
curl "https://api.sondahub.com/v1/store/order_items?limit=3"

Sample records

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

[
  {
    "id": 1,
    "created_at": "2025-11-20T00:24:59Z",
    "updated_at": "2025-11-20T00:24:59Z",
    "order_id": 1,
    "product_id": 743,
    "sku": "AUD-2R8AD5",
    "name": "Ember Portable Speaker",
    "quantity": 3,
    "unit_price": 380.59,
    "line_total": 1141.77
  },
  {
    "id": 2,
    "created_at": "2025-11-20T00:24:59Z",
    "updated_at": "2025-11-20T00:24:59Z",
    "order_id": 1,
    "product_id": 1912,
    "sku": "TOY-JMHXGC",
    "name": "Kinder Forge Magnetic Kite Forest",
    "quantity": 2,
    "unit_price": 64.24,
    "line_total": 128.48
  },
  {
    "id": 3,
    "created_at": "2026-08-25T02:18:09Z",
    "updated_at": "2026-08-25T02:18:09Z",
    "order_id": 2,
    "product_id": 1211,
    "sku": "AUD-8T74T2",
    "name": "Kettleworth Portable Soundbar Ivory",
    "quantity": 1,
    "unit_price": 669.28,
    "line_total": 669.28
  }
]

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.
order_idrequiredint → orders
product_idrequiredint → products
skustring
namestringThe product name at the time of the order.
quantityrequiredintmin 1, max 999
unit_pricefloatmin 0
line_totalfloatmin 0

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

Endpoints

GET/v1/store/order_itemsA page, with every filter, sort, search, field and expand option.
POST/v1/store/order_itemsCreate 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/order_items/{id}One record, with an ETag; If-None-Match earns a 304.
PATCH/v1/store/order_items/{id}Change the fields you send.
PUT/v1/store/order_items/{id}Replace the record; required fields must all be there.
DELETE/v1/store/order_items/{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/order_items/{id}/orderThe order this record points at.
GET/v1/store/order_items/{id}/productThe product this record points at.

Try it

List with a filter
curl "https://api.sondahub.com/v1/store/order_items?quantity_gte=1&expand=order&limit=3"
One record
curl https://api.sondahub.com/v1/store/order_items/1?expand=order
Create
curl -i -X POST https://api.sondahub.com/v1/store/order_items \
  -H "Content-Type: application/json" \
  -d '{"order_id":1,"product_id":1,"quantity":1}'
Read it back: newest first (send the session token)
curl "https://api.sondahub.com/v1/store/order_items?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/order_items/1 \
  -H "Content-Type: application/json" \
  -d '{"quantity":2}'
Delete the one you created
curl -X DELETE https://api.sondahub.com/v1/store/order_items/6220 \
  -H "X-Sondahub-Session: THE_TOKEN_FROM_THE_CREATE"

Query recipes

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

WhatRequest
Page 2, 50 at a time (of 6,219)/v1/store/order_items?page=2&limit=50
Quantity between two values, largest first/v1/store/order_items?quantity_gte=1&quantity_lte=500&sort=-quantity
Newest first by created at/v1/store/order_items?sort=-created_at&limit=5
Sku contains “aud”/v1/store/order_items?sku_like=aud
Full-text search/v1/store/order_items?q=aud
Only some fields/v1/store/order_items?fields=id,sku&limit=5
Embed the order/v1/store/order_items/1?expand=order
Just the count/v1/store/order_items?limit=1&fields=id

GraphQL

The same order items as the order_items query on https://api.sondahub.com/v1/store/graphql, and one order item as order_item(id: 1). Introspection is on. More on the GraphQL API.

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

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/order_items.

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":"order_items","limit":3}}}'

More in the Store API

categories (8) · products (2,000) · customers (800) · orders (3,000) · reviews (2,500) · warehouses (3) · inventory (6,000) · 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.