subscription.created

The subscription.created event is triggered when a user subscribes. (when the end-user subscribes - new subscription is created on the end-user's account)

Here are some examples:

  • If a user decides to create an account on a website, but does not subscribe, they will still receive an email
  • If a new user decides to subscribe, that will trigger both events "Customer.created" & "Subscription.created", which in return, will send two emails to the end-user
  • If an existing user decides to subscribe 3 months after registration, that will trigger the "Subscription.created" event, which in return, will send an email to the end-user
{
  "type": "subscription.created",
  "id": "evt_ejWLDXSs4rDSUiyDz7cAU3b3",
  "created": 1661349045,
  "data": {
    "object": {
      "object": "subscription",
      "id": 2556831,
      "address_id": 6906403,
      "address_shipping": {
        "object": "address",
        "id": 6906403,
        "city": "Toronto",
        "company": null,
        "country": "CA",
        "country_name": "Canada",
        "created_at": "2022-08-24T13:50:42.000000Z",
        "department": "1958 Bay Street",
        "first_name": "Ahmed",
        "is_default": true,
        "last_name": "Khairy",
        "line1": "1958 Bay Street",
        "line2": "1958 Bay Street",
        "postal_code": "M5J 2R8",
        "salutation": null,
        "state": "BC",
        "state_name": "British Columbia",
        "title": null,
        "type": "shipping",
        "updated_at": "2022-08-24T13:50:42.000000Z"
      },
      "agency_id": null,
      "auto_renew": true,
      "backdate_start_date": null,
      "billing": "send_invoice",
      "billing_cycle_anchor": "2022-08-24T13:50:43.000000Z",
      "cancel_at": null,
      "cancel_at_period_end": 0,
      "cancel_reason": null,
      "canceled_at": null,
      "canceled_by_email": null,
      "canceled_by_type": null,
      "coupon": null,
      "created": "2022-08-24T13:50:43.000000Z",
      "current_period_end": "2022-08-25T13:50:43.000000Z",
      "current_period_start": "2022-08-24T13:50:43.000000Z",
      "customer": {
        "object": "customer",
        "id": 6795567,
        "balance": 0,
        "created": "2022-08-24T13:48:28.000000Z",
        "currency": null,
        "default_source": null,
        "delinquent": false,
        "display_name": null,
        "email": "[email protected]",
        "email_confirm": null,
        "first_name": "New",
        "has_password": 0,
        "language": null,
        "last_name": "Customer",
        "metadata": null,
        "object_id": "cus_MIvo9Or7M8uXpz",
        "organization": {
          "id": 40,
          "account_id": 82,
          "name": "Pelcro",
          "created_at": "2022-08-08T19:22:31.000000Z",
          "updated_at": "2022-08-08T19:22:31.000000Z"
        },
        "password_last_updated_at": null,
        "phone": null,
        "phone_confirm": null,
        "salutation": null,
        "title": null
      },
      "days_until_due": 30,
      "default_source": null,
      "default_tax_rates": {
        "object": "list",
        "data": [
          {
            "object": "tax_rate",
            "id": 297,
            "active": 1,
            "display_name": "GST",
            "inclusive": 0,
            "jurisdiction": "CA",
            "percentage": "5.0000"
          }
        ]
      },
      "ended_at": null,
      "expires_at": null,
      "gift_code": null,
      "gift_donor_subscription_id": null,
      "gift_message": null,
      "gift_notification_sent": 0,
      "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": 1821233,
        "address_billing": null,
        "address_shipping": {
          "object": "address",
          "id": 6906403,
          "city": "Toronto",
          "company": null,
          "country": "CA",
          "country_name": "Canada",
          "created_at": "2022-08-24T13:50:42.000000Z",
          "department": "1958 Bay Street",
          "first_name": "Ahmed",
          "is_default": true,
          "last_name": "Khairy",
          "line1": "1958 Bay Street",
          "line2": "1958 Bay Street",
          "postal_code": "M5J 2R8",
          "salutation": null,
          "state": "BC",
          "state_name": "British Columbia",
          "title": null,
          "type": "shipping",
          "updated_at": "2022-08-24T13:50:42.000000Z"
        },
        "amount_due": 105,
        "amount_paid": 0,
        "amount_remaining": 105,
        "auto_advance": true,
        "billing": "send_invoice",
        "billing_address": null,
        "billing_reason": "subscription_create",
        "charge_id": null,
        "created": "2022-08-24T13:50:43.000000Z",
        "currency": "cad",
        "customer": {
          "object": "customer",
          "id": 6795567,
          "balance": 0,
          "created": "2022-08-24T13:48:28.000000Z",
          "currency": null,
          "default_source": null,
          "delinquent": false,
          "display_name": null,
          "email": "[email protected]",
          "email_confirm": null,
          "first_name": "New",
          "has_password": 0,
          "language": null,
          "last_name": "Customer",
          "metadata": null,
          "object_id": "cus_MIvo9Or7M8uXpz",
          "organization": {
            "id": 40,
            "account_id": 82,
            "name": "Pelcro",
            "created_at": "2022-08-08T19:22:31.000000Z",
            "updated_at": "2022-08-08T19:22:31.000000Z"
          },
          "password_last_updated_at": null,
          "phone": null,
          "phone_confirm": null,
          "salutation": null,
          "title": null
        },
        "customer_address": null,
        "customer_shipping": null,
        "default_tax_rates": {
          "object": "list",
          "data": [
            {
              "object": "tax_rate",
              "id": 297,
              "active": 1,
              "display_name": "GST",
              "inclusive": 0,
              "jurisdiction": "CA",
              "percentage": "5.0000"
            }
          ]
        },
        "deleted_at": null,
        "discount_id": null,
        "ending_balance": null,
        "finalized_at": null,
        "hosted_invoice_url": null,
        "invoice_pdf": "https://staging.pelcro.com/pdf/invoice/eyJpdiI6Im5iNU1sRXV3MFZqSkkyUEpHbDJuc0E9PSIsInZhbHVlIjoidmtidlZWWEVIeFV6Qkk0WmxyRGR3WHVadjR1RFRBOVNaR2ZMUFlqWElJND0iLCJtYWMiOiJjZDIxZmRjMGJiYWU5OGU1YzNlMDQ2NGM5NDYzZDk2M2YyMjk4NTZkYjkxYWYyZGJkNzZkMTZhYTRhZmFhN2ZlIiwidGFnIjoiIn0=",
        "is_imported": null,
        "lines": {
          "object": "list",
          "data": [
            {
              "object": "line_item",
              "id": 2282564,
              "amount": 100,
              "created_at": "2022-08-24T13:50:44.000000Z",
              "currency": "cad",
              "deleted_at": null,
              "description": "1 × Cool Product (at $1.00 / day)",
              "metadata": null,
              "object_id": "il_1LaJyhLuY8Os87GpUV9rBSUZ",
              "period": {
                "end": 1661435443,
                "start": 1661349043
              },
              "quantity": 1,
              "tax_amounts": {
                "object": "list",
                "data": [
                  {
                    "object": "tax_rate",
                    "id": 297,
                    "active": 1,
                    "amount": 5,
                    "display_name": "GST",
                    "inclusive": 0,
                    "jurisdiction": "CA",
                    "percentage": "5.0000"
                  }
                ]
              },
              "tax_rates": null,
              "updated_at": "2022-08-24T13:50:44.000000Z"
            }
          ]
        },
        "marked_uncollectible_at": null,
        "number": "3DF14E9D-0001",
        "object_id": "in_1LaJyhLuY8Os87Gp95o6JDWK",
        "paid_at": null,
        "period_end": "2022-08-24T13:50:43.000000Z",
        "period_start": "2022-08-24T13:50:43.000000Z",
        "post_payment_credit_notes_amount": 0,
        "pre_payment_credit_notes_amount": 0,
        "purchase_order": null,
        "source": null,
        "starting_balance": 0,
        "status": "scheduled",
        "subtotal": 100,
        "tax": 5,
        "tax_percent": "5.0000000",
        "total": 105,
        "total_tax_amounts": {
          "object": "list",
          "data": [
            {
              "object": "tax_rate",
              "id": 297,
              "active": 1,
              "amount": 5,
              "display_name": "GST",
              "inclusive": 0,
              "jurisdiction": "CA",
              "percentage": "5.0000"
            }
          ]
        },
        "updated_at": "2022-08-24T13:50:45.000000Z",
        "voided_at": null
      },
      "object_id": "sub_1LaJyhLuY8Os87Gp698JRHUw",
      "plan": {
        "object": "plan",
        "id": 364301,
        "object_id": "plan_MIvnsToWS9iXrQ",
        "active": "active",
        "amount": 100,
        "currency": "cad",
        "domains": null,
        "entitlements": null,
        "group_owner_plan_id": null,
        "interval": "day",
        "interval_count": 1,
        "nickname": "Cool Plan",
        "name_internal": null,
        "type": "regular",
        "member_seat_capacity": null,
        "trial_period_days": 0,
        "ip_addresses": null,
        "auto_renew": true,
        "shipments_per_interval": null,
        "product": {
          "object": "product",
          "id": 3429,
          "object_id": "prod_MIvnZ7yvwafvFk",
          "type": "service",
          "active": "active",
          "address_required": 0,
          "description": null,
          "entitlements": null,
          "livemode": false,
          "is_hidden": null,
          "name": "Cool Product",
          "name_internal": "Cool Product",
          "package_dimensions": null,
          "shippable": null,
          "statement_descriptor": null,
          "unit_label": null
        }
      },
      "quantity": 1,
      "renews_at": 1661435443,
      "schedules": null,
      "shipments_remaining": null,
      "shipments_suspended_until": null,
      "shipments_undeliverable": false,
      "shipping_address": {
        "object": "address",
        "id": 6906403,
        "city": "Toronto",
        "company": null,
        "country": "CA",
        "country_name": "Canada",
        "created_at": "2022-08-24T13:50:42.000000Z",
        "department": "1958 Bay Street",
        "first_name": "Ahmed",
        "is_default": true,
        "last_name": "Khairy",
        "line1": "1958 Bay Street",
        "line2": "1958 Bay Street",
        "postal_code": "M5J 2R8",
        "salutation": null,
        "state": "BC",
        "state_name": "British Columbia",
        "title": null,
        "type": "shipping",
        "updated_at": "2022-08-24T13:50:42.000000Z"
      },
      "site_id": 85,
      "source": "Phone",
      "start_date": "2022-08-24T13:50:43.000000Z",
      "status": "active",
      "trial_end": null,
      "trial_start": null
    }
  }
}