example-data.com
Menu
Browse docs and collections

Overview

carts / #21

carts #21

userId
Lenny Howe @lenny.howe
currency
USD
subtotal
928.95
itemCount
3
updatedAt
createdAt

Component variants

Related

Request

curl example

curl -sS \
  "https://example-data.com/api/v1/carts/21" \
  -H "Accept: application/json"

JavaScript example

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

TypeScript example

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

const res = await fetch(
  "https://example-data.com/api/v1/carts/21"
);
const cart = (await res.json()) as Cart;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/carts/21"
)
cart = res.json()

Response

{
  "id": 21,
  "userId": 37,
  "currency": "USD",
  "subtotal": 928.95,
  "itemCount": 3,
  "updatedAt": "2026-03-01T14:44:41.449Z",
  "createdAt": "2026-01-21T00:07:17.482Z"
}