Hi all,
I'm attempting to create a Bill in Acumatica using the REST API, but I keep running into this error:
Receipt Line 000026 - 2 not found.
If I select lines 1 and 3 the bill gets created, but for other lines I get the error.
Request Body: {
"Vendor": { "value": "V000000001" },
"Date": { "value": "04/17/2025" },
"PostPeriod": { "value": "04-2025" },
"DueDate": { "value": "05/17/2025" },
"Hold": { "value": false },
"Details": [
{ "POReceiptNbr": { "value": "000026" }, "POReceiptLine": { "value": 3 }, "POReceiptType": { "value": "Receipt" } },
{ "POReceiptNbr": { "value": "000026" }, "POReceiptLine": { "value": 2 }, "POReceiptType": { "value": "Receipt" } },
{ "POReceiptNbr": { "value": "000026" }, "POReceiptLine": { "value": 6 }, "POReceiptType": { "value": "Receipt" } },
{ "POReceiptNbr": { "value": "000026" }, "POReceiptLine": { "value": 1 }, "POReceiptType": { "value": "Receipt" } }
]
}
Request URL: Put Request- http://localhost/AcumaticaT100/entity/Default/24.200.001/Bill
Purchase Receipt:

Error:
{ "message": "An error has occurred.", "exceptionMessage": "Operation failed", "exceptionType": "PX.Data.PXInvalidOperationException", "stackTrace": " at PX.Api.ContractBased.EntityService.Put(ISystemContract systemContract, String version, String name, EntityImpl entity, CbOperationContext operationContext, Boolean throwOnError)\r\n at PX.Api.ContractBased.AspNetCore.CbEndpointFeatureServiceExtensions.Put(IEntityService entityService, ICbEndpointFeature feature, EntityImpl entity, CbOperationContext operationContext)\r\n at PX.Api.ContractBased.WebApi.Controllers.EntityController.PutEntity(EntityImpl entity, String select, String filter, String expand, String custom)\r\n at lambda_method(Closure , Object , Object[] )\r\n at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)\r\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeActionMethodAsync>d__12.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeNextActionFilterAsync>d__10.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)\r\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)\r\n at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeInnerFilterAsync>d__13.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.<InvokeNextExceptionFilterAsync>d__24.MoveNext()", "innerException": { "message": "An error has occurred.", "exceptionMessage": "Exception has been thrown by the target of an invocation.", "exceptionType": "System.Reflection.TargetInvocationException", "stackTrace": " at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)\r\n at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)\r\n at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\r\n at PX.Api.ContractBased.EntityExportContextBuilder.<>c__DisplayClass89_1.<FindImplementations>b__3(PXGraph graph, EntityImpl entity, EntityImpl targetEntity)\r\n at PX.Api.SyImportProcessor.SyStep.ProcessLocateByNoteIdCommand(SyCommand cmd, SyView view, Boolean invokeCommand)\r\n at PX.Api.SyImportProcessor.SyStep.ProcessCommand(SyCommand cmd, Boolean& needCommit)\r\n at PX.Api.SyImportProcessor.ExportTableHelper.ExportTable(CancellationToken token)", "innerException": { "message": "An error has occurred.", "exceptionMessage": "Receipt Line 000026 - 2 not found.", "exceptionType": "PX.Data.PXException", "stackTrace": " at PX.Objects.DefaultEndpointImpl.AddPOReceiptLineToBill(APInvoiceEntry invoiceEntry, EntityValueField receiptType, EntityValueField receiptNbr, EntityValueField receiptLineNbr)\r\n at PX.Objects.DefaultEndpointImpl.BillDetail_Insert(PXGraph graph, EntityImpl entity, EntityImpl targetEntity)\r\n at PX.Objects.EndpointAdapters.DefaultEndpointImpl24.BillDetail_Insert(PXGraph graph, EntityImpl entity, EntityImpl targetEntity)" } } }
Please help me regarding this.
Thanks and Regards
Trishant Pamnani
