example-data.com
Menu
Browse docs and collections

Overview

shipments / #160

shipments #160

orderId
orders/310
carrier
ups
trackingNumber
1YGNY14WUN4PTH6F
status
delivered
shippedAt
deliveredAt
estimatedDeliveryAt
createdAt

Component variants

Related

References

Request

curl example

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

JavaScript example

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

Python example

import requests

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

Response

{
  "id": 160,
  "orderId": 310,
  "carrier": "ups",
  "trackingNumber": "1YGNY14WUN4PTH6F",
  "status": "delivered",
  "shippedAt": "2024-07-31T00:30:09.969Z",
  "deliveredAt": "2024-08-03T17:30:46.780Z",
  "estimatedDeliveryAt": "2024-08-04T13:53:41.790Z",
  "createdAt": "2024-07-31T00:30:09.969Z"
}