Registrations / Billing (Lära)

TABLE OF CONTENTS

Registrations: billing/get
Registrations: billing/edit
Registrations: billing/getlist
Registrations: billing/editsubscriptiondate
Invoice error code descriptions

REGISTRATIONS

The API brings together the concepts of invoice, registration and training completion. A registration in the API is named "billing".

Billing: billing/get

https://www.domaine.com/lmsapi/billing/get

Returns the details of a registration (invoice) in your environment.
API call address : https://.../lmsapi/billing/get

Request

Example of request call content for information on a registration:

{
  "id": "u4DNThbf4WoRkZ%2b8rwU2AQ%3d%3d"
}

Field descriptions

Name
Required
Comments/description
id
X
This is the unique identifier of the invoice.
(String type)

Response

Example of response call content for information on a registration:

{
  "id": "u4DNThbf4WoRkZ%2b8rwU2AQ%3d%3d",
  "userId": "wHkVFD5qzpDQ6hyqvlmpjA%3d%3d",
  "subscriptionType": 0,
  "providerId": "djcZh8rfjtVuMzLdYFzHvA%3d%3d",
  "workspaceId": "Rv9LBvgPCxT0Imv4jBl%2fYA%3d%3d",
  "workspaceInstanceId": "8Cqi%2blqLC5WnzjrVaZLTPw%3d%3d",
  "creationDate": "2020-04-01T08:36:40.637",
  "subscriptionDate": "2020-04-01T08:36:40.637",
  "status": 1,
  "credits": 6.00,
  "creditsObtained": 6.00,
  "isCompleted": false,
  "isSuccess": false,
  "completionDate": "2020-04-01T08:39:08.62",
  "progressPercent": 100,
  "workspaceName": "Formation 123",
  "workspaceInstanceName": "Formation 123",
  "lastUpdateDate": "2020-04-01T08:39:08.62",
  "approverUserId": "y9DDvS6G4UzxlxV%2fPuEWqA%3d%3d",
  "originalBillingId": "0ZmJHkU8UY9k2si1sOPcGg%3d%3d",
  "provenance": 3,
  "customFields": {
    "no_titulaire": "# Titulaire",
    "fact_empl": 0
  }
}

Field descriptions

Name 

Comments/description

id

This is the unique identifier of the invoice.

(String type)

userId

Unique identifier of the user linked to this registration.

(String type)

subscriptionType

Registration type/context (present when the associated registration is still valid): 

  • 0 = WorkspaceInstance (Training session)
  • 1 = Cohort (Training program cohort)

(Number type)

providerId

Unique identifier of the training provider (present when the associated registration is still valid)

(String type)

workspaceId

Unique identifier of the training item (present when subscriptionType = 0)

(String type)

workspaceInstanceId

Unique identifier of the training session (present when subscriptionType = 0)

(String type)

programId

Unique identifier of the training program (present when subscriptionType = 1)

(String type)

cohortId

Unique identifier of the training program cohort (present when subscriptionType = 1)

(String type)

creationDate

Original registration date

String (YYYY-MM-DDTHH:MM:SSZ)

subscriptionDate

Date the registration in the training item or program was accepted

String (YYYY-MM-DDTHH:MM:SSZ)

status

Status of the registration

  • 0 = Inactive
  • 1 = Registered
  • 2 = Pending
  • 3 = Unregistered
  • 4 = Disabled
  • 5 = Transferred
  • 6 = Expired
  • 7 = Unconfirmed
  • 8 = Expired with access

(Number type)

credits

Number of credits granted upon successful completion of the training item or program

(Number type)

creditsObtained

Number of credits obtained by the user

(Number type)

isCompleted

Indicates whether the user completed their training

(Boolean type)

isSuccess

Indicates whether the user passed their training

(Boolean type)

completionDate

Completion date of the training

String (YYYY-MM-DDTHH:MM:SSZ)

progressPercent

Progress percentage of the training

(Number type – between 0 and 100)

workspaceName

Name of the training item (present when subscriptionType = 0)

(String type)

workspaceInstanceName

Name of the training session (present when subscriptionType = 0)

(String type)

programName

Name of the training program (present when subscriptionType = 1)

(String type)

cohortName

Name of the training program cohort (present when subscriptionType = 1)

(String type)

lastUpdateDate

Date the registration or the training completion was last updated

String (YYYY-MM-DDTHH:MM:SSZ)

approverUserIdIdentifier of a user who has approver rights (String type)
originalBillingIdIn the case of a registration transfer to another user: identifier of the invoice of the original registration
provenanceSource of the user's registration
  • 0 = GroupSubscription  
  • 1 = BranchSubscription  
  • 2 = ManualSubscription  
  • 3 = SelfSubscription  
  • 4 = LotPurchaseSubscription  
  • 5 = ProgramSubscription  
  • 6 = AutoResubscription  

