Skip to main content

Overview

The subscription.cancelled webhook is triggered when a subscription is cancelled in your Metrifox account. This event is sent when a subscription is immediately cancelled (not scheduled for future cancellation).

When It’s Triggered

This event is sent immediately after a subscription is successfully cancelled, which can happen when:
  • A customer cancels their subscription immediately
  • A subscription is cancelled through the API
  • A subscription is cancelled manually in the dashboard
  • A subscription is cancelled due to payment failure or other reasons
For subscriptions scheduled to cancel at the end of the billing period, see the subscription.cancel_scheduled event instead.

Payload Structure

{
  "id": "550e8400-e29b-41d4-a716-446655440005",
  "type": "subscription.cancelled",
  "created_at": 1704067500000,
  "data": {
    "subscription": {
      "id": "101",
      "subscription_key": "sub_abc123",
      "customer_id": "123",
      "customer_key": "cust_abc123",
      "plan_id": "plan_456",
      "plan_name": "Pro Plan",
      "status": "cancelled",
      "billing_interval": "monthly",
      "cancelled_at": "2024-01-01T00:05:00Z",
      "current_period_start": "2024-01-01T00:00:00Z",
      "current_period_end": "2024-02-01T00:00:00Z",
      "tenant_id": "456",
      "created_at": "2024-01-01T00:04:00Z",
      "updated_at": "2024-01-01T00:05:00Z"
      // ... other subscription fields
    }
  }
}

Data Fields

The data.subscription object contains the subscription record with cancellation details:
  • id: Internal subscription ID
  • subscription_key: Unique subscription identifier
  • customer_id: ID of the customer who owned the subscription
  • customer_key: Customer key
  • plan_id: ID of the plan that was cancelled
  • plan_name: Name of the cancelled plan
  • status: Subscription status (will be “cancelled”)
  • billing_interval: Billing frequency
  • cancelled_at: Timestamp when the subscription was cancelled
  • current_period_start: Start date of the current billing period
  • current_period_end: End date of the current billing period
  • tenant_id: The tenant ID this subscription belongs to
  • created_at: Original timestamp when the subscription was created
  • updated_at: Timestamp when the subscription was cancelled
  • Additional subscription-specific fields

Example Use Cases

  • Deactivate features in your application for the customer
  • Send cancellation confirmation emails
  • Update user access levels
  • Trigger retention workflows
  • Update analytics and reporting
  • Sync cancellation data to your CRM