Warehouses

Maintain warehouse operating details and import organized storage locations for connected inventory workflows.

Use the warehouse directory to keep names, source identifiers, addresses, and contacts aligned between ShelfCycle and connected systems. Warehouse responses include updatedAt for precise updates and lifecycle changes.

Access

Reads require warehouses:read. Creates, updates, archive, and restore actions require warehouses:write plus the acting person's current organization access. GET /me reports the available actions through effectiveCapabilities.warehouses and effectiveCapabilities.writeReadiness.warehouses.

Find warehouses

GET /warehouses returns active physical warehouses by default.

curl "$SHELFCYCLE_API_BASE_URL/warehouses?q=main&limit=25" \
  -H "Authorization: Bearer $SHELFCYCLE_API_KEY"

Use q for a name search or externalId for one exact source identifier. Set includeArchived=true when reconciling retired locations, or includeDirectShip=true when a workflow also needs Direct Ship locations for reference.

Continue with meta.nextCursor as cursor, keeping the first page’s filters and limit unchanged.

curl "$SHELFCYCLE_API_BASE_URL/warehouses?q=main&limit=25&cursor=$NEXT_CURSOR" \
  -H "Authorization: Bearer $SHELFCYCLE_API_KEY"

Read one known warehouse with GET /warehouses/{id}.

Create a warehouse

Create accepts a required name plus address, contact, and source-identity fields. A stable externalId makes repeated source-driven requests safe; otherwise, provide an Idempotency-Key.

Preview:

curl "$SHELFCYCLE_API_BASE_URL/warehouses?dryRun=true" \
  -X POST \
  -H "Authorization: Bearer $SHELFCYCLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Northeast Distribution Center",
    "street1": "410 Harbor Way",
    "city": "Newark",
    "state": "NJ",
    "zip": "07114",
    "country": "US",
    "phone": "973-555-0100",
    "email": "receiving@example.com",
    "contactName": "Receiving Team",
    "externalId": "WMS-NE-01"
  }'

Apply the same request without dryRun=true. Repeating the same externalId and fields returns the existing warehouse unchanged. A different request using an existing externalId returns the existing warehouse ID so the source record can be reconciled.

Update warehouse details

Read the warehouse first, then send the latest updatedAt value in If-Match.

curl "$SHELFCYCLE_API_BASE_URL/warehouses/warehouse-id" \
  -X PATCH \
  -H "Authorization: Bearer $SHELFCYCLE_API_KEY" \
  -H "Content-Type: application/json" \
  -H 'If-Match: "2026-09-12T14:30:00.000Z"' \
  -d '{
    "contactName": "Alex Rivera",
    "email": "alex.rivera@example.com"
  }'

The same fields can be previewed with dryRun=true before they are saved.

Keep warehouse reference details

Warehouse create, update, and reads include these optional nullable text fields:

  • notes, openingTimeText, and closingTimeText for descriptive operating information.
  • secondaryPhone and fax for additional contact numbers.
  • emergencyContactName, emergencyContactTitle, emergencyPhone, and emergencyAfterHoursPhone.
  • secondaryEmergencyContactName, secondaryEmergencyContactTitle, secondaryEmergencyPhone, and secondaryEmergencyAfterHoursPhone.

The API trims these fields, accepts up to 500 characters each, and stores blank text as null. Omitted reference fields do not participate in source-identity repeat comparisons; including them compares the supplied values. Hours remain descriptive text. Send country as an ISO two-letter code such as US; country text is stored as supplied.

For example, include these fields in a warehouse create or a PATCH using its latest updatedAt:

{
  "notes": "Receiving entrance on the east side.",
  "openingTimeText": "Monday–Friday 08:00",
  "closingTimeText": "Monday–Friday 17:00",
  "emergencyContactName": "Operations Desk",
  "emergencyAfterHoursPhone": "973-555-0199"
}

Find warehouse locations

GET /warehouse-locations requires warehouses:read and current warehouse-location viewing permission. Select exactly one of warehouseId or warehouseExternalId. Locations are ordered by path and ID, with a default and maximum limit of 1000.

curl "$SHELFCYCLE_API_BASE_URL/warehouse-locations?warehouseExternalId=WMS-NE-01&limit=100" \
  -H "Authorization: Bearer $SHELFCYCLE_API_KEY"

Add includeArchived=true to reconcile retired locations, or externalId for an exact source identifier. Location externalId preserves outer spaces, so send its exact saved value. Returned rows retain the warehouse, parent, path, type, source identity, barcode, storage metadata, and archive status. Decimal limits are returned as strings.

