POST
/api/public/v1/qa-specs

Create 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

PropertyTypeDescription
locationIdstringThe plant.
idstringPass an existing spec id to update rather than create.
productNamestring
referencestringYour own identifier for the product — an item code, an internal SKU, a customer part number. Searched alongside the name when listing specs.
sizestringHow the product packs out, e.g. "2 cu ft bag", "5 gal pail".
categorystringYour own grouping for the product, e.g. "Mulch". Free-form.
unitLabelstringSingular noun for one of whatever this is produced as — "bag", "pail", "carton". Defaults to "unit" wherever the app counts them.
targetWeightnumberPounds.
weightToleranceLownumberAcceptable minimum. Must be ≤ the high.
weightToleranceHighnumberAcceptable maximum.
targetVolumenumberCubic feet.
volumeTolerancenumberAllowed absolute deviation from the target.
checkIntervalMinutesnumberHow often a check is expected.
baselinePalletsPerTrucknumberDrives the freight savings figures.
targetPalletsPerTrucknumber
unitsPerPalletnumberWith the average weight the line checks measure, this is what says how many pallets fit under the truck weight limit.
truckWeightLimitLbsnumberUsable payload of a load. Defaults to 47000.
forecastAnnualUnitsnumberUnits 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.
customFieldsarrayYour 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.

Quality → Products
/quality/products
  1. Open Products.
  2. Add or edit a specification.