REST - Labor with CoParts

I’m trying to receive labor co-parts with the REST v1 API in E10.

I’m not sure the workflow I’m supposed to use but I keep getting errors when trying to do anything with LaborPart which is where Epicor stores co-part labor information.

Here’s one error I’m getting.

Also getting the always helpful: object reference not set to an instance of an object

I’m testing with POSTMAN.

It seems you need three main sections in the REST call, LaborHed, LaborDtl, and LaborPart. I’m setting them as shown on the Swagger help page but alas it’s just a big failure.

Has anyone received coparts with REST? Do you know what order I should send the REST calls in? I know you have to end activity before you can add the LaborPart call, and even then the Labor has to be TimeStatus = E and such that you can update it.

Just in case this helps someone else in the weeds…

I found that the field MESProcessing was set to TRUE in my JSON. This was causing Epicor to try to do some extra UI processing. Setting it to false when doing REST got by that error.

So the lesson here is if you get that error (object reference not set to an instance of an object) when doing REST, it might be that something a BPM or a BO is trying to do some stuff with the UI that is non-existant.