REST Api to create Part with PartRev

Hello,

Im tryng to create Part with REST API using Erp.BO.PartSvc endpoint, but I cannot seem to create the PartRev for this.

Here is the Json I POST to create it. any help will be appreciated.

{
    "Company": "CompA",
    "PartNum": "<NewPartNum>",
    "PartDescription" : "newDesc",
    "TypeCode":"M",
    "IUM":"ea",
    "PUM":"ea",
    "UsePartRev":true,
    "SalesUM":"ea",
    "Revision":true,
    "PartRevs":[
        {
            "Company" :"CompA",
            "PartNum" :"<NewPartNum>",
            "RevisionNum" : "A",
            "RevShortDesc" : "A",
            "RevDescription" : "Created by XXXXX",
            "EffectiveDate" : "2023-01-24T12:04:13.79+11:00",
            "PartDescriptionPartDescription":"newDesc"
        }
    ]
}

That looks mostly correct, remove the PartDescriptionPartDescription from the PartRev object, and remove the Revision field from the Part object. Those are both calculated fields, you usually don’t set those.

Hey Joseph,

Yeah i tried removing the field which are readonly and calculated fields. It still doesn’t create the Revisions.

I tried to create the PartRev seperately by using it in the API POST
.../Erp.BO.PartSvc/PartRevs
with body

{
    "Company": "CompA",
    "PartNum": "PartNum",
    "RevisionNum": "A",
    "RevDescription": "Created by XXXXX"
}

I always receive 404 ERROR

{
    "HttpStatus": 404,
    "ReasonPhrase": "REST API Exception",
    "ErrorMessage": "Entity PartRev with specified keys is not found",
    "ErrorType": "Epicor.RESTApi.ErrorHandling.ApiException",
    "CorrelationId": "c961805b-97b0-44ac-8a96-46cb039f6d28"
}

I even tried to create using the custom method API ...\Erp.BO.PartSvc/GetNewPartRev

Which clearly doesnt have any useful return message or JSON

Try adding Plant to your part rev query, all my working requests have that in the json.

What version of Epicor are you running?

At a minimum you should include the ‘AltMethod’ property, it is part of a PartRev’s key.

If you are running Kinetic 11.2 there is a new property called ProcessMfgID which is also now part of the PartRev key.

You may need to include them both, and set them to an empty string.

Hey Guys,

Thank you for all your input. The issue was the admin had some misconfiguration on the user setup.
With the JSON i posted im able to create revisions

Thanks.