Stock Lots V2
Update stock lot
Changed onUpdate a stock lot
Updates a stock lot's quantity, listed status, location, or notes. Verifies ownership before allowing updates and prevents negative quantities. Triggers automatic recalculation of quantity_available in the parent listing_items record.
Requirements:
- 20.1: PUT /api/v2/stock-lots/:id endpoint
- 20.2: Accept quantity_total update
- 20.3: Accept listed status update
- 20.4: Accept location_id update
- 20.5: Accept notes update
- 20.6: Verify ownership before updates
- 20.7: Trigger quantity_available recalculation
- 20.8: Prevent negative quantities
- 20.9: Log modifications to audit trail
- 20.10: Return updated stock lot with variant information
- 20.11: Validate notes length (max 1000 characters)
- 20.12: Use database transaction for atomicity
put/stock-lots/{id}
Request
- Base URL: /api/v2 (relative, and the document was published on a file host, not at the API’s origin)
- URL: /api/v2/stock-lots/{id}
- Auth: loggedin (a scheme the document does not define)
Path parameters
idstring required
Stock lot UUID
Request body
Response
Updated stock lot
Changes
- ○
added the required property
/to the response with the status - ○
added the required property
/to the response with the status
- ○
- ○
added the required property
/to the response with the status
- ○