example-data.com
Menu
Browse docs and collections

Overview

cart-items / #23

Component variants

Related

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/cart-items/23" \
  -H "Accept: application/json"

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/cart-items/23"
);
const cartItem = await res.json();

TypeScript example

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

const res = await fetch(
  "https://example-data.com/api/v1/cart-items/23"
);
const cartItem = (await res.json()) as CartItem;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/cart-items/23"
)
cart_item = res.json()

Response

{
  "id": 23,
  "cartId": 9,
  "productId": 77,
  "quantity": 3,
  "unitPrice": 48.59,
  "addedAt": "2025-05-24T22:59:25.242Z"
}