One of the biggest draws to the Acumatica Platform is its robust and easy-to-use API. Here I will show you how you can extend a web service endpoint and add custom entities to an object. A client of ours had a requirement to bring in tax details from another system into a Cash Sales Document.
In some cases, reporting transactions from another system like Lightspeed are required to be entered as Cash Sales Documents in Acumatica without recalculating them. We wanted to avoid decimal value discrepancies due to recalculations within another system. The goal was to pull in the tax rates and taxable amounts from Lightspeed as is into Acumatica. The desired result is in the screenshot below and the steps following will get you there.
There is a tax details section in the Cash Sales document but it was not exposed by the API.
If you are using Acumatica 2020R2 or later, you will need to take the Default endpoint in version 20.200.001 and extend it. Give the endpoint a name and a version number. Typically, I match the version number from the one I am extending, as you can see in the example below in Endpoint version 20.200.001.
I try to match the endpoint version number with the one I am extending for consistency purposes:
Once the endpoint has been extended, you go to the top level of the object (Cash Sales), and click on INSERT, you will see the following entry screen.
I populate the information required to create a tax detail object at the detail level:
From there, I add the necessary fields to the newly defined details object that already exists within Acumatica.
In order to test the extended API, we leverage the Postman utility which is used in Acumatica’s Integrations Certification. Using Postman, I confirm that the TaxDetails object is working as expected.
And here is the code you can access in Github with a link to the GIST.
As you can see, this is a pretty easy and straightforward process, which is highly efficient using a low code/no code approach that the Acumatica platform provides for trivial developer tasks. All the goodness of a robust REST API with the flexibility of extending it with custom objects and pulling in existing fields.