Details
Description
When calling the Selectline Mobile API endpoint to outsource consumption articles for a production order, the API returns HTTP 500 with the error message:
“Die Lagerungsmenge ist größer als der verfügbare Bestand”
This only happens when the request payload contains multiple entries in warehouse_list (e.g. outsourcing from multiple stocks / storage places). If warehouse_list contains exactly one item, the same outsourcing works.
Steps to reproduce
Pick a production order with a consumption article that exists in more than one warehouse/storage place.
Call POST /productionOrders/{id}/outsource with a payload that includes two or more warehouse_list entries for the outsourcing (same order, multiple warehouse lines).
Observe HTTP 500 with message above.
Repeat with the exact same data but send only one warehouse_list entry → works.
Expected behavior
The API should accept multiple warehouse_list items in a single request and validate each line correctly, or
return a proper client error (4xx) with details, not a 500.
Observed behavior
With multiple warehouse_list items: HTTP 500 “Lagerungsmenge … größer … Bestand”
With one warehouse_list item: success.
Workaround
Split the call into multiple requests, each containing exactly one warehouse_list entry. This avoids the error reliably.
Notes
This looks like the server-side validation aggregates quantities incorrectly when multiple warehouse lines are present in one outsource request (e.g. validating total quantity against the available stock of a single warehouse).
Details
Description
When calling the Selectline Mobile API endpoint to outsource consumption articles for a production order, the API returns HTTP 500 with the error message:
“Die Lagerungsmenge ist größer als der verfügbare Bestand”
This only happens when the request payload contains multiple entries in warehouse_list (e.g. outsourcing from multiple stocks / storage places). If warehouse_list contains exactly one item, the same outsourcing works.
Steps to reproduce
Pick a production order with a consumption article that exists in more than one warehouse/storage place.
Call POST /productionOrders/{id}/outsource with a payload that includes two or more warehouse_list entries for the outsourcing (same order, multiple warehouse lines).
Observe HTTP 500 with message above.
Repeat with the exact same data but send only one warehouse_list entry → works.
Expected behavior
The API should accept multiple warehouse_list items in a single request and validate each line correctly, or
return a proper client error (4xx) with details, not a 500.
Observed behavior
With multiple warehouse_list items: HTTP 500 “Lagerungsmenge … größer … Bestand”
With one warehouse_list item: success.
Workaround
Split the call into multiple requests, each containing exactly one warehouse_list entry. This avoids the error reliably.
Notes
This looks like the server-side validation aggregates quantities incorrectly when multiple warehouse lines are present in one outsource request (e.g. validating total quantity against the available stock of a single warehouse).