Solved

Error calling Invoice endpoint

  • 2 September 2022
  • 12 replies
  • 188 views

Hi,

I am constantly getting HTTP 500 error with Invoice endpoint when called using HttpClient C# code with part of stack trace below.

In postman I get the same error the first time but I try it again it works. So, the issue is not with the payload and it is not with HttpClient C# code because it works with Customer endpoint.

Any suggestions please?

Thanks

{"message":"An error has occurred.","exceptionMessage":"An error occurred during processing of the field Type value FCH The 'FCH' list value is not allowed for the Type field. The allowed values are: Invoice, Debit Memo, Credit Memo, Credit WO..","exceptionType":"PX.Api.SyImportProcessor+PXFieldErrorException","stackTrace":"   at PX.Api.ContractBased.ExportTableHelperExtensions.RunExportAndAssertSuccess(SyExportContext exportContext)\r\n   at PX.Api.ContractBased.EntityService.GetList(ISystemContract systemContract, String version, String name, EntityImpl entity, CbOperationContext operationContext, Boolean ignoreValueFields, PXGraph graph)\r\n   at PX.Api.ContractBased.EntityService.GetImpl(ISystemContract systemContract, String version, String name, EntityImpl entity, EntityExportContextBuilder entityExportContextBuilder, EntityDescriptor entityDescriptor, CbOperationContext operationContext)\r\n   at

icon

Best answer by Vignesh Ponnusamy 7 September 2022, 20:37

View original

12 replies

Userlevel 7
Badge +5

Well, it seems like the DocType that you are sending is not in the list of available doc types. 

 

I don’t think Acumatica allows creating ‘Overdue Charges’/’FCH’ type of documents manually

I am sending the type attribute value as ‘Invoice’ which is listed in allowed values. 

What I observed is if there is any issue with any of the invoice fields it throws this generic error and does not pinpoint the issue with actual field.

I am thinking server is returning 500 error before it even validates payload. I am not sure if it’s trying to marshal the API method input object and throws this error by default.

 

Userlevel 7
Badge +5

It would be helpful to see the actual payload. 

 

But 500 error is throwed during the payload validation/processing specifically. 

If something goes wrong before processing the payload, it usually generates a different error code.

Here is the payload. It use to work couple of days ago. What is wrong with it now?

{"Details":[{"InventoryID":{"value":"ASSETMGMT"},"Account":{"value":"418000"},"UnitPrice":{"value":"2400.0000"},"ExtendedPrice":{"value":"2400.0000"},"Amount":{"value":"2400.0000"},"Qty":{"value":"1"},"UOM":{"value":"EA"},"Branch":{"value":"XXXX"},"TransactionDescription":{"value":"Service"},"Subaccount":{"value":"XXXX-0000"}},{"InventoryID":{"value":"XXXXTAX"},"Account":{"value":"221002"},"UnitPrice":{"value":"158.4000"},"ExtendedPrice":{"value":"158.4000"},"Amount":{"value":"158.4000"},"Qty":{"value":"1"},"UOM":{"value":"EA"},"Branch":{"value":"XXXX"},"TransactionDescription":{"value":"XXXX"},"Subaccount":{"value":"XXXX-0000"}}],"Amount":{"value":"2558.4000"},"Customer":{"value":"2105"},"CustomerOrder":{"value":"S435134"},"Date":{"value":"2022-07-01"},"Description":{"value":"XXXX Invoice# S435134 Invoice Type - Invoice"},"LinkARAccount":{"value":"110001"},"LinkBranch":{"value":"XXXX"},"ReferenceNbr":{"value":"435134"},"Terms":{"value":"NET30"},"Type":{"value":"Invoice"},"custom":{"Document":{"AttributeSALEREGION":{"type":"CustomStringField","value":"12"}}}}

Hi Dmitrii,

What is ‘FCH’? I don’t understand why it is throwing this error on ‘FCH’.

{"message":"An error has occurred.","exceptionMessage":"An error occurred during processing of the field Type value FCH The 'FCH' list value is not allowed for the Type field. The allowed values are: Invoice, Debit Memo, Credit Memo, Credit 

 

Userlevel 7
Badge +4

@mvenkata, I suppose this could be a bug. As far as, I have notice, the error happens for the 1st request and the same request will work the 2nd time. 
Can you please confirm if resending request works?

It doesn’t work from our API because it log error and move on to next request.

It was working just a couple of days ago. I am not sure if we need to do anything to reset or restart the site.

Is it possible any of you can send a GoTo meeting so I can walk through the issue with Invoice web service endpoint? I am using Contract REST API with token.

Userlevel 7
Badge +4

@mvenkata, As you say, the request was working earlier, did you recently enable Overdue Charges feature from the Enable/Disable features screen? 

To check this over the call, please create a support case. Thanks,

It is not enabled.

 

Userlevel 7
Badge +4

@mvenkata, Thanks for the update. As per my testing, the issue occurs only when you have the Overdue Charge is disabled and we already reported it to our engineering team. 

Please create a developer support case with necessary details, and we will keep updated regarding the bug fix.  

has this issue been fixed?

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