example-data.com
Menu
Browse docs and collections

Overview

carts / #32

Component variants

Related

Request

curl example

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

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/carts/32"
);
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/32"
);
const cart = (await res.json()) as Cart;

Python example

import requests

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

Response

{
  "id": 32,
  "userId": 52,
  "currency": "USD",
  "subtotal": 265.39,
  "itemCount": 1,
  "updatedAt": "2026-02-14T13:49:54.409Z",
  "createdAt": "2025-02-28T08:22:33.220Z"
}