
ORGANIZATIONAL UNITS
"Organizational units" represent the billed entities of your environment: they carry the billing information and can be associated with a branch of the organizational chart. An organizational unit in the API is named "organizationalunit". | ![]() |
Organizational units: organizationalunit/get
https://www.domaine.com/lmsapi/organizationalunit/get
![]() | Returns an object representing an organizational unit in your environment. |
Request
Example of request call content for information on an organizational unit:
{
"id": "O%2f9dsKKECyJSUWkOK37D8g%3d%3d"
}Field descriptions
| Name | Required | Comments/description |
| id | X | Unique identifier of the organizational unit. (String type) |
Response
Example of response call content for information on an organizational unit:
{
"id": "O%2f9dsKKECyJSUWkOK37D8g%3d%3d",
"name": "organization3",
"billToName": "somebody",
"address": "22 AAA",
"city": "Quebec",
"postalCode": "G1X 2X1",
"stateId": 11,
"countryId": 37,
"creationDate": "0001-01-01T00:00:00",
"isActive": true,
"customFields": {
"abcdef": "ChampCustom"
}
}Field descriptions
| Name | Comments/description |
| id | Unique identifier of the organizational unit. (String type) |
| name | Name of the organizational unit. (String type) |
| billToName | Name to put on the invoice. (String type) |
| address | Address of the organizational unit. (String type) |
| address2 | Second address of the organizational unit. (String type) |
| city | City of the address of the organizational unit. (String type) |
| postalCode | Postal code of the address of the organizational unit. (String type) |
| stateId | The code of the province or state of the address of the organizational unit. (Long type) |
| countryId | The code of the country of the address of the organizational unit. (Long type) |
| branchId | Identifier of the branch associated with the organizational unit. (String type) |
| creationDate | Creation date of the organizational unit. (String type YYYY-MM-DDTHH:MM:SSZ) |
| isActive | Indicates whether the organizational unit is active. (Boolean type) |
| customFields | Custom fields linked to the organizational unit. |
Organizational units: organizationalunit/getlist
https://www.domaine.com/lmsapi/organizationalunit/getlist
![]() | Returns the list of all the organizational units in your environment. |
Request
Example of request call content for the list of organizational units:
{
}Field descriptions
| Name | Required | Comments/description |
| The method does not require any parameter. |
Response
Example of response call content for the list of organizational units:
[
{
"id": "O%2f9dsKKECyJSUWkOK37D8g%3d%3d",
"name": "organization3",
"billToName": "somebody",
"address": "22 AAA",
"city": "Quebec",
"postalCode": "G1X 2X1",
"stateId": 11,
"countryId": 37,
"creationDate": "0001-01-01T00:00:00",
"isActive": true,
"customFields": {
"abcdef": "ChampCustom"
}
}
]Field descriptions
| Name | Comments/description |
| id | Unique identifier of the organizational unit. (String type) |
| name | Name of the organizational unit. (String type) |
| billToName | Name to put on the invoice. (String type) |
| address | Address of the organizational unit. (String type) |
| address2 | Second address of the organizational unit. (String type) |
| city | City of the address of the organizational unit. (String type) |
| postalCode | Postal code of the address of the organizational unit. (String type) |
| stateId | The code of the province or state of the address of the organizational unit. (Long type) |
| countryId | The code of the country of the address of the organizational unit. (Long type) |
| branchId | Identifier of the branch associated with the organizational unit. (String type) |
| creationDate | Creation date of the organizational unit. (String type YYYY-MM-DDTHH:MM:SSZ) |
| isActive | Indicates whether the organizational unit is active. (Boolean type) |
| customFields | Custom fields linked to the organizational unit. |
Organizational units: organizationalunit/create
https://www.domaine.com/lmsapi/organizationalunit/create
![]() | Creates an organizational unit in your environment. |
Request
Example of request call content to create an organizational unit:
{
"name" : "organization",
"branchId": "sDcewsldf%2bytfn3jUPa3Cw%3d%3d",
"billToName" : "somebody",
"address" : "22 Rue des princes",
"city" : "Quebec",
"postalCode" : "G1X 2X1",
"address2": "11 desharmer",
"countryId": 37,
"stateId": 10,
"customFields": {
"abcdef": "CHAMPSINFO"
}
}Field descriptions
| Name | Required | Comments/description |
| name | X | Name of the organizational unit. Must contain between 3 and 250 characters inclusively. (String type) |
| billToName | X | Name to put on the invoice. Must contain between 3 and 50 characters inclusively. (String type) |
| address | X | Address of the organizational unit. Must contain between 3 and 100 characters inclusively. (String type) |
| city | X | City of the address of the organizational unit. Must contain between 3 and 100 characters inclusively. (String type) |
| postalCode | X | Postal code of the address of the organizational unit. It must match the postal code format of the country provided (Canada, USA, France). (String type) |
| countryId | X | The code of the country of the address of the organizational unit. (Long type) (See Appendix 3: Countries and States/Provinces) |
| branchId | Identifier of the branch to associate with the organizational unit. (String type) | |
| address2 | Second address of the organizational unit. Must contain between 3 and 100 characters inclusively. (String type) | |
| stateId | The code of the province or state of the address of the organizational unit. (Long type) (See Appendix 3: Countries and States/Provinces) | |
| isActive | Defines whether the organizational unit is active. True by default upon creation. (Boolean type) | |
| customFields | Custom fields linked to the organizational unit. |
Response
Example of response call content when creating an organizational unit:
{
"id": "BUdPM6Oa5BmEIGOQUikGRA%3d%3d"
}Field descriptions
| Name | Comments/description |
| id | Unique identifier of the created organizational unit. (String type) |
Organizational units: organizationalunit/edit
https://www.domaine.com/lmsapi/organizationalunit/edit
![]() | Modifies an existing organizational unit. |
Request
Example of request call content to edit an organizational unit:
{
"id": "BUdPM6Oa5BmEIGOQUikGRA%3d%3d",
"name" : "organization3"
}Field descriptions
IMPORTANT: When modifying, 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 | Unique identifier of the organizational unit to modify. (String type) |
| name | Name of the organizational unit. Must contain between 3 and 250 characters inclusively. (String type) | |
| billToName | Name to put on the invoice. Must contain between 3 and 50 characters inclusively. (String type) | |
| address | Address of the organizational unit. Must contain between 3 and 100 characters inclusively. (String type) | |
| city | City of the address of the organizational unit. Must contain between 3 and 100 characters inclusively. (String type) | |
| postalCode | Postal code of the address of the organizational unit. It must match the postal code format of the country provided (Canada, USA, France). (String type) Required in edit mode if the countryId field changes. | |
| countryId | The code of the country of the address of the organizational unit. (Long type) (See Appendix 3: Countries and States/Provinces) | |
| branchId | Identifier of the branch to associate with the organizational unit. (String type) | |
| address2 | Second address of the organizational unit. Must contain between 3 and 100 characters inclusively. (String type) | |
| stateId | The code of the province or state of the address of the organizational unit. (Long type) (See Appendix 3: Countries and States/Provinces) | |
| isActive | Defines whether the organizational unit is active. True by default upon creation. (Boolean type) | |
| customFields | Custom fields linked to the organizational unit. |
Response
Example of response call content when editing an organizational unit:
{
"id": "BUdPM6Oa5BmEIGOQUikGRA%3d%3d"
}Field descriptions
| Name | Comments/description |
| id | Unique identifier of the modified organizational unit. (String type) |
Organizational units: organizationalunit/delete
https://www.domaine.com/lmsapi/organizationalunit/delete
![]() | Deletes an existing organizational unit. |
Request
Example of request call content to delete an organizational unit:
{
"id": "O%2f9dsKKECyJSUWkOK37D8g%3d%3d"
}Field descriptions
| Name | Required | Comments/description |
| id | X | Unique identifier of the organizational unit to delete. (String type) |
Response
Example of response call content when deleting an organizational unit:
{
"id": "O%2f9dsKKECyJSUWkOK37D8g%3d%3d"
}Field descriptions
| Name | Comments/description |
| id | Unique identifier of the deleted organizational unit. (String type) |
Organizational unit error code descriptions
| Number | Message | Comment/description |
| 2400 | Required id | You must provide an identifier for the organizational unit |
| 2401 | Invalid id | The identifier provided for the organizational unit is invalid. |
| 2402 | Invalid Branch Id | The identifier provided for the branch is invalid. |
| 2403 | Branch is already assigned to an organization unit | The identifier provided for the branch is already assigned to an organizational unit. |
| 2404 | Required name | You must provide a name for the organizational unit |
| 2405 | Invalid name length | The name provided for the organizational unit must contain between 3 and 250 characters inclusively. |
| 2406 | Required billToName | You must provide a name for the invoice of the organizational unit |
| 2407 | Invalid billToName length | The name on the invoice of the organizational unit provided must contain between 3 and 50 characters inclusively. |
| 2408 | Required address | You must provide an address for the organizational unit |
| 2409 | Invalid address Length | The address provided for the organizational unit must contain between 3 and 100 characters inclusively. |
| 2410 | Required city | You must provide the city of the address for the organizational unit |
| 2411 | Invalid city length | The city of the address of the organizational unit provided must contain between 3 and 100 characters inclusively. |
| 2412 | Required postalCode | You must provide the postal code of the address for the organizational unit |
| 2413 | Invalid postalCode for the countryId ... | The postal code of the address of the organizational unit provided must match that of the country of the organizational unit. |
| 2414 | Invalid address2 length | The second address provided for the organizational unit must contain between 3 and 100 characters inclusively. |
| 2415 | Delete organizational unit has failed | The deletion of the organizational unit failed. |
| 2416 | Required countryId | You must provide the country identifier for the organizational unit |
| 2417 | This action cannot be done because the organizational unit has purchases | The action cannot be performed because the organizational unit has purchases |


