Save Part
Create or update a part definition and its due-date rules in one call. Pass attachStockID to add it to one stock item; it is also added to every other stock item of that product. categories groups the part with others that share a label. When that item is already in use, pass nextDue as remaining until the next check (due in 3000km, 10 bookings, 14 days) — do not compute last-check dates. Saving re-runs due checks on every stock item that has this part. App connections need the booking:write or inventory:write scope.
curl -X POST "https://dash.lockii.app/api/v1/maintenance-part" \
-H "x-api-key: $LOCKII_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "string"
}'Authorization
x-api-keystringheaderAPI key from Settings → Integrations → API.
AuthorizationstringheaderThe same API key, or an OAuth access token, sent as Authorization: Bearer.
api_keystringqueryAPI key query parameter.
Body
attachStockIDstringAttach the new part to this stock item
categoriesstring[]One category for this part, such as Brakes or Wheels. Reuse a name already used on another part when it fits. Extra names are ignored. Omit to leave the category unchanged.
iconstring | nullidstringPart/schedule ID. Generated if omitted.
namestringrequiredPart name
nextDueobject[]Remaining until the next check for each interval rule. Prefer this over last-check dates. Omit only when the item is unused or just serviced. If they give a current odometer, pass it in readings first.
publiclyReportablebooleanCustomers can report issues against this part
readingsmap of __schema0Current meter readings to snapshot against, e.g. { distance_km: 45000 }. Live GPS and stock readings are used automatically if omitted.
triggersobject[]Default:[]
Response
JSON result for this operation.
{}