example-data.com
Menu
Browse docs and collections

order-items

order-items

Page 77 of 124.

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": 1825,
      "orderId": 608,
      "productId": 163,
      "quantity": 1,
      "unitPrice": 355.34,
      "lineTotal": 355.34
    },
    {
      "id": 1826,
      "orderId": 609,
      "productId": 189,
      "quantity": 3,
      "unitPrice": 73.69,
      "lineTotal": 221.07
    },
    {
      "id": 1827,
      "orderId": 610,
      "productId": 194,
      "quantity": 4,
      "unitPrice": 295.67,
      "lineTotal": 1182.68
    }
  ],
  "meta": {
    "page": 77,
    "limit": 24,
    "total": 2964,
    "totalPages": 124
  },
  "links": {
    "self": "/api/v1/order-items?page=77&limit=24",
    "first": "/api/v1/order-items?page=1&limit=24",
    "last": "/api/v1/order-items?page=124&limit=24",
    "next": "/api/v1/order-items?page=78&limit=24",
    "prev": "/api/v1/order-items?page=76&limit=24"
  }
}