Solved

Data validation through API calls.

  • 17 May 2021
  • 2 replies
  • 161 views

Hi Everyone, 

    Hope you are doing well.

    I am new to Acumatica. I have a few questions regarding the data validation, hoping someone can help me out on this.

    When I tried to test creating / updating records through API service, I noticed a few issues. For instance:

  1. When creating an invoice with an invalid type value in the payload. The application doesn’t response with error message, like “the invoice type is wrong”. Instead, an invoice with bad data is created. See screenshot #1. Once it happened, all other request of updating / creating invoice will fail.
  2. When creating an invoice with invalid details. For instance, if I create an invoice record with two items in “Details”, The first item has an invalid inventory id, then the second item has the valid inventory id. Acumatica will accept with this request, then create an invoice. But the details in the created invoice, the first item will have empty value in the “Inventory ID” value.
  3. When updating a closed invoice through API. Acumatica accepts the request and payload, but without invoke any actual updates. I understand a closed invoice can not be updated through UI, but it is hard to tell via an API call.

In summarize, we wonder if the payload can be verified before being submitted. Acumatica accepts the request only when all values are good, otherwise the request should be rejected.

icon

Best answer by frederickodendaal77 6 April 2023, 15:43

View original

2 replies

Userlevel 3
Badge

Hi Yren, did you get a solution to this? I am experiencing the same problem.

Userlevel 3
Badge

I created this package and it prevents you from saving the invoice if one of the lines you send on the API contains an inventoryID that does not exist in the system.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved