Get an Azure entitlement for a subscription

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

Partners can view their Azure entitlement for a subscription by using this API, which gets the entitlement of the subscription identifier for a customer.

Prerequisites

  • Credentials as described in Partner Center authentication. This scenario supports authentication with both standalone App and App+User credentials.
  • Customer_id.
  • Subscription_id.
  • Entitlement_id.

C#

To cancel an Azure subscription, you'll need to identify your customer ID, subscription ID, and entitlement ID for the Azure subscription you want to cancel.

REST request

Request syntax

Method Request URI
POST {baseURL}/v1/customers/{customer_id}/subscriptions/{subscription_id}/azureEntitlements/{entitlement_id} HTTP/1.1

URI parameter

This table lists the required query parameters to cancel an Azure subscription.

Name Type Required Description
customer_id String Y The value is a string that denotes the identifier of the customer.
subscription_id String Y The value is a string that denotes the identifier of the customer.
entitlement_id String Y The value is a string that denotes the identifier of the Azure subscription entitlement.

Request headers

See Partner Center REST headers.

Request body

No request body is required.

Request example

GET https://api.partnercenter.microsoft.com/v1/customers/{customer_id}/subscriptions/{subscription_id}/azureEntitlements/{entitlement_id}

HTTP/1.1
Accept: application/json
MS-RequestId: 655890ba-4d2b-4d09-a95f-4ea1348686a5
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd

REST response

If successful, this method returns an Azure entitlement for a subscription resource in the response body.

Response success and error codes

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

HTTP Status HTTP Code Error code Description
BadRequest 400 900118 Invalid customer ID.
BadRequest 400 800002 Customer ID {0} should have GUID format (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
BadRequest 400 800002 Subscription ID is required.
BadRequest 400 800002 Entitlement ID is required.
BadRequest 400 800002 The Azure entitlement cancellation request content is required.
Forbidden 403 900159 The partner with account ID {0} and organization ID {1} has no commerce relationship with the customer with account ID {2} and organization ID {3}.
BadRequest 400 900307 Cancellation reason '{0} is invalid.
NotFound 404 800111 Azure entitlement with ID {0} isn't found.

Response example

The response returns the Azure entitlement for a given customer.

HTTP
HTTP/1.1 200 OK
Content-Length: 1132
Content-Type: application/json; charset=utf-8
MS-CorrelationId: bbbb1111-cc22-3333-44dd-555555eeeeee
MS-RequestId: 22bfd0fb-d1e6-4a8f-aa1a-124b7c820d80
MS-CV: cmde2DtbuUWi8JLq.0
MS-ServerId: 201022015
Date: Wed, 14 Dec 2022 00:12:53 GMT

{ 
    "id": "bbbb1b1b-cc2c-dd3d-ee4e-ffffff5f5f5f", 
    "friendlyName": " Cancel_Azure_Subscription", 
    "status": “inactive", 
    "subscriptionId": "aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e", 
    "links": { 
        "self": { 
            "uri": "/customers/aaaabbbb-0000-cccc-1111-dddd2222eeee/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/azureEntitlements/bbbb1b1b-cc2c-dd3d-ee4e-ffffff5f5f5f", 
            "method": "GET", 
            "headers": [] 
        } 
    }