Get List of Learners for an Invoice

Get List of Learners for an Invoice 

This API can be used to find list of learners, who are linked to a single purchase. The purchase may be for just the course session, or for a program session which contains the course sessions. API can be used in case of single or bulk purchase. In case of single purchase, all returned learner records will correspond to same user, but can be for different course sessions if the purchase was for program session. In case of bulk purchase, these learner records can be for different learners.

API Details

Signature of API call

connection.invokeApi(String uri, String realUserName, Map<String, String> requestParameters);

See details about invoking API in general


Parameter 1 - URI


Parameter 2 - UserName

Username of any site administrator


Parameter 3 - Request Parameters

Name Value
dispatch getLinkedCourseEnrollments
No other parameters are required
invoiceId invoiceId of the purchase




map of name value pairs, to filter course session members (learners) using the custom property. 





map of name value pairs, to filter users (learners) using the custom property. 



Comma separated entity types for which to expand the custom properties in the response. E.g. if you want the response to include custom properties of learners (course session members) then pass csm, if you want to include custom properties of users then pass user, if you want to include custom properties of coursses then pass course


expandCustomProp = csm,user,course

return contains the custom property names/values of all requested types 



1. Response on successfully getting results

HTTP Response Code = HttpServletResponse.SC_OK

Response XML

returns invoice id (used as order id within EduBrite lms)

HTTP Response Code = HttpServletResponse.SC_OK

Response XML

<response code="0">









            <courseSessionMember id="2fe1ddf0-8de6-11e6-a9c3-7b8f5d23978d" agreementAccepted="false" courseSessionId="d43e237e-6323-11e6-a6aa-51e7922605a9" late="false">










                <courseSessionName><![CDATA[Onboarding Course]]></courseSessionName>





                    <!--  custom properties -->










2. Response for unauthorized access

HTTP Response Code = HttpServletResponse.SC_UNAUTHORIZED

Response XML


<response code="-1">




             <value><![CDATA[You are not allowed to perform this action.]]></value>




Error response when invoice not found

<response code="-1">






                  Unable to find Invoice with matching Id=null.








Code Snippet

       /*  Check API Call for detail generic code */

         Map<String, String> parameters = new HashMap<String, String>();

    parameters.put("dispatch", "getLinkedCourseEnrollments");    

    parameters.put("expandCustomProp", "csm,course"); 

    parameters.put("csmPropertyFilter["propname1"]", "propvalue1"); //propname1 must be present for the learner, value must be propvalue1 (exact)

    parameters.put("csmPropertyFilter["propname2"]", "*"); //propname2 must be present for the learner, any value (not blank) will match

    String retStr = connection.invokeApi("", "chenry", parameters);