Megaventory API v2017a

<back to all web services

WorkOrderUpdate

Inserts/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 .soap11 suffix or ?format=soap11

HTTP + SOAP11

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

POST /soap11 HTTP/1.1 
Host: api.megaventory.com 
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: WorkOrderUpdate

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>

<WorkOrderUpdate xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <APIKEY>String</APIKEY>
  <mvWorkOrder xmlns:d2p1="https://api.megaventory.com/types">
    <d2p1:WorkOrderId>0</d2p1:WorkOrderId>
    <d2p1:WorkOrderTypeId>0</d2p1:WorkOrderTypeId>
    <d2p1:WorkOrderFinishedGoodTypeId>0</d2p1:WorkOrderFinishedGoodTypeId>
    <d2p1:WorkOrderTypeAbbreviation>String</d2p1:WorkOrderTypeAbbreviation>
    <d2p1:WorkOrderTypeDescription>String</d2p1:WorkOrderTypeDescription>
    <d2p1:WorkOrderNo>String</d2p1:WorkOrderNo>
    <d2p1:WorkOrderFinishedGoodSKU>String</d2p1:WorkOrderFinishedGoodSKU>
    <d2p1:WorkOrderStartDate>0001-01-01T00:00:00</d2p1:WorkOrderStartDate>
    <d2p1:WorkOrderDueDate>0001-01-01T00:00:00</d2p1:WorkOrderDueDate>
    <d2p1:WorkOrderPriority>Medium</d2p1:WorkOrderPriority>
    <d2p1:WorkOrderCurrencyCode>String</d2p1:WorkOrderCurrencyCode>
    <d2p1:WorkOrderInventoryLocationID>0</d2p1:WorkOrderInventoryLocationID>
    <d2p1:WorkOrderComments>String</d2p1:WorkOrderComments>
    <d2p1:WorkOrderTags>String</d2p1:WorkOrderTags>
    <d2p1:WorkOrderReferenceNo>String</d2p1:WorkOrderReferenceNo>
    <d2p1:WorkOrderReferenceApplication>String</d2p1:WorkOrderReferenceApplication>
    <d2p1:TopLevelWorkOrderId>0</d2p1:TopLevelWorkOrderId>
    <d2p1:WorkOrderOrderedQuantity>0</d2p1:WorkOrderOrderedQuantity>
    <d2p1:WorkOrderReceivedQuantity>0</d2p1:WorkOrderReceivedQuantity>
    <d2p1:WorkOrderTotalMaterialCost>0</d2p1:WorkOrderTotalMaterialCost>
    <d2p1:WorkOrderTotalLabourCost>0</d2p1:WorkOrderTotalLabourCost>
    <d2p1:WorkOrderTotalOverheadCost>0</d2p1:WorkOrderTotalOverheadCost>
    <d2p1:WorkOrderFinishedGoodUnitCost>0</d2p1:WorkOrderFinishedGoodUnitCost>
    <d2p1:WorkOrderDetails>
      <d2p1:mvWorkOrderRow>
        <d2p1:WorkOrderBOMRowProductSKU>String</d2p1:WorkOrderBOMRowProductSKU>
        <d2p1:WorkOrderBOMRowProductDescription>String</d2p1:WorkOrderBOMRowProductDescription>
        <d2p1:WorkOrderBOMRowProductVariant>String</d2p1:WorkOrderBOMRowProductVariant>
        <d2p1:WorkOrderBOMRowOrderedQuantity>0</d2p1:WorkOrderBOMRowOrderedQuantity>
        <d2p1:WorkOrderBOMRowTotalAllocatedQuantity>0</d2p1:WorkOrderBOMRowTotalAllocatedQuantity>
        <d2p1:WorkOrderBOMRowProductQuantityUnit>String</d2p1:WorkOrderBOMRowProductQuantityUnit>
        <d2p1:WorkOrderBOMRowRemarks>String</d2p1:WorkOrderBOMRowRemarks>
        <d2p1:WorkOrderRowAllocatedDetails>
          <d2p1:mvWorkOrderRowAllocatedDetails>
            <d2p1:WorkOrderBOMRowAllocatedQuantity>0</d2p1:WorkOrderBOMRowAllocatedQuantity>
            <d2p1:WorkOrderBOMRowAllocatedDateTime>0001-01-01T00:00:00</d2p1:WorkOrderBOMRowAllocatedDateTime>
            <d2p1:WorkOrderBOMRowAllocatedDateTimeFormatted>String</d2p1:WorkOrderBOMRowAllocatedDateTimeFormatted>
            <d2p1:WorkOrderBOMRowAllocatedSerialNumbers xmlns:d7p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
              <d7p1:string>String</d7p1:string>
            </d2p1:WorkOrderBOMRowAllocatedSerialNumbers>
            <d2p1:WorkOrderBOMRowAllocatedBatchNumbers>
              <d2p1:BatchNumberDetails>
                <d2p1:AssignedQTYInDetail>0</d2p1:AssignedQTYInDetail>
                <d2p1:BatchNumberName>String</d2p1:BatchNumberName>
                <d2p1:ExpiryDate>0001-01-01T00:00:00</d2p1:ExpiryDate>
              </d2p1:BatchNumberDetails>
            </d2p1:WorkOrderBOMRowAllocatedBatchNumbers>
          </d2p1:mvWorkOrderRowAllocatedDetails>
        </d2p1:WorkOrderRowAllocatedDetails>
      </d2p1:mvWorkOrderRow>
    </d2p1:WorkOrderDetails>
    <d2p1:WorkOrderStatus>Pending</d2p1:WorkOrderStatus>
    <d2p1:WorkOrderCreationDate>0001-01-01T00:00:00</d2p1:WorkOrderCreationDate>
    <d2p1:WorkOrderLastUpdatedDate>0001-01-01T00:00:00</d2p1:WorkOrderLastUpdatedDate>
  </mvWorkOrder>
  <mvRecordAction>Insert</mvRecordAction>
  <mvInsertUpdateDeleteSourceApplication>String</mvInsertUpdateDeleteSourceApplication>
