Order Intake API: Shipments and Tracking

Shipments, parcels and tracking numbers; split and merged orders; cursor pagination; and a tracking poll that never misses or double-writes a shipment.

Warehance doesn't send webhooks to your platform. You read shipments on a schedule and write the tracking numbers back to your orders.

Shipments and parcels

A shipment is one label purchase. It has one or more parcels (boxes), each with its own tracking number.

flowchart LR
    O["Order 10001<br/>(id 231185181985)"] --> S["Shipment 231185181482<br/>carrier usps, ship_date 2026-10-27"]
    S --> P1["Parcel 1<br/>tracking 9400...8490<br/>TEA-001 x1"]
    S --> P2["Parcel 2<br/>tracking 9400...8506<br/>MUG-RED x1"]
RequestResponse
GET /orders/{id}/shipments.json200 {"shipments": [...]} for one order. Empty until a label is bought.
GET /shipments.json200 {"has_next_page", "next_cursor", "shipments": [...]}, the store's shipments, oldest first. The tracking feed.
GET /shipments/{shipment_id}.json200 {"shipment": {...}}. An unknown or voided ID returns 200 with {"shipment": null}, not 404.

GET /shipments.json takes limit, cursor, updated_at_start, updated_at_end and order_number, like the order list.

Shipment

FieldTypeDescription
idstringWarehance's shipment ID.
order_numberstringThe order number of the (first) order it ships.
ordersarrayEvery order this shipment ships, as {"id", "order_number"}. More than one when the warehouse merged orders.
statusstringAlways shipped. A shipment only exists once a label is bought.
tracking_numberstring or nullThe first parcel's tracking number. Read shipment_parcels for every one.
tracking_urlstring or nullThe first parcel's tracking page, when the carrier has one.
carrier_codestring or nullWarehance's lowercase carrier code, such as usps, ups, fedex or dhl_express.
service_codestring or nullWarehance's lowercase service code, such as usps_ground_advantage or ups_ground.
ship_datestringThe label date, YYYY-MM-DD.
ship_name … countrystringThe address the label was bought for.
shipment_parcelsarrayEvery parcel in the shipment.

Parcel

