How to Cancel Dynamics 365 Dataverse Order in 2024: Step-by-Step Guide

There was a request to cancel orders through the Dynamics 365 CRM API. Microsoft does not provide exact documentation on how to do this. It does show which action to call, but not what to send in the body of the request.

To be able to do this, you have to call the following action endpoint:

{dataverse-url}/CancelSalesOrder

{
    "OrderClose": {
        "@odata.type": "#Microsoft.Dynamics.CRM.orderclose",
        "salesorderid@odata.bind": "/salesorders({salesorderguid})"
},
    "Status": -1
}



If you call this endpoint with this body and you place the salesorderguid of the order you want to cancel, the resulting order will be cancelled.

Comments

Popular posts from this blog

How to Implement Advanced Filtering in Azure Event Grid for More Granular Event Processing

Cancel Ongoing Flow Runs in Microsoft Dynamics 365 Dataverse: Complete Guide