</WorkOrderUpdate>

    </soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>

<WorkOrderUpdateResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Megaventory.APIEndpoints.Operations">
  <mvWorkOrder xmlns:d2p1="https://api.megaventory.com/types">
    <d2p1:WorkOrderId>0</d2p1:WorkOrderId>
    <d2p1:WorkOrderTypeId>0</d2p1:WorkOrderTypeId>
    <d2p1:WorkOrderFinishedGoodTypeId>0</d2p1:WorkOrderFinishedGoodTypeId>
    <d2p1:WorkOrderTypeAbbreviation>String</d2p1:WorkOrderTypeAbbreviation>
    <d2p1:WorkOrderTypeDescription>String</d2p1:WorkOrderTypeDescription>
    <d2p1:WorkOrderNo>String</d2p1:WorkOrderNo>
    <d2p1:WorkOrderFinishedGoodSKU>String</d2p1:WorkOrderFinishedGoodSKU>
    <d2p1:WorkOrderStartDate>0001-01-01T00:00:00</d2p1:WorkOrderStartDate>
    <d2p1:WorkOrderDueDate>0001-01-01T00:00:00</d2p1:WorkOrderDueDate>
    <d2p1:WorkOrderPriority>Medium</d2p1:WorkOrderPriority>
    <d2p1:WorkOrderCurrencyCode>String</d2p1:WorkOrderCurrencyCode>
    <d2p1:WorkOrderInventoryLocationID>0</d2p1:WorkOrderInventoryLocationID>
    <d2p1:WorkOrderComments>String</d2p1:WorkOrderComments>
    <d2p1:WorkOrderTags>String</d2p1:WorkOrderTags>
    <d2p1:WorkOrderReferenceNo>String</d2p1:WorkOrderReferenceNo>
    <d2p1:WorkOrderReferenceApplication>String</d2p1:WorkOrderReferenceApplication>
    <d2p1:TopLevelWorkOrderId>0</d2p1:TopLevelWorkOrderId>
    <d2p1:WorkOrderOrderedQuantity>0</d2p1:WorkOrderOrderedQuantity>
    <d2p1:WorkOrderReceivedQuantity>0</d2p1:WorkOrderReceivedQuantity>
    <d2p1:WorkOrderTotalMaterialCost>0</d2p1:WorkOrderTotalMaterialCost>
    <d2p1:WorkOrderTotalLabourCost>0</d2p1:WorkOrderTotalLabourCost>
    <d2p1:WorkOrderTotalOverheadCost>0</d2p1:WorkOrderTotalOverheadCost>
    <d2p1:WorkOrderFinishedGoodUnitCost>0</d2p1:WorkOrderFinishedGoodUnitCost>
    <d2p1:WorkOrderDetails>
      <d2p1:mvWorkOrderRow>
        <d2p1:WorkOrderBOMRowProductSKU>String</d2p1:WorkOrderBOMRowProductSKU>
        <d2p1:WorkOrderBOMRowProductDescription>String</d2p1:WorkOrderBOMRowProductDescription>
        <d2p1:WorkOrderBOMRowProductVariant>String</d2p1:WorkOrderBOMRowProductVariant>
        <d2p1:WorkOrderBOMRowOrderedQuantity>0</d2p1:WorkOrderBOMRowOrderedQuantity>
        <d2p1:WorkOrderBOMRowTotalAllocatedQuantity>0</d2p1:WorkOrderBOMRowTotalAllocatedQuantity>
        <d2p1:WorkOrderBOMRowProductQuantityUnit>String</d2p1:WorkOrderBOMRowProductQuantityUnit>
        <d2p1:WorkOrderBOMRowRemarks>String</d2p1:WorkOrderBOMRowRemarks>
        <d2p1:WorkOrderRowAllocatedDetails>
          <d2p1:mvWorkOrderRowAllocatedDetails>
            <d2p1:WorkOrderBOMRowAllocatedQuantity>0</d2p1:WorkOrderBOMRowAllocatedQuantity>
            <d2p1:WorkOrderBOMRowAllocatedDateTime>0001-01-01T00:00:00</d2p1:WorkOrderBOMRowAllocatedDateTime>
            <d2p1:WorkOrderBOMRowAllocatedDateTimeFormatted>String</d2p1:WorkOrderBOMRowAllocatedDateTimeFormatted>
            <d2p1:WorkOrderBOMRowAllocatedSerialNumbers xmlns:d7p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
              <d7p1:string>String</d7p1:string>
            </d2p1:WorkOrderBOMRowAllocatedSerialNumbers>
            <d2p1:WorkOrderBOMRowAllocatedBatchNumbers>
              <d2p1:BatchNumberDetails>
                <d2p1:AssignedQTYInDetail>0</d2p1:AssignedQTYInDetail>
                <d2p1:BatchNumberName>String</d2p1:BatchNumberName>
                <d2p1:ExpiryDate>0001-01-01T00:00:00</d2p1:ExpiryDate>
              </d2p1:BatchNumberDetails>
            </d2p1:WorkOrderBOMRowAllocatedBatchNumbers>
          </d2p1:mvWorkOrderRowAllocatedDetails>
        </d2p1:WorkOrderRowAllocatedDetails>
      </d2p1:mvWorkOrderRow>
    </d2p1:WorkOrderDetails>
    <d2p1:WorkOrderStatus>Pending</d2p1:WorkOrderStatus>
    <d2p1:WorkOrderCreationDate>0001-01-01T00:00:00</d2p1:WorkOrderCreationDate>
    <d2p1:WorkOrderLastUpdatedDate>0001-01-01T00:00:00</d2p1:WorkOrderLastUpdatedDate>
  </mvWorkOrder>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
      </d2p1:ResponseError>
    </d2p1:Errors>
  </ResponseStatus>
  <entityID>0</entityID>
  <InternalErrorCode>String</InternalErrorCode>
</WorkOrderUpdateResponse>

    </soap:Body>
</soap:Envelope>