Skip to main content

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

 

Hi @abdi,

Please try below

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

Method:POST

Request:

{

    "entity": {

        "OrderType": {

            "value": "SO"

        },

        "OrderNbr": {

            "value": "SO006322"

        }

    }

}

 

 


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.


Hi @jinin , @Naveen B 

 

 


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.

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


Hi @abdi 

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


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. 


Hi @Naveen B I think so, thank you


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

Endpoint will work after you unpublish your customization.

 


Reply