Work Order API - A-Z

Work Order API A-Z

In this example we will demonstrate how to:

  1. Create a Work Order
  2. Delete a component
  3. Add a component
  4. Allocate a component
  5. Add Assembly quantity
  6. Finish a work order

Create a work order

Prerequisite - An existing BOM in Order Time.   

End point - You will be using the work order POST end point.    The payload below is for the Assembly item is A1000 with an ordered quantity of 10 units. 

{
     "$type": "AOLib7.WorkOrder, AOLib7",
    "ItemRef": {
        "Name": "A100001"
    },
    "QuantityOrdered": 10,   
    "Memo": "This and that",
    "Instructions": "Put the dongle next to the doohicky",
    "PromiseDate": "2022-06-10",
    "CustomFields": [
     {
          "Name": "WOCust1",
          "Value": "REf - 4",
          "Caption": "REF"
     }
}

You can  allocate the work order component when a work order is created by checking 'Allocate components when a work order is created.' in Production company preferences

Delete a Component

In the response of the work order POST or work order GET you will see that each WorkOrderComponent will have an Id,  togethter with the DocNo and TranType of the work order you have enough to delete a component using FillLineItem DELETE end point as follows:

https://services.ordertime.com/api/FillLineItem?recordType=3&docNo=373&lineId=7431 

In this example, we are deleting a component from work order 373 having an Id of 7431.

Add a Component

To add a component you use the FillLineItem POST end point.   In this case we are adding component item '112' with a quantity required of 25 units.   The WOPID is the Id of the step into which you are adding the component.  If you wish to add a new Step you can omit WOPID. 

{
    "$type": "AOLib7.WorkOrderComponent, AOLib7",
    "WOPID": 1064,
    "ItemRef": {     
        "Name": "112"   
    },
    "StepRef": {     
        "Name": "Picking"
    },  
    "LineInstructions": "Place item heare",   
    "QuantityRequired": 25.0, 
    "DocNo": 658,
    "TranType": 3
}

You can also allocate the work order component by adding the Quantity property.   

Allocate a component

You can allocate a component using the Bin and Lot or Serial No Quantity Import POST end point.   In this payload we are allocating 25 units for item '112' at line no 5 from the Floor bin. 

{
      "$type": "AOLib7.ImportFillBin, AOLib7",
      "TranType": 3,
      "DocNo": 658,
      "ItemRef": {
          "Name": "112"
       },
       "BinRef": {
          "Name": "Floor"
        },
	"Quantity": 25,   
        "LineNo": 5        
}

Add Assembly quantity

You will add assembly quantity again using the Bin and Lot or Serial No Quantity Import POST end point.   In this payload we are adding 10 units of  lot #   FG9X-001 having an expiration date of Nov 19, 2022 to Bin 1-1-A.    The Assembly on the Work Order will always have 0 as its line no. 

{
      "$type": "AOLib7.ImportDocFillLotOrSerial, AOLib7",
      "TranType": 3,
      "DocNo": 658,
      "ItemRef": {
          "Name": "A100001"
       },
       "BinRef": {
          "Name": "1-1-A"
        },
       "Quantity": 10,   
       "LotOrSerialNo":  "FG9X-0001", 
       "ExpirationDate": "2022-11-19",
       "LineNo": 0        
}

If the Assembly does not Track Lot or Serial Nos.   you can bypass this step and simply change status to finished.   The Ordered Quantity will be the Produced Quanitity and the inventory will be added to the default bin. 

Finish a work order

End point - You will be using the work order PUT end point.

{
    "$type": "AOLib7.WorkOrder, AOLib7",
    "DocNo": 658,
    "TranType": 3,
    "ItemRef": {
        "Name": "A100001"
    },
    "QuantityOrdered": 10,   
    "Memo": "This and that",
    "Instructions": "Put the dongle next to the doohicky",
    "PromiseDate": "2022-06-10",
    "StatusRef": {
        "Name": "Finished"
    },
    "ItemType": 45,
}