Skip to main content
Question

REST API Not Returning Error for an Invalid Account on Bill Detail


I am using the Acumatica REST API to create vendor bills. I am using the "Default" endpoint, version 24.200.001. I see the same behavior in older versions of the API too.

When I submit a bill with an invalid account number on a bill detail line, the vendor's default expense account is used and no error is returned unless there is also an error with another field. The bill is successfully created and the response code is 200.

Other bill detail line fields do not behave this way. For example, if I pass an invalid value for the Branch or Subaccount fields the bill is not created and the response code is 422.

If I submit invalid values for both Account and Subaccount, the call fails but only the error for the invalid Subaccount value is returned.

If I submit invalid values for both the Vendor field at the header level and Account the bill is not created. The response code is 422 and the body indicates both that the vendor could not be found and that the account could not be found:

{
    "id": "8daa3702-d105-f011-8d20-000c299e9cc7",
    "rowNumber": 1,
    "note": {
        "value": ""
    },
    "error": "'VendorLocationID' cannot be empty.; VendorLocationID: 'VendorLocationID' cannot be empty.",
    ...
    "Details": [
        {
            "id": "90aa3702-d105-f011-8d20-000c299e9cc7",
            "rowNumber": 1,
            ...
            "Account": {
                "value": "200001",
                "error": "Account '200001' cannot be found in the system."
            },
            "Amount": {
                "value": 15.0
            },
            ...
        }
    ],
    ...
    "Vendor": {
        "value": "V000Z00007",
        "error": "Vendor 'V000Z00007' cannot be found in the system."
    },
    ...
}

Only when another field contains an invalid value does the call fail. Also, only when a header field contains an invalid value does an error message get returned for the Account field.

I've tried to expand Details which shows that the Account specified was not used but does not show an error message or cause the call to fail.

PUT .../entity/Default/24.200.001/Bill?$expand=Details

Why does an invalid account not result in an error? Is there any way I can change this behavior?

0 replies

Be the first to reply!

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings