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 :
Supply chain | Supply Chain Management, Commerce
Suggested Answer

Sort GetInvoices API in descending order using InvoiceDate

(1) ShareShare
ReportReport
Posted on by 6

How to sort /Commerce/SalesOrders/GetInvoices API response in descending order?

Hi All,

I’m trying to get the latest invoices using the following RetailServer API:

 

{{baseUrl}}/Commerce/SalesOrders/GetInvoices?$top=4&$skip=0

 

I attempted to sort the results by invoice date in descending order using:

 

{{baseUrl}}/Commerce/SalesOrders/GetInvoices?$top=4&$orderby=INVOICEDATE desc

 

However, I’m getting the following error:

 

"TypeName": "CommerceException", "Exception": { "ErrorResourceId": "Microsoft_Dynamics_Commerce_Runtime_HeadquarterCommunicationFailure", "LocalizedMessage": "A connection to headquarters could not be established. This may be due to Retail Real-time Service is not running properly or the trusted certificate used by Real-time Service is missing or expired" }

 

👉 Note: RTS is working perfectly in all other scenarios.

Can someone please guide me on how to properly sort the response of GetInvoices API in descending order?

INVOICE API.png
Categories:
I have the same question (0)
  • Suggested answer
    Wilcox Consulting Profile Picture
    12 on at
    Have you made any successful get calls? You may need to look at your ids, secrets etc. And also call for an auth prior to this call. 
     
     

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 > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 299 Super User 2025 Season 2

#2
Siv Sagar Profile Picture

Siv Sagar 183 Super User 2025 Season 2

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 118 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans