lela-lida
v1.0.0
Published
![example image](https://i.ibb.co/7bqPkGJ/PMS-integration-workflow.png "An exemplary image") **Before beginning work it is necessary that:** * Your organization is registered and activated * You have participated in a kickoff meeting * The openin
Downloads
8
Readme
Getting Started with Channel Management API
Getting Started
Introduction
Before beginning work it is necessary that:
- Your organization is registered and activated
- You have participated in a kickoff meeting
- The opening questionnaire has been filled out
- You have your login and password. (Using it you get a unique session
token
that must be used in every request to API as paramjwt
)
Contact us to be registered and get your credentials.
All responses are returned as JSON.
This document covers all the API calls and other methods that can be used to complete Razor-Cloud integration. It is important to note that all parameters are case sensitive in this document and should be used as documented.
Responses:
When a request is successful, a response body will typically be sent back in the form of a JSON object. An exception to this is when a DELETE request is processed, which will result in a successful 200
status and an empty response body.
Install the Package
Run the following command from your project directory to install the package from npm:
npm install [email protected]
Initialize the API Client
The following parameters are configurable for the API Client:
| Parameter | Type | Description |
| --- | --- | --- |
| timeout
| number
| Timeout for API calls.Default: 0
|
| jwt
| string
| Token which need to be passed in every request as GET parameter. You will get this token in authorization response. Token is valid 1 hour. |
The API client can be initialized as follows:
const client = new Client({
timeout: 0,
jwt: 'jwt',
})
Authorization
This API uses Custom Query Parameter
.
Client Class Documentation
Channel Management API Client
The gateway for the SDK. This class acts as a factory for the Controllers and also holds the configuration of the SDK.
Controllers
| Name | Description | | --- | --- | | authorization | Gets AuthorizationController | | propertyManagers | Gets PropertyManagersController | | product | Gets ProductController | | images | Gets ImagesController | | ratesAndAvailability | Gets RatesAndAvailabilityController | | lOSPricing | Gets LOSPricingController | | feeAndTax | Gets FeeAndTaxController | | feeAndTaxMandatoryAtThePropertyLevel | Gets FeeAndTaxMandatoryAtThePropertyLevelController | | yields | Gets YieldsController | | validation | Gets ValidationController | | testingOfMessageAPICalls | Gets TestingOfMessageAPICallsController | | messaging | Gets MessagingController | | requestToBook | Gets RequestToBookController | | pushNotification | Gets PushNotificationController | | reservationNotifications | Gets ReservationNotificationsController |
API Reference
List of APIs
- Authorization
- Property Managers
- Product
- Images
- Rates and Availability
- LOS Pricing
- Fee and Tax
- Fee and Tax Mandatory at the Property Level
- Yields
- Validation
- Testing of Message API Calls
- Messaging
- Request to Book
- Push Notification
- Reservation Notifications
Authorization
Login
In order to begin utilizing the platform APIs, your application must be authenticated and authorized to access domain resources. Follow the URL with your credentials and obtain an authorization token which is used in every request. You will have 2 types of tokens. One is on the PMS level, and this one should be used when you send requests related to PMS/PM data. For managing properties, you will need a token on PM level, with PM credentials. For every API call it will be noted which API credentials you should use.
:information_source: Note This endpoint does not require authentication.
async login(
username: string,
password: string,
requestOptions?: RequestOptions
): Promise<ApiResponse<Authorization>>
Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| username
| string
| Query, Required | Your account email address (for PMS or PM) |
| password
| string
| Query, Required | Your password |
| requestOptions
| RequestOptions \| undefined
| Optional | Pass additional request options. |
Response Type
Example Usage
const username = 'username0';
const password = 'password4';
try {
const { result, ...httpResponse } = await authorizationController.login(username, password);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch(error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
Example Response (as JSON)
{
"message": "",
"errorMessage": [],
"is_error": false,
"code": "",
"token": "a9eaf5b0-c433-450e-991d-8011fc4aa264",
"partyId": 61692799,
"organizationId": 61690131,
"name": "Update Name",
"currency": "USD",
"supplierId": 61692799
}
Property Managers
Overview
In all requests in this API section you need to use your PMS credentials.
P Mslist
This API call will return a list of property managers (PM) that have been created in the BookingPal platform that is associated with your PMS. In all requests in this API section, you need to use your PMS credentials.
async pMslist(
requestOptions?: RequestOptions
): Promise<ApiResponse<GetPMslist>>
Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| requestOptions
| RequestOptions \| undefined
| Optional | Pass additional request options. |
Response Type
Example Usage
try {
const { result, ...httpResponse } = await propertyManagersController.pMslist();
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch(error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
Example Response (as JSON)
{
"message": "",
"errorMessage": [],
"is_error": false,
"code": "",
"data": [
{
"id": 61690133,
"name": "Test name",
"extraName": "Test fullname",
"emailAddress": "[email protected]"
},
{
"id": 61690517,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61690534,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691075,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691076,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691729,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691731,
"name": "Update Name",
"extraName": "Update Full Name",
"emailAddress": "[email protected]"
},
{
"id": 61691732,
"name": "Update Name",
"extraName": "Update Full Name",
"emailAddress": "[email protected]"
},
{
"id": 61691733,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691734,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691735,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691736,
"name": "Update Name",
"extraName": "Update Full Name",
"emailAddress": "[email protected]"
},
{
"id": 61691737,
"name": "Update Name",
"extraName": "Update Full Name",
"emailAddress": "[email protected]"
},
{
"id": 61691803,
"name": "Update Name",
"extraName": "Update Full Name",
"emailAddress": "[email protected]"
},
{
"id": 61691852,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691861,
"name": "Auto-lyxpz company name",
"extraName": "Auto-dzvjr full name",
"emailAddress": "[email protected]"
},
{
"id": 61691868,
"name": "Update Name",
"extraName": "Update Full Name",
"emailAddress": "[email protected]"
},
{
"id": 61691875,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691876,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691877,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691878,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691879,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691880,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691881,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691882,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691883,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691884,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691885,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691886,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691887,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691888,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691889,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691896,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691897,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691898,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691899,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691900,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691903,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691904,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691905,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691906,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691907,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691908,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691909,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691910,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691911,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61691979,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61692003,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61692065,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61692066,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61692067,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61692068,
"name": "Update Name",
"extraName": "Update Full Name",
"emailAddress": "[email protected]"
},
{
"id": 61692418,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61692455,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61692456,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61692457,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61692552,
"name": "Update Name",
"extraName": "Update Full Name",
"emailAddress": "[email protected]"
},
{
"id": 61692554,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61692695,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61692769,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61692782,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61692785,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61692787,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61692789,
"name": "Test",
"extraName": "Test",
"emailAddress": "[email protected]"
},
{
"id": 61692790,
"name": "Test Wiz",
"extraName": "Test Wiz",
"emailAddress": "[email protected]"
},
{
"id": 61692791,
"name": "Test wiz1",
"extraName": "Test wiz1",
"emailAddress": "[email protected]"
},
{
"id": 61692793,
"name": "Test wiz1",
"extraName": "Test wiz1",
"emailAddress": "[email protected]"
},
{
"id": 61692794,
"name": "Test wiz1",
"extraName": "Test wiz1",
"emailAddress": "[email protected]"
},
{
"id": 61692795,
"name": "Test wiz",
"extraName": "Test wiz",
"emailAddress": "[email protected]"
},
{
"id": 61692797,
"name": "Wizard Demo",
"extraName": "Wizard Demo",
"emailAddress": "[email protected]"
},
{
"id": 61692799,
"name": "Test PM",
"extraName": "Test PM",
"emailAddress": "[email protected]"
}
]
}
Createnew Property Manager
This API call will allow the PMS to pass all data to BookingPal that is required for registering a new PM (Property Manager). All fields are mandatory - PMS must pass this data in order for a PM account to be created. You need to use PMS credentials for this request.
async createnewPropertyManager(
contentType: string,
body: CreatenewUpdatePropertyManagerRequest,
requestOptions?: RequestOptions
): Promise<ApiResponse<PropertyManagerdetailsresponse>>
Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| contentType
| string
| Header, Required | - |
| body
| CreatenewUpdatePropertyManagerRequest
| Body, Required | - |
| requestOptions
| RequestOptions \| undefined
| Optional | Pass additional request options. |
Response Type
PropertyManagerdetailsresponse
Example Usage
const contentType = 'Content-Type2';
const bodyDataCompanyDetailsCompanyAddress: CompanyAddress = {
country: 'US',
state: 'Test State',
streetAddress: 'Test Street',
city: 'Test City',
zip: '13245',
};
const bodyDataCompanyDetailsPhone: Phone = {
countryCode: '+321',
number: '132456',
};
const bodyDataCompanyDetails: CompanyDetails = {
accountId: '132',
companyName: 'Test PM',
language: 'en',
fullName: 'Test PM',
companyAddress: bodyDataCompanyDetailsCompanyAddress,
website: 'www.testsite.com',
email: '[email protected]',
phone: bodyDataCompanyDetailsPhone,
currency: 'USD',
};
bodyDataCompanyDetails.password = 'password';
const bodyDataPoliciesPaymentPolicySplitPayment: SplitPayment = {
depositType: 'FLAT',
value: 4,
secondPaymentDays: 30,
};
const bodyDataPoliciesPaymentPolicy: PaymentPolicy = {
type: 'SPLIT',
splitPayment: bodyDataPoliciesPaymentPolicySplitPayment,
};
const bodyDataPoliciesCancellationPolicyManualPolicyManualPolicies: ManualPolicies[] = [];
const bodyDataPoliciesCancellationPolicyManualPolicymanualPolicies0: ManualPolicies = {
chargeValue: 20,
beforeDays: 34,
cancellationFee: 1,
};
bodyDataPoliciesCancellationPolicyManualPolicyManualPolicies[0] = bodyDataPoliciesCancellationPolicyManualPolicymanualPolicies0;
const bodyDataPoliciesCancellationPolicyManualPolicymanualPolicies1: ManualPolicies = {
chargeValue: 12,
beforeDays: 45,
cancellationFee: 2,
};
bodyDataPoliciesCancellationPolicyManualPolicyManualPolicies[1] = bodyDataPoliciesCancellationPolicyManualPolicymanualPolicies1;
const bodyDataPoliciesCancellationPolicyManualPolicy: ManualPolicy = {
type: 'FLAT',
manualPolicies: bodyDataPoliciesCancellationPolicyManualPolicyManualPolicies,
};
const bodyDataPoliciesCancellationPolicy: CancellationPolicy = {
type: 'MANUAL',
manualPolicy: bodyDataPoliciesCancellationPolicyManualPolicy,
};
const bodyDataPoliciesFeeTaxMandatory: FeeTaxMandatory = {
isFeeMandatory: true,
isTaxMandatory: true,
};
const bodyDataPolicies: Policies = {
paymentPolicy: bodyDataPoliciesPaymentPolicy,
cancellationPolicy: bodyDataPoliciesCancellationPolicy,
feeTaxMandatory: bodyDataPoliciesFeeTaxMandatory,
terms: 'www.test.com',
checkInTime: '10:00:00',
checkOutTime: '16:00:00',
leadTime: 2,
};
const bodyDataPaymentCreditCardPaymentGateways: PaymentGateways = {
paymentGatewaysType: 'AUTHORIZE_NET',
};
bodyDataPaymentCreditCardPaymentGateways.user = 'test';
bodyDataPaymentCreditCardPaymentGateways.secret = 'test';
bodyDataPaymentCreditCardPaymentGateways.additionalField1 = '';
bodyDataPaymentCreditCardPaymentGateways.additionalField2 = '';
const bodyDataPaymentCreditCardCreditCardList: CreditCardListEnum[] = ['AMERICAN_EXPRESS', 'DINERS_CLUB'];
const bodyDataPaymentCreditCard: CreditCard = {
creditCardType: 'POST',
};
bodyDataPaymentCreditCard.paymentGateways = bodyDataPaymentCreditCardPaymentGateways;
bodyDataPaymentCreditCard.creditCardList = bodyDataPaymentCreditCardCreditCardList;
const bodyDataPayment: Payment = {
paymentType: 'MAIL_CHECK',
};
bodyDataPayment.creditCard = bodyDataPaymentCreditCard;
const bodyData: Company = {
companyDetails: bodyDataCompanyDetails,
policies: bodyDataPolicies,
payment: bodyDataPayment,
};
const body: CreatenewUpdatePropertyManagerRequest = {
data: bodyData,
};
try {
const { result, ...httpResponse } = await propertyManagersController.createnewPropertyManager(contentType, body);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch(error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
Example Response (as JSON)
{
"message": "",
"errorMessage": [],
"is_error": false,
"code": "",
"data": [
{
"companyDetails": {
"accountId": "132",
"companyName": "Test PM",
"language": "en",
"fullName": "Test PM",
"companyAddress": {
"country": "US",
"state": "Test State",
"streetAddress": "Test Street",
"city": "Test City",
"zip": "13245"
},
"website": "www.testsite.com",
"email": "[email protected]",
"phone": {
"countryCode": "+321",
"number": "132456"
},
"password": "password",
"currency": "USD"
},
"policies": {
"paymentPolicy": {
"type": "SPLIT",
"splitPayment": {
"depositType": "FLAT",
"value": 4,
"secondPaymentDays": 30
}
},
"cancellationPolicy": {
"type": "MANUAL",
"manualPolicy": {
"type": "FLAT",
"manualPolicies": [
{
"chargeValue": 20,
"beforeDays": 34,
"cancellationFee": 1
},
{
"chargeValue": 12,
"beforeDays": 45,
"cancellationFee": 2
}
]
}
},
"feeTaxMandatory": {
"isFeeMandatory": true,
"isTaxMandatory": true
},
"terms": "www.test.com",
"checkInTime": "10:00:00",
"checkOutTime": "16:00:00",
"leadTime": 2
},
"payment": {
"paymentType": "MAIL_CHECK",
"creditCard": {
"creditCardType": "POST",
"creditCardList": [
"AMERICAN_EXPRESS",
"DINERS_CLUB",
"DISCOVER",
"MASTER_CARD",
"VISA"
],
"paymentGateways": {
"paymentGatewaysType": "AUTHORIZE_NET"
}
}
},
"id": 61692801
}
]
}
Get Property Managerdetaildata
This function will return a property manager’s details that belong to the current user. You need to use your PMS API credentials.
Request Body parameters are the same as for creating PM.
Response is the same as in creating a Property Manager function. Here you do not need to pass all root level fields, but if some are used - all fields inside are mandatory:
- in CompanyDetails Model you can pass any field, and none of them is mandatory
- in Policies Model - you can pass any field, and none of them is mandatory
- if you do use PaymentPolicy - all fields inside are mandatory
- if you do use CancellationPolicy - all fields inside are mandatory
- if you use Payment Model - all fields inside are mandatory
async getPropertyManagerdetaildata(
contentType: string,
id: string,
requestOptions?: RequestOptions
): Promise<ApiResponse<PropertyManagerdetailsresponse>>
Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| contentType
| string
| Header, Required | - |
| id
| string
| Template, Required | Property Manager ID |
| requestOptions
| RequestOptions \| undefined
| Optional | Pass additional request options. |
Response Type
PropertyManagerdetailsresponse
Example Usage
const contentType = 'Content-Type2';
const id = 'id0';
try {
const { result, ...httpResponse } = await propertyManagersController.getPropertyManagerdetaildata(contentType, id);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch(error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
Example Response (as JSON)
{
"message": "",
"errorMessage": [],
"is_error": false,
"code": "",
"data": [
{
"companyDetails": {
"accountId": "132",
"companyName": "Test PM",
"language": "en",
"fullName": "Test PM",
"companyAddress": {
"country": "US",
"state": "Test State",
"streetAddress": "Test Street",
"city": "Test City",
"zip": "13245"
},
"website": "www.testsite.com",
"email": "[email protected]",
"phone": {
"countryCode": "+321",
"number": "132456"
},
"currency": "USD"
},
"policies": {
"paymentPolicy": {
"type": "SPLIT",
"splitPayment": {
"depositType": "FLAT",
"value": 4,
"secondPaymentDays": 30
}
},
"cancellationPolicy": {
"type": "MANUAL",
"manualPolicy": {
"type": "FLAT",
"manualPolicies": [
{
"chargeValue": 20,
"beforeDays": 34,
"cancellationFee": 1
},
{
"chargeValue": 12,
"beforeDays": 45,
"cancellationFee": 2
}
]
}
},
"feeTaxMandatory": {
"isFeeMandatory": true,
"isTaxMandatory": true
},
"terms": "www.test.com",
"checkInTime": "10:00:00",
"checkOutTime": "16:00:00",
"leadTime": 2
},
"payment": {
"paymentType": "MAIL_CHECK",
"creditCard": {
"creditCardType": "POST",
"creditCardList": [
"AMERICAN_EXPRESS",
"DINERS_CLUB",
"DISCOVER",
"MASTER_CARD",
"VISA"
],
"paymentGateways": {
"paymentGatewaysType": "AUTHORIZE_NET"
}
}
},
"id": 61692799
}
]
}
Update Property Managerdetails
This function will update a property manager’s details. In case of an update you do not need to pass all information, but if you have values in one section - all fields inside are mandatory.
async updatePropertyManagerdetails(
contentType: string,
body: CreatenewUpdatePropertyManagerRequest,
id: string,
requestOptions?: RequestOptions
): Promise<ApiResponse<PropertyManagerdetailsresponse>>
Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| contentType
| string
| Header, Required | - |
| body
| CreatenewUpdatePropertyManagerRequest
| Body, Required | - |
| id
| string
| Template, Required | Property Manager ID |
| requestOptions
| RequestOptions \| undefined
| Optional | Pass additional request options. |
Response Type
PropertyManagerdetailsresponse
Example Usage
const contentType = 'Content-Type2';
const bodyDataCompanyDetailsCompanyAddress: CompanyAddress = {
country: 'US',
state: 'Test State',
streetAddress: 'Test Street',
city: 'Test City',
zip: '13245',
};
const bodyDataCompanyDetailsPhone: Phone = {
countryCode: '+321',
number: '132456',
};
const bodyDataCompanyDetails: CompanyDetails = {
accountId: '132',
companyName: 'Test PM',
language: 'en',
fullName: 'Test PM',
companyAddress: bodyDataCompanyDetailsCompanyAddress,
website: 'www.testsite.com',
email: '[email protected]',
phone: bodyDataCompanyDetailsPhone,
currency: 'USD',
};
bodyDataCompanyDetails.password = 'password';
const bodyDataPoliciesPaymentPolicySplitPayment: SplitPayment = {
depositType: 'FLAT',
value: 4,
secondPaymentDays: 30,
};
const bodyDataPoliciesPaymentPolicy: PaymentPolicy = {
type: 'SPLIT',
splitPayment: bodyDataPoliciesPaymentPolicySplitPayment,
};
const bodyDataPoliciesCancellationPolicyManualPolicyManualPolicies: ManualPolicies[] = [];
const bodyDataPoliciesCancellationPolicyManualPolicymanualPolicies0: ManualPolicies = {
chargeValue: 20,
beforeDays: 34,
cancellationFee: 1,
};
bodyDataPoliciesCancellationPolicyManualPolicyManualPolicies[0] = bodyDataPoliciesCancellationPolicyManualPolicymanualPolicies0;
const bodyDataPoliciesCancellationPolicyManualPolicymanualPolicies1: ManualPolicies = {
chargeValue: 12,
beforeDays: 45,
cancellationFee: 2,
};
bodyDataPoliciesCancellationPolicyManualPolicyManualPolicies[1] = bodyDataPoliciesCancellationPolicyManualPolicymanualPolicies1;
const bodyDataPoliciesCancellationPolicyManualPolicy: ManualPolicy = {
type: 'FLAT',
manualPolicies: bodyDataPoliciesCancellationPolicyManualPolicyManualPolicies,
};
const bodyDataPoliciesCancellationPolicy: CancellationPolicy = {
type: 'MANUAL',
manualPolicy: bodyDataPoliciesCancellationPolicyManualPolicy,
};
const bodyDataPoliciesFeeTaxMandatory: FeeTaxMandatory = {
isFeeMandatory: true,
isTaxMandatory: true,
};
const bodyDataPolicies: Policies = {
paymentPolicy: bodyDataPoliciesPaymentPolicy,
cancellationPolicy: bodyDataPoliciesCancellationPolicy,
feeTaxMandatory: bodyDataPoliciesFeeTaxMandatory,
terms: 'www.test.com',
checkInTime: '10:00:00',
checkOutTime: '16:00:00',
leadTime: 2,
};
const bodyDataPaymentCreditCardPaymentGateways: PaymentGateways = {
paymentGatewaysType: 'AUTHORIZE_NET',
};
bodyDataPaymentCreditCardPaymentGateways.user = 'test';
bodyDataPaymentCreditCardPaymentGateways.secret = 'test';
bodyDataPaymentCreditCardPaymentGateways.additionalField1 = '';
bodyDataPaymentCreditCardPaymentGateways.additionalField2 = '';
const bodyDataPaymentCreditCardCreditCardList: CreditCardListEnum[] = ['AMERICAN_EXPRESS', 'DINERS_CLUB'];
const bodyDataPaymentCreditCard: CreditCard = {
creditCardType: 'POST',
};
bodyDataPaymentCreditCard.paymentGateways = bodyDataPaymentCreditCardPaymentGateways;
bodyDataPaymentCreditCard.creditCardList = bodyDataPaymentCreditCardCreditCardList;
const bodyDataPayment: Payment = {
paymentType: 'MAIL_CHECK',
};
bodyDataPayment.creditCard = bodyDataPaymentCreditCard;
const bodyData: Company = {
companyDetails: bodyDataCompanyDetails,
policies: bodyDataPolicies,
payment: bodyDataPayment,
};
const body: CreatenewUpdatePropertyManagerRequest = {
data: bodyData,
};
const id = 'id0';
try {
const { result, ...httpResponse } = await propertyManagersController.updatePropertyManagerdetails(contentType, body, id);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch(error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
Example Response (as JSON)
{
"message": "",
"errorMessage": [],
"is_error": false,
"code": "",
"data": [
{
"companyDetails": {
"accountId": "132",
"companyName": "Update Name",
"language": "en",
"fullName": "Update Full Name",
"companyAddress": {
"country": "US",
"state": "Update State",
"streetAddress": "Update Street",
"city": "Update City",
"zip": "13245"
},
"website": "www.updatesite.com",
"email": "[email protected]",
"phone": {
"countryCode": "+321",
"number": "132456"
},
"currency": "USD"
},
"policies": {
"paymentPolicy": {
"type": "SPLIT",
"splitPayment": {
"depositType": "FLAT",
"value": 4,
"secondPaymentDays": 30
}
},
"cancellationPolicy": {
"type": "MANUAL",
"manualPolicy": {
"type": "FLAT",
"manualPolicies": [
{
"chargeValue": 20,
"beforeDays": 34,
"cancellationFee": 1
},
{
"chargeValue": 12,
"beforeDays": 45,
"cancellationFee": 2
}
]
}
},
"feeTaxMandatory": {
"isFeeMandatory": true,
"isTaxMandatory": true
},
"terms": "www.test.com",
"checkInTime": "10:00:00",
"checkOutTime": "16:00:00",
"leadTime": 2
},
"payment": {
"paymentType": "MAIL_CHECK",
"creditCard": {
"creditCardType": "POST",
"creditCardList": [
"AMERICAN_EXPRESS",
"DINERS_CLUB",
"DISCOVER",
"MASTER_CARD",
"VISA"
],
"paymentGateways": {
"paymentGatewaysType": "AUTHORIZE_NET"
}
}
},
"id": 61692799
}
]
}
Product
Overview
Every API call in this section should be with PM credentials.
Getproductlist
This API call will return a list of properties that belong to the current user. This means that a user has to be logged in with products created already. Every API call in this section should be with PM credentials.
async getproductlist(
requestOptions?: RequestOptions
): Promise<ApiResponse<Productresponse>>
Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| requestOptions
| RequestOptions \| undefined
| Optional | Pass additional request options. |
Response Type
Example Usage
try {
const { result, ...httpResponse } = await productController.getproductlist();
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch(error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
Example Response (as JSON)
{
"message": "",
"errorMessage": [],
"is_error": false,
"code": "",
"data": [
{
"name": "Apimatic Test",
"id": 1235124634,
"supplierId": 61692799,
"rooms": 5,
"bathrooms": 4,
"toilets": 2,
"totalBeds": 6,
"space": 111,
"spaceUnit": "SQ_FT",
"persons": 10,
"childs": 2,
"latitude": 41.886125,
"longitude": -87.634233,
"livingRoom": 2,
"altId": 23556,
"notes": {
"description": {
"texts": [
{
"language": "EN",
"value": "Main description on EN!"
},
{
"language": "ES",
"value": "Main description on ES!"
}
]
},
"shortDescription": {
"texts": [
{
"language": "EN",
"value": "House Rules on EN!"
},
{
"language": "IT",
"value": "House Rules on IT!"
}
]
},
"houseRules": {
"texts": [
{
"language": "EN",
"value": "House Rules on EN!"
},
{
"language": "SR",
"value": "House Rules on SR!"
}
]
},
"name": {
"texts": [
{
"language": "EN",
"value": "House Rules on EN!"
},
{
"language": "FR",
"value": "House Rules on FR!"
}
]
},
"finePrint": {
"texts": [
{
"language": "EN",
"value": "House Rules on EN!"
},
{
"language": "SR",
"value": "House Rules on SR!"
}
]
}
},
"attributesWithQuantity": [
{
"attributeId": "HAC312",
"quantity": 1
},
{
"attributeId": "RMA19",
"quantity": 1
},
{
"attributeId": "RMA273",
"quantity": 1
},
{
"attributeId": "RMA32",
"quantity": 1
},
{
"attributeId": "RMA41",
"quantity": 1
},
{
"attributeId": "RMA5085",
"quantity": 1
},
{
"attributeId": "RMA68",
"quantity": 1
},
{
"attributeId": "RMA88",
"quantity": 1
}
],
"nearbyAmenities": [],
"propertyType": "PCT34",
"bedroomConfiguration": {
"bedrooms": [
{
"beds": {
"bed": [
{
"bedType": "RMA113",
"count": 1
},
{
"bedType": "RMA58",
"count": 1
}
]
},
"type": "Bedroom",
"privateBathroom": false
},
{
"beds": {
"bed": [
{
"bedType": "RMA113",
"count": 1
},
{
"bedType": "RMA58",
"count": 1
}
]
},
"type": "Bedroom",
"privateBathroom": false
},
{
"beds": {
"bed": [
{
"bedType": "RMA113",
"count": 1
},
{
"bedType": "RMA86",
"count": 1
}
]
},
"type": "Bedroom",
"privateBathroom": false
},
{
"beds": {
"bed": [
{
"bedType": "RMA113",
"count": 1
}
]
},
"type": "Bedroom",
"privateBathroom": false
},
{
"beds": {
"bed": [
{
"bedType": "RMA58",
"count": 1
}
]
},
"type": "Bedroom",
"privateBathroom": true
},
{
"beds": {
"bed": [
{
"bedType": "RMA58",
"count": 1
}
]
},
"type": "Living Room",
"privateBathroom": false
}
]
},
"checkInTime": "16:00:00",
"checkInToTime": "20:00:00",
"checkOutTime": "10:00:00",
"currency": "EUR",
"policy": {
"internetPolicy": {
"accessInternet": true,
"kindOfInternet": "WiFi",
"availableInternet": "AllAreas",
"chargeInternet": "Free"
},
"parkingPolicy": {
"accessParking": true,
"locatedParking": "OnSite",
"privateParking": true,
"chargeParking": "$ 150",
"timeCostParking": "PerStay",
"necessaryReservationParking": "NotPossible"
},
"petPolicy": {
"allowedPets": "Allowed",
"chargePets": "Free"
},
"childrenAllowed": true,
"smokingAllowed": false
},
"location": {
"postalCode": "60606",
"country": "US",
"region": "Illinois",
"city": "Chicago",
"street": "210 North Wells Street",
"zipCode9": "60606-1330"
},
"supportedLosRates": false
}
]
}
Createproduct
This function allows a logged in user to create new product. You can only send one product in each request.
async createproduct(
contentType: string,
body: CreateUpdatePropertyRequest,
requestOptions?: RequestOptions
): Promise<ApiResponse<Productresponse>>
Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| contentType
| string
| Header, Required | - |
| body
| CreateUpdatePropertyRequest
| Body, Required | - |
| requestOptions
| RequestOptions \| undefined
| Optional | Pass additional request options. |
Response Type
Example Usage
const contentType = 'Content-Type2';
const bodyDataNotesDescriptionTexts: Text[] = [];
const bodyDataNotesDescriptiontexts0: Text = {
language: 'EN',
value: 'Main description on EN!',
};
bodyDataNotesDescriptionTexts[0] = bodyDataNotesDescriptiontexts0;
const bodyDataNotesDescriptiontexts1: Text = {
language: 'ES',
value: 'Main description on ES!',
};
bodyDataNotesDescriptionTexts[1] = bodyDataNotesDescriptiontexts1;
const bodyDataNotesDescription: DescriptionTextModel = {
texts: bodyDataNotesDescriptionTexts,
};
const bodyDataNotesHouseRulesTexts: Text[] = [];
const bodyDataNotesHouseRulestexts0: Text = {
language: 'EN',
value: 'House Rules on EN!',
};
bodyDataNotesHouseRulesTexts[0] = bodyDataNotesHouseRulestexts0;
const bodyDataNotesHouseRulestexts1: Text = {
language: 'SR',
value: 'House Rules on SR!',
};
bodyDataNotesHouseRulesTexts[1] = bodyDataNotesHouseRulestexts1;
const bodyDataNotesHouseRules: DescriptionTextModel = {
texts: bodyDataNotesHouseRulesTexts,
};
const bodyDataNotesShortDescriptionTexts: Text[] = [];
const bodyDataNotesShortDescriptiontexts0: Text = {
language: 'EN',
value: 'Short description on EN!',
};
bodyDataNotesShortDescriptionTexts[0] = bodyDataNotesShortDescriptiontexts0;
const bodyDataNotesShortDescriptiontexts1: Text = {
language: 'ES',
value: 'short description on ES!',
};
bodyDataNotesShortDescriptionTexts[1] = bodyDataNotesShortDescriptiontexts1;
const bodyDataNotesShortDescription: DescriptionTextModel = {
texts: bodyDataNotesShortDescriptionTexts,
};
const bodyDataNotes: Notes = {
description: bodyDataNotesDescription,
};
bodyDataNotes.houseRules = bodyDataNotesHouseRules;
bodyDataNotes.shortDescription = bodyDataNotesShortDescription;
const bodyDataAttributesWithQuantity: AttributesWithQuantity[] = [];
const bodyDataattributesWithQuantity0: AttributesWithQuantity = {
attributeId: 'HAC312',
quantity: 1,
};
bodyDataAttributesWithQuantity[0] = bodyDataattributesWithQuantity0;
const bodyDataattributesWithQuantity1: AttributesWithQuantity = {
attributeId: 'RMA107',
quantity: 1,
};
bodyDataAttributesWithQuantity[1] = bodyDataattributesWithQuantity1;
const bodyDataattributesWithQuantity2: AttributesWithQuantity = {
attributeId: 'RMA11',
quantity: 1,
};
bodyDataAttributesWithQuantity[2] = bodyDataattributesWithQuantity2;
const bodyDataattributesWithQuantity3: AttributesWithQuantity = {
attributeId: 'RMA149',
quantity: 1,
};
bodyDataAttributesWithQuantity[3] = bodyDataattributesWithQuantity3;
const bodyDataattributesWithQuantity4: AttributesWithQuantity = {
attributeId: 'RMA163',
quantity: 1,
};
bodyDataAttributesWithQuantity[4] = bodyDataattributesWithQuantity4;
const bodyDataattributesWithQuantity5: AttributesWithQuantity = {
attributeId: 'RMA18',
quantity: 1,
};
bodyDataAttributesWithQuantity[5] = bodyDataattributesWithQuantity5;
const bodyDataattributesWithQuantity6: AttributesWithQuantity = {
attributeId: 'RMA19',
quantity: 1,
};
bodyDataAttributesWithQuantity[6] = bodyDataattributesWithQuantity6;
const bodyDataattributesWithQuantity7: AttributesWithQuantity = {
attributeId: 'RMA251',
quantity: 1,
};
bodyDataAttributesWithQuantity[7] = bodyDataattributesWithQuantity7;
const bodyDataattributesWithQuantity8: AttributesWithQuantity = {
attributeId: 'RMA273',
quantity: 1,
};
bodyDataAttributesWithQuantity[8] = bodyDataattributesWithQuantity8;
const bodyDataattributesWithQuantity9: AttributesWithQuantity = {
attributeId: 'RMA32',
quantity: 1,
};
bodyDataAttributesWithQuantity[9] = bodyDataattributesWithQuantity9;
const bodyDataattributesWithQuantity10: AttributesWithQuantity = {
attributeId: 'RMA41',
quantity: 1,
};
bodyDataAttributesWithQuantity[10] = bodyDataattributesWithQuantity10;
const bodyDataattributesWithQuantity11: AttributesWithQuantity = {
attributeId: 'RMA5085',
quantity: 1,
};
bodyDataAttributesWithQuantity[11] = bodyDataattributesWithQuantity11;
const bodyDataattributesWithQuantity12: AttributesWithQuantity = {
attributeId: 'RMA59',
quantity: 1,
};
bodyDataAttributesWithQuantity[12] = bodyDataattributesWithQuantity12;
const bodyDataattributesWithQuantity13: AttributesWithQuantity = {
attributeId: 'RMA6058',
quantity: 1,
};
bodyDataAttributesWithQuantity[13] = bodyDataattributesWithQuantity13;
const bodyDataattributesWithQuantity14: AttributesWithQuantity = {
attributeId: 'RMA68',
quantity: 1,
};
bodyDataAttributesWithQuantity[14] = bodyDataattributesWithQuantity14;
const bodyDataattributesWithQuantity15: AttributesWithQuantity = {
attributeId: 'RMA88',
quantity: 1,
};
bodyDataAttributesWithQuantity[15] = bodyDataattributesWithQuantity15;
const bodyDataBedroomConfigurationBedrooms: Bedroom[] = [];
const bodyDataBedroomConfigurationbedrooms0BedsBed: Bed[] = [];
const bodyDataBedroomConfigurationbedrooms0Bedsbed0: Bed = {
bedType: 'RMA113',
count: 1,
};
bodyDataBedroomConfigurationbedrooms0BedsBed[0] = bodyDataBedroomConfigurationbedrooms0Bedsbed0;
const bodyDataBedroomConfigurationbedrooms0Bedsbed1: Bed = {
bedType: 'RMA58',
count: 1,
};
bodyDataBedroomConfigurationbedrooms0BedsBed[1] = bodyDataBedroomConfigurationbedrooms0Bedsbed1;
const bodyDataBedroomConfigurationbedrooms0Beds: Beds = {
bed: bodyDataBedroomConfigurationbedrooms0BedsBed,
};
const bodyDataBedroomConfigurationbedrooms0: Bedroom = {
beds: bodyDataBedroomConfigurationbedrooms0Beds,
type: 'Bedroom',
privateBathroom: false,
};
bodyDataBedroomConfigurationBedrooms[0] = bodyDataBedroomConfigurationbedrooms0;
const bodyDataBedroomConfigurationbedrooms1BedsBed: Bed[] = [];
const bodyDataBedroomConfigurationbedrooms1Bedsbed0: Bed = {
bedType: 'RMA113',
count: 1,
};
bodyDataBedroomConfigurationbedrooms1BedsBed[0] = bodyDataBedroomConfigurationbedrooms1Bedsbed0;
const bodyDataBedroomConfigurationbedrooms1Bedsbed1: Bed = {
bedType: 'RMA58',
count: 1,
};
bodyDataBedroomConfigurationbedrooms1BedsBed[1] = bodyDataBedroomConfigurationbedrooms1Bedsbed1;
const bodyDataBedroomConfigurationbedrooms1Beds: Beds = {
bed: bodyDataBedroomConfigurationbedrooms1BedsBed,
};
const bodyDataBedroomConfigurationbedrooms1: Bedroom = {
beds: bodyDataBedroomConfigurationbedrooms1Beds,
type: 'Bedroom',
privateBathroom: false,
};
bodyDataBedroomConfigurationBedrooms[1] = bodyDataBedroomConfigurationbedrooms1;
const bodyDataBedroomConfigurationbedrooms2BedsBed: Bed[] = [];
const bodyDataBedroomConfigurationbedrooms2Bedsbed0: Bed = {
bedType: 'RMA113',
count: 1,
};
bodyDataBedroomConfigurationbedrooms2BedsBed[0] = bodyDataBedroomConfigurationbedrooms2Bedsbed0;
const bodyDataBedroomConfigurationbedrooms2Bedsbed1: Bed = {
bedType: 'RMA86',
count: 1,
};
bodyDataBedroomConfigurationbedrooms2BedsBed[1] = bodyDataBedroomConfigurationbedrooms2Bedsbed1;
const bodyDataBedroomConfigurationbedrooms2Beds: Beds = {
bed: bodyDataBedroomConfigurationbedrooms2BedsBed,
};
const bodyDataBedroomConfigurationbedrooms2: Bedroom = {
beds: bodyDataBedroomConfigurationbedrooms2Beds,
type: 'Bedroom',
privateBathroom: false,
};
bodyDataBedroomConfigurationBedrooms[2] = bodyDataBedroomConfigurationbedrooms2;
const bodyDataBedroomConfigurationbedrooms3BedsBed: Bed[] = [];
const bodyDataBedroomConfigurationbedrooms3Bedsbed0: Bed = {
bedType: 'RMA113',
count: 1,
};
bodyDataBedroomConfigurationbedrooms3BedsBed[0] = bodyDataBedroomConfigurationbedrooms3Bedsbed0;
const bodyDataBedroomConfigurationbedrooms3Beds: Beds = {
bed: bodyDataBedroomConfigurationbedrooms3BedsBed,
};
const bodyDataBedroomConfigurationbedrooms3: Bedroom = {
beds: bodyDataBedroomConfigurationbedrooms3Beds,
type: 'Bedroom',
privateBathroom: false,
};
bodyDataBedroomConfigurationBedrooms[3] = bodyDataBedroomConfigurationbedrooms3;
const bodyDataBedroomConfigurationbedrooms4BedsBed: Bed[] = [];
const bodyDataBedroomConfigurationbedrooms4Bedsbed0: Bed = {
bedType: 'RMA113',
count: 1,
};
bodyDataBedroomConfigurationbedrooms4BedsBed[0] = bodyDataBedroomConfigurationbedrooms4Bedsbed0;
const bodyDataBedroomConfigurationbedrooms4Beds: Beds = {
bed: bodyDataBedroomConfigurationbedrooms4BedsBed,
};
const bodyDataBedroomConfigurationbedrooms4: Bedroom = {
beds: bodyDataBedroomConfigurationbedrooms4Beds,
type: 'Bedroom',
privateBathroom: false,
};
bodyDataBedroomConfigurationBedrooms[4] = bodyDataBedroomConfigurationbedrooms4;
const bodyDataBedroomConfigurationbedrooms5BedsBed: Bed[] = [];
const bodyDataBedroomConfigurationbedrooms5Bedsbed0: Bed = {
bedType: 'RMA58',
count: 1,
};
bodyDataBedroomConfigurationbedrooms5BedsBed[0] = bodyDataBedroomConfigurationbedrooms5Bedsbed0;
const bodyDataBedroomConfigurationbedrooms5Beds: Beds = {
bed: bodyDataBedroomConfigurationbedrooms5BedsBed,
};
const bodyDataBedroomConfigurationbedrooms5: Bedroom = {
beds: bodyDataBedroomConfigurationbedrooms5Beds,
type: 'Bedroom',
privateBathroom: true,
};
bodyDataBedroomConfigurationBedrooms[5] = bodyDataBedroomConfigurationbedrooms5;
const bodyDataBedroomConfigurationbedrooms6BedsBed: Bed[] = [];
const bodyDataBedroomConfigurationbedrooms6Bedsbed0: Bed = {
bedType: 'RMA58',
count: 1,
};
bodyDataBedroomConfigurationbedrooms6BedsBed[0] = bodyDataBedroomConfigurationbedrooms6Bedsbed0;
const bodyDataBedroomConfigurationbedrooms6Beds: Beds = {
bed: bodyDataBedroomConfigurationbedrooms6BedsBed,
};
const bodyDataBedroomConfigurationbedrooms6: Bedroom = {
beds: bodyDataBedroomConfigurationbedrooms6Beds,
type: 'Living Room',
privateBathroom: false,
};
bodyDataBedroomConfigurationBedrooms[6] = bodyDataBedroomConfigurationbedrooms6;
const bodyDataBedroomConfiguration: BedroomConfiguration = {
bedrooms: bodyDataBedroomConfigurationBedrooms,
};
const bodyDataPolicyInternetPolicy: InternetPolicy = {
accessInternet: true,
};
bodyDataPolicyInternetPolicy.kindOfInternet = 'WiFi';
bodyDataPolicyInternetPolicy.availableInternet = 'AllAreas';
bodyDataPolicyInternetPolicy.chargeInternet = 'Free';
const bodyDataPolicyParkingPolicy: ParkingPolicy = {
accessParking: true,
};
bodyDataPolicyParkingPolicy.locatedParking = 'OnSite';
bodyDataPolicyParkingPolicy.privateParking = true;
bodyDataPolicyParkingPolicy.chargeParking = '$ 150';
bodyDataPolicyParkingPolicy.timeCostParking = 'PerStay';
bodyDataPolicyParkingPolicy.necessaryReservationParking = 'NotPossible';
const bodyDataPolicyPetPolicy: PetPolicy = {
allowedPets: 'Allowed',
};
bodyDataPolicyPetPolicy.chargePets = 'Free';
const bodyDataPolicy: Policy = {
childrenAllowed: true,
smokingAllowed: false,
};
bodyDataPolicy.internetPolicy = bodyDataPolicyInternetPolicy;
bodyDataPolicy.parkingPolicy = bodyDataPolicyParkingPolicy;
bodyDataPolicy.petPolicy = bodyDataPolicyPetPolicy;
const bodyDataLocation: Location = {
postalCode: '60606',
country: 'US',
region: 'Illinois',
city: 'Chicago',
street: '210 North Wells Street',
zipCode9: '60606-1330',
};
const bodyData: Property = {
name: 'Test product',
rooms: 5,
bathrooms: 4,
persons: 10,
propertyType: 'PCT34',
currency: 'EUR',
supportedLosRates: false,
};
bodyData.toilets = 2;
bodyData.totalBeds = 6;
bodyData.space = 113.76;
bodyData.spaceUnit = 'SQ_FT';
bodyData.childs = 2;
bodyData.latitude = 41.886125;
bodyData.longitude = -87.634233;
bodyData.livingRoom = 2;
bodyData.notes = bodyDataNotes;
bodyData.attributesWithQuantity = bodyDataAttributesWithQuantity;
bodyData.bedroomConfiguration = bodyDataBedroomConfiguration;
bodyData.checkInTime = '16:00:00';
bodyData.checkInToTime = '20:00:00';
bodyData.checkOutTime = '10:00:00';
bodyData.policy = bodyDataPolicy;
bodyData.location = bodyDataLocation;
const body: CreateUpdatePropertyRequest = {
data: bodyData,
};
try {
const { result, ...httpResponse } = await productController.createproduct(contentType, body);
// Get more response info...
// const { statusCode, headers } = httpResponse;
} catch(error) {
if (error instanceof ApiError) {
const errors = error.result;
// const { statusCode, headers } = error;
}
}
Example Response (as JSON)
{
"message": "",
"errorMessage": [],
"is_error": false,
"code": "",
"data": [
{
"name": "Apimatic Test",
"id": 1235124634,
"supplierId": 61692799,
"rooms": 5,
"bathrooms": 4,
"toilets": 2,
"totalBeds": 6,
"space": 111,
"spaceUnit": "SQ_FT",
"persons": 10,
"childs": 2,
"latitude": 41.886125,
"longitude": -87.634233,
"livingRoom": 2,
"altId": 23556,
"notes": {
"description": {
"texts": [
{
"language": "EN",
"value": "Main description on EN!"
},
{
"language": "ES",
"value": "Main description on ES!"
}
]
},
"shortDescription": {
"texts": [
{
"language": "EN",
"value": "House Rules on EN!"
},
{
"language": "IT",
"value": "House Rules on IT!"
}
]
},
"houseRules": {
"texts": [
{
"language": "EN",
"value": "House Rules on EN!"
},
{
"language": "SR",
"value": "House Rules on SR!"
}
]
},
"name": {
"texts": [
{
"language": "EN",
"value": "House Rules on EN!"
},
{
"language": "FR",
"value": "House Rules on FR!"
}
]
},
"finePrint": {
"texts": [
{
"language": "EN",
"value": "House Rules on EN!"
},
{
"language": "SR",
"value": "House Rules on SR!"
}
]
}
},
"attributesWithQuantity": [
{
"attributeId": "HAC312",
"quantity": 1
},
{
"attributeId": "RMA19",
"quantity": 1
},
{
"attributeId": "RMA273",
"quantity": 1
},
{
"attributeId": "RMA32",
"quantity": 1
},
{
"attributeId": "RMA41",
"quantity": 1
},
{
"attributeId": "RMA5085",
"quantity": 1
},
{
"attributeId": "RMA68",
"quantity": 1
},
{
"attributeId": "RMA88",
"quantity": 1
}
],
"nearbyAmenities": [],
"propertyType": "PCT34",
"bedroomConfiguration": {
"bedrooms": [
{
"beds": {
"bed": [
{
"bedType": "RMA113",
"count": 1
},
{
"bedType": "RMA58",
"count": 1
}
]
},
"type": "Bedroom",
"privateBathroom": false
},
{
"beds": {
"bed": [
{
"bedType": "RMA113",
"count": 1
},
{
"bedType": "RMA58",
"count": 1
}
]
},
"type": "Bedroom",
"privateBathroom": false
},
{
"beds": {
"bed": [
{
"bedType": "RMA113",
"count": 1
},
{
"bedType": "RMA86",
"count": 1
}
]
},
"type": "Bedroom",
"privateBathroom": false
},
{
"beds": {
"bed": [
{
"bedType": "RMA113",
"count": 1
}
]
},
"type": "Bedroom",
"privateBathroom": false
},
{
"beds": {
"bed": [
{
"bedType": "RMA58",
"count": 1
}
]
},
"type": "Bedroom",
"privateBathroom": true
},
{
"beds": {
"bed": [
{
"bedType": "RMA58",
"count": 1
}
]
},
"type": "Living Room",
"privateBathroom": false
}
]
},
"checkInTime": "16:00:00",
"checkInToTime": "20:00:00",
"checkOutTime": "10:00:00",
"currency": "EUR",
"policy": {
"internetPolicy": {
"accessInternet": true,
"kindOfInternet": "WiFi",
"availableInternet": "AllAreas",
"chargeInternet": "Free"
},
"parkingPolicy": {
"accessParking": true,
"locatedParking": "OnSite",
"privateParking": true,
"chargeParking": "$ 150",
"timeCostParking": "PerStay",
"necessaryReservationParking": "NotPossible"
},
"petPolicy": {
"allowedPets": "Allowed",
"chargePets": "Free"
},
"childrenAllowed": true,
"smokingAllowed": false
},
"location": {
"postalCode": "60606",
"country": "US",
"region": "Illinois",
"city": "Chicago",
"street": "210 North Wells Street",
"zipCode9": "60606-1330"
},
"supportedLosRates": false
}
]
}
Updateproduct
This function allows a logged in user to update product details.
Request parameters and request example will be the same as in the create product API. The only field that must be added is the product id.
You need to have all other parameters which were used in the create API call that you want to keep (AltID can’t be updated). Everything that you do not send as an update will be deleted (overwritten).
Response parameters and response examples are the same as in the create product API.
async updateproduct(
contentType: string,
body: CreateUpdatePropertyRequest,
requestOptions?: RequestOptions
): Promise<ApiResponse<Productresponse>>
Parameters
| Parameter | Type | Tags | Description |
| --- | --- | --- | --- |
| contentType
| string
| Header, Required | - |
| body
| CreateUpdatePropertyRequest
| Body, Required | - |
| requestOptions
| RequestOptions \| undefined
| Optional | Pass additional request options. |
Response Type
Example Usage
const contentType = 'Content-Type2';
const bodyDataNotesDescriptionTexts: Text[] = [];
const bodyDataNotesDescriptiontexts0: Text = {
language: 'EN',
value: 'Main description on EN!',
};
bodyDataNotesDescriptionTexts[0] = bodyDataNotesDescriptiontexts0;
const bodyDataNotesDescriptiontexts1: Text = {
language: 'ES',
value: 'Main description on ES!',
};
bodyDataNotesDescriptionTexts[1] = bodyDataNotesDescriptiontexts1;
const bodyDataNotesDescription: DescriptionTextModel = {
texts: bodyDataNotesDescriptionTexts,
};
const bodyDataNotesHouseRulesTexts: Text[] = [];
const bodyDataNotesHouseRulestexts0: Text = {
language: 'EN',
value: 'House Rules on EN!',
};
bodyDataNotesHouseRulesTexts[0] = bodyDataNotesHouseRulestexts0;
const bodyDataNotesHouseRulestexts1: Text = {
language: 'SR',
value: 'House Rules on SR!',
};
bodyDataNotesHouseRulesTexts[1] = bodyDataNotesHouseRulestexts1;
const bodyDataNotesHouseRules: DescriptionTextModel = {
texts: bodyDataNotesHouseRulesTexts,
};
const bodyDataNotesShortDescriptionTexts: Text[] = [];
const bodyDataNotesShortDescriptiontexts0: Text = {
language: 'EN',
value: 'Short description on EN!',
};
bodyDataNotesShortDescriptionTexts[0] = bodyDataNotesShortDescriptiontexts0;
const bodyDataNotesShortDescriptiontexts1: Text = {
language: 'ES',
value: 'short description on ES!',
};
bodyDataNotesShortDescriptionTexts[1] = bodyDataNotesShortDescriptiontexts1;
const bodyDataNotesShortDescription: DescriptionTextModel = {
texts: bodyDataNotesShortDescriptionTexts,
};
const bodyDataNotes: Notes = {
description: bodyDataNotesDescription,
};
bodyDataNotes.houseRules = bodyDataNotesHouseRules;
bodyDataNotes.shortDescription = bodyDataNotesShortDescription;
const bodyDataAttributesWithQuantity: AttributesWithQuantity[] = [];
const bodyDataattributesWithQuantity0: AttributesWithQuantity = {
attributeId: 'HAC312',
quantity: 1,
};
bodyDataAttributesWithQuantity[0] = bodyDataattributesWithQuantity0;
const bodyDataattributesWithQuantity1: AttributesWithQuantity = {
attributeId: 'RMA107',
quantity: 1,
};
bodyDataAttributesWithQuantity[1] = bodyDataattributesWithQuantity1;
const bodyDataattributesWithQuantity2: AttributesWithQuantity = {
attributeId: 'RMA11',
quantity: 1,
};
bodyDataAttributesWithQuantity[2] = bodyDataattributesWithQuantity2;
const bodyDataattributesWithQuantity3: AttributesWithQuantity = {
attributeId: 'RMA149',
quantity: 1,
};
bodyDataAttributesWithQuantity[3] = bodyDataattributesWithQuantity3;
const bodyDataattributesWithQuantity4: AttributesWithQuantity = {
attributeId: 'RMA163',
quantity: 1,
};
bodyDataAttributesWithQuantity[4] = bodyDataattributesWithQuantity4;
const bodyDataattributesWithQuantity5: AttributesWithQuantity = {
attributeId: 'RMA18',
quantity: 1,
};
bodyDataAttributesWithQuantity[5] = bodyDataattributesWithQuantity5;
const bodyDataattributesWithQuantity6: AttributesWithQuantity = {
attributeId: 'RMA19',
quantity: 1,
};
bodyDataAttributesWithQuantity[6] = bodyDataattributesWithQuantity6;
const bodyDataattributesWithQuantity7: AttributesWithQuantity = {
attributeId: 'RMA251',
quantity: 1,
};
bodyDataAttributesWithQuantity[7] = bodyDataattributesWithQuantity7;
const bodyDataattributesWithQuantity8: AttributesWithQuantity = {
attributeId: 'RMA273',
quantity: 1,
};
bodyDataAttributesWithQuantity[8] = bodyDataattributesWithQuantity8;
const bodyDataattributesWithQuantity9: AttributesWithQuantity = {
attributeId: 'RMA32',
quantity: 1,
};
bodyDataAttributesWithQuantity[9] = bodyDataattributesWithQuantity9;
const bodyDataattributesWithQuantity10: AttributesWithQuantity = {
attributeId: 'RMA41',
quantity: 1,
};
bodyDataAttributesWithQuantity[10] = bodyDataattributesWithQuantity10;
const bodyDataattributesWithQuantity11: AttributesWithQuantity = {
attributeId: 'RMA5085',
quantity: 1,
};
bodyDataAttributesWithQuantity[11] = bodyDataattributesWithQuantity11;
const bodyDataattributesWithQuantity12: AttributesWithQuantity = {
attributeId: 'RMA59',
quantity: 1,
};
bodyDataAttributesWithQuantity[12] = bodyDataattributesWithQuantity12;
const bodyDataattributesWithQuantity13: AttributesWithQuantity = {
attributeId: 'RMA6058',
quantity: 1,
};
bodyDataAttributesWithQuantity[13] = bodyDataattributesWithQuantity13;
const bodyDataattributesWithQuantity14: AttributesWithQuantity = {
attributeId: 'RMA68',
quantity: 1,
};
bodyDataAttributesWithQuantity[14] = bodyDataattributesWithQuantity14;
const bodyDataattributesWithQuantity15: AttributesWithQuantity = {
attributeId: 'RMA88',
quantity: 1,
};
bodyDataAttributesWithQuantity[15] = bodyDataattributesWithQuantity15;
const bodyDataBedroomConfigurationBedrooms: Bedroom[] = [];
const bodyDataBedroomConfigurationbedrooms0BedsBed: Bed[] = [];
const bodyDataBedroomConfigurationbedrooms0Bedsbed0: Bed = {
bedType: 'RMA113',
count: 1,
};
bodyDataBedroomConfigurationbedrooms0BedsBed[0] = bodyDataBedroomConfigurationbedrooms0Bedsbed0;
const bodyDataBedroomConfigurationbedrooms0Bedsbed1: Bed = {
bedType: 'RMA58',
count: 1,
};
bodyDataBedroomConfigurationbedrooms0BedsBed[1] = bodyDataBedroomConfigurationbedrooms0Bedsbed1;
const bodyDataBedroomConfigurationbedrooms0Beds: Beds = {
bed: bodyDataBedroomConfigurationbedrooms0BedsBed,
};
const bodyDataBedroomConfigurationbedrooms0: Bedroom = {
beds: bodyDataBedroomConfigurationbedrooms0Beds,
type: 'Bedroom',
privateBathroom: false,
};
bodyDataBedroomConfigurationBedrooms[0] = bodyDataBedroomConfigurationbedrooms0;
const bodyDataBedroomConfigurationbedrooms1BedsBed: Bed[] = [];
const bodyDataBedroomConfigurationbedrooms1Bedsbed0: Bed = {
bedType: 'RMA113',
count: 1,
};
bodyDataBedroomConfigurationbedrooms1BedsBed[0] = bodyDataBedroomConfigurationbedrooms1Bedsbed0;
const bodyDataBedroomConfigur