Skip to main content

Canceling a subscription

Once you have a created valid subscription, you can cancel that subscription. To do so, you will need the unique subscription identifer returned in the create subscription response. The identifier may also be found by calling the subscription list API method.

URL endpoint: /api/billing/v1/subscriptions/{subscriptionId}

Method: DELETE

Parameters:

  • subscriptionId - The unique identifier for the subscription provided by the channel. This id can be obtained either from the response returned when the subscription is created via the API, or by using the API to list the subscriptions for the company  and user in order to view the id for the subscription.

HTTP status codes

HTTP Status CodeDescription
204 No ContentThe subscription was successfully deleted.
400 Bad RequestThe subscription was previously deleted.
404 Not FoundThe specified subscription was not found.

Below is an example of a successful subscription cancel request and response. Additional examples for the error cases are provided in the example section of this document.  All of the examples presented assume you have successfully created a subscription as described in Create subscriptions.

Request

  • JSON
DELETE https://www.appdirect.com/api/billing/v1/subscriptions/7845d75c-0fc0-4ec3-ac17-df95a746eff9
Host: www.appdirect.com
Authorization OAuth oauth_version="1.0", oauth_signature_method="HMAC-SHA1", oauth_nonce="VeJO1tP7RKUE1rz", oauth_timestamp="1438728054", oauth_consumer_key="appdirect-91", oauth_signature="xy37tmDbpwuIHZJIioRSB3GGAhM%3D"
Content-Type application/json
  • XML
DELETE https://www.appdirect.com/api/billing/v1/subscriptions/7845d75c-0fc0-4ec3-ac17-df95a746eff9
Host: www.appdirect.com
Authorization OAuth oauth_version="1.0", oauth_signature_method="HMAC-SHA1", oauth_nonce="VeJO1tP7RKUE1rz", oauth_timestamp="1438728054", oauth_consumer_key="appdirect-91", oauth_signature="xy37tmDbpwuIHZJIioRSB3GGAhM%3D"
Content-Type application/xml

Response

  • JSON
Status Code: 204 No Content
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Date: Tue, 18 Aug 2015 17:30:49 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=42507F373A2CF782C6C9DC3B222ED5A4; Path=/; HttpOnly
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff
  • XML
Status Code: 204 No Content
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Date: Tue, 18 Aug 2015 17:30:49 GMT
Expires: 0
Pragma: no-cache
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=42507F373A2CF782C6C9DC3B222ED5A4; Path=/; HttpOnly
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
x-content-type-options: nosniff

Was this page helpful?