Requisition Patch Through V2 API

I am not a developer by trade just your average systems administrator trying to teach myself new skills. We are trying to create requisitions through an app I created in power apps and I am close. I got the POST working but having troubles with dispatching the req once it is created. From what I understand I need to update the ““CurrDispatcherID”: “”,” to do so. When a req is created within Epicor this is the value that is spit out: ““CurrDispatcherID”: “Purchasing Department”,”. But when I try and PATCH that same value I get this back:

{
  "HttpStatus": 400,
  "ReasonPhrase": "REST API Exception",
  "ErrorMessage": "User ID references invalid value.",
  "ErrorType": "Ice.Common.BusinessObjectException",
  "ErrorDetails": [
    {
      "Message": "User ID references invalid value.",
      "Type": "Error",
      "Table": "ReqHead",
      "Program": "Epicor.RESTApi.Common.dll",
      "Method": "ThrowUpdateExtException",
      "LineNumber": 27,
      "ColumnNumber": 17
    }
  ],
  "CorrelationId": "a74fdeb9-0437-4465-a24e-83511a5daf8b"
}

As soon as I remove the “CurrDispatcherID”: “Purchasing Department” the patch comes back as successful and I can see values that I change getting updated. Any tips would be much appreciated.

There is no dispatcher on the send to purchasing requisition action. You only set the dispatcher on any other requisition actions. You can see this if you manually dispatch in epicor. Dispatcher selection is blank when you pick send to purchasing as the next action.

1 Like

Hi Alisa,

Thank you for your reply. Once the requisition is created what would I need to patch to dispatch my req? Here is what I am currently sending over to create the req:
{
“Company”: “sanitized”,
“OpenReq”: true,
“ReqNum”: 0,
“RequestorID”: “sanitized”,
“ShipName”: “sanitized”,
“StatusDesc”: “Approved”,
“ReqActionID”: “SUBMIT”,
“CurrDispatcherID”: “Purchasing Department”,
“StatusType”: “A”,
“ReqDetails”: [
{
“Company”: “sanitized”,
“ReqNum”: 0,
“ReqLine”: 1,
“LineDesc”: “This is a test”,
“UnitCost”: 1.00,
“DocUnitCost”: 0,
“Taxable”: true,
“PartNum”: “test”,
“Class”: “ISOF”,
“OrderQty”: 2,
“XOrderQty”: 2,
“ExtCost”: 1.00,
“VendorNum”: 700,
“VendorID”: “AMAZON”,
“VendorVendorID”: “AMAZON”,
“ReqDetailAttches”: [
{
}
]
}
],
“ReqHeadAttches”: [
{
}
]
}

Easiest way is to do the dispatch in Kinetic directly with tracing turned on, you will see exactly what data is getting passed.

1 Like