'Microsoft Graph API - Contracts - How to pull subscribed skus?

Using the Microsoft Graph API I can see the contracts of my organization when I execute:

https://graph.microsoft.com/v1.0/contracts

A Sample Response below:

"value": [
{
"id": "107adc54-f77c-4b8b-9cc0-1759e8d0cdfer",
"deletedDateTime": null,
"contractType": "2",
"customerId": "75ace3eb-6bf4-4655-95fd-f3d0610924789",
"defaultDomainName": "test.onmicrosoft.com",
"displayName": "Test Me"
}

How can i query the subscribedskus of the above contract via Graph API. is this even possible?

I tried

https://graph.microsoft.com/v1.0/test.onmicrosoft.com/subscribedSkus

But it returns the skus my organization is subscribed to and not the ones subscribed by test.onmicrosoft.com.

Please assist.



Solution 1:[1]

Looks like your organization acts as a Microsoft Partner. This means that you have 2 choices:

  1. Rely on the Partner Center APIs. Here is the PC API counterpart to the Graph SubscribedSKUs API: https://docs.microsoft.com/en-us/partner-center/develop/get-a-list-of-available-licenses
  2. Impersonate the end-customer via the Delegated Admin Permissions, as mentioned in the active_coder answer above.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Anton Zlygostev