example-data.com
Menu
Browse docs and collections

Overview

orders / #115

orders #115

userId
Wallace Batz @wallace_batz
status
delivered
currency
USD
subtotal
587.94
tax
51.44
shipping
0
total
639.38
placedAt
shippedAt
deliveredAt
createdAt
updatedAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 115,
  "userId": 229,
  "status": "delivered",
  "currency": "USD",
  "subtotal": 587.94,
  "tax": 51.44,
  "shipping": 0,
  "total": 639.38,
  "placedAt": "2024-10-09T07:19:55.922Z",
  "shippedAt": "2024-10-10T20:10:51.032Z",
  "deliveredAt": "2024-10-14T21:50:30.758Z",
  "createdAt": "2024-10-09T07:19:55.922Z",
  "updatedAt": "2024-10-14T21:50:30.758Z"
}