Clients

  1. List clients
  2. Get a single client
  3. Create a new client
  4. Update a client

Parameters

Group Name Type Read/Write Description
  id Integer Read Client’s id.
  company String Read Client’s company name.
  fullname String Read Client’s fullname.
  firstname String Read Client’s first name.
  lastname String Read Client’s last name.
  notes Text Read Client’s notes.
  passport String Read Client’s passport id.
  preferred_locale String Read Client’s contact language preference.
  vat_number String Read Client’s company vat number.
  created_at Time Read Client’s create time.
  updated_at Time Read Client’s update time.
addresses   Array Read Array of client’s addresses.
  address1 String Read Client’s first address.
  address2 String Read Client’s second address.
  city String Read Client’s city.
  country_code String Read Client’s country code, list of codes is available at wikipedia.
  label String Read Address label.
  state String Read Client’s state.
  zip String Read Client’s zip.
emails   Array Read Array of client’s emails.
  email String Read Client’s email.
  label String Read Email label.
phones   Array Read Array of client’s phone numbers.
  label String Read Phone label.
  number String Read Client’s number.
Group Name Type Read/Write Description
  id Integer Read Client’s id.
  company String Read/Write Client’s company name.
  fullname String Read/Write Required. Client’s fullname. (150 characters max)
  firstname String Read/Write Client’s first name. (150 characters max)
  lastname String Read/Write Client’s last name. (150 characters max)
  notes Text Read/Write Client’s notes. (5000 characters max)
  passport String Read/Write Client’s passport id. (50 characters max)
  preferred_locale String Read/Write Client’s contact language preference.
  vat_number String Read/Write Client’s company vat number.
  created_at Time Read Client’s create time.
  updated_at Time Read Client’s update time.
addresses   Array Read/Write Array of client’s addresses.
  address1 String Read/Write Client’s first address.
  address2 String Read/Write Client’s second address.
  city String Read/Write Client’s city.
  country_code String Read/Write Client’s country code, list of codes is available at wikipedia.
  label String Read/Write Address label.
  state String Read/Write Client’s state.
  zip String Read/Write Client’s zip.
emails   Array Read/Write Array of client’s emails.
  email String Read/Write Client’s email.
  label String Read/Write Email label.
phones   Array Read/Write Array of client’s phone numbers.
  label String Read/Write Phone label.
  number String Read/Write Client’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

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

Get a single client

Returns a single client identified by ID.

GET /clients/:client_id

Response

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

Create a new client

Returns a newly created client.

POST /clients

Example JSON request

{
  "clients": [
    {
      "addresses": [
        {
          "address1": "Kutch Stravenue",
          "address2": "Building 1",
          "city": "North Jacey",
          "country_code": "US",
          "label": "default",
          "state": "Illinois",
          "zip": "01363-9579"
        }
      ],
      "company": "Great Company",
      "emails": [
        {
          "email": "clementina_kling@example.com",
          "label": "default"
        }
      ],
      "firstname": "Clementina",
      "fullname": "Clementina Kling",
      "lastname": "Kling",
      "notes": "",
      "passport": "AHJ4678956",
      "phones": [
        {
          "label": "phone",
          "number": "(153)070-6105"
        },
        {
          "label": "mobile",
          "number": "(153)070-6106"
        },
        {
          "label": "fax",
          "number": "(153)070-6107"
        }
      ],
      "preferred_locale": "en",
      "vat_number": "ES65465465",
      "created_at": "2014-12-28T15:19:27Z",
      "updated_at": "2015-02-02T11:07:45Z"
    }
  ]
}

Response

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

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

Example JSON request

{
  "clients": [
    {
      "addresses": [
        {
          "address1": "Kutch Stravenue",
          "address2": "Building 1",
          "city": "North Jacey",
          "country_code": "US",
          "label": "default",
          "state": "Illinois",
          "zip": "01363-9579"
        }
      ],
      "company": "Great Company",
      "emails": [
        {
          "email": "clementina_kling@example.com",
          "label": "default"
        }
      ],
      "firstname": "Clementina",
      "fullname": "Clementina Kling",
      "lastname": "Kling",
      "notes": "",
      "passport": "AHJ4678956",
      "phones": [
        {
          "label": "phone",
          "number": "(153)070-6105"
        },
        {
          "label": "mobile",
          "number": "(153)070-6106"
        },
        {
          "label": "fax",
          "number": "(153)070-6107"
        }
      ],
      "preferred_locale": "en",
      "vat_number": "ES65465465",
      "created_at": "2014-12-28T15:19:27Z",
      "updated_at": "2015-02-02T11:07:45Z"
    }
  ]
}

Response

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