I am adding a Bill through Default endpoint in Acumatica. Its responding with an error:
{
"message": "An error has occurred.",
"exceptionMessage": "Bill.Details[0].Subaccount: Subaccount '560' cannot be found in the system. Please verify whether you have proper access rights to this object.nInserting 'AP Transactions' record raised at least one error. Please review the errors.",
"exceptionType": "PX.Api.ContractBased.OutcomeEntityHasErrorsException",
"stackTrace": " at PX.Api.ContractBased.EntityService.GetOperationResult(EntityImpl entity, EntityExportContextBuilder entityExportContextBuilder, PXSYTable exportedKeys, PXOuterException contextError, Boolean throwOnError, Boolean addCancelCommand) in C:\build\code_repo\NetTools\PX.Api.ContractBased\EntityService.cs:line 724rn at PX.Api.ContractBased.EntityService.Put(ISystemContract systemContract, String version, String name, EntityImpl entity, CbOperationContext operationContext, Boolean throwOnError) in C:\build\code_repo\NetTools\PX.Api.ContractBased\EntityService.cs:line 676rn at PX.Api.ContractBased.Soap.SoapFacadeBase.PutImpl(EntityImpl entity, Boolean throwOnValidationError) in C:\build\code_repo\NetTools\PX.Api.ContractBased\Soap\SoapFacadeBase.cs:line 126rn at PX.Api.ContractBased.SystemContracts.V2.RestController.PutEntity(EntityImpl entity, String select, String filter, String expand, String custom) in C:\build\code_repo\NetTools\PX.Api.ContractBased\SystemContracts\V2\RestController.cs:line 304rn at lambda_method(Closure , Object , Object[] )rn at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass6_2.<GetExecutor>b__2(Object instance, Object[] methodParameters)rn at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)rn--- End of stack trace from previous location where exception was thrown ---rn at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()rn at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)rn at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext()rn--- End of stack trace from previous location where exception was thrown ---rn at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()rn at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)rn at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()rn--- End of stack trace from previous location where exception was thrown ---rn at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()rn at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()rn--- End of stack trace from previous location where exception was thrown ---rn at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()rn at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)rn at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()rn--- End of stack trace from previous location where exception was thrown ---rn at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()rn at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)rn at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()rn--- End of stack trace from previous location where exception was thrown ---rn at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()rn at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__6.MoveNext()rn--- End of stack trace from previous location where exception was thrown ---rn at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()rn at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)rn at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__5.MoveNext()rn--- End of stack trace from previous location where exception was thrown ---rn at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()rn at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)rn at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__5.MoveNext()rn--- End of stack trace from previous location where exception was thrown ---rn at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()rn at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)rn at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__3.MoveNext()rn--- End of stack trace from previous location where exception was thrown ---rn at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()rn at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)rn at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()rn--- End of stack trace from previous location where exception was thrown ---rn at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()rn at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__6.MoveNext()rn--- End of stack trace from previous location where exception was thrown ---rn at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()rn at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)rn at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__15.MoveNext()"
}
The accounts and subaccounts are controlled by the GL access and the user im logging as does have access, also I can enter the account and subaccount through the UI view with no issue as well.
The only time it does work is if the Supplier has no Expense Account and Expense Sub set or the Account and Subaccount are the same as the suppliers Expense Account and Expense Sub.
Any help would be appreciated
Below is my request Json
{
"Id": null,
"Type": {
"Value": "INV"
},
"ReferenceNbr": null,
"Status": null,
"Date": {
"Value": "2024-08-25T00:00:00"
},
"PostPeriod": {
"Value": "052025"
},
"Vendor": {
"Value": "2495"
},
"VendorRef": {
"Value": "test"
},
"DueDate": null,
"Hold": null,
"BranchID": {
"Value": "90"
},
"CapturedTax": {
"Value": 5.1
},
"CapturedTotal": {
"Value": 39.13
},
"Amount": {
"Value": 39.13
},
"WorkgroupID": null,
"Owner": {
"Value": 13912
},
"note": null,
"files": null,
"FinancialDetails": null,
"Details": [
{
"InventoryID": {
"Value": null
},
"TransactionDescription": {
"Value": "Dunite AP25 ECR680"
},
"Qty": {
"Value": 0.86
},
"UnitCost": {
"Value": 39.57
},
"Account": {
"Value": "7463"
},
"SubAccount": {
"Value": "560"
},
"TaxCategory": null,
"POLine": null,
"POOrderType": null,
"POOrderNbr": null,
"POReceiptNbr": null,
"POReceiptLine": null,
"Branch": {
"Value": "90"
},
"note": null
}
]
}