Enroll Course by Student
Enrolls the logged-in learner in a course (self-enrollment from your app or website). For a paid course it creates the enrollment and payment records and returns the payment details to complete checkout; for a free course the learner is enrolled straight away.
POST
/joinbundle/{bundleId}Enroll Course by Student
curl --request POST \
--url 'https://<your-api-host>/nuSource/api/v1/joinbundle/{bundleId}' \
--header 'APIKEY: <your-api-key>' \
--header 'ORGID: <your-org-id>' \
--form 'JSONString={
"payment_gateway": 8,
"organization_id": <organizationId>,
"academic_year": <academic_year>,
"instalments": [
{
"instalment_name": "Full Payment 1",
"currency_symbol": "₹",
"position": 1,
"part_amount": 100,
"part_date": 1652918400,
"part_formatted_date": "19/05/2022",
"discount": 0,
"final_amount": 100
}
],
"fees_template_id": <feestemplateId>,
"credits_applied": 0,
"is_student_enrollment": 1
}'{
"code": 200,
"message": "Bundle Joined",
"bundle": {
"payment_id": 4418,
"part_ids": [
5665
],
"enrollment_id": 4516,
"conflicting_students": []
}
}Access: Any logged-in user. The learner enrolled is always the owner of the API key.
Path parameters
ID of the course, e.g.
joinbundle/1369.Request body: form-data with one field, JSONString, containing this JSON:
Body
JSONStringOrganization offering the course. The course must be published there.
batch_idstring
Comma-separated batch IDs to join, e.g.
"2301,2302". Each must be an active batch of this course in that organization. If left out, the course's default batch is used.template_idinteger
Fee template (payment plan) to use. Default
1.promo_code_textstring
Promo code to apply.
payment_gatewaystring
Payment gateway to use for the checkout.
academic_yearinteger
Academic year of the enrollment.
is_free_previewinteger
1 enrolls the learner in the course's free preview instead of the paid course.credits_appliednumber
Learner credits to apply against the first instalment (base currency only).
Response
codeinteger
Example:
200messagestring
Example:
Bundle Joinedbundleobject
Show child attributesHide child attributes
bundle.payment_idinteger
Example:
4418bundle.part_idsinteger[]
One per instalment
bundle.enrollment_idinteger
Example:
4516Notes:
- If the first instalment is more than 0, the enrollment stays "payment in progress" until the payment succeeds. Otherwise the learner is enrolled immediately and gets the enrollment email/SMS.
- Errors: "Invalid Bundle Id" (course not published in that organization), "Enrollment for this course is disabled by admin...", "Already enrolled in this course package.", "Invalid Batch Id", "Issue with installments", "Issue with currency".
- Rate limit: 30 requests per minute; going over locks you out for 30 minutes.