AP Invoice via REST API - GL Analysis Lines

Hi

I can create a group, an AP invoice, and an AP invoice header but I am really struggling to create the GL Analysis code with a GL Account.

I thought I need APInvExp for a GLAccount but it looks like I need APInvExpTGLCs as all my my AP lines are “M” (Miscellaneous)

Is there a guide to the minimum required fields required to a complete AP Invoice load of a type Miscellaneous?

I keep getting back a 400 - Unable to deserialize entity error. That only tells me that something is wrong or missing or incorrect in my object but not exactly what! (unless I am missing something to query in the response object)

APInvExpTGLC is complex and the API documentation at /api/help/v2/odata/Erp.BO.APInvoiceSvc/index.html#/OData/Add_UpdateExt_APInvoices is not clear as to what is need and what is “optional” (the schema

Thanks for any help on this

The BEST guidance is to follow a trace. In REST, you’re trying to mimic the client. So watch what the client does in a successful call.

And I’ll offer the same advice as other threads, do the Epicor work in an Epicor Function and call the function using REST. Reasons given in many other threads often penned by @Aaron_Moreng.

4 Likes

Maybe you and @rthompson can collaborate.
He needs help with the header, and I haven’t had time to dig into it.

Progress in a way.

Seems that the GL Control set over-rides anything sent in request post object. Regardless of setting a GLAccount or the required segments, they are ignored. Further the GL Control and context is set to blank which was why I have been struggling to make sense of the why nothing was showing.

After a good tutorial on GL Controls and Contexts.

Thanks

Hi Sam,

Using REST API OData methods you need make 2 calls.

Add GL Analysis record (provide APInvExp json)
https://server/appserver/api/v1/Erp.BO.APInvoiceSvc/APInvExps
Change the GL Account (provide APInvExpTGLC json)
https://server/appserver/api/v1/Erp.BO.APInvoiceSvc/APInvExpTGLCs

However, it has been confirmed by Epicor support that the second call “/APInvExpTGLCs” has an issue on current latest version, hence you end up with a line with empty account.
Try it and if you get this: “Message”: “Value cannot be null. (Parameter ‘fromItem’)” let us know here.

Trace the Kinetic App on a manual process and call the REST API Custom Method instead.
It does the same thing on a single step. You have to provide the input with, APInvExp and APInvExpTGLC, json.
https://server/appserver/api/v1/Erp.BO.APInvoiceSvc/UpdateMaster

Regards,

Hi Sam, I’m having some issues creating an AP Invoice using the REST API would you be able to provide some insight on how you were able to do so?

Creating an AP Invoice Head with GetNewAPInvHedInvoice REST-API endpoint - ERP 10 - Epicor User Help Forum (epiusers.help)

1 Like