Skip to main content

Documentation

Subscription Updated Webhook

The CUSTOMER_SUBSCRIPTION_UPDATED webhook is sent when a subscription object is modified.

  • CUSTOMER_SUBSCRIPTION_UPDATED Webhook

  • {
        "id": "wh_4255d650d6e3b631932919dddb7f4b0a",
        "type": "CUSTOMER_SUBSCRIPTION_UPDATED",
        "data": {
            "id": "sub_005ca057b15771a535469a60ccce98a2",
            "type": "payment",
            "status": "active",
            "billing": "pay_automatically",
            "discount": null,
            "ended_at": null,
            "metadata": {},
            "trial_end": null,
            "created_at": 1641802550,
            "canceled_at": null,
            "tax_percent": 0,
            "trial_start": null,
            "payout_fields": null,
            "customer_token": "cus_d3ed65d5091a8398cc3651bcedec1201",
            "days_until_due": null,
            "payment_fields": null,
            "payment_method": "card_85264b18bc1bfb949dbb2d88d3d5c12c",
            "current_period_end": 1641975350,
            "subscription_items": {
                "url": "/v1/subscription_items?subscription=sub_005ca057b15771a535469a60ccce98a2",
                "data": [{
                        "id": "subi_139cc833a43aa340ee25ca59a4a34ea6",
                        "plan": {
                            "id": "plan_a2b5060d3e93d4c32883ac2b39c3f2de",
                            "tiers": [],
                            "amount": 1050,
                            "product": {
                                "id": "product_2ddd6f6b43f598d30543ef23ab806b58",
                                "name": "Acme music stream",
                                "skus": [],
                                "type": "services",
                                "active": true,
                                "images": [],
                                "metadata": {},
                                "shippable": false,
                                "attributes": [],
                                "created_at": 1641481860,
                                "unit_label": "",
                                "updated_at": 1641481860,
                                "description": "",
                                "package_dimensions": {
                                    "width": 0,
                                    "height": 0,
                                    "length": 0,
                                    "weight": 0
                                },
                                "statement_descriptor": ""
                            },
                            "currency": "USD",
                            "interval": "day",
                            "metadata": {},
                            "nickname": "Plan 1050",
                            "created_at": 1641802015,
                            "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": 0
                        },
                        "created": 1641802550,
                        "metadata": null,
                        "quantity": 1
                    }
                ],
                "has_more": false,
                "total_count": 0
            },
            "billing_cycle_anchor": 1641802550,
            "cancel_at_period_end": false,
            "current_period_start": 1641888950
        },
        "trigger_operation_id": "5df6b51b-0203-4930-a9d0-b51353e31464",
        "status": "NEW",
        "created_at": 1641859559,
        "extended_timestamp": 1641859559431
    }