Suggest Product Density
POST/api/manufacturing/products/:product/density/suggest
Ask the account's configured AI model for a density suggestion based on the product's name, SKU, brand, default supplier and purchase unit. Nothing is stored: the caller confirms the value through Update Product Density with source=ai_lookup (and may pass the suggestion back in suggestion so it is kept on the activity log). Suggestions are cached per account for 30 days on the product name + supplier, so repeating the call for the same ingredient returns the cached answer (cached: true) without spending quota. Uncached calls count against the per-user hourly AI quota configured for the account.
Auth: requires Bearer token.
Path param: product = product id.
manufacturing:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Response fields: density_g_per_ml (suggested value at 20 °C, between 0.01 and 30), density_lb_per_gal and specific_gravity (the same value converted), confidence (high | medium | low — low means the model could not identify the substance or it has no meaningful density), basis (one line naming the assumed substance, grade, concentration and temperature), notes (caveats, or null), alternatives (up to 3 other grades or types, each with label and density_g_per_ml), cached, model.
Errors: 503 when AI look-up is off for the account or the active provider has no API key (ai_lookup_available=false on Get Product Density); 429 when the caller has used this hour's quota or the provider is rate-limiting — carries retry_after_seconds in the body and a Retry-After header; 502 when the provider request failed, authentication with the provider failed, or the answer did not pass validation (value out of range, unknown confidence, more than 3 alternatives); 504 when the provider timed out.
Request
Responses
- 200
- 401
- 403
- 404
- 422
- 429
- 502
- 503
- 504
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Validation failed — the body is a field → messages map (Laravel shape) or the platform envelope with a stable machine-readable code. Fix the payload and resubmit.
Too Many Requests
Response Headers
Bad Gateway
Response Headers
Service Unavailable
Response Headers
Gateway Timeout