Skip to main content
Solved

Unable to set Subaccount on AP Bill details via Rest API when it is defaulting from a vendor and doesn't match

  • January 16, 2026
  • 4 replies
  • 23 views

KurtBauer
Jr Varsity III
Forum|alt.badge.img

I’m trying to create a simple AP Bill via the Rest API, but am running into an issue where it appears Acumatica is validating the Subaccount field and producing an error even though I have valid accounts in the account and subaccount.  

Below in the UI screenshot when I enter line 1, the account and sub default from the vendor record.  In line 2 I have manually entered the account and subaccount from the payload that are valid.  In line 3 shows as I first update the account, the subaccount is showing an error just like the API payload response.  I can’t use PATCH because this is the initial PUT to create the bill.  I have also tried creating a non-stock item with no expense account or sub to see if that helps, but it does not.

Right now, the only solution I can see is to delete the account and subaccount from the vendor so it doesn’t default into the line.  One thought is to turn off the commit on the Account field in a customization, but that doesn’t feel right.

Are there any other solutions? 

Note: This is 2025 R2, not SP1

 

Best answer by KurtBauer

Apparently, I should have done more research and digging.  The issue was someone had enabled row-level security and setup some account / subaccount restrictions.  All but a couple of the restriction groups were disabled, and even-though the feature was disabled, Acumatica was still applying the restriction group settings.

To fix I re-enabled the feature went through all the groups and deactivated the two that were missed and turned back off the feature.

4 replies

KurtBauer
Jr Varsity III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • January 16, 2026

Adding a quick note after some additional research.  It appears the client may have previously enabled row level security, added some security and then disabled the feature without deactivating some of the security.   I’m looking to see if this can be cleaned up to potentially fix the issue.


KurtBauer
Jr Varsity III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • Answer
  • January 18, 2026

Apparently, I should have done more research and digging.  The issue was someone had enabled row-level security and setup some account / subaccount restrictions.  All but a couple of the restriction groups were disabled, and even-though the feature was disabled, Acumatica was still applying the restriction group settings.

To fix I re-enabled the feature went through all the groups and deactivated the two that were missed and turned back off the feature.


Forum|alt.badge.img
  • Freshman I
  • January 20, 2026

REST API requires the segmented Subaccount format, not the raw digits.
"Subaccount": { "value": "20000000" }
Instead of the above line Update Like
"Subaccount": { "value": "2000-0000" }-this Works

{
  "BranchID": { "value": "164" },
  "TransactionDescription": { "value": "iTech Test" },
  "Qty": { "value": 1 },
  "ExtendedCost": { "value": "100.00" },
  "Account": { "value": "7040030" },
  "Subaccount": { "value": "2000-0000" },
  "TaxCategory": { "value": "EXEMPT" }
}
 

Vendor default is already stored in correct segmented format (9999-0000) so it passes validation.

But when you override with 20000000, Acumatica tries to validate the Department segment and can’t find it

and also you can try
 

In CS202000 – Segment Keys, check Subaccount segment structure:

  • Segment name like Department

  • Segment length (ex: 4)

  • Separator -

That will confirm exactly what format you must send.


KurtBauer
Jr Varsity III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • January 20, 2026

@FarhanaM60 thanks for the response.  Acumatica supports both the segment dash and without the dash in the API payload. 

The issue was someone enabled row level security, setup some security groups, and then when they disabled the feature they didn’t deactivate all of the row restrictions.  Apparently, Acumatica still uses the row security even if the feature is disabled.