j
Customer is the object that represents clients of property, that is people on the name of whom reservations are registered.
| Resource | Description |
|---|---|
| GET /v1/Customer/{id} | Get the stored data for a Customer of the property |
| GET /v1/Customers | Get the stored data for all Customers of the property |
| POST /v1/Customers | Get the stored data for filtered Customers of the property |
| POST /v1/Customer | Create record for a new Customer |
| PUT /v1/Customer | Update stored data of an existing Customer |
| DELETE /v1/Customer | Delete the record of a Customer |
| Name | Type | Description | |
|---|---|---|---|
| id | int | Unique identifier of Customer | |
| lastName | string (100) | Customer's last name | |
| firstName | string (100) | Customer's first name | |
| string (50) | Customer's e-mail | ||
| mobile | string (20) | Customer's mobile number, without international dialing code | |
| phone | string (50) | Customer's phone number, without international dialing code | |
| billingAddress1 | string (100) | Customer's primary billing address | |
| billingAddress2 | string (100) | Customer's secondary billing address | |
| billingCity | string (100) | Customer's billing city | |
| billingZipCode | string (20) | Postal code of Customer's billing address | |
| provinceId | int | Unique identifier of province where billingCity belongs to | |
| countryCode | string (2) | Customer's country code accordind to ISO 3166-1 alpha-2 | |
| taxId | string (50) | Customer's VAT number | |
| taxIdAdditional | string (50) | Customer's additional VAT number | |
| isSalesTaxExempt | tinyint | Indicates if Customer is free of tax obligations | |
| occupation | string (50) | Customer's job title | |
| notes | string (250) | Notes about the Customer. | |
| categories | array | Customer's category contains: id (int) - Unique identifier of category, title (string 50) - title of customer category |
Get the stored data for a Customer of the property.
Request parameters
| Name | Value |
|---|---|
| id | The id of requested Customer |
Response
The result is a Customer object.
Example Response
<?xml version="1.0" ?>
<Customer>
<BillingAddress1> Main Str. 22 </BillingAddress1>
<BillingAddress2 />
<BillingCity> Madrit </BillingCity>
<BillingZipCode> 28001 </BillingZipCode>
<CountryCode> ES </CountryCode>
<Email> jmith@example.com </Email>
<FirstName> John </FirstName>
<Id> 1 </Id>
<IsSalesTaxExempt> 0 </IsSalesTaxExempt>
<LastName> Smith </LastName>
<Mobile> 612345678 </Mobile>
<Notes> Notes about customer </Notes>
<Occupation> Developer </Occupation>
<Phone> 915111100 </Phone>
<ProvinceId> 0 </ProvinceId>
<TaxId> 1111111111 </TaxId>
<TaxIdAdditional/>
</Customer>
{
"billingAddress1":"Main Str. 22",
"billingAddress2":"",
"billingCity":"Madrit",
"billingZipCode":"28001",
"countryCode":"ES",
"email":"jmith@example.com",
"firstName":"John",
"id":1,
"isSalesTaxExempt":0,
"lastName":"Smith",
"mobile":"612345678",
"notes":"Notes about customer",
"occupation":"Developer",
"phone":"915111100",
"provinceId":0,
"taxId":"1111111111",
"taxIdAdditional":""
}
Get the stored data for all Customers of the property.
Request parameters
None
Response
Request results in a list of Customer objects.
Example Response
<?xml version="1.0" ?>
<Customers>
<Customer>
<BillingAddress1> Main Str. 22 </BillingAddress1>
<BillingAddress2 />
<BillingCity> Madrit </BillingcCty>
<Billingzipcode> 28001 </BillingZipCode>
<CountryCode> ES </CountryCode>
<Email> jmith@example.com </Email>
<FirstName> John </FirstName>
<Id> 1 </Id>
<IsSalesTaxExempt> 0 </IsSalesTaxExempt>
<LastName> Smith </LastName>
<Mobile> 612345678 </Mobile>
<Notes> Notes about customer </Notes>
<Occupation> Developer </Occupation>
<Phone> 915111100 </Phone>
<ProvinceId> 0 </ProvinceId>
<TaxId> 1111111111 </TaxId>
<TaxIdAdditional/>
</Customer>
<Customer>
...
</Customer>
...
</Customers>
[
{
billingAddress1:"Main Str. 22",
billingAddress2:"",
billingCity:"Madrit",
billingZipCode:"28001",
countryCode:"ES",
email:"jmith@example.com",
firstName:"John",
id:1,
isSalesTaxExempt:0,
lastName:"Smith",
mobile:"612345678",
notes:"Notes about customer",
occupation:"Developer",
phone:"915111100",
provinceId:0,
taxId:"1111111111",
taxIdAdditional:"",
},
{...},
...
]
Get the stored data for filtered Customers of the property.
Request parameters
| Name | Value |
|---|---|
| CustomerId | Customer Id |
| NameContains | a string which is substring in firstName or LastName |
| PhoneContains | a string which is substring in Phone |
| MobileContains | a string which is substring in Mobile |
| CountryIs.Id | 2 character country code |
| TaxIdContains | a string which is substring in TaxId |
Response
Request results in a list of Customer objects.
Example Request
<?xml version="1.0" ?>
<CustomerFilter>
<CustomerId> 123 </CustomerId>
<NameContains> Jordan </NameContains>
<PhoneContains> +90 </PhoneContains>
<CountryIs>
<Id> ES </Id>
</CountryIs>
<TaxIdContains> 1111 </TaxIdContains>
<MobileContains> +80 </MobileContains>
</CustomerFilter>
{
"CustomerId":123,
"NameContains":"Jordan",
"PhoneContains":"+90",
"CountryIs": {
"Id": "ES"
},
"TaxIdContains":"1111",
"MobileContains":"+80",
}
Example Response
<?xml version="1.0" ?>
<Customers>
<Customer>
<BillingAddress1> Main Str. 22 </BillingAddress1>
<BillingAddress2 />
<BillingCity> Madrit </BillingcCty>
<Billingzipcode> 28001 </BillingZipCode>
<CountryCode> ES </CountryCode>
<Email> jmith@example.com </Email>
<FirstName> John </FirstName>
<Id> 1 </Id>
<IsSalesTaxExempt> 0 </IsSalesTaxExempt>
<LastName> Smith </LastName>
<Mobile> 612345678 </Mobile>
<Notes> Notes about customer </Notes>
<Occupation> Developer </Occupation>
<Phone> 915111100 </Phone>
<ProvinceId> 0 </ProvinceId>
<TaxId> 1111111111 </TaxId>
<TaxIdAdditional/>
</Customer>
<Customer>
...
</Customer>
...
</Customers>
[
{
billingAddress1:"Main Str. 22",
billingAddress2:"",
billingCity:"Madrit",
billingZipCode:"28001",
countryCode:"ES",
email:"jmith@example.com",
firstName:"John",
id:1,
isSalesTaxExempt:0,
lastName:"Smith",
mobile:"612345678",
notes:"Notes about customer",
occupation:"Developer",
phone:"915111100",
provinceId:0,
taxId:"1111111111",
taxIdAdditional:"",
},
{...},
...
]
Create record for a new Customer.
Request parameters
| Name | Value |
|---|---|
| lastName | Last name of the new Customer |
* The rest of Customer's object fields are optional.
** The id field must not be issued in the request.
Response
Result is the id of the newly created Customer.
Example Request
<?xml version="1.0" ?>
<Customer>
<BillingAddress1> Main Str. 22 </BillingAddress1>
<BillingAddress2> Secondary Str. 35 </BillingAddress2>
<BillingCity> Madrit </BillingCity>
<BillingZipCode> 28001 </BillingZipCode>
<CountryCode> ES </CountryCode>
<Email> jmith@example.com </Email>
<FirstName> John </FirstName>
<IsSalesTaxExempt> 0 </IsSalesTaxExempt>
<LastName> Smith </LastName>
<Mobile> 612345678 </Mobile>
<Notes> Notes about customer </Notes>
<Occupation> Developer </Occupation>
<Phone> 915111100 </Phone>
<ProvinceId> 2 </ProvinceId>
<TaxId> 1111111111 </TaxId>
<TaxIdAdditional> 2222222222 </TaxIdAdditional>
</Customer>
{
"billingAddress1":"Main Str. 22",
"billingAddress2":"Secondary Str. 35",
"billingCity":"Madrit",
"billingZipCode":"28001",
"countryCode":"ES",
"email":"jmith@example.com",
"firstName":"John",
"isSalesTaxExempt":0,
"lastName":"Smith",
"mobile":"612345678",
"notes":"Notes about customer",
"occupation":"Developer",
"phone":"915111100",
"provinceId":2,
"taxId":"1111111111",
"taxIdAdditional":"2222222222"
}
Example Response
<?xml version="1.0" ?>
<Customer>
<Id> 11 </Id>
</Customer>
{
"id":429
}
Update stored data of an existing Customer.
Request parameters
| Name | Value |
|---|---|
| id | The id of requested Customer |
| lastName | Last name of Customer |
* The rest of Customer's object fields are optional.
** Fields that are not issued in the request will be set to default value.
Response
Result is the status code of the request.
Example Request
<?xml version="1.0" ?>
<Customer>
<BillingAddress1> Main Str. 22 </BillingAddress1>
<BillingAddress2> Secondary Str. 35 </BillingAddress2>
<BillingCity> Madrit </BillingCity>
<BillingZipCode> 28001 </BillingZipCode>
<CountryCode> ES </CountryCode>
<Email> jmith@example.com </Email>
<Id>1</Id>
<FirstName> John </FirstName>
<IsSalesTaxExempt> 0 </IsSalesTaxExempt>
<LastName> Smith </LastName>
<Mobile> 612345678 </Mobile>
<Notes> Notes about customer </Notes>
<Occupation> Developer </Occupation>
<Phone> 915111100 </Phone>
<ProvinceId> 2 </ProvinceId>
<TaxId> 1111111111 </TaxId>
<TaxIdAdditional> 2222222222 </TaxIdAdditional>
</Customer>
{
"billingAddress1":"Main Str. 22",
"billingAddress2":"Secondary Str. 35",
"billingCity":"Madrit",
"billingZipCode":"28001",
"countryCode":"ES",
"email":"jmith@example.com",
"firstName":"John",
"id":1,
"isSalesTaxExempt":0,
"lastName":"Smith",
"mobile":"612345678",
"notes":"Notes about customer",
"occupation":"Developer",
"phone":"915111100",
"provinceId":2,
"taxId":"1111111111",
"taxIdAdditional":"2222222222"
}
Delete the record of a Customer.
Request parameters
| Name | Value |
|---|---|
| id | The id of the requested Customer |
Response
Result is the status code of the request.