Core API
- Checkout
- Checkout Links
- Custom Checkout Fields
- Customers
- Subscriptions
- Orders
- Discounts
- Refunds
- Products
- Benefits
- License Keys
- Files
- Organizations
- Metrics
Customer Portal API
- GETGet Customer
- GETGet Organization
- Sessions
- Subscriptions
- Orders
- License Keys
- File Downloads
Webhook Events
- Customer Events
- Billing Events
- Organization Events
OAuth 2.0 API
- Connect
- Clients
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
"customer.state_changed"
"customer.state_changed"
A customer along with additional state information:
- Active subscriptions
- Active benefits
The ID of the customer.
"992fae2a-2a17-4b7a-8d9e-e287cf90131b"
Creation timestamp of the object.
Last modification timestamp of the object.
The ID of the customer in your system. This must be unique within the organization. Once set, it can't be updated.
"usr_1337"
The email address of the customer. This must be unique within the organization.
"customer@example.com"
Whether the customer email address is verified. The address is automatically verified when the customer accesses the customer portal using their email address.
true
The name of the customer.
"John Doe"
["911144442", "us_ein"]
The ID of the organization owning the customer.
"1dbfc517-0bbf-4301-9ba8-555ca42b9737"
The customer's active subscriptions.
An active customer subscription.
The ID of the subscription.
"e5149aae-e521-42b9-b24c-abb3d71eea2e"
Creation timestamp of the object.
Last modification timestamp of the object.
"active"
"active"
The amount of the subscription.
1000
The currency of the subscription.
"usd"
The interval at which the subscription recurs.
month
, year
The start timestamp of the current billing period.
"2025-02-03T13:37:00Z"
The end timestamp of the current billing period.
"2025-03-03T13:37:00Z"
Whether the subscription will be canceled at the end of the current period.
false
The timestamp when the subscription was canceled. The subscription might still be active if cancel_at_period_end
is true
.
null
The timestamp when the subscription started.
"2025-01-03T13:37:00Z"
The timestamp when the subscription will end.
null
The ID of the subscribed product.
"d8dd2de1-21b7-4a41-8bc3-ce909c0cfe23"
The ID of the subscribed price.
"196ca717-4d84-4d28-a1b8-777255797dbc"
The ID of the applied discount, if any.
null
The customer's active benefit grants.
An active benefit grant for a customer.
The ID of the grant.
"d322132c-a9d0-4e0d-b8d3-d81ad021a3a9"
Creation timestamp of the object.
Last modification timestamp of the object.
The timestamp when the benefit was granted.
"2025-01-03T13:37:00Z"
The ID of the benefit concerned by this grant.
"397a17aa-15cf-4cb4-9333-18040203cf98"
The type of the benefit concerned by this grant.
custom
, discord
, github_repository
, downloadables
, license_keys
"custom"
"https://www.gravatar.com/avatar/xxx?d=blank"
Was this page helpful?
{
"type": "customer.state_changed",
"data": {
"id": "992fae2a-2a17-4b7a-8d9e-e287cf90131b",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"metadata": {},
"external_id": "usr_1337",
"email": "customer@example.com",
"email_verified": true,
"name": "John Doe",
"billing_address": {
"line1": "<string>",
"line2": "<string>",
"postal_code": "<string>",
"city": "<string>",
"state": "<string>",
"country": "US"
},
"tax_id": [
"911144442",
"us_ein"
],
"organization_id": "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
"active_subscriptions": [
{
"id": "e5149aae-e521-42b9-b24c-abb3d71eea2e",
"created_at": "2023-11-07T05:31:56Z",
"modified_at": "2023-11-07T05:31:56Z",
"custom_field_data": {},
"metadata": {},
"status": "active",
"amount": 1000,
"currency": "usd",
"recurring_interval": "month",
"current_period_start": "2025-02-03T13:37:00Z",
"current_period_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",
"price_id": "196ca717-4d84-4d28-a1b8-777255797dbc",
"discount_id": null
}
],
"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",
"properties": {
"account_id": "<string>",
"guild_id": "<string>",
"role_id": "<string>"
}
}
],
"avatar_url": "https://www.gravatar.com/avatar/xxx?d=blank"
}
}