# Canceled subscription

When a subscription is canceled, Xsolla sends a webhook with the cancel_subscription type to the webhook URL.

Endpoint: POST canceled-subscription
Version: 1.0

## Request fields (application/json):

  - `notification_type` (string, required)
    Notification type.

  - `settings` (object)
    Custom project settings (object).

  - `settings.project_id` (integer)
    Project ID. You can find this parameter in your [Publisher Account](https://publisher.xsolla.com/) next to the name of the project.

  - `settings.merchant_id` (integer)
    Merchant ID.

  - `user` (object)
    User details (object).

  - `user.id` (string, required)
    User ID.

  - `user.name` (string)
    Username.

  - `subscription` (object)
    Subscription details (object).

  - `subscription.plan_id` (string)
    Plan ID (external if the plan was created via API).

  - `subscription.tags` (array)
    Plan tags.

  - `subscription.subscription_id` (integer)
    Subscription ID in Xsolla database.

  - `subscription.product_id` (string)
    Product ID (if sent in the access token).

  - `subscription.date_create` (string)
    Subscription creation date. Date and time per [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601).

  - `subscription.date_end` (string)
    Subscription termination date. Date and time per [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601).

## Response 400 fields (application/json):

  - `error` (object)

  - `error.code` (string)

  - `error.message` (string)


## Response 204 fields

## Response 500 fields
