Skip to main content

Documentation

Trial Nearing End Webhook

The CUSTOMER_SUBSCRIPTION_TRIAL_WILL_END webhook is sent 3 days before the end of a subscription trial period.

  • CUSTOMER_SUBSCRIPTION_TRIAL_WILL_END Webhook

  • {
      "id": "wh_beee0db0dc021a1a042bfe3945d8e011",
      "type": "CUSTOMER_SUBSCRIPTION_TRIAL_WILL_END",
      "data": {
        "id": "sub_1e15fad92f711c3fa1f00db92ef8d91f",
        "type": "payment",
        "status": "trialing",
        "billing": "pay_automatically",
        "discount": null,
        "ended_at": null,
        "metadata": {},
        "trial_end": 1669377641,
        "created_at": 1668945641,
        "canceled_at": null,
        "tax_percent": 0,
        "trial_start": 1668945641,
        "payout_fields": null,
        "customer_token": "cus_c0cf01e6610a80f056d48252d3ad2c37",
        "days_until_due": 30,
        "payment_fields": null,
        "payment_method": "other_91c1d735a483f86d6e2631a3bcbb45de",
        "current_period_end": 1669377641,
        "subscription_items": {
          "url": "/v1/subscription_items?subscription=sub_1e15fad92f711c3fa1f00db92ef8d91f",
          "data": [
            {
              "id": "subi_511fe66bb4e184d25727f2025e770750",
              "plan": {
                "id": "plan_7a51ebf97431a4be38777790f2a95d7c",
                "tiers": [],
                "amount": 500,
                "product": {
                  "id": "product_4467adcd4c2062664e69b189d8e7a541",
                  "name": "SEO",
                  "skus": [],
                  "type": "services",
                  "active": true,
                  "images": [
                    "64bit-encoded-image-1"
                  ],
                  "metadata": {
                    "merchant_defined": true
                  },
                  "shippable": false,
                  "attributes": [
                    "frequency"
                  ],
                  "created_at": 1668930252,
                  "unit_label": "",
                  "updated_at": 1668930252,
                  "description": "SEO services",
                  "package_dimensions": {
                    "width": 0,
                    "height": 0,
                    "length": 0,
                    "weight": 0
                  },
                  "statement_descriptor": "SEO Services"
                },
                "currency": "USD",
                "interval": "week",
                "metadata": {},
                "nickname": "Weekly SEO Pro",
                "created_at": 1668945296,
                "tiers_mode": "",
                "usage_type": "licensed",
                "billing_scheme": "per_unit",
                "interval_count": 1,
                "aggregate_usage": "sum",
                "transform_usage": {
                  "round": "up",
                  "divide_by": 1
                },
                "trial_period_days": 5
              },
              "created": 1668945641,
              "metadata": null,
              "quantity": 1
            }
          ],
          "has_more": false,
          "total_count": 1
        },
        "billing_cycle_anchor": 1669377641,
        "cancel_at_period_end": false,
        "current_period_start": 1668945641
      },
      "trigger_operation_id": "a686c073-7975-434a-80a1-cf837171ae26",
      "status": "NEW",
      "created_at": 1669110656,
      "extended_timestamp": 1669110656545
    }