Read meta.coverage and continue with meta.nextCursor until coverage is complete. Continue with meta.nextCursor as cursor, keeping the first page’s filters and limit unchanged.

curl "$SHELFCYCLE_API_BASE_URL/warehouse-locations?warehouseExternalId=WMS-NE-01&limit=100&cursor=$NEXT_CURSOR" \
  -H "Authorization: Bearer $SHELFCYCLE_API_KEY"

Import warehouse locations

POST /warehouse-locations/batch accepts 1–50 independent items in up to 2 MiB. Use warehouses:write with current warehouse-location create permission. A request containing any archived: true item also requires warehouse-location archive permission, including on preview.

Each payload requires name, code, type, and a stable nonblank externalId, plus exactly one warehouse reference. Location identity is the warehouse plus the exact externalId; unlike the warehouse's source ID, a location's source ID is not trimmed. Names and codes are trimmed, and codes cannot contain /. Convert source codes before submitting, and declare the location type explicitly rather than deriving it from the source code.

curl "$SHELFCYCLE_API_BASE_URL/warehouse-locations/batch?dryRun=true" \
  -X POST \
  -H "Authorization: Bearer $SHELFCYCLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "items": [{
      "clientItemId": "location-east-zone",
      "payload": {
        "warehouseExternalId": "WMS-NE-01",
        "externalId": "SOURCE-EAST",
        "name": "East storage zone",
        "code": "EAST",
        "type": "ZONE",
        "parentExternalId": null,
        "notes": "East-side storage area",
        "archived": false
      }
    }]
  }'

Supported types are ZONE, AISLE, RACK, LEVEL, BIN, DOCK, STAGING, QUARANTINE, YARD, TANK, and ROOM. Optional metadata includes barcode/GLN fields, receiving and picking flags, security and storage conditions, dimensions, limits, pallet positions, hazard classes, and notes. Use the live reference for exact fields and units. batchPickExcluded preserves true, false, or null as supplied; it records source information and does not enforce a picking exclusion.

Use parentExternalId for an existing parent in the same warehouse, or null for a root location. Creation follows the warehouse's hierarchy and archive rules. An earlier item's newly created parent is visible to later items during execution, but previews roll back each item separately. For reliable child previews, import and verify parents in a separate pass first. Same-request identity collisions are also evaluated against earlier saved items only during execution.

Preview returns ordered data.results with ready or failed; ready items include data.resultAction as created or unchanged. It saves nothing and needs no Idempotency-Key. A missing or repeated clientItemId rejects the envelope; invalid location content fails only that item. There is no new /me write-readiness operation for this import.

After reviewing the preview, remove dryRun=true and add a stable Idempotency-Key, such as warehouse-setup:locations:east-001. Successful items report succeeded with id, warehouseId, externalId, code, archived, updatedAt, and resultAction. An existing identity returns unchanged only when the supplied fields match. Each differing field returns a duplicate_reference_identity failure without updating that location; omitted fields are not compared. This is an import and reconciliation endpoint, not an update route.

Repeat an uncertain execution or 503 warehouse_locations_batch_interrupted with the identical body, item order, IDs, and key. Recorded results replay and pending items continue; changing the body with the same key conflicts. Corrected failed items go in a new request with a new key. Requests consume one item-unit per submitted location, within 250 item-units per 60 seconds.

Create or load warehouses as active first, import their locations with the correct archive flags, then archive warehouses that should be retired. Verify the saved locations through GET before continuing. This setup flow does not import stock or inventory balances.

Archive and restore

Archive a warehouse that is no longer used for new setup while preserving its identity and existing history. Both actions use an empty body and the latest updatedAt value.

curl "$SHELFCYCLE_API_BASE_URL/warehouses/warehouse-id/archive?dryRun=true" \
  -X POST \
  -H "Authorization: Bearer $SHELFCYCLE_API_KEY" \
  -H 'If-Match: "2026-09-12T14:30:00.000Z"' \
  -H "Content-Type: application/json" \
  -d '{}'

Remove dryRun=true to apply the archive. To restore the location, call /warehouses/{id}/unarchive with its latest updatedAt value.

Resolve a warehouse name

Entity Resolution accepts class: "warehouse" and returns stable warehouse IDs for familiar names. It uses search:read together with the acting person's current Lot viewing access.

curl "$SHELFCYCLE_API_BASE_URL/entity-resolution?q=Northeast%20DC&class=warehouse" \
  -H "Authorization: Bearer $SHELFCYCLE_API_KEY"

Use the selected warehouse ID with inventory balances, reorder status, reorder-point maintenance, pricing, and other warehouse-aware workflows.