example-data.com
Menu
Browse docs and collections

order-items

order-items

Browse 2964 order-items records. Explore sample records and fetch JSON over a free REST API for prototypes, tests, and learning.

Overview

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/order-items?limit=25"

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/order-items?limit=25"
);
const { data, meta } = await res.json();

TypeScript example

// Download once: mkdir -p types && curl -o types/order-items.d.ts https://example-data.com/types/order-items.d.ts
import type { OrderItem, ListEnvelope } from "./types/order-items";

const res = await fetch(
  "https://example-data.com/api/v1/order-items?limit=25"
);
const { data, meta } = (await res.json()) as ListEnvelope<OrderItem>;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/order-items",
    params={"limit": 25},
)
data = res.json()

Response

{
  "data": [
    {
      "id": 1,
      "orderId": 1,
      "productId": 33,
      "quantity": 4,
      "unitPrice": 60.49,
      "lineTotal": 241.96
    },
    {
      "id": 2,
      "orderId": 1,
      "productId": 61,
      "quantity": 1,
      "unitPrice": 167.23,
      "lineTotal": 167.23
    },
    {
      "id": 3,
      "orderId": 1,
      "productId": 103,
      "quantity": 2,
      "unitPrice": 26.69,
      "lineTotal": 53.38
    }
  ],
  "meta": {
    "page": 1,
    "limit": 25,
    "total": 2964,
    "totalPages": 119
  },
  "links": {
    "self": "/api/v1/order-items?page=1",
    "first": "/api/v1/order-items?page=1",
    "last": "/api/v1/order-items?page=119",
    "next": "/api/v1/order-items?page=2",
    "prev": null
  }
}

View full response →