Reputation: 2522
Assume a customer has 3 subscriptions:
Exchange Online (Plan 1)
Microsoft 365 E3
Microsoft Teams Room Pro
In the admin portal (https://admin.microsoft.com/) I can see the subs and counts and such. If I click into Exchange Online Plan 1 The url in my browser changes to:
Note the ID after assets.
Now, If i use the Graph API and list all subscriptions, I do see the Exchange online Plan 1, but the subscription ID is different.
$url ="https://graph.microsoft.com/v1.0/directory/subscriptions";
stdClass Object
(
[@odata.context] => https://graph.microsoft.com/v1.0/$metadata#directory/subscriptions
[value] => Array
(
[0] => stdClass Object
(
[createdDateTime] => 2023-04-27T15:27:35Z
[commerceSubscriptionId] => 1234567-de25-4aff-858c-AABBCCDD
[id] => 123456-2a6d-4630-9931-SomethingNotCloseToOtherId
[isTrial] =>
[nextLifecycleDateTime] => 2025-04-03T00:00:00Z
[skuId] => c5928f49-12ba-48f7-ada3-0d743a3601d5
[skuPartNumber] => SomeExchangeSKu
[status] => Enabled
[totalLicenses] => 5
[ownerTenantId] =>
[ownerId] =>
[ownerType] =>
[serviceStatus] => Array
I would expect the id parameter do be the same as the id I saw in the url. Am I calling the wrong endpoint? What am I missing?
Upvotes: 0
Views: 87
Reputation: 16064
The ID in the below URL when clicked on the license is commerceSubscriptionId.
id
of the subscription entity in the https://commerceapi.office.net/v1
API refers to a unique identifier for a specific subscription in the Microsoft 365 commerce system.I executed the below query:
https://graph.microsoft.com/v1.0/directory/subscriptions
The ID in the URL will be displayed under commerceSubscriptionId in the response.
And you can also get the details of commerce Subscription Id by using the below query:
https://graph.microsoft.com/v1.0/directory/subscriptions/IDFromURL/commerceSubscriptionId
Upvotes: 0