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
overridesthat 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β
- Obtain an API token and your location subdomain (see Authentication).
- 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β
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
start_date | Date | No | Inclusive 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_date | Date | No | Inclusive end of the query window (YYYY-MM-DD). Same default and single-parameter behavior as start_date. | end_date=2026-04-30 |
product_name | String | No | Exact 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 |
page | Integer | No | Page number for pagination (same pattern as other location APIs). | page=2 |
Date Range Rulesβ
- Both omitted:
Date.currentthroughDate.current + 7 days(inclusive). - Only
start_date:end_dateis treated as the same day asstart_date. - Only
end_date:start_dateis treated as the same day asend_date. start_dateafterend_date: request fails with400 Bad Request(see Errors).
Filtering Behaviorβ
- Only limits with
enabled: trueare returned. - A limit is included if its
start_date/end_dateoverlap the requested range, treating nullstart_dateorend_dateon the limit as unbounded on that side. - Nested
overridesare filtered in memory: an override is listed only if itsstart_date..end_dateoverlaps 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β
| Field | Type | Description |
|---|---|---|
id | Integer | Limit record id |
name | String | Display name of the limit |
limitable_type | String | How the limit is measured; typically quantity or weight |
limit | Number | Numeric cap |
enabled | Boolean | Always true for rows returned by this endpoint |
start_date | Date/null | Limit effective start (null = no lower bound) |
end_date | Date/null | Limit effective end (null = no upper bound) |
start_time | String/null | Time-of-day window start (if configured) |
end_time | String/null | Time-of-day window end (if configured) |
limitable_period | String | Period granularity; typically hour, day, or week |
outbound | Boolean/null | Applies to outbound when true (semantics match app configuration) |
drop_trailer | Boolean/null | Applies to drop-trailer flows when true |
all_products | Boolean | When true, limit applies broadly (see product_name filter behavior) |
location_name | String | Name of the location |
product_name | String/null | Associated product name, if any |
product_category_name | String/null | Associated category name, if any |
week_days | Array | English day names (e.g. "Monday", "Tuesday") derived from stored weekdays |
companies | Array | Company names resolved from stored company_ids |
overrides | Array | Override rows overlapping the requested range (see below) |
overrides[] fieldsβ
| Field | Type | Description |
|---|---|---|
id | Integer | Override id |
product_limit_id | Integer | Parent limit id |
limit | Number | Override cap |
start_date | Date | Override window start |
end_date | Date | Override 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.