FieldTypeDescription
idstringWarehance's parcel ID.
tracking_numberstringThis parcel's tracking number.
tracking_urlstringThis parcel's tracking page. Empty when the carrier has none.
weightnumberOunces.
length, width, heightnumberInches.
boxstringThe box the warehouse packed it in, or Custom Box.
itemsarrayWhat's in this parcel: order_item_id (your line's id), sku, quantity, product (id, name, sku of the warehouse product) and lot (id, lot_number, expiration_date, or null when the product isn't lot-tracked).

A bundle or kit line can appear as its components in items, each with the bundle line's order_item_id. The parcel fields have the same names and meaning as in the main Warehance API.

Example: a shipped order with two boxes

{
  "order": {
    "id": "231185181985",
    "status": "shipped",
    "fulfillment_status": "fulfilled",
    "order_number": "10001",
    "shipments": [
      {
        "id": "231185181482",
        "order_number": "10001",
        "status": "shipped",
        "tracking_number": "9400111899223197428490",
        "tracking_url": "https://tools.usps.com/go/TrackConfirmAction?tLabels=9400111899223197428490",
        "carrier_code": "usps",
        "service_code": "usps_ground_advantage",
        "ship_date": "2026-10-27",
        "orders": [{"id": "231185181985", "order_number": "10001"}],
        "ship_name": "Jane Doe",
        "address1": "1600 SW 4TH AVE",
        "address2": "Suite 300",
        "city": "PORTLAND",
        "state": "OR",
        "postal_code": "97201",
        "country": "US",
        "shipment_parcels": [
          {
            "id": "231185181484",
            "tracking_number": "9400111899223197428490",
            "tracking_url": "https://tools.usps.com/go/TrackConfirmAction?tLabels=9400111899223197428490",
            "weight": 12, "height": 6, "width": 6, "length": 6,
            "box": "6x6x6 Box",
            "items": [
              {
                "quantity": 1,
                "product": {"id": 231185181506, "name": "Green Tea, 20 bags", "sku": "TEA-001"},
                "order_item_id": "2bffbd71-f2c2-4e22-9ff6-d30009de3180",
                "sku": "TEA-001",
                "lot": null
              }
            ]
          },
          {
            "id": "231185181485",
            "tracking_number": "9400111899223197428506",
            "tracking_url": "https://tools.usps.com/go/TrackConfirmAction?tLabels=9400111899223197428506",
            "weight": 16, "height": 6, "width": 6, "length": 6,
            "box": "6x6x6 Box",
            "items": [
              {
                "quantity": 1,
                "product": {"id": 231185181508, "name": "Red Mug", "sku": "MUG-RED"},
                "order_item_id": "5e150770-2d25-4ecd-9a2c-40d58ced5715",
                "sku": "MUG-RED",
                "lot": {"id": 231185190011, "lot_number": "L2026-10", "expiration_date": "2028-10-01T00:00:00Z"}
              }
            ]
          }
        ]
      }
    ],
    "items": [
      {"id": "2bffbd71-f2c2-4e22-9ff6-d30009de3180", "sku_id": 231185181506, "quantity": 1, "sku": "TEA-001", "price": 12.5},
      {"id": "5e150770-2d25-4ecd-9a2c-40d58ced5715", "sku_id": 231185181508, "quantity": 1, "sku": "MUG-RED", "price": 12.5}
    ]
  }
}

(Address and money fields of the order are left out above for space.)

Rules for tracking

  • One shipment, many boxes. The shipment-level tracking_number is only the first box's. If your platform can store several tracking numbers per order, read them from shipment_parcels.
  • Which line is in which box. Each parcel's items lists your lines (order_item_id) and quantities in that box. Use it if your platform tracks line-level fulfillment.
  • One order, many shipments. An order can have more than one shipment: when it's split, when part of it ships later, or when the warehouse sends a replacement. Always handle a list.
  • Voided labels. If the warehouse voids a label, that shipment disappears from every response. A replacement label is a new shipment with a new id. When you see a new shipment for an order you already have tracking for, re-read the order and store its current shipments.
  • Carrier and service codes are Warehance's own lowercase codes, the same whichever carrier account the warehouse used. Map the ones your platform needs and fall back to showing the raw code.
  • Delivery status isn't included. The API reports that an order shipped, not where the package is. Use tracking_url or the carrier to follow it.

Split and merged orders

The warehouse can split one of your orders into several shipments, for example to ship in-stock items first. It can also merge several of your orders to the same address into one shipment. Your view of the orders doesn't change.

flowchart LR
    subgraph Split
        A["Order 1001"] --> SA["Shipment A<br/>2 parcels"]
        A --> SB["Shipment B<br/>1 parcel, ships later"]
    end
    subgraph Merge
        B["Order 1002"] --> SC["Shipment C<br/>orders: 1002, 1003"]
        C["Order 1003"] --> SC
    end
  • Your order keeps its id and order_number. Both still work, and the order list still has one entry per order number.
  • Split orders list every shipment made so far. fulfillment_status is partially_fulfilled until the last part ships, then fulfilled. The order's items don't change.
  • Merged orders each list the shared shipment, and its orders lists all of them. Write the same tracking to each order. Within an order (GET /orders/{id}), the shipment's parcels list only that order's lines; GET /shipments/{id} lists every line.
  • No more edits. Once split or merged, status is pending_shipment and edits and cancels return 403, even before anything ships.

Pagination

GET /orders.json and GET /shipments.json use cursor pagination, oldest first:

  1. Request the first page with your filters and limit (1–500, default 25). Don't send cursor.
  2. If the response has "has_next_page": true, request the next page with cursor set to the response's next_cursor. Keep the same filters and limit.
  3. Repeat until has_next_page is false. On the last page next_cursor is null.
GET /stores/{store_id}/shipments.json?updated_at_start=2026-10-26T14:00:00Z&limit=500
GET /stores/{store_id}/shipments.json?updated_at_start=2026-10-26T14:00:00Z&limit=500&cursor=eyJ2Ijoy...
{
  "has_next_page": true,
  "next_cursor": "eyJ2Ijoy...",
  "shipments": [ ... ]
}
  • Cursors are opaque. Store and send them exactly as you got them. Don't build or edit them.
  • Walks are stable. A walk you start keeps working while new orders and shipments arrive. New ones show up on a later page; nothing is skipped or repeated.
  • A cursor that isn't a next_cursor from this API returns 400 {"errors": ["supplied cursor is invalid"]}. Start again from the first page.
  • There are no totals or page counts. Use has_next_page.

The tracking poll

Run this every 15 to 60 minutes per store:

flowchart TD
    A([Timer fires]) --> B["poll_start = now<br/>since = last_success - 5 minutes"]
    B --> C["cursor = none"]
    C --> D["GET /shipments.json?updated_at_start=since&limit=500 (&cursor=cursor)"]
    D --> E{"For each shipment"}
    E -->|"id already processed"| E
    E -->|new| F["For every order in shipment.orders:<br/>save every parcel's tracking_number,<br/>carrier_code and tracking_url"]
    F --> G["Mark shipment id processed"]
    G --> E
    E -->|page done| H{"has_next_page?"}
    H -->|yes| I["cursor = next_cursor"] --> D
    H -->|no| J["last_success = poll_start"]
    J --> K([Done])

The same thing as pseudocode:

def poll_tracking(store):
    poll_start = now_utc()
    since = store.last_success - timedelta(minutes=5)   # overlap the window
    cursor = None
    while True:
        params = {"updated_at_start": since.isoformat(), "limit": 500}
        if cursor:
            params["cursor"] = cursor
        page = get(f"{store.base_url}/stores/{store.id}/shipments.json", params, auth=store.basic_auth)
        for shipment in page["shipments"]:
            if already_processed(store, shipment["id"]):
                continue
            for order_ref in shipment["orders"]:              # merged shipments ship several orders
                for parcel in shipment["shipment_parcels"]:   # several boxes, several tracking numbers
                    save_tracking(order_ref["order_number"], parcel["tracking_number"],
                                  shipment["carrier_code"], parcel["tracking_url"])
            mark_processed(store, shipment["id"])
        if not page["has_next_page"]:
            break
        cursor = page["next_cursor"]
    store.last_success = poll_start                         # only after every page succeeded
  • Overlap the window. Start each poll a few minutes before the last successful one started, so nothing is missed at the boundary.
  • Deduplicate on shipment id. A shipment can show up in more than one poll.
  • Read every page. Send limit on the first request, then keep requesting with cursor set to next_cursor while has_next_page is true.
  • Save the window only after success. If a poll fails halfway, the next poll starts from the same point.
  • On 401, stop. Pause the store and alert your customer; don't keep polling with a rotated key.

Did this page help you?