Customer Events
customer.state_changed
Sent when a customer state has changed.
It’s triggered when:
- Customer is created, updated or deleted.
- A subscription is created or updated.
- A benefit is granted or revoked.
Discord & Slack support: Basic
WEBHOOK
customer.state_changed
{
"type": "customer.state_changed",
"timestamp": "2023-11-07T05:31:56Z",
"data": {
"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"metadata": {},
"email": "customer@example.com",
"email_verified": true,
"type": "individual",
"name": "John Doe",
"billing_name": "John Doe",
"billing_address": {
"country": "US",
"line1": "<string>",
"line2": "<string>",
"postal_code": "<string>",
"city": "<string>",
"state": "<string>"
},
"tax_id": {
"[0]": "<string>"
},
"organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
"deleted_at": "2023-11-07T05:31:56Z",
"first_user_event_at": "2023-11-07T05:31:56Z",
"avatar_url": "https://www.gravatar.com/avatar/xxx?d=404",
"active_subscriptions": [
{
"id": "e5149aae-e521-42b9-b24c-abb3d71eea2e",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"metadata": {},
"status": "active",
"amount": 1000,
"currency": "usd",
"current_period_start": "2025-02-03T13:37:00Z",
"current_period_end": "2025-03-03T13:37:00Z",
"trial_start": "2025-02-03T13:37:00Z",
"trial_end": "2025-03-03T13:37:00Z",
"cancel_at_period_end": false,
"canceled_at": null,
"started_at": "2025-01-03T13:37:00Z",
"ends_at": null,
"product_id": "d8dd2de1-21b7-4a41-8bc3-ce909c0cfe23",
"discount_id": null,
"meters": [
{
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"consumed_units": 25,
"credited_units": 100,
"amount": 0,
"meter_id": "d498a884-e2cd-4d3e-8002-f536468a8b22"
}
],
"custom_field_data": {}
}
],
"granted_benefits": [
{
"id": "d322132c-a9d0-4e0d-b8d3-d81ad021a3a9",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"granted_at": "2025-01-03T13:37:00Z",
"benefit_id": "397a17aa-15cf-4cb4-9333-18040203cf98",
"benefit_type": "custom",
"benefit_metadata": {
"key": "value"
},
"properties": {
"account_id": "<string>",
"guild_id": "<string>",
"role_id": "<string>",
"granted_account_id": "<string>"
}
}
],
"active_meters": [
{
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"meter_id": "d498a884-e2cd-4d3e-8002-f536468a8b22",
"consumed_units": 25,
"credited_units": 100,
"balance": 75
}
],
"external_id": "usr_1337",
"locale": "<string>",
"default_payment_method_id": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
application/json
Sent when a customer state has changed.
It's triggered when:
- Customer is created, updated or deleted.
- A subscription is created or updated.
- A benefit is granted or revoked.
Discord & Slack support: Basic
Allowed value:
"customer.state_changed"Example:
"customer.state_changed"
A customer along with additional state information:
- Active subscriptions
- Granted benefits
- Active meters
- CustomerStateIndividual
- CustomerStateTeam
Show child attributes
Show child attributes
Response
Successful Response
Was this page helpful?
⌘I
{
"type": "customer.state_changed",
"timestamp": "2023-11-07T05:31:56Z",
"data": {
"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"metadata": {},
"email": "customer@example.com",
"email_verified": true,
"type": "individual",
"name": "John Doe",
"billing_name": "John Doe",
"billing_address": {
"country": "US",
"line1": "<string>",
"line2": "<string>",
"postal_code": "<string>",
"city": "<string>",
"state": "<string>"
},
"tax_id": {
"[0]": "<string>"
},
"organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
"deleted_at": "2023-11-07T05:31:56Z",
"first_user_event_at": "2023-11-07T05:31:56Z",
"avatar_url": "https://www.gravatar.com/avatar/xxx?d=404",
"active_subscriptions": [
{
"id": "e5149aae-e521-42b9-b24c-abb3d71eea2e",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"metadata": {},
"status": "active",
"amount": 1000,
"currency": "usd",
"current_period_start": "2025-02-03T13:37:00Z",
"current_period_end": "2025-03-03T13:37:00Z",
"trial_start": "2025-02-03T13:37:00Z",
"trial_end": "2025-03-03T13:37:00Z",
"cancel_at_period_end": false,
"canceled_at": null,
"started_at": "2025-01-03T13:37:00Z",
"ends_at": null,
"product_id": "d8dd2de1-21b7-4a41-8bc3-ce909c0cfe23",
"discount_id": null,
"meters": [
{
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"consumed_units": 25,
"credited_units": 100,
"amount": 0,
"meter_id": "d498a884-e2cd-4d3e-8002-f536468a8b22"
}
],
"custom_field_data": {}
}
],
"granted_benefits": [
{
"id": "d322132c-a9d0-4e0d-b8d3-d81ad021a3a9",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"granted_at": "2025-01-03T13:37:00Z",
"benefit_id": "397a17aa-15cf-4cb4-9333-18040203cf98",
"benefit_type": "custom",
"benefit_metadata": {
"key": "value"
},
"properties": {
"account_id": "<string>",
"guild_id": "<string>",
"role_id": "<string>",
"granted_account_id": "<string>"
}
}
],
"active_meters": [
{
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"meter_id": "d498a884-e2cd-4d3e-8002-f536468a8b22",
"consumed_units": 25,
"credited_units": 100,
"balance": 75
}
],
"external_id": "usr_1337",
"locale": "<string>",
"default_payment_method_id": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}
