example-data.com
Menu
Browse docs and collections

Overview

shipments / #94

shipments #94

orderId
orders/162
carrier
usps
trackingNumber
6D0HCW80Z3G4JK78
status
delivered
shippedAt
deliveredAt
estimatedDeliveryAt
createdAt

Component variants

Related

References

Request

curl example

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

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/shipments/94"
);
const shipment = await res.json();

TypeScript example

// Download once: mkdir -p types && curl -o types/shipments.d.ts https://example-data.com/types/shipments.d.ts
import type { Shipment } from "./types/shipments";

const res = await fetch(
  "https://example-data.com/api/v1/shipments/94"
);
const shipment = (await res.json()) as Shipment;

Python example

import requests

res = requests.get(
    "https://example-data.com/api/v1/shipments/94"
)
shipment = res.json()

Response

{
  "id": 94,
  "orderId": 162,
  "carrier": "usps",
  "trackingNumber": "6D0HCW80Z3G4JK78",
  "status": "delivered",
  "shippedAt": "2024-08-24T07:26:39.536Z",
  "deliveredAt": "2024-08-29T03:30:12.932Z",
  "estimatedDeliveryAt": "2024-09-01T14:03:43.333Z",
  "createdAt": "2024-08-24T07:26:39.536Z"
}