Skip to main content
Solved

Retrun Code 422 Unprocessable Entity

  • 3 December 2021
  • 9 replies
  • 610 views

Forum|alt.badge.img
  • 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

 

Best answer by Naveen Boga

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. 

View original
Did this topic help you find an answer to your question?

9 replies

jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • 680 replies
  • December 3, 2021

Hi @abdi,

Please try below

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

Method:POST

Request:

{

    "entity": {

        "OrderType": {

            "value": "SO"

        },

        "OrderNbr": {

            "value": "SO006322"

        }

    }

}

 

 


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3377 replies
  • December 3, 2021

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.


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 51 replies
  • December 3, 2021

Hi @jinin , @Naveen B 

 

 


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3377 replies
  • December 3, 2021

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.

Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 51 replies
  • December 3, 2021

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


jinin
Pro I
Forum|alt.badge.img+11
  • Pro I
  • 680 replies
  • December 3, 2021

Hi @abdi 

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


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3377 replies
  • Answer
  • December 3, 2021

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. 


Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • 51 replies
  • December 3, 2021

Hi @Naveen B I think so, thank you


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3377 replies
  • December 3, 2021

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

Endpoint will work after you unpublish your customization.

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings