# subscription.cancelled

Webhook event `subscription.cancelled`, sent as `POST` to the URL of each webhook subscriber that subscribes to it.

Sent when a subscription is cancelled.

This describes webhook payload version 2. Version 1 sends the same envelope, with `data` in the shape of the object's retrieve endpoint; the Webhooks guide explains both.

## Request

### Header parameters

- `X-Webhook-HMAC` (string, required): The HMAC-SHA256 of the raw request body, keyed with the subscriber's shared secret, as a hex string. Verify it before trusting the body.
- `X-Webhook-Id` (string, required): The ID of the delivery. It stays the same when the delivery is retried.
- `X-Webhook-Attempt` (integer, required): Which attempt this is, starting at 1. Minimum 1.

## Payload

Content type `application/json`, required.

Type: object.

- `profile` (string, required): The ID of the webhook subscriber the delivery is for. Use it to choose the shared secret that verifies the signature.
- `merchantId` (string, required): The ID of your merchant account.
- `eventId` (string, required): The ID of the event. It is the same for every delivery of the event, so use it to skip duplicates.
- `eventType` (string, required): One of `subscription.cancelled`.
- `timestamp` (string (date-time), required): When the event happened.
- `data` (object (SubscriptionWebhookSnapshot) or object (WebhookSubjectReference), required): The subscription as the event left it. Rarely, when the event could not be captured at that moment, `data` is read when the webhook is built instead, or contains only `id` if the subscription no longer exists.
  - When the value is SubscriptionWebhookSnapshot:
    - `id` (string, required): The ID of the object.
    - `createdAt` (string (date-time), required): When the object was created.
    - `updatedAt` (string (date-time), required, nullable): When the object was last updated.
    - `status` (string, required): One of `active`, `cancelled`.
    - `autoBillingEnabled` (boolean, required)
    - `autoBillingDisabledAt` (string (date-time), required, nullable)
    - `autoBillingDisabledReason` (string, required, nullable): One of `recurring_payment_errored`, `subscription_cancelled`, `latest_invoice_retrying`.
    - `startDate` (string (date-time), required)
    - `endDate` (string (date-time), required, nullable)
    - `currentPeriodStart` (string (date-time), required)
    - `currentPeriodEnd` (string (date-time), required)
    - `currentCycle` (integer, required): Minimum -9007199254740991. Maximum 9007199254740991.
    - `cancelAtPeriodEnd` (boolean, required)
    - `cancelAtCycle` (integer, required, nullable): Minimum -9007199254740991. Maximum 9007199254740991.
    - `cancellationReason` (string, nullable): Why the subscription was cancelled. `null` while it is active. Absent on events recorded before this field was introduced. One of `requested`, `payment_failed`, `chargeback`, `customer_blacklisted`.
    - `customer` (string, required): The ID of the customer. Retrieve it from the API for the full object.
    - `price` (string, required): The ID of the price. Retrieve it from the API for the full object.
    - `setupInvoice` (string, required, nullable): The ID of the setup invoice. Retrieve it from the API for the full object.
    - `setupLineItem` (string, required, nullable): The ID of the setup line item. It has no retrieve endpoint of its own.
    - `billingSettings` (object, required, nullable)
      - `paymentMethodType` (string, required): One of `card`, `paypal`, `applePay`.
      - `captureMethod` (string, required): One of `automatic`, `automaticDelayed`, `manual`.
      - `captureDelay` (integer, required, nullable): Minimum -9007199254740991. Maximum 9007199254740991.
    - `upcomingInvoice` (object, required, nullable)
      - `amount` (integer, required): Minimum -9007199254740991. Maximum 9007199254740991.
      - `currency` (string, required): One of `usd`, `eur`, `gbp`, `cad`, `aud`, `pln`, `czk`, `sek`, `dkk`.
      - `periodStart` (string (date-time), required)
      - `periodEnd` (string (date-time), required)
      - `comment` (string, required, nullable)
    - `metadata` (object, required, nullable): Your metadata on the object, after the change that caused the event.
  - When the value is WebhookSubjectReference:
    - `id` (string, required): The ID of the object.

## Your response

### `2XX`

Acknowledges the delivery. Respond within 15 seconds; any other response, or none, is retried.


---

Generated from the Core API v2 OpenAPI document, https://api.odus.com/openapi.v2.json. Interactive page: https://docs.odus.com/docs/api/core/v2/webhook-subscription-cancelled
