Webhooks
Membership Plan Webhooks
Detailed information about membership plan webhook events including membership_plan.created and membership_plan.updated.
membership_plan.created
The membership_plan.created event is triggered when a new membership plan is created in the system.
Event Properties
| Property | Type | Description |
|---|---|---|
| id | string | The unique identifier of the membership plan |
| name | string | The name of the membership plan |
| description | string | The description of the membership plan |
| currency | string | The currency code for the plan's price (default: "TWD") |
| amount | number | The price amount of the plan |
| interval | string | The billing interval (month, year) |
| interval_count | integer | The number of intervals between billings |
| active | boolean | Indicates if the plan is active |
| created_at | string | The timestamp when the plan was created (ISO 8601 format, e.g. "2023-12-04T18:45:44+08:00" or "2023-12-04T10:45:44Z") |
| updated_at | string | The timestamp when the plan was last updated (ISO 8601 format) |
| ended_at | string | The timestamp when the plan ends (ISO 8601 format, if applicable) |
| plan_type | string | The type of plan (recurring, fixed_date, specific_length, or lifetime) |
| quantity | integer | The quantity of items included in the plan |
| sold_items_count | integer | The number of items sold for this plan |
| slug | string | The URL-friendly identifier for the plan |
| max_interval_count | integer | The maximum number of intervals allowed |
| visible | boolean | Indicates if the plan is visible to users |
Example Payload
Recurring Plan Example
{
"type": "membership_plan.created",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Premium Monthly Membership",
"description": "Access to all premium features with monthly billing",
"currency": "TWD",
"amount": 1500.0,
"interval": "month",
"interval_count": 1,
"active": true,
"created_at": "2023-05-15T14:30:00Z",
"updated_at": "2023-05-15T14:30:00Z",
"ended_at": null,
"plan_type": "recurring",
"quantity": null,
"sold_items_count": 0,
"slug": "premium-monthly-membership",
"max_interval_count": null,
"visible": true
}
}Lifetime Plan Example
{
"type": "membership_plan.created",
"data": {
"id": "660e8500-f39c-52e5-b827-557766550111",
"name": "Lifetime Premium Access",
"description": "Permanent access to all premium features with a one-time payment",
"currency": "TWD",
"amount": 9999.0,
"interval": "lifetime",
"interval_count": 1,
"active": true,
"created_at": "2023-05-15T14:30:00Z",
"updated_at": "2023-05-15T14:30:00Z",
"ended_at": null,
"plan_type": "lifetime",
"quantity": null,
"sold_items_count": 0,
"slug": "lifetime-premium-access",
"max_interval_count": null,
"visible": true
}
}membership_plan.updated
The membership_plan.updated event is triggered when an existing membership plan is updated in the system.
Event Properties
| Property | Type | Description |
|---|---|---|
| id | string | The unique identifier of the membership plan |
| name | string | The name of the membership plan |
| description | string | The description of the membership plan |
| currency | string | The currency code for the plan's price (default: "TWD") |
| amount | number | The price amount of the plan |
| interval | string | The billing interval (month, year) |
| interval_count | integer | The number of intervals between billings |
| active | boolean | Indicates if the plan is active |
| created_at | string | The timestamp when the plan was created (ISO 8601 format, e.g. "2023-12-04T18:45:44+08:00" or "2023-12-04T10:45:44Z") |
| updated_at | string | The timestamp when the plan was last updated (ISO 8601 format) |
| ended_at | string | The timestamp when the plan ends (ISO 8601 format, if applicable) |
| plan_type | string | The type of plan (recurring, fixed_date, specific_length, or lifetime) |
| quantity | integer | The quantity of items included in the plan |
| sold_items_count | integer | The number of items sold for this plan |
| slug | string | The URL-friendly identifier for the plan |
| max_interval_count | integer | The maximum number of intervals allowed |
| visible | boolean | Indicates if the plan is visible to users |
Example Payload
Recurring Plan Example
{
"type": "membership_plan.updated",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Premium Annual Membership",
"description": "Access to all premium features with annual billing",
"currency": "TWD",
"amount": 15000.0,
"interval": "year",
"interval_count": 1,
"active": true,
"created_at": "2023-05-15T14:30:00Z",
"updated_at": "2023-05-16T10:15:00Z",
"ended_at": null,
"plan_type": "recurring",
"quantity": null,
"sold_items_count": 5,
"slug": "premium-annual-membership",
"max_interval_count": null,
"visible": true
}
}Lifetime Plan Example
{
"type": "membership_plan.updated",
"data": {
"id": "660e8500-f39c-52e5-b827-557766550111",
"name": "Lifetime Premium Access",
"description": "Permanent access to all premium features with a one-time payment",
"currency": "TWD",
"amount": 12999.0,
"interval": "lifetime",
"interval_count": 1,
"active": true,
"created_at": "2023-05-15T14:30:00Z",
"updated_at": "2023-05-16T10:15:00Z",
"ended_at": null,
"plan_type": "lifetime",
"quantity": null,
"sold_items_count": 10,
"slug": "lifetime-premium-access",
"max_interval_count": null,
"visible": true
}
}