example-data.com
Menu
Browse docs and collections

Overview

orders / #531

orders #531

userId
Lamont Schroeder @lamont.schroeder89
status
shipped
currency
USD
subtotal
220.18
tax
19.27
shipping
0
total
239.45
placedAt
shippedAt
deliveredAt
createdAt
updatedAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 531,
  "userId": 180,
  "status": "shipped",
  "currency": "USD",
  "subtotal": 220.18,
  "tax": 19.27,
  "shipping": 0,
  "total": 239.45,
  "placedAt": "2024-06-08T13:58:02.079Z",
  "shippedAt": "2024-06-11T01:57:22.431Z",
  "deliveredAt": null,
  "createdAt": "2024-06-08T13:58:02.079Z",
  "updatedAt": "2024-06-11T01:57:22.431Z"
}