POST | /WorkOrder/WorkOrderAllocateMaterials | Allocates materials to a work order. | Uses
your API Key and allocates materials to the Work Order specified by the WorkOrderId.
WorkOrderAllocateMaterials field contains all the information for the materials to be allocated: the ProductSKU and
the AllocateQuantity fields are mandatory. If the material contains serial and/or batch numbers, use the AllocateSerialNumbers and
the AllocateBatchNumbers field to specify the information of the material.
AutoInsertBatchNumbersToProductRows: this field is used to
automatically attach batch numbers to the material that is being allocated, depending on the order that you have selected (e.g. if you want
to attach first the batch numbers that have the closest expiry date, give this field the value ByExpiryDate).
A. Allocate Materials for Work Order with Id 67795.
Value: {
"WorkOrderId": 67795,
"Comments": "Material Allocation",
"WorkOrderAllocateMaterials": [
{
"ProductSKU": "Product 1",
"AllocateQuantity": 2
}
]
}
Response: {
"mvWorkOrder": {
"WorkOrderId": 67795,
"WorkOrderTypeId": -8,
"WorkOrderFinishedGoodTypeId": -9,
"WorkOrderTypeAbbreviation": "WO",
"WorkOrderTypeDescription": "Work order",
"WorkOrderNo": "44",
"WorkOrderFinishedGoodSKU": "Finished Good 1",
"WorkOrderStartDate": "/Date(1684184400000-0000)/",
"WorkOrderDueDate": "/Date(-62135596800000-0000)/",
"WorkOrderPriority": "Medium",
"WorkOrderCurrencyCode": "USD",
"WorkOrderInventoryLocationID": 4442,
"WorkOrderComments": "",
"WorkOrderTags": "",
"WorkOrderReferenceNo": "",
"WorkOrderReferenceApplication": "",
"TopLevelWorkOrderId": 0,
"WorkOrderOrderedQuantity": 15,
"WorkOrderReceivedQuantity": 0,
"WorkOrderTotalMaterialCost": 8.283835057,
"WorkOrderTotalLabourCost": 0,
"WorkOrderTotalOverheadCost": 0,
"WorkOrderFinishedGoodUnitCost": 4.141917529,
"WorkOrderDetails": [
{
"WorkOrderBOMRowProductSKU": "batch-product",
"WorkOrderBOMRowProductDescription": "Product that requires batch numbers",
"WorkOrderBOMRowProductVariant": "",
"WorkOrderBOMRowOrderedQuantity": 15,
"WorkOrderBOMRowTotalAllocatedQuantity": 0,
"WorkOrderBOMRowProductQuantityUnit": "",
"WorkOrderBOMRowRemarks": "",
"WorkOrderRowAllocatedDetails": [
{
"WorkOrderBOMRowAllocatedQuantity": 2,
"WorkOrderBOMRowAllocatedDateTime": "/Date(1685484867053-0000)/",
"WorkOrderBOMRowAllocatedDateTimeFormatted": ""
}
]
},
{
"WorkOrderBOMRowProductSKU": "Product 1",
"WorkOrderBOMRowProductDescription": "Product Description",
"WorkOrderBOMRowProductVariant": "",
"WorkOrderBOMRowOrderedQuantity": 15,
"WorkOrderBOMRowTotalAllocatedQuantity": 0,
"WorkOrderBOMRowProductQuantityUnit": "Kg",
"WorkOrderBOMRowRemarks": "",
"WorkOrderRowAllocatedDetails": [
{
"WorkOrderBOMRowAllocatedQuantity": 2,
"WorkOrderBOMRowAllocatedDateTime": "/Date(1685484948599+0300)/",
"WorkOrderBOMRowAllocatedDateTimeFormatted": ""
}
]
}
],
"WorkOrderStatus": "InProcess",
"WorkOrderCreationDate": "/Date(1684225634023-0000)/",
"WorkOrderLastUpdatedDate": "/Date(1685484948816+0300)/"
},
"ResponseStatus": {
"ErrorCode": "0"
},
"entityID": 67795
}
B. Allocate Materials when product requires Batch Numbers for Work Order with Id 67795 .
Value: {
"WorkOrderId": 67795,
"Comments": "Material Allocation",
"WorkOrderAllocateMaterials": [
{
"ProductSKU": "batch-product",
"AllocateQuantity": 2,
"AllocateBatchNumbers": [
{
"BatchNumberName": "bn2",
"Quantity": 2
}
]
}
]
}
Response: {
"mvWorkOrder": {
"WorkOrderId": 67795,
"WorkOrderTypeId": -8,
"WorkOrderFinishedGoodTypeId": -9,
"WorkOrderTypeAbbreviation": "WO",
"WorkOrderTypeDescription": "Work order",
"WorkOrderNo": "44",
"WorkOrderFinishedGoodSKU": "Finished Good 1",
"WorkOrderStartDate": "/Date(1684184400000-0000)/",
"WorkOrderDueDate": "/Date(-62135596800000-0000)/",
"WorkOrderPriority": "Medium",
"WorkOrderCurrencyCode": "USD",
"WorkOrderInventoryLocationID": 4442,
"WorkOrderComments": "",
"WorkOrderTags": "",
"WorkOrderReferenceNo": "",
"WorkOrderReferenceApplication": "",
"TopLevelWorkOrderId": 0,
"WorkOrderOrderedQuantity": 15,
"WorkOrderReceivedQuantity": 0,
"WorkOrderTotalMaterialCost": 11.611548184,
"WorkOrderTotalLabourCost": 0,
"WorkOrderTotalOverheadCost": 0,
"WorkOrderFinishedGoodUnitCost": 5.805774092,
"WorkOrderDetails": [
{
"WorkOrderBOMRowProductSKU": "batch-product",
"WorkOrderBOMRowProductDescription": "Product that requires batch numbers",
"WorkOrderBOMRowProductVariant": "",
"WorkOrderBOMRowOrderedQuantity": 15,
"WorkOrderBOMRowTotalAllocatedQuantity": 0,
"WorkOrderBOMRowProductQuantityUnit": "",
"WorkOrderBOMRowRemarks": "",
"WorkOrderRowAllocatedDetails": [
{
"WorkOrderBOMRowAllocatedQuantity": 2,
"WorkOrderBOMRowAllocatedDateTime": "/Date(1685485280514+0300)/",
"WorkOrderBOMRowAllocatedDateTimeFormatted": ""
},
{
"WorkOrderBOMRowAllocatedQuantity": 2,
"WorkOrderBOMRowAllocatedDateTime": "/Date(1685484867053-0000)/",
"WorkOrderBOMRowAllocatedDateTimeFormatted": ""
}
]
},
{
"WorkOrderBOMRowProductSKU": "Product 1",
"WorkOrderBOMRowProductDescription": "Product Description",
"WorkOrderBOMRowProductVariant": "",
"WorkOrderBOMRowOrderedQuantity": 15,
"WorkOrderBOMRowTotalAllocatedQuantity": 0,
"WorkOrderBOMRowProductQuantityUnit": "Kg",
"WorkOrderBOMRowRemarks": "",
"WorkOrderRowAllocatedDetails": [
{
"WorkOrderBOMRowAllocatedQuantity": 2,
"WorkOrderBOMRowAllocatedDateTime": "/Date(1685484948600-0000)/",
"WorkOrderBOMRowAllocatedDateTimeFormatted": ""
}
]
}
],
"WorkOrderStatus": "InProcess",
"WorkOrderCreationDate": "/Date(1684225634023-0000)/",
"WorkOrderLastUpdatedDate": "/Date(1685485280643+0300)/"
},
"ResponseStatus": {
"ErrorCode": "0"
},
"entityID": 67795
}
|
---|