example-data.com
Menu
Browse docs and collections

Overview

carts / #28

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 28,
  "userId": 47,
  "currency": "USD",
  "subtotal": 925.06,
  "itemCount": 6,
  "updatedAt": "2025-08-15T11:32:51.039Z",
  "createdAt": "2025-05-21T07:01:30.706Z"
}