> ## Documentation Index
> Fetch the complete documentation index at: https://docs.metrifox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Subscription Created

## 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

```json theme={null}
{
  "id": "550e8400-e29b-41d4-a716-446655440004",
  "type": "subscription.created",
  "created_at": 1704067440000,
  "data": {
    "subscription": {
      "id": "3f99de2d-c11d-49d3-ba47-a77e4151cad5",
      "status": "active",
      "ends_at": null,
      "plan_id": "54adc052-0ba7-4c90-8ba2-7ff6af06de26",
      "metadata": {},
      "order_id": "40191cca-475a-461f-9587-d97e0ee48d1b",
      "paused_at": null,
      "renews_at": "2026-03-09T11:54:48.341Z",
      "starts_at": "2026-02-09T11:54:48.124Z",
      "tenant_id": "b1b7b362-5c5c-48a5-9454-94c3c4d3e5b3",
      "created_at": "2026-02-09T11:54:48.171Z",
      "updated_at": "2026-02-09T11:54:48.353Z",
      "customer_id": "ce9479d4-9fe2-4a0d-9674-6a43427c2075",
      "customer_key": "cust_ext_67890",
      "cancelled_at": null,
      "converted_at": null,
      "currency_code": "USD",
      "trial_end_date": null,
      "price_option_id": "90941e5e-e9b5-496d-998a-d472980392c2",
      "billing_interval": "monthly",
      "renew_date_anchor": 9,
      "subscription_number": "SAN-20260209-OM9FO1",
      "billing_interval_value": 1
    },
    "subscription_items": [
      {
        "id": "233a9ffc-146e-4981-922c-9ee06f92440f",
        "quantity": 1,
        "source_id": "54adc052-0ba7-4c90-8ba2-7ff6af06de26",
        "created_at": "2026-02-09T11:54:48.198Z",
        "updated_at": "2026-02-09T11:54:48.198Z",
        "source_type": "ProductCatalogues::Offerings::OfferingVersion",
        "price_option_id": "90941e5e-e9b5-496d-998a-d472980392c2",
        "subscription_id": "3f99de2d-c11d-49d3-ba47-a77e4151cad5"
      },
      {
        "id": "fb7cee3b-51fe-49fc-bf5a-8b80273d4a0f",
        "quantity": 1,
        "source_id": "58ced965-c6da-4ced-a465-ff0cc1ad72f6",
        "created_at": "2026-02-09T11:54:48.229Z",
        "updated_at": "2026-02-09T11:54:48.229Z",
        "source_type": "ProductCatalogues::Entitlements::Entitlement",
        "price_option_id": "a5114704-f481-4997-b9e2-06f1aaebe081",
        "subscription_id": "3f99de2d-c11d-49d3-ba47-a77e4151cad5"
      },
      {
        "id": "2dbb2836-364d-44d3-8396-204cb3e37e69",
        "quantity": 1,
        "source_id": "42141c03-491d-49d0-8291-d17af4f3f20c",
        "created_at": "2026-02-09T11:54:48.245Z",
        "updated_at": "2026-02-09T11:54:48.245Z",
        "source_type": "CreditSystems::CreditAttachment",
        "price_option_id": "67380401-642f-4b5a-91dd-acc6ebaf2093",
        "subscription_id": "3f99de2d-c11d-49d3-ba47-a77e4151cad5"
      }
    ]
  }
}
```

## 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
