Skip to main content

Clients

Overview

This resource represents the Clients which effectively are the actual travelers (guests) that are related to Bookings.

Parameters

GroupNameTypeRead/WriteDescription
accountIntegerReadAccount's ID related to the Client
idIntegerReadClient's id.
companyStringReadClient's company name.
fullnameStringReadClient's fullname.
firstnameStringReadClient's first name.
lastnameStringReadClient's last name.
notesTextReadClient's notes.
passportStringReadClient's passport id.
preferred_localeStringReadClient's contact language preference.
vat_numberStringReadClient's company vat number.
created_atTimeReadClient's create time.
updated_atTimeReadClient's update time.
forget_me_atTimeReadRefer to GDPR guide.
processing_restricted_atTimeReadRefer to GDPR guide
addressesArrayReadArray of client's addresses.
address1StringReadClient's first address.
address2StringReadClient's second address.
cityStringReadClient's city.
country_codeStringReadClient's country code, list of codes is available at wikipedia.
labelStringReadAddress label.
stateStringReadClient's state.
zipStringReadClient's zip.
emailsArrayReadArray of client's emails.
emailStringReadClient's email.
labelStringReadEmail label.
phonesArrayReadArray of client's phone numbers.
labelStringReadPhone label.
numberStringReadClient's number.
Grouped attributes

First set of attributes in array group will always be used as default address, email or phone.

List clients

List all clients for a given account.

GET /clients
response.json
{
"links": {
"clients.account": "https://www.bookingsync.com/api/v3/accounts/{clients.account}"
},
"clients": [
{
"links": {
"account": 1
},
"id": 1,
"addresses": [
{
"id": 1,
"client_id": 1,
"label": "default",
"address1": "Kutch Stravenue",
"address2": "Building 1",
"city": "North Jacey",
"state": "Illinois",
"zip": "01363-9579",
"country_code": "US",
"created_at": "2018-12-04T12:33:36Z",
"updated_at": "2018-12-04T12:33:36Z",
"canceled_at": null,
"primary": true
}
],
"emails": [
{
"id": 1,
"client_id": 1,
"label": "default",
"email": "clementina_kling@example.com",
"created_at": "2018-12-04T12:33:36Z",
"updated_at": "2018-12-04T12:33:36Z",
"canceled_at": null,
"primary": true,
"locked": null
}
],
"phones": [
{
"id": 1,
"client_id": 1,
"label": "phone",
"number": "(153)070-6105",
"country_code": "VG",
"created_at": "2018-12-04T12:33:36Z",
"updated_at": "2018-12-04T12:33:36Z",
"canceled_at": null,
"primary": true,
"locked": null
},
{
"id": 2,
"client_id": 1,
"label": "mobile",
"number": "(153)070-6106",
"country_code": "VG",
"created_at": "2018-12-04T12:33:36Z",
"updated_at": "2018-12-04T12:33:36Z",
"canceled_at": null,
"primary": true,
"locked": null
},
{
"id": 3,
"client_id": 1,
"label": "fax",
"number": "(153)070-6107",
"country_code": "VG",
"created_at": "2018-12-04T12:33:36Z",
"updated_at": "2018-12-04T12:33:36Z",
"canceled_at": null,
"primary": true,
"locked": null
}
],
"created_at": "2014-12-28T15:19:27Z",
"updated_at": "2015-02-02T11:07:45Z",
"fullname": "Clementina Kling",
"firstname": "Clementina",
"lastname": "Kling",
"notes": "",
"passport": "AHJ4678956",
"preferred_locale": "en",
"company": "Great Company",
"vat_number": "ES65465465"
}
],
"meta": {}
}

Get a single client

Returns a single client identified by ID.

GET /clients/:client_id
response.json
{
"links": {
"clients.account": "https://www.bookingsync.com/api/v3/accounts/{clients.account}"
},
"clients": [
{
"links": {
"account": 1
},
"id": 1,
"addresses": [
{
"id": 1,
"client_id": 1,
"label": "default",
"address1": "Kutch Stravenue",
"address2": "Building 1",
"city": "North Jacey",
"state": "Illinois",
"zip": "01363-9579",
"country_code": "US",
"created_at": "2018-12-04T12:33:36Z",
"updated_at": "2018-12-04T12:33:36Z",
"canceled_at": null,
"primary": true
}
],
"emails": [
{
"id": 1,
"client_id": 1,
"label": "default",
"email": "clementina_kling@example.com",
"created_at": "2018-12-04T12:33:36Z",
"updated_at": "2018-12-04T12:33:36Z",
"canceled_at": null,
"primary": true,
"locked": null
}
],
"phones": [
{
"id": 1,
"client_id": 1,
"label": "phone",
"number": "(153)070-6105",
"country_code": "VG",
"created_at": "2018-12-04T12:33:36Z",
"updated_at": "2018-12-04T12:33:36Z",
"canceled_at": null,
"primary": true,
"locked": null
},
{
"id": 2,
"client_id": 1,
"label": "mobile",
"number": "(153)070-6106",
"country_code": "VG",
"created_at": "2018-12-04T12:33:36Z",
"updated_at": "2018-12-04T12:33:36Z",
"canceled_at": null,
"primary": true,
"locked": null
},
{
"id": 3,
"client_id": 1,
"label": "fax",
"number": "(153)070-6107",
"country_code": "VG",
"created_at": "2018-12-04T12:33:36Z",
"updated_at": "2018-12-04T12:33:36Z",
"canceled_at": null,
"primary": true,
"locked": null
}
],
"created_at": "2014-12-28T15:19:27Z",
"updated_at": "2015-02-02T11:07:45Z",
"fullname": "Clementina Kling",
"firstname": "Clementina",
"lastname": "Kling",
"notes": "",
"passport": "AHJ4678956",
"preferred_locale": "en",
"company": "Great Company",
"vat_number": "ES65465465"
}
],
"meta": {}
}

Create a new client

Returns a newly created client.

POST /clients

Update a client

Grouped attributes

Please note that updating grouped attributes requires the full array to be re-sent, to avoid data loss. In below example all phones elements are present.

Returns an updated client identified by ID.

PUT /clients/:client_id