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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

API End point for completed and deleted sales orders

(7) ShareShare
ReportReport
Posted on by 42
Hi Team,
 
Please help us find the completed and deleted Sales orders from the front end with all the amount-related columns.
 
And help us identify the API endpoint to extract the completed and deleted Sales Orders.
 
Thanks
Thulasi
I have the same question (0)
  • Gerardo Rentería García Profile Picture
    27,054 Most Valuable Professional on at
  • CU31031353-0 Profile Picture
    42 on at
    The below API end point is to Delete a sales order object from Business Central. But I need an API endpoint to get all these deleted Sales orders.

     
  • KasparsSemjonovs Profile Picture
    4,838 Super User 2026 Season 1 on at
    Once deleted, the orders are no longer there. 
    You can enable Order Archiving, and then You should be able to get the last archived version number, and filter the values there.
  • CU31031353-0 Profile Picture
    42 on at
    Hi Kaspars,
     
    how can we extract the completed / deleted sales orders from API end point?
     
    Is there API endpoint is available to extract the completed / deleted sales orders?
     
    Thanks,
    Thulasi.
  • Jun Wang Profile Picture
    8,220 Moderator on at
    you might need to provide more info on what happened. 
  • CU31031353-0 Profile Picture
    42 on at
    Hi Jun,
     
    We would like to extract the Completed/Deleted Sales orders (The sales order that were moved to archival) OR Sales Order History data using the API endpoint.
     
    Thanks
    Thulasi.
  • Suggested answer
    DAnny3211 Profile Picture
    11,423 Super User 2026 Season 1 on at

    Hi Thulasi 👋

    Thanks for your question!

    In Dynamics 365 Business Central, accessing completed and deleted sales orders via the front end and API requires a few considerations:

     From the Front End:

    • Completed Sales Orders are typically converted into Posted Sales Invoices or Posted Sales Shipments. You can view them under:
      • Posted Sales Invoices
      • Posted Sales Shipments
    • Deleted Sales Orders are not retained unless Change Log or Audit Trail is enabled. If enabled, you can track deletions via the Change Log Entries.

     API Endpoint for Completed Sales Orders:

    • Use the Posted Sales Invoice API:
      GET /businesscentral/companies({companyId})/postedSalesInvoices
    • Use the Posted Sales Shipment API:
      GET /businesscentral/companies({companyId})/postedSalesShipments

     API Endpoint for Deleted Sales Orders:

    • There is no direct API for deleted records. To track deletions:
      • Enable Change Log for the Sales Order table.
      • Use the Change Log Entries API (if exposed) or query the table directly via OData.

    💡 Make sure to include amount-related columns like totalAmount, amountIncludingTax, etc., in your API queries or custom API pages.

    Hope this helps!
    ✅ Please mark this reply as helpful if it answered your question.
    Best regards! 👋

  • Suggested answer
    YUN ZHU Profile Picture
    101,857 Super User 2026 Season 1 on at
    Hi, There is no field in the standard API to determine this status. You need to customize a new API to filter it out.
    PS: Dynamics 365 Business Central: Can we extend standard APIs? – Download Standard Source Code for APIs
     
    Thanks.
    ZHU
     
  • Suggested answer
    Suresh Kulla Profile Picture
    50,280 Super User 2026 Season 1 on at
    What do you mean by Completed, (Shipped and Invoiced) if so you can get that information from the posted sales shipments or posted sales invoices but remember there is a possibility of having more than one shipment and invoice for an order and regarding deleted sales orders system does not store them in BC so you cannot access them unless you archive them before deleting, then you can access them from Sales Order Archive but there is no easy way to find if that order is deleted or completed.
     
  • Suggested answer
    Sohail Ahmed Profile Picture
    11,177 Super User 2026 Season 1 on at
    In Business Central, once a sales order is posted, it becomes a Posted Sales Invoice (and/or Shipment). You can access these via the API endpoint:
     
    /api/v2.0/companies({companyId})/salesInvoices
     
    This will return all posted sales invoices with amounts, customer, and other details. Deleted invoices aren’t available, only those posted and stored in BC.
     
    ✅ Mark this as the verified answer if helpful.
     
     

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,386 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,774 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,515

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans