example-data.com
Menu
Browse docs and collections

Overview

shipments / #296

shipments #296

orderId
orders/554
carrier
usps
trackingNumber
Y047PU0YBR6YHDBS
status
in_transit
shippedAt
deliveredAt
estimatedDeliveryAt
createdAt

Component variants

Related

References

Request

curl example

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

JavaScript example

const res = await fetch(
  "https://example-data.com/api/v1/shipments/296"
);
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/296"
);
const shipment = (await res.json()) as Shipment;

Python example

import requests

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

Response

{
  "id": 296,
  "orderId": 554,
  "carrier": "usps",
  "trackingNumber": "Y047PU0YBR6YHDBS",
  "status": "in_transit",
  "shippedAt": "2024-06-30T03:53:21.832Z",
  "deliveredAt": null,
  "estimatedDeliveryAt": "2024-07-03T08:58:09.907Z",
  "createdAt": "2024-06-30T03:53:21.832Z"
}