Subscriber Event Object
Name | Type | Description | Example |
---|---|---|---|
id | str | Identifier of the event | “mmmm4444nnnn3333pppp” |
type | str | The type of event that occurred | See below for full list of event types |
created | int | Unix timestampe when the event occurred | 1622589211 |
data | object | Type | See JSON below |
data.object.type | str | Resource type of event | "Subscription" |
data.object.merchant | str | Identifier of merchant | "aaaa1111bbbb2222cccc" |
data.object.merchant_user_id | str | ID of consumer from merchant system. | "dddjjjjkk3343" |
data.object.subscription | str | ID of corresponding subscription that triggered the subscriber event. Is empty if event can have more than one subscription | "ssss3333llll2222bbbb" |
data.object.subscriptions | array | List of the ids of the corresponding subscriptions that triggered the event. Is empty if event can only have one subscription. | ["ssss3333llll2222bbbb", "ssss3333llll2222aaaa"] |
data.object.session_id | str | Session ID, obtained from og_session_id cookie | "aaaa1111bbbb2222cccc.450125.1299622365" |
data.object.first_name | str | Customer first name | "John" |
data.object.last_name | str | Customer last name | "Smith" |
data.object.email | str | Customer email | "[email protected]" |
data.object.phone_number | str | Customer phone number | "555-555-5555" |
data.object.phone_type | int | Phone type enum. Options: 0, 1, 2, 3 | 2 |
data.object.phone_type_display | str | Readable version of phone type enum. Options: "invalid", "landline", "mobile", "voip" | "mobile" |
data.object.live | bool | Customer status. "true" if they have any subscriptions active; false if no subscriptions are active. | true |
data.object.created | int | Unix timestamp when the customer was created | 1298407706 |
data.object.last_updated | int | Unix timestamp when the customer was last updated | 1301323663 |
data.object.extra_data | object | Key/value store for any extra information about the customer | {"some": "extra", "fields": "here"} |
data.object.locale | int | Locale enum. Options: 1 - 46 | 1 |
data.object.locale_display | str | Readable version of locale enum. | "en-us" |
- Example data:
{
"id": "mmmm4444nnnn3333pppp",
"type": "subscriber.create",
"created": 1622589211,
"data": {
"object": {
"type": "subscriber",
"merchant": "aaaa1111bbbb2222cccc",
"merchant_user_id": "dddjjjjkk3343",
"subscription": "ssss3333llll2222bbbb",
"subscriptions": ["ssss3333llll2222aaaa", "ssss3333llll2222cccc"],
"session_id": "aaaa1111bbbb2222cccc.450125.1299622365",
"first_name": "John",
"last_name": "Smith",
"email": "[email protected]",
"phone_number": "555-555-5555",
"phone_type": 2,
"phone_type_display": "mobile",
"live": true,
"created": 1298407706,
"last_updated": 1301323663,
"extra_data": {},
"locale": 1,
"locale_display": "en-us",
}
}
}
Subscriber Event Types
-
subscriber.create
-
subscriber.cancel
-
subscriber.subscriptions_created
Triggered when a customer has created their first subscription. Contains the public id of the first subscription created in the "subscription" property. Has an empty "subscriptions" property. This event can only ever occur once for a customer.
Triggered when a customer has cancelled their last active subscription and thus will no longer be generating any recurring revenue. Contains the public id of the last subscription canceled in the "subscription" property. Has an empty "subscriptions" property. This event can be triggered multiple times for a customer. For example: I cancel my last subscription, reactivate it, and then cancel it again. This event will be triggered twice.
Triggered when a subscriber creates one or more subscriptions. Contain the public ids of the subscriptions that were created in the "subscriptions" property. Has an empty "subscription" property.