Docs home

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
bundle_idintegerrequired
ID of the course, e.g. joinbundle/1369.

Request body: form-data with one field, JSONString, containing this JSON:

BodyJSONString
organization_idintegerrequired
Organization 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.
Fee template (payment plan) to use. Default 1.
Promo code to apply.
Payment gateway to use for the checkout.
Academic year of the enrollment.
1 enrolls the learner in the course's free preview instead of the paid course.
Learner credits to apply against the first instalment (base currency only).
Response200application/json
codeinteger
Example: 200
messagestring
Example: Bundle Joined
bundleobject
Show child attributesHide child attributes
Example: 4418
One per instalment
Example: 4516

Notes:

  • 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.

Updated yesterday

Ask AI