Megaventory API v2017a

<back to all web services

WorkOrderReturnMaterials

The following routes are available for this service:
POST/WorkOrder/WorkOrderReturnMaterialsReturns materials from a work order.Uses your API Key and returns already allocated materials from a Work Order specified by the WorkOrderId

Examples:



A.

Return the material Sugar with quantity of 1 a Work Order with Id 21729.

Value:

 {
    "WorkOrderId":21729,
    "WorkOrderReturnMaterials":[
        {
            "ProductSKU":"Sugar",
            "ReturnQuantity":1
        }
    ]       
}  


Response:

{
  "mvWorkOrder": {
    "WorkOrderId": 21729,
    "WorkOrderTypeId": -8,
    "WorkOrderFinishedGoodTypeId": -9,
    "WorkOrderTypeAbbreviation": "PROD-O",
    "WorkOrderTypeDescription": "Production Order",
    "WorkOrderNo": "3",
    "WorkOrderFinishedGoodSKU": "Cappuccino",
    "WorkOrderStartDate": "/Date(1685307600000-0000)/",
    "WorkOrderDueDate": "/Date(1690491600000-0000)/",
    "WorkOrderPriority": "High",
    "WorkOrderCurrencyCode": "EUR",
    "WorkOrderInventoryLocationID": 1011,
    "WorkOrderComments": "Need to get this done as soon and as efficiently as possible",
    "WorkOrderTags": "",
    "WorkOrderReferenceNo": "",
    "WorkOrderReferenceApplication": "",
    "TopLevelWorkOrderId": 0,
    "WorkOrderOrderedQuantity": 3,
    "WorkOrderReceivedQuantity": 0,
    "WorkOrderTotalMaterialCost": 0,
    "WorkOrderTotalLabourCost": 0,
    "WorkOrderTotalOverheadCost": 0,
    "WorkOrderFinishedGoodUnitCost": 0,
    "WorkOrderDetails": [
      {
        "WorkOrderBOMRowProductSKU": "Sugar",
        "WorkOrderBOMRowProductDescription": "Coffee Ingredient",
        "WorkOrderBOMRowProductVariant": "",
        "WorkOrderBOMRowOrderedQuantity": 3,
        "WorkOrderBOMRowTotalAllocatedQuantity": 0,
        "WorkOrderBOMRowProductQuantityUnit": "",
        "WorkOrderBOMRowRemarks": "",
        "WorkOrderRowAllocatedDetails": []
      },
      {
        "WorkOrderBOMRowProductSKU": "Milk",
        "WorkOrderBOMRowProductDescription": "Coffee Ingredient",
        "WorkOrderBOMRowProductVariant": "",
        "WorkOrderBOMRowOrderedQuantity": 6,
        "WorkOrderBOMRowTotalAllocatedQuantity": 0,
        "WorkOrderBOMRowProductQuantityUnit": "",
        "WorkOrderBOMRowRemarks": "",
        "WorkOrderRowAllocatedDetails": [
          {
            "WorkOrderBOMRowAllocatedQuantity": 2,
            "WorkOrderBOMRowAllocatedDateTime": "/Date(1685367982363-0000)/",
            "WorkOrderBOMRowAllocatedDateTimeFormatted": ""
          }
        ]
      },
      {
        "WorkOrderBOMRowProductSKU": "Coffee",
        "WorkOrderBOMRowProductDescription": "Coffee Ingredient",
        "WorkOrderBOMRowProductVariant": "",
        "WorkOrderBOMRowOrderedQuantity": 9,
        "WorkOrderBOMRowTotalAllocatedQuantity": 0,
        "WorkOrderBOMRowProductQuantityUnit": "",
        "WorkOrderBOMRowRemarks": "",
        "WorkOrderRowAllocatedDetails": [
          {
            "WorkOrderBOMRowAllocatedQuantity": 3,
            "WorkOrderBOMRowAllocatedDateTime": "/Date(1685367982377-0000)/",
            "WorkOrderBOMRowAllocatedDateTimeFormatted": ""
          }
        ]
      }
    ],
    "WorkOrderStatus": "InProcess",
    "WorkOrderCreationDate": "/Date(1685358169057-0000)/",
    "WorkOrderLastUpdatedDate": "/Date(1685613896122+0300)/"
  },
  "ResponseStatus": {
    "ErrorCode": "0"
  },
  "entityID": 21729
}

 

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/WorkOrderReturnMaterials HTTP/1.1 
Host: api.megaventory.com 
Content-Type: text/csv
Content-Length: length

ProductSKU,ReturnQuantity,ReturnSerialNumbers,ReturnBatchNumbers
String,0,[String],"[{BatchNumberName:String,ExpiryDate:0001-01-01,Quantity:0}]"

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