Delete a self-serve policy
Applies to: Partner Center
This article explains how to update a self-serve policy.
A self-serve policy allows partners to give their customers permission to buy their own product and services. For more info, see Give customers permission to buy their own products and services.
Prerequisites
- Credentials as described in Partner Center authentication. This scenario supports authentication with Application+User credentials.
C#
To delete a self-serve policy:
Call the IAggregatePartner.SelfServePolicies.ById method with the entity identifier to retrieve an interface to operations on the policies.
Call the Delete or DeleteAsync method to delete the self-serve policy.
// IAggregatePartner partnerOperations;
string policyId;
// All the operations executed on this partner operation instance will share the same correlation Id but will differ in request Id
IPartner scopedPartnerOperations = partnerOperations.With(RequestContextFactory.Instance.Create(Guid.NewGuid()));
// deletes the self-serve policies
partnerOperations.SelfServePolicies.ById(policyId).Delete();
For an example, see the following:
- Sample: Console test app
- Project: PartnerSDK.FeatureSamples
- Class: DeleteSelfServePolicies.cs
REST request
Request syntax
Method | Request URI |
---|---|
DELETE | {baseURL}/v1/SelfServePolicy/{id} HTTP/1.1 |
URI parameter
Use the following path parameters to get the specified product.
Name | Type | Required | Description |
---|---|---|---|
SelfServePolicy-id | string | Yes | A string that identifies the self-serve policy. |
Request headers
- A request ID and correlation ID are required.
- For more information, see Partner Center REST headers.
Request body
None.
Request example
DELETE https://api.partnercenter.microsoft.com/v1/SelfServePolicy/634f6379-ad54-449b-9821-564f737158ab_0431a72c-7d8a-4393-b25e-ef63f5efb415 HTTP/1.1
Authorization: Bearer <token>
Accept: application/json
MS-RequestId: 94e4e214-6b06-4fb7-96d1-94d559f9b47f
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
X-Locale: en-US
Host: api.partnercenter.microsoft.com
Content-Length: 789
Connection: Keep-Alive
REST response
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
MS-CorrelationId: aaaa0000-bb11-2222-33cc-444444dddddd
MS-RequestId: 94e4e214-6b06-4fb7-96d1-94d559f9b47f
Date: Tue, 14 Feb 2017 20:06:02 GMT