Get subscription provisioning status

Applies to: Partner Center | Partner Center operated by 21Vianet | Partner Center for Microsoft Cloud for US Government

How to get the subscription provisioning status for a customer subscription.

Prerequisites

  • Credentials as described in Partner Center authentication. This scenario supports authentication with App+User credentials only.

  • A customer ID (customer-tenant-id). If you don't know the customer's ID, you can look it up in Partner Center by selecting the Customers workspace, then the customer from the customer list, then Account. On the customer's Account page, look for the Microsoft ID in the Customer Account Info section. The Microsoft ID is the same as the customer ID (customer-tenant-id).

  • A subscription identifier.

  • Delegated admin permissions on the subscription are required to perform this operation.

GDAP roles

You'll need at least one of the following GDAP roles:

  • Directory Reader
  • Global Reader

C#

To get the provisioning status of a subscription, begin by using the IAggregatePartner.Customers.ById method with the customer ID to identify the customer. Then, get an interface to subscription operations by calling the Subscriptions.ById method with the subscription ID. Next, use the ProvisioningStatus property to obtain an interface to the current subscription's provisioning status operations, and then call the Get or GetAsync method to retrieve the SubscriptionProvisioningStatus object.

// IAggregatePartner partnerOperations.
// string customerId;
// string subscriptionId;

// Retrieve a subscription's provisioning status.
var provisioningStatus = partnerOperations.Customers.ById(customerId).Subscriptions.ById(subscriptionID).ProvisioningStatus.Get();

REST request

Request syntax

Method Request URI
GET {baseURL}/v1/customers/{customer-id}/subscriptions/{subscription-id}/provisioningstatus HTTP/1.1

URI parameters

Use the following path parameters to identify the customer and subscription.

Name Type Required Description
customer-id string Yes A GUID formatted string that identifies the customer.
subscription-id string Yes A GUID formatted string that identifies the subscription.

Request headers

For more information, see Partner Center REST headers.

Request body

None.

Request example

GET https://api.partnercenter.microsoft.com/v1/customers/0c39d6d5-c70d-4c55-bc02-f620844f3fd1/subscriptions/34828C05-C16C-4D6F-9CFC-4D2650EF19A1/provisioningstatus HTTP/1.1
Accept: application/json, text/plain, */*
Authorization: Bearer <token>
MS-RequestId: d0e38dfd-a2c5-4a14-ac06-12d30f0ec54e
MS-CorrelationId: e937630b-8341-4d70-8f73-450d32ee0189
X-Locale: en-US
Host: api.partnercenter.microsoft.com

REST response

If successful, the response body contains a SubscriptionProvisioningStatus resource.

Response success and error codes

Each response comes with an HTTP status code that indicates success or failure and additional debugging information. Use a network trace tool to read this code, error type, and additional parameters. For the full list, see Partner Center REST error codes.

Response example

HTTP/1.1 200 OK
Content-Length: 177
Content-Type: application/json; charset=utf-8
MS-CorrelationId: e937630b-8341-4d70-8f73-450d32ee0189
MS-RequestId: d0e38dfd-a2c5-4a14-ac06-12d30f0ec54e
MS-CV: InswEQre402koceL.0
MS-ServerId: 030020344
Date: Thu, 20 Apr 2017 19:23:39 GMT

{
    "skuId": "6FD2C87F-B296-42F0-B197-1E91E994B900",
    "status": "success",
    "quantity": 5,
    "endDate": "2018-05-10T00:00:00Z",
    "attributes": {
        "objectType": "SubscriptionProvisioningStatus"
    }
}

Remarks

  • During a license change assignment, the status field in SubscriptionProvisioningStatus is set to "pending".

  • The status field is updated every 15 minutes.