Webhooks
Course Webhooks
Detailed information about course webhook events including course.created, course.updated, and course.student_enroll.
course.created
The course.created event is triggered when a new course is created in the system.
Event Properties
| Property | Type | Description |
|---|---|---|
| id | string | The unique identifier of the course |
| name | string | The name of the course |
| description | string | The description of the course |
| state | string | The current state of the course |
| type | string | The type of the course (always "Course") |
| created_at | string | The timestamp when the course was created |
| updated_at | string | The timestamp when the course was last updated |
| slug | string | The URL-friendly slug of the course |
| plans | array | An array of plans associated with the course |
Plan Properties
Each plan in the plans array has the following properties:
| Property | Type | Description |
|---|---|---|
| id | string | The unique identifier of the plan |
| name | string | The name of the plan |
| description | string | A description of the plan |
| currency | string | The currency code for the plan's price |
| amount | integer | The price amount in the smallest currency unit |
| 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) |
Example Payload
{
"type": "course.created",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Introduction to Programming",
"description": "Learn the basics of coding with this comprehensive course.",
"state": "draft",
"type": "Course",
"created_at": "2023-05-15T14:30:00Z",
"updated_at": "2023-05-15T14:30:00Z",
"slug": "intro-to-programming",
"plans": [
{
"id": "plan_123",
"name": "Basic Plan",
"description": "Access to all course materials for 3 months",
"currency": "TWD",
"amount": 5000,
"created_at": "2023-05-15T14:35:00Z",
"updated_at": "2023-05-15T14:35:00Z"
},
{
"id": "plan_456",
"name": "Premium Plan",
"description": "Lifetime access to course materials and weekly Q&A sessions",
"currency": "TWD",
"amount": 1900,
"created_at": "2023-05-15T14:36:00Z",
"updated_at": "2023-05-15T14:36:00Z"
}
]
}
}course.updated
The course.updated event is triggered when an existing course is updated in the system.
Event Properties
| Property | Type | Description |
|---|---|---|
| id | string | The unique identifier of the course |
| name | string | The updated name of the course |
| description | string | The updated description of the course |
| state | string | The current state of the course |
| type | string | The type of the course (always "Course") |
| created_at | string | The timestamp when the course was created |
| updated_at | string | The timestamp when the course was last updated |
| slug | string | The updated URL-friendly slug of the course |
| plans | array | An array of updated plans associated with the course |
Plan Properties
Each plan in the plans array has the following properties:
| Property | Type | Description |
|---|---|---|
| id | string | The unique identifier of the plan |
| name | string | The updated name of the plan |
| description | string | The updated description of the plan |
| currency | string | The currency code for the plan's price |
| amount | integer | The updated price amount in the smallest currency unit |
| 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) |
Example Payload
{
"type": "course.updated",
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Advanced Programming Techniques",
"description": "Take your coding skills to the next level with advanced programming concepts.",
"state": "published",
"type": "Course",
"created_at": "2023-05-15T14:30:00Z",
"updated_at": "2023-06-01T10:15:00Z",
"slug": "advanced-programming-techniques",
"plans": [
{
"id": "plan_123",
"name": "Standard Plan",
"description": "6 months access to all course materials",
"currency": "TWD",
"amount": 7500,
"created_at": "2023-05-15T14:35:00Z",
"updated_at": "2023-06-01T10:15:00Z"
},
{
"id": "plan_456",
"name": "Premium Plan",
"description": "Lifetime access to course materials, weekly Q&A sessions, and personal mentoring",
"currency": "TWD",
"amount": 15000,
"created_at": "2023-05-15T14:36:00Z",
"updated_at": "2023-06-01T10:15:00Z"
}
]
}
}course.student_enroll
The course.student_enroll event is triggered when a student is enrolled in a course.
Event Properties
| Property | Type | Description |
|---|---|---|
| id | string | The unique identifier of the enrollment |
| course | object | Details about the course |
| user | object | Details about the enrolled user |
| created_at | string | The timestamp when the enrollment was created |
| updated_at | string | The timestamp when the enrollment was last updated |
| state | string | The current state of the enrollment delivery |
Course Object
| Property | Type | Description |
|---|---|---|
| id | string | The unique identifier of the course |
| name | string | The name of the course |
| slug | string | The URL-friendly slug of the course |
| subtitle | string | The subtitle of the course |
User Object
| Property | Type | Description |
|---|---|---|
| id | string | The unique identifier of the user |
| name | string | The name of the user |
| string | The email address of the user | |
| phone_number | string | The phone number of the user |
Example Payload
{
"type": "course.student_enroll",
"data": {
"id": "enroll_123456",
"course": {
"id": "course_789012",
"name": "Introduction to Programming",
"slug": "intro-to-programming",
"subtitle": "Learn the basics of coding"
},
"user": {
"id": "user_345678",
"name": "Sample User",
"email": "student@example.com",
"phone_number": "+1234567890"
},
"created_at": "2023-05-15T14:30:00Z",
"updated_at": "2023-05-15T14:30:00Z",
"state": "pending"
}
}