(Number type)

customFields

Custom fields linked to an invoice.

Billing: billing/edit

https://www.domaine.com/lmsapi/billing/edit

Modifies an existing registration (invoice).
API call address : https://.../lmsapi/billing/edit

Request

Example of request call content to modify a registration:

IMPORTANT: The method requires only the "id" value. The fields that are passed are updated; the fields that are not provided are simply not updated.

{
  "id": "DR7sYn48%2fuzi3b4fTGZ1nQ%3d%3d",
   "approverUserId": "y9DDvS6G4UzxlxV%2fPuEWqA%3d%3d"
}

Field descriptions

IMPORTANT: The method requires only the "id" value. The fields that are passed are updated; the fields that are not provided are simply not updated.

Name
Required
Comments/description
id
X
This is the unique identifier of the invoice.
(String type)
customFields Custom fields linked to the invoice.
approverUserId Identifier of a user who has approver rights.
(String type)

Response

Example of response call content when modifying a registration:

{
  "id": "DR7sYn48%2fuzi3b4fTGZ1nQ%3d%3d"
}

Field descriptions

NameComments/description
idUnique identifier of the modified invoice.
(String type)

Billing: billing/getlist

https://www.domaine.com/lmsapi/billing/getlist

Returns the list of registrations (invoices) in your environment.
API call address : https://.../lmsapi/billing/getlist

Request

Example of request call content for the list of registrations:

{
  "filterId": "wHkVFD5qzpDQ6hyqvlmpjA%3d%3d",
  "filterIndex": 1,
  "filterDate": "YYYY-MM-DDTHH:MM:SSZ",
  "filterEndDate": "YYYY-MM-DDTHH:MM:SSZ",
  "filterIncludeDisabled": true
}

Field descriptions

Name
Required
Comments/description
filterId Optional parameter corresponding to the identifier of a user whose billing, registration or completion data is to be retrieved.
(String type)
filterIndex Optional parameter corresponding to pagination of 200 registrations. The method returns the list of 200 objects based on the index passed as a filter. An index filter of 1 returns registrations 1 to 200, and an index filter of 2 returns registrations 201 to 400.
If this parameter is not used, the return of this call will contain at most 100 elements.
(Number type)
filterDate Optional parameter corresponding to the date the registration or completion was last modified. The method returns the list of objects whose date is after the date passed as a filter.
String (YYYY-MM-DDTHH:MM:SSZ)
filterEndDate Optional parameter that is taken into account only if "filterDate" has been defined. The method returns the list of objects whose last modification date is before the date passed as a filter.
String (YYYY-MM-DDTHH:MM:SSZ)
filterIncludeDisabled Optional parameter. By default, cancelled registrations ("Unregistered" and "Disabled") are never returned. The possible values are:
  • true includes registrations with the "Unregistered" and "Disabled" statuses.
  • false excludes registrations with the "Unregistered" and "Disabled" statuses.
(Boolean type)

Response

Example of response call content for the list of registrations:

[
    {
        "id": "u4DNThbf4WoRkZ%2b8rwU2AQ%3d%3d",
        "userId": "wHkVFD5qzpDQ6hyqvlmpjA%3d%3d",
        "subscriptionType": 0,
        "providerId": "djcZh8rfjtVuMzLdYFzHvA%3d%3d",
        "workspaceId": "Rv9LBvgPCxT0Imv4jBl%2fYA%3d%3d",
        "workspaceInstanceId": "8Cqi%2blqLC5WnzjrVaZLTPw%3d%3d",
        "creationDate": "2020-04-01T08:36:40.637",
        "subscriptionDate": "2020-04-01T08:36:40.637",
        "status": 1,
        "credits": 6.00,
        "creditsObtained": 6.00,
        "isCompleted": false,
        "isSuccess": false,
        "completionDate": "2020-04-01T08:39:08.62",
        "progressPercent": 100,
        "workspaceName": "Formation 123",
        "workspaceInstanceName": "Formation 123",
        "lastUpdateDate": "2020-04-01T08:39:08.62",
        "approverUserId": null,
        "provenance": 3,
        "customFields": {
            "no_titulaire": "# Titulaire",
            "fact_empl": 0
        }
    },
    {
        "id": "5DXt2mQIPrF%2bOtKJXDJkHQ%3d%3d",
        "userId": "wHkVFD5qzpDQ6hyqvlmpjA%3d%3d",
        "subscriptionType": 1,
        "providerId": "djcZh8rfjtVuMzLdYFzHvA%3d%3d",
        "programId": "TdQNdAVv233NKXZO%2fhSiww%3d%3d",
        "cohortId": "wf4T36TwvfNSF8HOgwZ1jw%3d%3d",
        "subscriptionDate": "2020-03-26T12:03:49.753",
        "status": 1,
        "credits": 0.00,
        "creditsObtained": 0.0,
        "isCompleted": false,
        "isSuccess": false,
        "completionDate": "2020-05-04T10:57:26.52",
        "progressPercent": 16,
        "programName": "Programme 123",
        "cohortName": "Programme 123",
        "lastUpdateDate": "2020-05-04T10:57:26.52",
        "approverUserId": "y9DDvS6G4UzxlxV%2fPuEWqA%3d%3d",
        "provenance": 3,
        "customFields": {
            "no_titulaire": "# Titulaire",
            "fact_empl": 0
        }
  }
]

