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

Consume Retail Server APIs in external applications - testing in Postman error Microsoft_Dynamics_Commerce_Runtime_InvalidAudience

(0) ShareShare
ReportReport
Posted on by 42

We are setting up integration to D365 Commerce and have followed the instructions / guidelines in https://learn.microsoft.com/en-us/dynamics365/commerce/dev-itpro/consume-retail-server-api.

The environment is of type MS managed acceptance test (generated on ice, West Europe).

Following the guideline, we have in Azure AD set up

  • an application for the Retail Server,
  • an application for the client,
  • added a client secret,
  • registered the app in the finance and operations app,
  • generated the Authorization token in Postman. 

However, when testing the call to the Api from Postman, we run into the error : 

"TypeName": "UserAuthenticationException",
"Exception": "{\r\n \"ErrorResourceId\": \"Microsoft_Dynamics_Commerce_Runtime_InvalidAudience\",\r\n \"LocalizedMessage\": \"The audience validation failed. Contact your system administrator to set up identity providers properly in retail headquarters.\\r\\n- If you are using Personnel ID and Password logon, make sure relying parties are correctly configured.\\r\\n- If you are using Azure AD logon, make sure both relying parties and server resource ids are correctly configured.\"\r\n}",
"CorrelationId": "7cc75ad7-1b84-44ee-8987-bfa4aff6880b"

Any idea on where to look to find a solution ?
Here are the screenshot of our setup.

Azure AD Retail Server App registration

pastedimage1678795745811v3.png
Azure AD Scope
pastedimage1678796246511v6.png
Azure AD client reg
pastedimage1678796402679v7.png
Register app in D365 Commerce (shared parameters)
pastedimage1678796626257v8.png
I have the same question (0)
  • Harald Grannes Profile Picture
    42 on at

    Postman call to get authorization token

    pastedimage1678796908770v1.png

  • Harald Grannes Profile Picture
    42 on at

    Calling the API GetOrderHistory from Postman

    pastedimage1678797118779v1.png

  • Verified answer
    huijij Profile Picture
    19,813 on at

    Hi Harald,

    You can use the Authorization tab to complete the relevant details for the correct data values which be determined by your API at the server side. Please check your configurations following the blog:

    anithasantosh.wordpress.com/.../

  • Verified answer
    Harald Grannes Profile Picture
    42 on at

    Microsoft support solved the issue.

    The problem was that we needed to add/modify an azure ad type Identity Provider as shown below and restart the retail server.



    pastedimage1678976517498v1.png

  • Shailee Shah Profile Picture
    84 on at
    Hi All,
     
    I am facing similar issue, even after restart it is not working for me. Any other suggestion ? TIA.
     
  • RS-30070451-0 Profile Picture
    on at
    Hi, 
     
    I was facing this issue earlier but after setting up Identity Providers, we are now facing this:
     
    We are looking to consume APIs in Postman for a client (Retail client) using MS Dynamics 365 F&O for a 3rd Party Application and have followed the following documentation:
     
    However, we are facing the following error:
     
    Microsoft_Dynamics_Commerce_Runtime_AuthorizationFailed\",\r\n  \"LocalizedMessage\": \"The user is not authorized to perform this operation
     
    We have tried multiple steps (from a lot of sources) and continue to face this error.
     
    Would you know how to resolve this?

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 145 Super User 2026 Season 1

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 102 Super User 2026 Season 1

#3
Laurens vd Tang Profile Picture

Laurens vd Tang 97 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans