Skip to main content

Product Limits API

πŸš€ Why Use the Product Limits API?​

Product limits define how much of a product (or category) can move through a location in a given period. The Product Limits API is read-only: it lets you query active limits and their overrides for a date window so scheduling, WMS, or analytics systems can align with the same rules the warehouse uses in DataDocks.

Real Problems This API Solves​

  • Capacity-aware planning: Pull limits that apply to a shipment date range without scraping the UI
  • Exceptions in one payload: Each limit includes overrides that apply within your requested window
  • Cross-system consistency: Use the same enabled limits DataDocks enforces for inbound/outbound and drop-trailer flows

This endpoint does not create, update, or delete limits. Please use the DataDocks software to manage your Product Limits.

5-Minute Quickstart​

  1. Obtain an API token and your location subdomain (see Authentication).
  2. Call the listing endpoint (defaults described below).
See cURL example (default date window)
curl -H "Authorization: Token YOUR_API_TOKEN" \
"https://YOUR_LOCATION.datadocks.com/api/v1/product_limits"

How It Fits Together​

Authentication​

All requests must send your token in the Authorization header (same as other location APIs). See Authentication for details.

Authorization: Token YOUR_API_TOKEN

Listing Product Limits​

Purpose​

Return a paginated list of enabled product limits whose configured date range overlaps the range you request (or the default range). For each limit, overrides includes only override rows whose dates overlap that same requested range.

HTTP Request​

GET https://[location_subdomain].datadocks.com/api/v1/product_limits

Query Parameters​

ParameterTypeRequiredDescriptionExample
start_dateDateNoInclusive start of the query window (YYYY-MM-DD). If both start_date and end_date are omitted, the window defaults to today through today + 7 days. If only one bound is sent, the missing bound equals the provided date.start_date=2026-04-01
end_dateDateNoInclusive end of the query window (YYYY-MM-DD). Same default and single-parameter behavior as start_date.end_date=2026-04-30
product_nameStringNoExact match on product name, case-insensitive (whitespace trimmed). When set, results include limits tied to that product or limits with all_products: true.product_name=Widgets
pageIntegerNoPage number for pagination (same pattern as other location APIs).page=2

Date Range Rules​

  • Both omitted: Date.current through Date.current + 7 days (inclusive).
  • Only start_date: end_date is treated as the same day as start_date.
  • Only end_date: start_date is treated as the same day as end_date.
  • start_date after end_date: request fails with 400 Bad Request (see Errors).

Filtering Behavior​

  • Only limits with enabled: true are returned.
  • A limit is included if its start_date / end_date overlap the requested range, treating null start_date or end_date on the limit as unbounded on that side.
  • Nested overrides are filtered in memory: an override is listed only if its start_date..end_date overlaps the requested range.

Response Format​

The JSON root is an object with a product_limits array (not a bare array at the top level).

product_limits[] fields​

FieldTypeDescription
idIntegerLimit record id
nameStringDisplay name of the limit
limitable_typeStringHow the limit is measured; typically quantity or weight
limitNumberNumeric cap
enabledBooleanAlways true for rows returned by this endpoint
start_dateDate/nullLimit effective start (null = no lower bound)
end_dateDate/nullLimit effective end (null = no upper bound)
start_timeString/nullTime-of-day window start (if configured)
end_timeString/nullTime-of-day window end (if configured)
limitable_periodStringPeriod granularity; typically hour, day, or week
outboundBoolean/nullApplies to outbound when true (semantics match app configuration)
drop_trailerBoolean/nullApplies to drop-trailer flows when true
all_productsBooleanWhen true, limit applies broadly (see product_name filter behavior)
location_nameStringName of the location
product_nameString/nullAssociated product name, if any
product_category_nameString/nullAssociated category name, if any
week_daysArrayEnglish day names (e.g. "Monday", "Tuesday") derived from stored weekdays
companiesArrayCompany names resolved from stored company_ids
overridesArrayOverride rows overlapping the requested range (see below)

overrides[] fields​

FieldTypeDescription
idIntegerOverride id
product_limit_idIntegerParent limit id
limitNumberOverride cap
start_dateDateOverride window start
end_dateDateOverride window end

Errors​

Invalid dates, or start_date after end_date, produce 400 Bad Request with a JSON body:

{ "error": "<message>" }

The message comes from date parsing or validation (for example: start_date must be on or before end_date).

Code Examples​

cURL​

Default range (today through today + 7 days)
curl -H "Authorization: Token YOUR_API_TOKEN" \
"https://YOUR_LOCATION.datadocks.com/api/v1/product_limits"
Explicit date range
curl -H "Authorization: Token YOUR_API_TOKEN" \
"https://YOUR_LOCATION.datadocks.com/api/v1/product_limits?start_date=2026-04-01&end_date=2026-04-30"
Filter by product name (exact, case-insensitive)
curl -H "Authorization: Token YOUR_API_TOKEN" \
"https://YOUR_LOCATION.datadocks.com/api/v1/product_limits?product_name=Widgets&start_date=2026-04-01&end_date=2026-04-07"

JavaScript​

See JavaScript example
const getProductLimits = async ({ startDate, endDate, productName, page } = {}) => {
const params = new URLSearchParams();
if (startDate) params.append("start_date", startDate);
if (endDate) params.append("end_date", endDate);
if (productName) params.append("product_name", productName);
if (page) params.append("page", String(page));

const response = await fetch(
`https://YOUR_LOCATION.datadocks.com/api/v1/product_limits?${params.toString()}`,
{
method: "GET",
headers: {
Authorization: "Token YOUR_API_TOKEN",
"Content-Type": "application/json",
},
}
);

if (!response.ok) {
const errorData = await response.json().catch(() => ({}));
throw new Error(`Failed to fetch product limits: ${JSON.stringify(errorData)}`);
}

return response.json();
};

Sample Response​

See sample response
{
"product_limits": [
{
"id": 101,
"name": "Inbound pallets β€” peak season",
"limitable_type": "quantity",
"limit": 40,
"enabled": true,
"start_date": "2026-04-01",
"end_date": "2026-04-30",
"start_time": "06:00",
"end_time": "18:00",
"limitable_period": "day",
"outbound": false,
"drop_trailer": null,
"all_products": false,
"location_name": "Main DC",
"product_name": "Widgets",
"product_category_name": null,
"week_days": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"],
"companies": ["Acme Logistics", "Beta Foods"],
"overrides": [
{
"id": 5001,
"product_limit_id": 101,
"limit": 55,
"start_date": "2026-04-10",
"end_date": "2026-04-12"
}
]
},
{
"id": 102,
"name": "All outbound weight cap",
"limitable_type": "weight",
"limit": 120000,
"enabled": true,
"start_date": null,
"end_date": null,
"start_time": null,
"end_time": null,
"limitable_period": "week",
"outbound": true,
"drop_trailer": false,
"all_products": true,
"location_name": "Main DC",
"product_name": null,
"product_category_name": null,
"week_days": [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday"
],
"companies": [],
"overrides": []
}
]
}

Pagination​

Results are paginated like other location APIs. See Pagination for headers and how to follow page links.