example-data.com
Menu
Browse docs and collections

Overview

orders / #873

orders #873

userId
Brock Hackett @brock.hackett
status
delivered
currency
USD
subtotal
52.26
tax
4.57
shipping
9.99
total
66.82
placedAt
shippedAt
deliveredAt
createdAt
updatedAt

Component variants

Related

Request

curl example

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

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/orders/873"
);
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/873"
);
const order = (await res.json()) as Order;

Python example

import requests

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

Response

{
  "id": 873,
  "userId": 161,
  "status": "delivered",
  "currency": "USD",
  "subtotal": 52.26,
  "tax": 4.57,
  "shipping": 9.99,
  "total": 66.82,
  "placedAt": "2024-08-22T04:05:21.000Z",
  "shippedAt": "2024-08-24T02:38:12.160Z",
  "deliveredAt": "2024-08-29T18:15:47.464Z",
  "createdAt": "2024-08-22T04:05:21.000Z",
  "updatedAt": "2024-08-29T18:15:47.464Z"
}