POST
/api/public/v1/qa-specsCreate or update a QA product spec
Creates a spec, or updates one by passing its `id` — one call rather than two, because the console’s start-of-shift setup does the same. The tolerance band has to make sense: a low above the high is rejected rather than stored as a spec no check could ever pass.
Required scope
The access token must carry this scope. A token missing it gets 403 Forbidden. Grant them to an API client under Settings → Company → API, and to a teammate under Employee → Permissions.
quality:specs:write
Request Body
| Property | Type | Description |
|---|---|---|
locationId | string | The plant. |
id | string | Pass an existing spec id to update rather than create. |
productName | string | |
reference | string | Your own identifier for the product — an item code, an internal SKU, a customer part number. Searched alongside the name when listing specs. |
size | string | How the product packs out, e.g. "2 cu ft bag", "5 gal pail". |
category | string | Your own grouping for the product, e.g. "Mulch". Free-form. |
unitLabel | string | Singular noun for one of whatever this is produced as — "bag", "pail", "carton". Defaults to "unit" wherever the app counts them. |
targetWeight | number | Pounds. |
weightToleranceLow | number | Acceptable minimum. Must be ≤ the high. |
weightToleranceHigh | number | Acceptable maximum. |
targetVolume | number | Cubic feet. |
volumeTolerance | number | Allowed absolute deviation from the target. |
checkIntervalMinutes | number | How often a check is expected. |
baselinePalletsPerTruck | number | Drives the freight savings figures. |
targetPalletsPerTruck | number | |
unitsPerPallet | number | With the average weight the line checks measure, this is what says how many pallets fit under the truck weight limit. |
truckWeightLimitLbs | number | Usable payload of a load. Defaults to 47000. |
forecastAnnualUnits | number | Units a year the plant expects to ship of this product. With the pallet figures it turns the loading gain into truckloads a year, and a number in dollars. |
customFields | array | Your own `{ label, value }` facts about the product. Replace-all: send the whole list, or omit it to leave the existing one alone. |
POSTExample request
curl
curl -X POST "https://www.pxb.app/api/public/v1/qa-specs" \
-H "Authorization: Bearer your_access_token" \
-H "Content-Type: application/json" \
-d '{
"locationId": "loc_abc123",
"productName": "Premium mulch, 2cu ft",
"reference": "MUL-2CF-PRM",
"category": "Mulch",
"unitLabel": "bag",
"unitsPerPallet": 60,
"targetWeight": 31.9,
"weightToleranceLow": 31.2,
"weightToleranceHigh": 32.6,
"customFields": [
{
"label": "Pallet pattern",
"value": "5 x 12"
}
]
}'200Example response
json
{
"message": "Spec created!",
"content": {
"spec": {
"id": "qsp_1001",
"locationId": "loc_abc123",
"productName": "Premium mulch, 2cu ft",
"reference": "MUL-2CF-PRM",
"size": "2 cu ft woven poly bag",
"category": "Mulch",
"unitLabel": "bag",
"unitsPerPallet": 60,
"truckWeightLimitLbs": 47000,
"forecastAnnualUnits": 1400000,
"targetWeight": 31.9,
"weightToleranceLow": 31.2,
"weightToleranceHigh": 32.6,
"targetVolume": 2,
"volumeTolerance": 0.08,
"checkIntervalMinutes": 15,
"baselinePalletsPerTruck": 17.7,
"targetPalletsPerTruck": 21
}
}
}400Example response
json
{
"message": "Weight tolerance low must be ≤ tolerance high."
}In the console
The same thing done by hand, for anyone comparing the API against the screen they already use.