Update the actual quantity used of an inventory resource

This web service lets you adjust the actual quantity used (real_qty_used) of an inventory resource in a work order task, independently of the delivered quantity. It works for both integrated and non-integrated warehouses, as long as the resource already has a registered delivery and the new value is less than or equal to the delivered quantity.

When the change is applied, the resource's total cost is recalculated as real_qty_used × unit cost. The delivered quantity, the unit cost and the warehouse stock are not modified.

Input parameters

ParameterTypeRequiredDescription
code_warehousetextYesCode of the warehouse from which the resource was delivered.
code_itemtextYesCode of the item (spare part or tool) associated with the task resource.
output_ordertextYesNumber of the warehouse output order used to deliver the resource.
real_qty_usednumberYesNew actual quantity used. Must be greater than or equal to 0 and less than or equal to the delivered quantity. Decimals are accepted.

Usage rules

  • The resource must have a registered delivery (delivered quantity greater than 0).
  • The resource is identified by the combination of code_warehouse, code_item and output_order.
  • In integrated warehouses with the external-integration zero quantities option enabled, manual adjustment of the actual quantity used is not allowed and the request is rejected with CHECK_WAREHOUSES_MODULE_CONFIGURATION. This validation takes precedence over the comparison against the delivered quantity.
  • If two requests on the same resource arrive at almost the same time, the last one processed prevails.
  • The token must have edit permission on this service. Otherwise, the API responds with 401.

Output parameters

ParameterTypeDescription
successbooleantrue if the actual quantity used was updated successfully.
messagetextResult code. 200 if the operation succeeded.
dataarraynull on success. On error, it contains an object with the ERROR field describing the cause.
totalinteger1 if the resource was updated. 0 on error.

Errors

CodeCause
400REAL_QTY_CANT_BE_MAJOR_THAN_DELIVERED_QTY: real_qty_used is negative or greater than the delivered quantity.
400CHECK_WAREHOUSES_MODULE_CONFIGURATION: the warehouse is integrated and has the external-integration zero quantities option enabled. Check the Warehouses module configuration.
404A required field is missing (code_warehouse, code_item, output_order or real_qty_used).
404The indicated warehouse, item or output order does not exist, or the combination does not match a valid resource.
404The resource has no reg
Language
LoadingLoading…