Webhook Integration
The webhook integration works with any payment provider that can send HTTP requests. You get a unique URL, configure it in your payment provider, and purchases automatically enroll students.
Setup
- Go to Settings → Integrations → Add integration → Webhook
- Enter a label (e.g., "Gumroad" or "Stripe") to identify the webhook
- Copy the generated webhook URL
- Paste the URL into your payment provider's webhook settings
The webhook is active immediately.
How it works
When a purchase happens, your payment provider sends a POST request to the webhook URL with the student's information. Simplecourse creates the student account and enrolls them in the course.
Since the course ID is included in the payload, you don't need to add an enrollment source in Simplecourse — the webhook already defines which course to enroll in.
How to configure
Your payment provider needs to send a JSON POST request to the webhook URL. How exactly you set this up depends on your provider — consult their webhook documentation for details. Here's what Simplecourse expects to receive:
| Field | Required | Description |
|---|---|---|
email |
Yes | Student's email address |
course_id |
Yes | The course ID (shown in the Enrollments tab) |
tier |
No | Tier level: 1, 2, or 3 (defaults to 1) |
first_name |
No | Student's first name |
last_name |
No | Student's last name |
Example:
{
"email": "[email protected]",
"course_id": 42,
"tier": 1,
"first_name": "Jane",
"last_name": "Doe"
}
Response codes
| Code | Meaning |
|---|---|
| 201 | Student enrolled successfully |
| 200 | Student was already enrolled |
| 400 | Invalid request (missing fields or bad data) |
| 401 | Invalid or inactive webhook |
| 404 | Course not found |
Security
The webhook URL contains a unique secret — anyone with the URL can trigger enrollments. Keep it private and only share it with your payment provider. If you suspect it's been compromised, delete the webhook and create a new one.