Skip to main content

Overview

The subscription.created webhook is triggered when a new subscription is created for a customer in your Metrifox account.

When It’s Triggered

This event is sent immediately after a subscription is successfully created, which can happen when:
  • A customer purchases a plan that creates a subscription
  • A subscription is created through the API
  • A subscription is manually assigned to a customer
  • A scheduled subscription becomes active

Payload Structure

Data Fields

The payload includes:

data.subscription

  • id: Internal subscription ID
  • status: Subscription status (e.g., “active”, “cancelled”, “past_due”)
  • ends_at: Subscription end timestamp (if scheduled to end)
  • plan_id: ID of the plan associated with this subscription
  • metadata: Custom metadata object
  • order_id: Order ID that created the subscription
  • paused_at: Pause timestamp (if paused)
  • renews_at: Next renewal timestamp
  • starts_at: Subscription start timestamp
  • tenant_id: The tenant ID this subscription belongs to
  • created_at: Timestamp when the subscription was created
  • updated_at: Timestamp when the subscription was last updated
  • customer_id: ID of the customer who owns the subscription
  • customer_key: Your external customer identifier
  • cancelled_at: Cancellation timestamp (if cancelled)
  • converted_at: Conversion timestamp (if converted)
  • currency_code: Currency code (e.g., “USD”, “NGN”)
  • trial_end_date: Trial end timestamp (if applicable)
  • price_option_id: Price option ID
  • billing_interval: Billing interval (e.g., “monthly”)
  • renew_date_anchor: Renewal day of month anchor
  • subscription_number: Subscription number
  • billing_interval_value: Billing interval value

data.subscription_items

  • id: Subscription item ID
  • quantity: Quantity for the item
  • source_id: Source record ID
  • created_at: Timestamp when the item was created
  • updated_at: Timestamp when the item was last updated
  • source_type: Source record type
  • price_option_id: Price option ID
  • subscription_id: Subscription ID the item belongs to

Example Use Cases

  • Activate features in your application for the customer
  • Send subscription confirmation emails
  • Sync subscription data to your CRM
  • Trigger onboarding workflows for new subscribers
  • Update user access levels