Organizational units (Lära)

TABLE OF CONTENTS

Organizational units: organizationalunit/get
Organizational units: organizationalunit/getlist
Organizational units: organizationalunit/create
Organizational units: organizationalunit/edit
Organizational units: organizationalunit/delete
Organizational unit error code descriptions

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.
API call address : https://.../lmsapi/organizationalunit/get

Request

Example of request call content for information on an organizational unit:

{
   "id": "O%2f9dsKKECyJSUWkOK37D8g%3d%3d"
}

Field descriptions

NameRequiredComments/description
idXUnique 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

NameComments/description
idUnique identifier of the organizational unit.
(String type)
nameName of the organizational unit.
(String type)
billToNameName to put on the invoice.
(String type)
addressAddress of the organizational unit.
(String type)
address2Second address of the organizational unit.
(String type)
cityCity of the address of the organizational unit.
(String type)
postalCodePostal code of the address of the organizational unit.
(String type)
stateIdThe code of the province or state of the address of the organizational unit.
(Long type)
countryIdThe code of the country of the address of the organizational unit.
(Long type)
branchIdIdentifier of the branch associated with the organizational unit.
(String type)
creationDateCreation date of the organizational unit.
(String type YYYY-MM-DDTHH:MM:SSZ)
isActiveIndicates whether the organizational unit is active.
(Boolean type)
customFieldsCustom 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.
API call address : https://.../lmsapi/organizationalunit/getlist

Request

Example of request call content for the list of organizational units:

{
}

Field descriptions

NameRequiredComments/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

NameComments/description
idUnique identifier of the organizational unit.
(String type)
nameName of the organizational unit.
(String type)
billToNameName to put on the invoice.
(String type)
addressAddress of the organizational unit.
(String type)
address2Second address of the organizational unit.
(String type)
cityCity of the address of the organizational unit.
(String type)
postalCodePostal code of the address of the organizational unit.
(String type)
stateIdThe code of the province or state of the address of the organizational unit.
(Long type)
countryIdThe code of the country of the address of the organizational unit.
(Long type)
branchIdIdentifier of the branch associated with the organizational unit.
(String type)
creationDateCreation date of the organizational unit.
(String type YYYY-MM-DDTHH:MM:SSZ)
isActiveIndicates whether the organizational unit is active.
(Boolean type)
customFieldsCustom fields linked to the organizational unit.

Organizational units: organizationalunit/create

https://www.domaine.com/lmsapi/organizationalunit/create

Creates an organizational unit in your environment.
API call address : https://.../lmsapi/organizationalunit/create

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

NameRequiredComments/description
nameXName of the organizational unit.
Must contain between 3 and 250 characters inclusively.
(String type)
billToNameXName to put on the invoice.
Must contain between 3 and 50 characters inclusively.
(String type)
addressXAddress of the organizational unit.
Must contain between 3 and 100 characters inclusively.
(String type)
cityXCity of the address of the organizational unit.
Must contain between 3 and 100 characters inclusively.
(String type)
postalCodeXPostal code of the address of the organizational unit. It must match the postal code format of the country provided (Canada, USA, France).
(String type)
countryIdXThe 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

NameComments/description
idUnique identifier of the created organizational unit.
(String type)


Organizational units: organizationalunit/edit

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

Modifies an existing organizational unit.
API call address : https://.../lmsapi/organizationalunit/edit

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.

NameRequiredComments/description
idXUnique 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

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

Organizational units: organizationalunit/delete

https://www.domaine.com/lmsapi/organizationalunit/delete

Deletes an existing organizational unit.
API call address : https://.../lmsapi/organizationalunit/delete

Request

Example of request call content to delete an organizational unit:

{
    "id": "O%2f9dsKKECyJSUWkOK37D8g%3d%3d"
}

Field descriptions

NameRequiredComments/description
idXUnique 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

NameComments/description
idUnique identifier of the deleted organizational unit.
(String type)


Organizational unit error code descriptions

NumberMessage
Comment/description
2400Required id
You must provide an identifier for the organizational unit
2401Invalid id
The identifier provided for the organizational unit is invalid.
2402
Invalid Branch Id
The identifier provided for the branch is invalid.
2403Branch is already assigned to an organization unit
The identifier provided for the branch is already assigned to an organizational unit.
2404Required name
You must provide a name for the organizational unit
2405Invalid name length
The name provided for the organizational unit must contain between 3 and 250 characters inclusively.
2406Required billToName
You must provide a name for the invoice of the organizational unit
2407Invalid billToName length
The name on the invoice of the organizational unit provided must contain between 3 and 50 characters inclusively.
2408Required address
You must provide an address for the organizational unit
2409Invalid address Length
The address provided for the organizational unit must contain between 3 and 100 characters inclusively.
2410Required city
You must provide the city of the address for the organizational unit
2411Invalid city length
The city of the address of the organizational unit provided must contain between 3 and 100 characters inclusively.
2412Required postalCode
You must provide the postal code of the address for the organizational unit
2413Invalid 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.
2414Invalid 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.
2416Required countryIdYou must provide the country identifier for the organizational unit
2417This action cannot be done because the organizational unit has purchases
The action cannot be performed because the organizational unit has purchases


Did you find it helpful? Yes No

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