> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# appmixer.stripe.core.SubscriptionChanged

- Component: `appmixer.stripe.core.SubscriptionChanged`
- Kind: Trigger
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.stripe 3.1.0](https://connectors.appmixer.com/connector/appmixer.stripe/3.1.0.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.stripe/3.1.0/component/appmixer.stripe.core.SubscriptionChanged>

Triggers when a subscription is created, updated (e.g. a plan change, renewal or status change) or canceled. For updates, Previous Attributes holds the values that changed. Stripe allows up to 16 webhook endpoints per account; each running flow with this trigger uses one. A restricted API key needs write access to Webhook Endpoints and read access to Events.

## Properties

| Field | Type | Description |
| --- | --- | --- |
| Events (`events`) | multiselect | The Stripe events that start the flow. If none is selected, all three are used. |

## Output ports

### Port `out`

| Field | Type | Description |
| --- | --- | --- |
| Event ID (`id`) | string | - |
| Event Type (`type`) | string | - |
| Created (Unix Timestamp) (`created`) | integer | - |
| Live Mode (`livemode`) | boolean | - |
| Subscription (`data`) | object | - |
| Previous Attributes (`previousAttributes`) | object | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.stripe.core.SubscriptionChanged",
  "description": "Triggers when a subscription is created, updated (e.g. a plan change, renewal or status change) or canceled. For updates, Previous Attributes holds the values that changed. Stripe allows up to 16 webhook endpoints per account; each running flow with this trigger uses one. A restricted API key needs write access to Webhook Endpoints and read access to Events.",
  "author": "Appmixer <info@appmixer.com>",
  "version": "1.0.0",
  "trigger": true,
  "webhook": true,
  "auth": {
    "service": "appmixer:stripe"
  },
  "quota": {
    "manager": "appmixer:stripe",
    "resources": "requests"
  },
  "properties": {
    "schema": {
      "type": "object",
      "properties": {
        "events": {
          "type": [
            "array",
            "string"
          ],
          "items": {
            "type": "string"
          }
        }
      }
    },
    "inspector": {
      "inputs": {
        "events": {
          "type": "multiselect",
          "label": "Events",
          "index": 1,
          "defaultValue": [
            "customer.subscription.created",
            "customer.subscription.updated",
            "customer.subscription.deleted"
          ],
          "tooltip": "The Stripe events that start the flow. If none is selected, all three are used.",
          "options": [
            {
              "label": "Subscription Created",
              "value": "customer.subscription.created"
            },
            {
              "label": "Subscription Updated",
              "value": "customer.subscription.updated"
            },
            {
              "label": "Subscription Canceled",
              "value": "customer.subscription.deleted"
            }
          ]
        }
      }
    }
  },
  "outPorts": [
    {
      "name": "out",
      "schema": {
        "type": "object",
        "required": [
          "id",
          "type",
          "created",
          "data"
        ],
        "properties": {
          "id": {
            "type": "string",
            "title": "Event ID",
            "example": "evt_1NG8Du2eZvKYlo2CUI79vXWy"
          },
          "type": {
            "type": "string",
            "title": "Event Type",
            "example": "customer.subscription.updated"
          },
          "created": {
            "type": "integer",
            "title": "Created (Unix Timestamp)",
            "example": 1686089970
          },
          "livemode": {
            "type": "boolean",
            "title": "Live Mode",
            "example": false
          },
          "data": {
            "type": "object",
            "title": "Subscription",
            "required": [
              "id",
              "object",
              "status",
              "customer",
              "created"
            ],
            "properties": {
              "id": {
                "type": "string",
                "title": "Subscription.ID",
                "example": "sub_1MowQVLkdIwHu7ixeRlqHVzs"
              },
              "object": {
                "type": "string",
                "title": "Subscription.Object",
                "example": "subscription"
              },
              "status": {
                "type": "string",
                "title": "Subscription.Status",
                "example": "active"
              },
              "customer": {
                "type": "string",
                "title": "Subscription.Customer ID",
                "example": "cus_Na6dX7aXxi11N4"
              },
              "collection_method": {
                "type": "string",
                "title": "Subscription.Collection Method",
                "example": "charge_automatically"
              },
              "currency": {
                "type": "string",
                "title": "Subscription.Currency",
                "example": "usd"
              },
              "cancel_at_period_end": {
                "type": "boolean",
                "title": "Subscription.Cancel At Period End",
                "example": false
              },
              "cancel_at": {
                "type": [
                  "integer",
                  "null"
                ],
                "title": "Subscription.Cancel At (Unix Timestamp)",
                "example": null
              },
              "canceled_at": {
                "type": [
                  "integer",
                  "null"
                ],
                "title": "Subscription.Canceled At (Unix Timestamp)",
                "example": null
              },
              "ended_at": {
                "type": [
                  "integer",
                  "null"
                ],
                "title": "Subscription.Ended At (Unix Timestamp)",
                "example": null
              },
              "trial_start": {
                "type": [
                  "integer",
                  "null"
                ],
                "title": "Subscription.Trial Start (Unix Timestamp)",
                "example": null
              },
              "trial_end": {
                "type": [
                  "integer",
                  "null"
                ],
                "title": "Subscription.Trial End (Unix Timestamp)",
                "example": null
              },
              "start_date": {
                "type": "integer",
                "title": "Subscription.Start Date (Unix Timestamp)",
                "example": 1680893993
              },
              "latest_invoice": {
                "type": [
                  "string",
                  "null"
                ],
                "title": "Subscription.Latest Invoice ID",
                "example": "in_1MowQWLkdIwHu7ixuzkSPfKd"
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ],
                "title": "Subscription.Description",
                "example": "Gold plan"
              },
              "created": {
                "type": "integer",
                "title": "Subscription.Created (Unix Timestamp)",
                "example": 1680893993
              },
              "livemode": {
                "type": "boolean",
                "title": "Subscription.Live Mode",
                "example": false
              },
              "metadata": {
                "type": "object",
                "title": "Subscription.Metadata",
                "example": {
                  "accountId": "acme-42"
                }
              },
              "items": {
                "type": "object",
                "title": "Subscription.Items",
                "properties": {
                  "data": {
                    "type": "array",
                    "title": "Subscription.Items.Data",
                    "items": {
                      "type": "object"
                    },
                    "example": [
                      {
                        "id": "si_Na6dzxczY5fwHx",
                        "price": {
                          "id": "price_1MowQULkdIwHu7ixraBm864M",
                          "unit_amount": 1000,
                          "currency": "usd"
                        },
                        "quantity": 1
                      }
                    ]
                  }
                }
              }
            }
          },
          "previousAttributes": {
            "type": "object",
            "title": "Previous Attributes",
            "example": {
              "status": "trialing"
            }
          }
        }
      }
    }
  ],
  "icon": "(data URI omitted)"
}
```
