Applies to: Partner Center | Partner Center operated by 21Vianet | Partner Center for Microsoft Cloud for US Government
Reactivates a Subscription that was previously suspended for nonpayment.
In Partner Center, this operation can be performed by first selecting a customer. Then, select the subscription in question that you wish to rename. To finish, choose the Active button, then select Submit.
Prerequisites
Credentials as described in Partner Center authentication. This scenario supports authentication with both standalone App and App+User credentials.
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 ID.
C#
To reactivate a customer's subscription, first Get the subscription, then change the subscription's Status property. For information on Status codes, consult [SubscriptionStatus enumeration/dotnet/api/microsoft.store.partnercenter.models.subscriptions.subscriptionstatus). Once the change is made, use your IPartner.Customers collection and call the ById() method. Then call the Subscriptions property, followed by the ById() method. Then, finish by calling the Patch() method.
C#
// IPartner partnerOperations;// var selectedCustomer as Customer;// var selectedSubscription as Subscription;
updatedSubscription = partnerOperations.Customers.ById(selectedCustomerId).Subscriptions.ById(selectedSubscription.Id).Patch(
new Subscription()
{
Status = SubscriptionStatus.Active
});
Sample: Console test app. Project: FeatureSamplesApplication. Class: UpdateSubscription
If successful, this method returns updated Subscription resource properties in the response body.
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 Error Codes.
This learning path allows you to manage subscription revenue, recurring billing, and multi-element revenue allocation by working with billing schedules.