5. PMS Integration Process
Landlord
The landlord token can be obtained through these interfaces. You must include the API token in the HTTP header of the request. Here is an example:
x-api-token wNFiu4i5PcAyFBA7rYzaAr0sIkRW4v
CreateLandlord
-
API: createLandlord
-
Purpose & Use Cases: If your landlord does not yet exist at SCOM, you can create it through this interface, or if it already exists, refer to this step: Landlord Existed on SCOM
-
Request:
| Field | Type | Required | Description |
|---|---|---|---|
| name | String | Yes | Landlord name. |
| companyType | Enum | Yes | Landlord company type. |
| billingAddress | String | Yes | Landlord billing address. |
| billingPostalCode | String | Yes | Landlord billing postal code. |
| businessNumber | String | Yes | Landlord business number. |
QUERY
mutation CreateLandlord($input: CreateLandlordInput!) {
createLandlord(input: $input) {
id
name
slug
}
}
GRAPHQL VARIABLES
{
"input": {
"name": "pms landlord name",
"companyType": "REAL_ESTATE_AGENCY",
"billingAddress": "london",
"billingPostalCode": "12345",
"businessNumber": "12345",
}
}
- Response:
{
"data": {
"createLandlord": {
"landlord": {
"id": "ID",
"name": "pms landlord name",
"slug": "pms_landlord_name",
"status": "PENDING",
"registerType": "PMS_CREATED",
"businessNumber": "12345",
"businessScale": 0,
"businessType": "COMPANY",
"companyType": "REAL_ESTATE_AGENCY",
"billingAddress": "london",
"billingPostalCode": "12345",
"createdAt": "2023-10-08T03:39:55+00:00",
"updatedAt": "2023-10-08T03:39:55+00:00",
"verifiedAt": null
}
}
}
}
ActivateLandlord
-
API: activeLandlord
-
Purpose & Use Cases: After the landlord is verified, it needs to be activated. After successful activation, you can get the landlord’s API token, using this API token you can manage the landlord through the landlord’s related api, such as creating property.
-
Request:
| Field | Type | Required | Description |
|---|---|---|---|
| activationToken | String | Yes | Temporary token to activate landlord, retrieved from webhook |
QUERY
mutation ActivateLandlord($input: ActiveLandlordInput!) {
activeLandlord(input: $input) {
apiToken
}
}
GRAPHQL VARIABLES
{
"input": {
"activationToken": "R4lwkzMqDzrNpdA58JbQeu80VSx01D"
}
}
- Response:
{
"data": {
"activateLandlord": {
"apiToken": "XRM6mZqmQfPX4KxAe9K848TSYqZp7l"
}
}
}
- Error Message:
| Error Message | Description |
|---|---|
| activationToken not exist | The activation token for the PMS landlord does not exist |
| activationToken expired | The activation token for the PMS landlord has expired |
| landlord status must be verified | The landlord’s status must be VERIFIED to perform this operation |
Landlord Existed on SCOM
If your landlord already exists at SCOM, there is no need to create the landlord again using createLandlord. SCOM administrator can bind the landlord to your system, and when the binding is successful, SCOM will send a post request to your callbackUrl, which contains a temporary token that you can use to activate the landlord.