subscription.trial_will_end

The subscription.trial_will_end event will get triggered whenever the current end-user's subscription trial is about to expire. It is sent three days before the trial period ends.

You can use that to trigger email campaigns and promote subscriptions to your customers.

{
    "type": "subscription.trial_will_end",
    "id": "evt_HeqzE2IqqdochkzPVYdFTh5U",
    "created": 1624543775,
    "triggered_from": "open_api",
    "data": {
        "object": {
            "object": "subscription",
            "id": 6,
            "address_id": null,
            "campaign_id": null,
            "campaign_key":null,
            "address_shipping": null,
            "agency_id": null,
            "auto_renew": true,
            "backdate_start_date": null,
            "billing": "send_invoice",
            "billing_cycle_anchor": "2021-06-25 14:08:41",
            "campaign_id": 5374,
            "campaign_key": "InstantPromo",
            "cancel_at": null,
            "cancel_at_period_end": 0,
            "cancel_reason": null,
            "canceled_at": null,
            "coupon": null,
            "created": "2021-06-24 14:08:51",
            "current_period_end": "2021-06-25 14:08:41",
            "current_period_start": "2021-06-24 14:08:51",
            "customer": {
                "object": "customer",
                "id": 5,
                "balance": 0,
                "created": "2021-06-24 13:53:25",
                "currency": "cad",
                "default_source": null,
                "delinquent": false,
                "display_name": "display_name",
                "email": "[email protected]",
                "email_confirm": null,
                "first_name": "first name",
                "has_password": 0,
                "language": null,
      					"last_login_method": 'email',
                "last_name": "last name",
                "metadata": {
                    "pelcro_account_id": "1",
                    "pelcro_customer_id": "5"
                },
                "phone": "123456",
                "phone_confirm": null,
                "salutation": null,
                "title": null,
      					"username": null
            },
            "days_until_due": 30,
            "default_source": null,
            "default_tax_rates": null,
            "ended_at": null,
            "expires_at": null,
            "gift_code": null,
            "gift_donor_subscription_id": null,
            "gift_recipient_email": null,
            "gift_recipient_first_name": null,
            "gift_recipient_last_name": null,
            "gift_start_date": null,
            "is_gift_donor": null,
            "is_gift_recipient": null,
            "is_redeemed": null,
            "latest_invoice": {
                "object": "invoice",
                "id": 6,
                "address_billing": {
                    "object": "address",
                    "id": 2,
                    "city": "city name",
                    "company": null,
                    "country": "CA",
                    "country_name": "Canada",
                    "created_at": "2021-06-24 13:58:57",
                    "department": null,
                    "first_name": "first name",
                    "is_default": true,
                    "last_name": "last name",
                    "line1": "specific address",
                    "line2": null,
                    "postal_code": "12345",
                    "salutation": null,
                    "state": "QC",
                    "state_name": "Quebec",
                    "title": null,
                    "type": "billing",
                    "updated_at": "2021-06-24 13:58:57"
                },
                "address_shipping": null,
                "amount_due": 0,
                "amount_paid": 0,
                "amount_remaining": 0,
                "auto_advance": false,
                "billing": "send_invoice",
                "billing_address": {
                    "object": "address",
                    "id": 2,
                    "city": "city name",
                    "company": null,
                    "country": "CA",
                    "country_name": "Canada",
                    "created_at": "2021-06-24 13:58:57",
                    "department": null,
                    "first_name": "first name",
                    "is_default": true,
                    "last_name": "last name",
                    "line1": "specific address",
                    "line2": null,
                    "postal_code": "12345",
                    "salutation": null,
                    "state": "QC",
                    "state_name": "Quebec",
                    "title": null,
                    "type": "billing",
                    "updated_at": "2021-06-24 13:58:57"
                },
                "billing_reason": "subscription_create",
                "charge_id": null,
                "created": "2021-06-24 14:08:51",
                "currency": "cad",
                "customer": {
                    "object": "customer",
                    "id": 5,
                    "balance": 0,
                    "created": "2021-06-24 13:53:25",
                    "currency": "cad",
                    "default_source": null,
                    "delinquent": false,
                    "display_name": "display_name",
                    "email": "[email protected]",
                    "email_confirm": null,
                    "first_name": "first name",
                    "has_password": 0,
                    "language": null,
      							"last_login_method": 'email',
                    "last_name": "last name",
                    "metadata": {
                        "pelcro_account_id": "1",
                        "pelcro_customer_id": "5"
                    },
                    "phone": "123456",
                    "phone_confirm": null,
                    "salutation": null,
                    "title": null,
      							"username": null
                },
                "customer_address": {
                    "city": "city name",
                    "country": "CA",
                    "line1": "specific address",
                    "line2": null,
                    "postal_code": "12345",
                    "state": "QC"
                },
                "customer_shipping": null,
                "default_tax_rates": null,
                "deleted_at": null,
                "discount_id": null,
                "ending_balance": 0,
                "finalized_at": "2021-06-24 14:08:53",
                "is_imported": null,
                "lines": {
                    "object": "list",
                    "data": [
                        {
                            "object": "line_item",
                            "id": 6,
                            "amount": 0,
                            "created_at": "2021-06-24 14:08:55",
                            "currency": "cad",
                            "deleted_at": null,
                            "description": "Trial period for Cool product",
                            "metadata": {
                                "pelcro_site_id": "1",
                                "pelcro_subscription_id": "6"
                            },
                            "period": {
                                "end": 1624630121,
                                "start": 1624543731
                            },
                            "quantity": 1,
                            "tax_amounts": null,
                            "tax_rates": null,
                            "updated_at": "2021-06-24 14:08:55"
                        }
                    ]
                },
                "marked_uncollectible_at": null,
                "number": "4C6B728B-0004",
                "paid_at": "2021-06-24 14:08:53",
                "period_end": "2021-06-24 14:08:51",
                "period_start": "2021-06-24 14:08:51",
                "post_payment_credit_notes_amount": 0,
                "pre_payment_credit_notes_amount": 0,
                "purchase_order": null,
                "source": null,
                "plan": {
                    "id": 1,
                    "nickname": "test",
                    "interval": "day"
                },
                "product": {
                    "id": 1,
                    "name": "test",
                    "name_internal": null
                },
                "subscription_id": 10,
                "starting_balance": 0,
                "status": "paid",
                "subtotal": 0,
                "tax": null,
                "tax_percent": null,
                "total": 0,
                "total_tax_amounts": null,
                "updated_at": "2021-06-24 14:09:00",
                "voided_at": null
            },
            "plan": {
                "object": "plan",
                "id": 2,
                "active": "active",
                "amount": 10000,
                "currency": "cad",
                "domains": null,
                "description": null,
                "entitlements": null,
                "group_owner_plan_id": null,
                "interval": "year",
                "interval_count": 1,
                "nickname": "cool plan",
                "name_internal": "cool plan",
                "type": "regular",
                "trial_period_days": 0,
                "ip_addresses": null,
                "product": {
                    "object": "product",
                    "id": 1,
                    "type": "service",
                    "active": "active",
                    "address_required": 0,
                    "description": "Cool product",
                    "livemode": false,
                    "is_hidden": null,
                    "name": "Cool product",
                    "package_dimensions": null,
                    "shippable": null,
                    "statement_descriptor": "Cool product",
                    "unit_label": null
                }
            },
            "quantity": 1,
            "renews_at": 1660646666,
            "schedules": null,
            "shipments_remaining": null,
            "shipments_suspended_until": null,
            "shipments_undeliverable": false,
            "shipping_address": null,
            "site_id": 1,
            "source": "Phone",
            "start_date": "2021-06-24 14:08:51",
            "status": "trialing",
            "trial_end": "2021-06-25 14:08:41",
            "trial_start": "2021-06-24 14:08:51"
        },
        "previous_attributes": []
    }
}