Forum Discussion

tl-jacob's avatar
tl-jacob
Copper Contributor
Mar 21, 2025

Partner Center API: Getting subscription usage count

Goal: Given a customerId, skuId, and productId for a specific microsoft license check the usage data (i.e. how many used / unused licenses) for that license.

Examples:

  • skuId = "0004"
  • productId = "CFQ7TTC0JXCZ"

Steps taken so far:

  1. I can pull down a customer's subscriptions via this endpoint. The response contains a skuId and productId, so I can filter the response to find the license I'm interested in. However, the response does not contain any information about license usage. It contains the total quantity associated with the subscription but doesn't specify the number of licenses used.
  2. I can use a different endpoint to pull down all the subscribed skus for a specific customer. This endpoint does return the license usage information that I want, but it doesn't return the desired productId and the returned skuId doesn't match the pattern I expect. It also returns a skuPartNumber that isn't helpful to mapping back to my input skuId and productId

 

I'm stuck, so any support would be much appreciated! Thank you!

 

  • Nick_Beacroft's avatar
    Nick_Beacroft
    Steel Contributor

    I use this endpoint to get the list of licenses in the customer tenant and the availability data, then try and tie them back to the subscriptions we provide.

    https://learn.microsoft.com/en-us/partner-center/developer/get-a-list-of-available-licenses

    The challenge being the licensed product in the customer tenant is a container that could be made up of multiple subscriptions. Some from Microsoft direct and some from other partners.  That's why the subscription endpoint cannot give you availability data.

  • sansbacher's avatar
    sansbacher
    Brass Contributor

    tl-jacob,

    It's been a while since I tried to do something along those lines, and it may have been pre-NCE. But I recall having to use "Offers" to link up Subscriptions and Licenses, finding the same disconnect you did.

     

    I got SubscribedSkus as you did, plus:

    https://learn.microsoft.com/en-us/partner-center/developer/get-all-of-a-customer-s-subscriptions

    To get all their Subscriptions, but Orders as you're doing probably works as well.

    And was able to link them using Offers:

    https://learn.microsoft.com/en-us/rest/api/partner-center/manage-orders/get-a-list-of-offers-for-a-market

    Things may have changed since I last tried, but see if you can use a known Customer's SKUs, Subscriptions, various IDs and compare with Offers - I'm sure I found OfferID matched ProductID or something.

     

    Microsoft has Products which are made up of Product SKUs, the product catalogue lists Offers of how these Products are sold. Customers get Subscriptions to Offers, and can have multiple Offers all for the same underlying License. (Again, fuzzy memory for all this, but it wasn't a straight line between SKU and Subscription, since from a License perspective it doesn't matter if it's an O365 E3 Trial or Charity or Gov't Offer of the O365 E3 Product, within the customer's tenant they would just have the total of all those Subscriptions). I was dealing with all this in the 2019 - 2020 timeframe, so could be dated.

     

    There's also a semi-frequently updated list here:

    https://learn.microsoft.com/en-us/entra/identity/users/licensing-service-plan-reference

    But I've found it is never complete.

     

    --Saul

  • tl-jacob's avatar
    tl-jacob
    Copper Contributor

    jilljust wanted to ping you to see if you know anyone who might be able to help here.

Resources