example-data.com
Menu
Browse docs and collections

Overview

orders / #389

orders #389

userId
Elva Roberts @elva.roberts48
status
cancelled
currency
USD
subtotal
2088.59
tax
182.75
shipping
0
total
2271.34
placedAt
shippedAt
deliveredAt
createdAt
updatedAt

Component variants

Related

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 389,
  "userId": 107,
  "status": "cancelled",
  "currency": "USD",
  "subtotal": 2088.59,
  "tax": 182.75,
  "shipping": 0,
  "total": 2271.34,
  "placedAt": "2024-10-21T06:39:35.570Z",
  "shippedAt": null,
  "deliveredAt": null,
  "createdAt": "2024-10-21T06:39:35.570Z",
  "updatedAt": "2024-10-21T06:39:35.570Z"
}