The PUT method will be used to add a Part to an existing Repair Order.

PUT Method

https://api.karmak.io/api/unity/{version}/unityapi/service/repairorder/fluids

Restrictions

  1. Repair Order must be a valid, open repair order 
    1. Status must = Open, or a status linked to Open (as shown in SVO92200 Repair Order Status Maintenance)
    2. R/O must exist in the branch that was passed in the API request
  2. Repair Order Task must be a valid, open repair order task
    1. Task must = Open, or a status linked to Open (as shown in SVO92210 Repair Task Status)
    2. Task must exist on the R/O that was passed in the API request
  3. Part must be valid, active part number 
    1. Supplier must be valid supplier; part number must exist in that Supplier
    2. Part must exist in the branch that was passed in the API request
    3. The following part types are not allowed
      1. Part Type = Exchange
      2. Part Type = Core
      3. Kit Type = Kit 
      4. Kit Type = Assembly 
      5. Serial Stock Type = Point-of-Sale/Stocking not allowed.
    4. If a part with an invalid part type is passed, a message will be returned stating that the part type is not allowed
  4.  The requested quantity will be pulled from inventory when added to the R/O, and written to Parts Transaction (set application = R/O Detail Parts)
  5. The part will be priced at the customer’s calculated price 
    1. If Override Price is passed in, use override price
      1. If User Permissions do not permit override price, customer’s calculated price will be used, and a message will be returned that price override was not allowed
  6. The Action Flag on the R/O will default to Sale.
    1. If the part requested contains insufficient quantity to fill the requested quantity, set action to Sale - Force Fill
  7. If no Inside Salesperson is passed in, default to user associated with API user
    1. If Inside Salesperson is passed, it must be a valid Fusion user
  8. Technician is not required, but if passed must be a valid Fusion technician number

API Fields

JSON API Field Description Data Type Required? Field Length/Format Fusion Default (will use if not passed in)
Branch Branch associated with Repair Order to which parts will be added string Required    
Repair Order Repair Order number to which parts will be added int Required    
Task Task on Repair Order to which parts will be added short Required    
Part Number Part number being added to the Repair Order string Required Up to 50 alphanumeric characters  
Supplier Supplier of part number being added to the Repair Order string Required    
Quantity Quantity dispensed from the machine; can be whole number or decimal, not to exceed tenths place (ex: 7.4) decimal Required Up to 10 numeric characters  
Rounding Determines how the Quantity should be rounded U = Always round up to nearest whole number (default) D = Always round down to nearest whole number (truncate partial quantity passed; ie, 7.4 becomes 7) string   Up to 1 alpha character; will default to U if no character is passed U - always round up to nearest whole number
OverridePrice Will override the customer’s calculated price.  If Fusion user permissions do not permit override price, customer’s calculated price will be used. decimal   Up to 10 numeric digits   
Inside Salesperson Salesperson for the repair order string   Up to 50 alphanumeric characters Will default to user associated with API user 
Technician Technician requesting the part for the repair order integer   Up to 10 numeric characters  


Sample PUT Request

[
      {
        "Branch" : "01",
        "RepairOrder": 190657,
        "Task" : 1,
        "PartNumber": "2174733676",
        "Supplier" : "LAR",
        "Rounding" : "D",
        "OverridePrice": 19.99,
        "Quantity": "3.9"
    },
     {
        "Branch" : "JBE1",
        "RepairOrder": 528,
        "Task" : 1,
        "PartNumber": "1029-1",
        "Supplier" : "AA-1",
        "Rounding" : "D",
        "Quantity": "2.5"
    },
     {
        "Branch" : "JBE1",
        "RepairOrder": 528,
        "Task" : 1,
        "PartNumber": "1029-1",
        "Supplier" : "AA-1",
        "Rounding" : "D",
        "Quantity": "1.3"
    }
     
]

Response Code (200 OK)

[
    {
        "SystemId": "34069",
        "Branch": "01",
        "RepairOrder": 190657,
        "Task": 1,
        "FillingBranch": "01",
        "Supplier": "LAR",
        "PartNumber": "2174733676",
        "Status": "Success",
        "Message": "Selected Override Price of  19.99 is outside the maximum price change percentage allowed. Part 2174733676."
    },
    {
        "SystemId": "34070",
        "Branch": "JBE1",
        "RepairOrder": 528,
        "Task": 1,
        "FillingBranch": "JBE1",
        "Supplier": "AA-1",
        "PartNumber": "1029-1",
        "Status": "Success",
        "Message": ""
    },
    {
        "SystemId": "34071",
        "Branch": "JBE1",
        "RepairOrder": 528,
        "Task": 1,
        "FillingBranch": "JBE1",
        "Supplier": "AA-1",
        "PartNumber": "1029-1",
        "Status": "Success",
        "Message": ""
    }
]