Activate a sandbox subscription for commercial marketplace SaaS products to enable billing

How to activate a subscription for commercial marketplace Software as a Service (SaaS) products from integration sandbox accounts to enable billing.

Note

It's only possible to activate a subscription for commercial marketplace SaaS products from integration sandbox accounts. If you have a production subscription, you must visit the publisher's site to complete the setup process. Subscription billing will begin only after setup is complete.

Prerequisites

  • Credentials as described in Partner Center authentication. This scenario supports authentication with both standalone App and App+User credentials.
  • An integration sandbox partner account with a customer having an active subscription for commercial marketplace SaaS products.
  • For partners using Partner Center .NET SDK, you must use SDK version 1.14.0 or higher to access this capability.

Important

As of June 2023, the latest Partner Center .NET SDK release 3.4.0 is now archived. You can download the SDK release from GitHub, along with a readme file that contains useful information.

Partners are encouraged to continue to use the Partner Center REST APIs.

C#

Use the following steps to activate a subscription for commercial marketplace SaaS products:

  1. Make an interface to the subscription operations available. You must identify the customer and specify the subscription identifier of the trial subscription.

    var subscriptionOperations = partnerOperations.Customers.ById(customerId).Subscriptions.ById(subscriptionId);
    
  2. Activate the subscription using the Activate operation.

    var subscriptionActivationResult = subscriptionOperations.Activate();
    

REST request

Request syntax

Method Request URI
POST {baseURL}/v1/customers/{customer-tenant-id}/subscriptions/{subscription-id}/activate HTTP/1.1

URI parameter

Name Type Required Description
customer-tenant-id guid Y The value is a GUID-formatted customer tenant identifier (customer-tenant-id), which allows you to specify a customer.
subscription-id guid Y The value is a GUID-formatted subscription identifier (subscription-id), which allows you to specify a subscription.

Request headers

For more information, see Partner Center REST headers.

Request body

None.

Request example

POST https://api.partnercenter.microsoft.com/v1/customers/42b5f772-5c5c-4bce-b9d7-bdadeecca411/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/activate HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 655890ba-4d2b-4d09-a95f-4ea1348686a5

REST response

This method returns the subscription-id and status properties.

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: 79
Content-Type: application/json
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 655890ba-4d2b-4d09-a95f-4ea1348686a5

{
    "subscriptionId":"aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e",
    "status":"Success"
}