Solved

Retrun Code 422 Unprocessable Entity

  • 3 December 2021
  • 9 replies
  • 449 views

Userlevel 3
Badge
  • Jr Varsity III
  • 51 replies

Api ExtendEndpoint/20.200.001/SalesOrder/CancelSalesOrder

 

how to fixed if API retrun code Code 422 Unprocessable Entity?

return body normaly like return body success

 

icon

Best answer by Naveen Boga 3 December 2021, 08:27

View original

9 replies

Userlevel 7
Badge +11

Hi @abdi,

Please try below

Url:/entity/Default/20.200.001/SalesOrder/CancelSalesOrder

Method:POST

Request:

{

    "entity": {

        "OrderType": {

            "value": "SO"

        },

        "OrderNbr": {

            "value": "SO006322"

        }

    }

}

 

 

Userlevel 7
Badge +17

Hi @abdi  

Root cause of 422 Unprocessable Entity is nothing but either URL should be wrong OR JSON request wrong.

As you mentioned above, URL looks good to me, check the JSON body.

Jini, already provided the proper JSON request in previous comment, please use this json request and verify.

Userlevel 3
Badge

Hi @jinin , @Naveen B 

 

 

Userlevel 7
Badge +17

Hi @abdi  Json body also looks correct. Can you please do below verification.

  • Can you please check in other instance - (We have checked in brand new instance and observed it is working fine)
  • Also, you are using extend endpoint, not sure but it might be issue with that as well. Just for confirmation can you please verify with DEFAULT endpoint and confirm.
  • Are you able to cancel the order manually.
Userlevel 3
Badge

Hi @Naveen B, after I investigated, the error only applies to some Order Nbr only and if the Order Nbr is canceled from the screen an error will appear: 'UsrQTStatus' cannot be empty

Userlevel 7
Badge +11

Hi @abdi 

Is ‘UsrQTStatus’ User defined Field  and Marked as required?

Userlevel 7
Badge +17

Hi @abdi Yes, there is NO issue with the Endpoint. 422 issue is causing from the customization.

you can fix that customization issue and verify from the Endpoint. 

Userlevel 3
Badge

Hi @Naveen B I think so, thank you

Userlevel 7
Badge +17

@abdi  Yes it is. To confirm this you can unpublish your customization and check once.

Endpoint will work after you unpublish your customization.

 

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