REST Payload for unallocation & unreservaation of job

Does anyone have a payload example of using REST API v1 to Unallocate & Unreserve for a job.

I think I have to use this endpoint: ....v1/Erp.BO.OrderAllocSvc/UnallocateAndUnreserve
but I can’t figure out the minimum viable payload to do it.

Trace logs shows hundreds of fields in the dataset. I’m trying to do it with POSTMAN and I can’t fill in all those fields because I will only know a bit of data on my webpage about the item that’s in the fulfillment log. I won’t have the entire dataset.

image

Server shows this error:

I think it means that I’m not passing a field that’s needed, however it doesn’t explain which one. Which field do you want Epicor?! Kramer’s voice: Why don’t you just tell me the field you want to see?

It looks like the error is coming from a Post-Processing BPM related to a Web Endpoint. It is coming from the constructor of a Uri, and is being passed a null instead of a valid string.

In case anyone is wondering how to do the actual reservation I got this tiny payload working:

But I can’t do the reverse of that with the unallocation / unreserve endpoint. which is the reason for this post. I ran a trace log and got the xml for the entire request out then converted that to JSON with an online convert tool and then tried to run that as my “ds” but get the same error as when I tried with the SlimOrderAlloc.

You might want to build up your ds in a function, and call that instead, if you have limited data.

Work from the limit, retrieve what you need, and call the bo server side.

1 Like

After much trial and error and a support call with Epicor to help get an example full payload I was able to get the following MVP (Minimum Viable Payload) to Unallocate & Unreserve a Job Material with REST.

This REST endpoint: …v1/Erp.BO.OrderAllocSvc/UnallocateAndUnreserve

With the following JSON Payload (all fields were required)

{
    "ds": {
        "OrderAlloc": [{
                "Company": "SD",               
                "Plant": "MfgSys",              
                "WarehouseCode": "MAIN",                                                
                "SelectedForAction": true,    <--- hardcoded to true
                "JobNum": 551650,
                "AssemblySeq": 0,
                "MtlSeq": 20,               
                "DemandType": "Job",
                "DemandKey1": 551650,         <--- JobNum
                "DemandKey2": 0,              <--- AssemblySeq
                "DemandKey3": 20,             <--- MtlSeq                
                "RowMod": "U"                 <--- hardcoded to "U"
            }]
    }
}

I found that the OrderAlloc’s value had to be an array else it didn’t work, even though there’s only one element in it. I also found that POSTMAN kept saying Sorry something went wrong, even though inside Epicor the job material record was actually unallocated and unreserved.

Maybe this will help someone else in the future.

Also make sure your call settings in POSTMAN are set to something like this:

This. We don’t call any BO’s from outside of Epicor. Only functions. It keeps the Epicor logic inside of Epicor and keeps API calls minimal and clean.

2 Likes