example-data.com
Menu
Browse docs and collections

Overview

orders / #912

orders #912

userId
Hilda Crooks @hilda_crooks61
status
delivered
currency
USD
subtotal
1959.88
tax
171.49
shipping
0
total
2131.37
placedAt
shippedAt
deliveredAt
createdAt
updatedAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 912,
  "userId": 187,
  "status": "delivered",
  "currency": "USD",
  "subtotal": 1959.88,
  "tax": 171.49,
  "shipping": 0,
  "total": 2131.37,
  "placedAt": "2024-08-24T23:18:56.749Z",
  "shippedAt": "2024-08-26T23:59:16.982Z",
  "deliveredAt": "2024-09-03T04:47:30.836Z",
  "createdAt": "2024-08-24T23:18:56.749Z",
  "updatedAt": "2024-09-03T04:47:30.836Z"
}