Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Which API to use to cancel an order?

(0) ShareShare
ReportReport
Posted on by 40

Hello community

Please help me with the following query:
What is the API process to cancel an order OR which API to use to cancel an order?


I have all the parameters and credentials, I want to cancel an order with Id or number but not able to find the way.


Thanks in advance!


  • Khungersumit Profile Picture
    40 on at
    RE: Which API to use to cancel an order?

    Hi Ing

    Can you please have a look over the following query :

    I am trying to fulfill a line item of an order I am getting the following issue, I google it many times but didn't get any issue.

    Here 38f6c48b-6432-41e7-a945-71bffa9a72c7 is the id which I get from Order's => salesOrderLines => id

    api.businesscentral.dynamics.com/.../salesOrderLines('38f6c48b-6432-41e7-a945-71bffa9a72c7')

    Error from API

    {"error":{"code":"BadRequest_NotFound","message":"Bad Request - Error in query syntax.  CorrelationId:  94886ba5-2adc-479f-9eb1-d8438d9ed4b5."}}

    I don't understand what is this CorrelationId means, do you have any idea what could be the issue here? :)

  • Khungersumit Profile Picture
    40 on at
    RE: Which API to use to cancel an order?

    Hi Inge

    Thanks for the quick reply 

    Much appreciated

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,029 Moderator on at
    RE: Which API to use to cancel an order?

    Yes, you are using the correct reference link.

    Just be aware that in order to do shipping you also might have to use the sales line API especially if you do not ship the complete order.

    And for refund you probably need to create a sales credit memo that also have its own API.

    But all these API's are covered by the link you posted.

  • Khungersumit Profile Picture
    40 on at
    RE: Which API to use to cancel an order?

    Hi Inge

    Thanks for responding

    I want to implement the following Functionality, Can you please check if this is the correct  reference link I should follow: docs.microsoft.com/.../

    => Cancel an Order

    => Fulfill/Ship an order with tracking info

    => Refund an order

  • Khungersumit Profile Picture
    40 on at
    RE: Which API to use to cancel an order?

    Hi Josh
    Thanks for responding


    I want to implement the following Functionality, Can you please check if this is the correct  reference link I should follow: docs.microsoft.com/.../

    => Cancel an Order
    => Fulfill/Ship an order with tracking info
    => Refund an order










    5850.png

  • Suggested answer
    JAngle Profile Picture
    95 on at
    RE: Which API to use to cancel an order?

    Even in the regular UI there isn’t a cancel per say. You would generally delete the order and if you have archiving enabled a copy would be stored.

    So API wise follow the process to delete. This is subject to no postings having taken place with the order. If postings have happened you will need something custom as there is no standard facility to reverse shipments. Invoices do have a feature for this though

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,029 Moderator on at
    RE: Which API to use to cancel an order?

    You should use the sales order API:

    docs.microsoft.com/.../dynamics_salesorder

    To cancel it you have to either delete it or update some field to mark it as canceled using the patch method in the API.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Now Available: 2025 Release Wave 2

Quick Links

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,655

#2
Mansi Soni Profile Picture

Mansi Soni 1,574

#3
YUN ZHU Profile Picture

YUN ZHU 1,453 Super User 2025 Season 1

Featured topics

Product updates

Dynamics 365 release plans