Get companySubscription

Namespace: microsoft.graph

Get a specific commercial subscription that an organization acquired.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) Organization.Read.All Directory.Read.All
Delegated (personal Microsoft account) Not supported. Not supported.
Application Organization.Read.All Directory.Read.All, Organization.ReadWrite.All

Important

In delegated scenarios with work or school accounts where the signed-in user is acting on another user, they must be assigned a supported Microsoft Entra role or a custom role with a supported role permission. The following least privileged roles are supported for this operation.

  • Dynamics 365 Business Central Administrator - read only standard properties
  • Global Reader
  • Directory Readers

HTTP request

GET /directory/subscriptions/{id}
GET /directory/subscriptions(commerceSubscriptionId='{commerceSubscriptionId}')

Optional query parameters

This method supports the $select OData query parameter to help customize the response.

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.

Request body

Don't supply a request body for this method.

Response

If successful, this method returns a 200 OK response code and a companySubscription object in the response body.

Example

Request

The following example shows a request.

GET https://graph.microsoft.com/v1.0/directory/subscriptions/f9c1ea2d-2c6e-4717-8c3b-7130812d70ba

Response

The following example shows the response.

Note: The response object shown here might be shortened for readability.

HTTP/1.1 200 OK
Content-type: application/json
Content-length: 450

{
  "createdDateTime": "2023-01-01T00:00:00Z",
  "commerceSubscriptionId": "f9c1ea2d-2c6e-4717-8c3b-7130812d70ba",
  "id": "860697e3-b0aa-4196-a6c6-7ec361ed58f7",
  "isTrial": false,
  "nextLifecycleDateTime": "2023-02-01T00:00:00Z",
  "serviceStatus": [
    {
      "appliesTo": "User",
      "provisioningStatus": "Success",
      "servicePlanId": "8b8269e5-f841-416c-ab3a-f5dfb9737986",
      "servicePlanName": "MyPlanName"
    }
  ],
  "skuId": "0816ccb9-3785-4d19-bf78-6c53e2106509",
  "skuPartNumber": "MyPartNumber",
  "status": "Enabled",
  "totalLicenses": 25,
  "ownerId": "fe04f19f-d924-42b7-9dee-edf4e3fab7f6",
  "ownerTenantId": "331af819-4e0b-49f7-a6bf-14e1165ad3a0",
  "ownerType": "User"
}