Megaventory API v2017a

<back to all web services

WorkOrderUpdate

The following routes are available for this service:
POST/WorkOrder/WorkOrderUpdateInserts/Updates a work order.Uses your API Key and applies a mvRecordAction value on an mvWorkOrder object. We can insert the mvWorkOrder object we specified using "Insert" as our mvRecordAction. Optionally, you can use mvInsertUpdateDeleteSourceApplication when an external application ( eg WooCommerce ) is the one that triggers the WorkOrderUpdate call. WorkOrderFinishedGoodSKU must be inserted in the mvWorkOrder object.

Examples:



A.

Insert a new work order that has a high priority, needs to be done by 12:00 on 25/12/2017 on Inventory Location with Id 4 and add some comments to describe it.

Value:

 {
   "mvWorkOrder": {
      "WorkOrderFinishedGoodSKU": "dvd-w-case-gdf1",
      "WorkOrderInventoryLocationId": "4",
      "WorkOrderDueDate": "3/28/2021, 1:33:11 PM",
      "WorkOrderPriority": "High",
      "WorkOrderOrderedQuantity": 1,
      "WorkOrderComments": "Need to get this done as soon and as efficiently as possible"
   },
   "mvRecordAction": "Insert"
}  


Response:

{
   "mvWorkOrder": {
      "WorkOrderId": 75,
      "WorkOrderNo": "4",
      "WorkOrderFinishedGoodSKU": "dvd-w-case-gdf1",
      "WorkOrderStartDate": "/Date(1507582800000+0300)/",
      "WorkOrderDueDate": "/Date(-62135596800000-0000)/",
      "WorkOrderPriority": "High",
      "WorkOrderCurrencyCode": "EUR",
      "WorkOrderInventoryLocationID": 4,
      "WorkOrderComments": "Need to get this done as soon and as efficiently as possible",
      "WorkOrderTags": "",
      "WorkOrderReferenceNo": "",
      "WorkOrderReferenceApplication": "",
      "TopLevelWorkOrderId": 0,
      "WorkOrderOrderedQuantity": 1,
      "WorkOrderReceivedQuantity": 0,
      "WorkOrderTotalMaterialCost": 0,
      "WorkOrderTotalLabourCost": 0,
      "WorkOrderTotalOverheadCost": 0,
      "WorkOrderFinishedGoodUnitCost": 0,
      "WorkOrderDetails": [],
      "WorkOrderStatus": "Pending",
      "WorkOrderCreationDate": "/Date(-62135596800000-0000)/",
      "WorkOrderLastUpdatedDate": "/Date(-62135596800000-0000)/"
   },
   "ResponseStatus": {
      "ErrorCode": "0"
   },
   "entityID": 75
} 

To override the Content-type in your clients HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /csv/reply/WorkOrderUpdate HTTP/1.1 
Host: api.megaventory.com 
Content-Type: text/csv
Content-Length: length

WorkOrderId,WorkOrderTypeId,WorkOrderFinishedGoodTypeId,WorkOrderTypeAbbreviation,WorkOrderTypeDescription,WorkOrderNo,WorkOrderFinishedGoodSKU,WorkOrderStartDate,WorkOrderDueDate,WorkOrderPriority,WorkOrderCurrencyCode,WorkOrderInventoryLocationID,WorkOrderComments,WorkOrderTags,WorkOrderReferenceNo,WorkOrderReferenceApplication,TopLevelWorkOrderId,WorkOrderOrderedQuantity,WorkOrderReceivedQuantity,WorkOrderTotalMaterialCost,WorkOrderTotalLabourCost,WorkOrderTotalOverheadCost,WorkOrderFinishedGoodUnitCost,WorkOrderDetails,WorkOrderStatus,WorkOrderCreationDate,WorkOrderLastUpdatedDate
0,0,0,String,String,String,String,0001-01-01,0001-01-01,Medium,String,0,String,String,String,String,0,0,0,0,0,0,0,"[{WorkOrderBOMRowProductSKU:String,WorkOrderBOMRowProductDescription:String,WorkOrderBOMRowProductVariant:String,WorkOrderBOMRowOrderedQuantity:0,WorkOrderBOMRowTotalAllocatedQuantity:0,WorkOrderBOMRowProductQuantityUnit:String,WorkOrderBOMRowRemarks:String,WorkOrderRowAllocatedDetails:[{WorkOrderBOMRowAllocatedQuantity:0,WorkOrderBOMRowAllocatedDateTime:0001-01-01,WorkOrderBOMRowAllocatedDateTimeFormatted:String,WorkOrderBOMRowAllocatedSerialNumbers:[String],WorkOrderBOMRowAllocatedBatchNumbers:[{BatchNumberName:String,ExpiryDate:0001-01-01,AssignedQTYInDetail:0}]}]}]",Pending,0001-01-01,0001-01-01

HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

WorkOrderId,WorkOrderTypeId,WorkOrderFinishedGoodTypeId,WorkOrderTypeAbbreviation,WorkOrderTypeDescription,WorkOrderNo,WorkOrderFinishedGoodSKU,WorkOrderStartDate,WorkOrderDueDate,WorkOrderPriority,WorkOrderCurrencyCode,WorkOrderInventoryLocationID,WorkOrderComments,WorkOrderTags,WorkOrderReferenceNo,WorkOrderReferenceApplication,TopLevelWorkOrderId,WorkOrderOrderedQuantity,WorkOrderReceivedQuantity,WorkOrderTotalMaterialCost,WorkOrderTotalLabourCost,WorkOrderTotalOverheadCost,WorkOrderFinishedGoodUnitCost,WorkOrderDetails,WorkOrderStatus,WorkOrderCreationDate,WorkOrderLastUpdatedDate
0,0,0,String,String,String,String,0001-01-01,0001-01-01,Medium,String,0,String,String,String,String,0,0,0,0,0,0,0,"[{WorkOrderBOMRowProductSKU:String,WorkOrderBOMRowProductDescription:String,WorkOrderBOMRowProductVariant:String,WorkOrderBOMRowOrderedQuantity:0,WorkOrderBOMRowTotalAllocatedQuantity:0,WorkOrderBOMRowProductQuantityUnit:String,WorkOrderBOMRowRemarks:String,WorkOrderRowAllocatedDetails:[{WorkOrderBOMRowAllocatedQuantity:0,WorkOrderBOMRowAllocatedDateTime:0001-01-01,WorkOrderBOMRowAllocatedDateTimeFormatted:String,WorkOrderBOMRowAllocatedSerialNumbers:[String],WorkOrderBOMRowAllocatedBatchNumbers:[{BatchNumberName:String,ExpiryDate:0001-01-01,AssignedQTYInDetail:0}]}]}]",Pending,0001-01-01,0001-01-01