> For the complete documentation index, see [llms.txt](https://docs.conscent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.conscent.ai/old-webhooks/subscription-cancelled-webhook.md).

# Subscription Cancelled Webhook

You can register your webhook endpoint for receiving data whenever a user cancels their subscription via ConsCent - by logging in to your ConsCent Client Dashboard and navigating to the Webhook Page. You will be able to enable/disable and edit your webhook url from this section. Once the webhook URL is registered and the webhook is in the enabled state - the endpoint will receive the user's canceled subscription data, along with the details of the subscription and the last purchase/renewal of the user for the particular subscription - anytime the user cancels a client's subscription via ConsCent. Moreover, the webhook is secured by basic auth using the Client's API Key and API Secret provided by ConsCent on the SDK Integration section of the client dashboard - ConsCent Client Integration. You can optionally choose to keep the endpoint protected and authenticate using the provided credentials which are passed in the headers of the POST request to the configured webhook endpoint.

{% code title="SUBSCRIPTION CANCELED JSON" overflow="wrap" %}

```json
{
  "cancelledSubscriptionDetails": {
    "renewalCount": 0,
    "rzpSubscriptionId": "sub_InvqpVxG0vu7n8",
    "status": "CANCELLED",
    "price": 300,
    "currency": "INR"
  },
  "userEmail": "admin1@seed.com",
  "userPhoneNumber": "9869779647",
  "userId": "7843y9xm44428xm24x2m0x2xm42",
  "userName": "john doe",
  "userAddress": {
    "apartment": "",
    "area": "",
    "pincode": "",
    "landmark": "",
    "city": "",
    "state": "",
    "country": ""
  },
  "clientSpecificUserId": "11003289298",
  "subscriptionDetails": {
    "freeTrial": {
      "enabled": true,
      "duration": 14
    },
    "recommended": false,
    "benefits": "benefit ewiowe, benefit 2",
    "physical": false,
    "digital": true,
    "enabled": true,
    "migrated": false,
    "couponsEnabled": true,
    "adminCoupon": "",
    "usedCouponNumbers": [1],
    "_id": "616ffd76621d69c5ee43c044",
    "clientId": "601a8ea4f2149f089782814f",
    "title": "Subscription 5",
    "iconUrl": "https://conscent-subscriptions.s3.ap-south-1.amazonaws.com/local/Samakshs-MacBook-Pro-2.local/Screenshot%202021-07-22%20at%209.05.01%20PM.png",
    "tiers": [
      {
        "priceOverrides": {
          "country": []
        },
        "currency": "INR",
        "basePrice": 0,
        "offers": [],
        "_id": "616ffd76621d69c5ee43c045",
        "price": 300,
        "duration": 5
      }
    ],
    "couponCount": 5,
    "createdAt": "2021-10-20T11:28:54.143Z",
    "updatedAt": "2022-01-19T06:45:18.634Z",
    "__v": 5
  },
  "lastPurchaseDetails": {
    "location": {
      "latitude": 13.0411,
      "longitude": 77.5702,
      "postcode": "560056"
    },
    "gstComponents": {
      "physical": 0,
      "digital": 0
    },
    "inrGstComponents": {
      "physical": 0,
      "digital": 0
    },
    "manuallyRenewed": false,
    "renewSubscription": true,
    "availedOffers": [],
    "promotional": false,
    "tags": [],
    "bundle": false,
    "bundleContentIds": [],
    "paymentType": ["REPEAT", "NETWORK"],
    "freeTrial": false,
    "migrated": false,
    "clientId": "601a8ea4f2149f089782814f",
    "buyingPrice": 289.5,
    "price": 300,
    "country": "IN",
    "city": "bengaluru (nagashettyhalli)",
    "userCountry": "IN",
    "expiryDate": "2023-04-25T09:52:52.814Z",
    "priceDetails": {
      "price": 300,
      "currency": "INR"
    },
    "type": "SUBSCRIPTION",
    "subscriptionTitle": "Subscription 5",
    "operatingSystem": "Mac OS",
    "device": "desktop",
    "subscriptionType": {
      "physical": false,
      "digital": true
    },
    "subscriptionId": "616ffd76621d69c5ee43c044",
    "tierId": "616ffd76621d69c5ee43c045",
    "renewalId": "61efc865acb0d82962e2ad14",
    "renewalDetails": {
      "price": 300,
      "currency": "INR"
    }
  }
}
```

{% endcode %}

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.conscent.ai/old-webhooks/subscription-cancelled-webhook.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
