web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

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!


I have the same question (0)
  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,111 Moderator on at

    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.

  • Suggested answer
    JAngle Profile Picture
    133 on at

    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

  • Khungersumit Profile Picture
    40 on at

    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

  • Khungersumit Profile Picture
    40 on at

    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

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,111 Moderator on at

    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

    Hi Inge

    Thanks for the quick reply 

    Much appreciated

  • Khungersumit Profile Picture
    40 on at

    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? :)

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

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,917

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,161 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,025 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans