example-data.com
Menu
Browse docs and collections

Overview

orders / #76

orders #76

userId
Mable West @mable_west
status
delivered
currency
USD
subtotal
2940.56
tax
257.3
shipping
0
total
3197.86
placedAt
shippedAt
deliveredAt
createdAt
updatedAt

Component variants

Related

Request

curl example

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

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/orders/76"
);
const order = await res.json();

TypeScript example

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

const res = await fetch(
  "https://example-data.com/api/v1/orders/76"
);
const order = (await res.json()) as Order;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/orders/76"
)
order = res.json()

Response

{
  "id": 76,
  "userId": 86,
  "status": "delivered",
  "currency": "USD",
  "subtotal": 2940.56,
  "tax": 257.3,
  "shipping": 0,
  "total": 3197.86,
  "placedAt": "2024-10-06T06:31:25.179Z",
  "shippedAt": "2024-10-08T21:05:26.032Z",
  "deliveredAt": "2024-10-10T11:11:52.121Z",
  "createdAt": "2024-10-06T06:31:25.179Z",
  "updatedAt": "2024-10-10T11:11:52.121Z"
}