Field descriptions

Each element of the list contains the same fields as those returned by billing/get:

Name 

Comments/description

id

This is the unique identifier of the invoice.

(String type)

userId

Unique identifier of the user linked to this registration.

(String type)

subscriptionType

Registration type/context (present when the associated registration is still valid): 

  • 0 = WorkspaceInstance (Training session)
  • 1 = Cohort (Training program cohort)

(Number type)

providerId

Unique identifier of the training provider (present when the associated registration is still valid)

(String type)

workspaceId

Unique identifier of the training item (present when subscriptionType = 0)

(String type)

workspaceInstanceId

Unique identifier of the training session (present when subscriptionType = 0)

(String type)

programId

Unique identifier of the training program (present when subscriptionType = 1)

(String type)

cohortId

Unique identifier of the training program cohort (present when subscriptionType = 1)

(String type)

creationDate

Original registration date

String (YYYY-MM-DDTHH:MM:SSZ)

subscriptionDate

Date the registration in the training item or program was accepted

String (YYYY-MM-DDTHH:MM:SSZ)

status

Status of the registration

  • 0 = Inactive
  • 1 = Registered
  • 2 = Pending
  • 3 = Unregistered
  • 4 = Disabled
  • 5 = Transferred
  • 6 = Expired
  • 7 = Unconfirmed
  • 8 = Expired with access

(Number type)

credits

Number of credits granted upon successful completion of the training item or program

(Number type)

creditsObtained

Number of credits obtained by the user

(Number type)

isCompleted

Indicates whether the user completed their training

(Boolean type)

isSuccess

Indicates whether the user passed their training

(Boolean type)

completionDate

Completion date of the training

String (YYYY-MM-DDTHH:MM:SSZ)

progressPercent

Progress percentage of the training

(Number type – between 0 and 100)

workspaceName

Name of the training item (present when subscriptionType = 0)

(String type)

workspaceInstanceName

Name of the training session (present when subscriptionType = 0)

(String type)

programName

Name of the training program (present when subscriptionType = 1)

(String type)

cohortName

Name of the training program cohort (present when subscriptionType = 1)

(String type)

lastUpdateDate

Date the registration or the training completion was last updated

String (YYYY-MM-DDTHH:MM:SSZ)

approverUserIdIdentifier of a user who has approver rights (String type)
originalBillingIdIn the case of a registration transfer to another user: identifier of the invoice of the original registration
provenanceSource of the user's registration
  • 0 = GroupSubscription  
  • 1 = BranchSubscription  
  • 2 = ManualSubscription  
  • 3 = SelfSubscription  
  • 4 = LotPurchaseSubscription  
  • 5 = ProgramSubscription  
  • 6 = AutoResubscription  

(Number type)

customFields

Custom fields linked to an invoice.

Billing: billing/editsubscriptiondate

https://www.domaine.com/lmsapi/billing/editsubscriptiondate

Updates the registration date of a user.
API call address : https://.../lmsapi/billing/editsubscriptiondate

Request

Example of request call content to update the registration date:

{
  "id": "0ZmJHkU8UY9k2si1sOPcGg%3d%3d",
  "subscriptionDate": "2020-10-09T08:00:00.000Z",
  "adminNote": "note optionnelle"
}

Field descriptions

Name
Required
Comments/description
id
X
This is the unique identifier of the invoice.
(String type)
subscriptionDate
X
New date on which the registration in the training item or program is accepted.
String (YYYY-MM-DDTHH:MM:SSZ)
adminNote Optional administrative note associated with the modification.
(String type)

Response

Example of response call content when updating the registration date:

{
  "id": "0ZmJHkU8UY9k2si1sOPcGg%3d%3d"
}

Field descriptions

NameComments/description
idUnique identifier of the modified registration.
(String type)

Invoice error code descriptions

Number

Message

Comments/description

1200

Required id

You must provide an identifier.

1201

Invalid id

The identifier provided is invalid.

1202

Required subscriptionDate

You must provide a date.

1203

Invalid FilterId

The user identifier filter provided is invalid.

1204Invalid approverUserIdThe identifier provided for the approver user is invalid
1205approverUserId does not have rightThe approver user identifier does not have the right to view approvals

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.