Customers

Get all customers

Returns all customers filtered by identifiers, emails, names and other filters. Note this operation uses Pagination and supports Portfolio Access Tokens.

Request

[PlatformAddress]/api/connector/v1/customers/getAll

{
    "ClientToken": "E0D439EE522F44368DC78E1BFB03710C-D24FB11DBE31D4621C4817E028D9E1D",
    "AccessToken": "C66EF7B239D24632943D115EDE9CB810-EA00F8FD8294692C940F6B5A8F9453D",
    "Client": "Sample Client 1.0.0",
    "ChainIds": [
        "1df21f06-0cfc-4960-9c58-a3bf1261663e",
        "5fcd1933-22f2-40b9-84da-7db04cbecec2"
    ],
    "CustomerIds": [
        "35d4b117-4e60-44a3-9580-c582117eff98"
    ],
    "Emails": [
        "john@doe.com"
    ],
    "FirstNames": [
        "John",
        "Jane"
    ],
    "LastNames": [
        "Doe"
    ],
    "LoyaltyCodes": [
        "LL810213"
    ],
    "CreatedUtc": {
        "StartUtc": "2019-12-05T00:00:00Z",
        "EndUtc": "2019-12-10T00:00:00Z"
    },
    "UpdatedUtc": {
        "StartUtc": "2019-12-10T00:00:00Z",
        "EndUtc": "2019-12-17T00:00:00Z"
    },
    "ActivityStates": [
        "Active"
    ],
    "Extent" : {
        "Customers": "true",
        "Documents": "true",
        "Addresses": "false"
    },
    "Limitation":{ "Count": 10 }
}
PropertyTypeContractDescription

ClientToken

string

required

Token identifying the client application.

AccessToken

string

required

Access token of the client application.

Client

string

required

Name and version of the client application.

CustomerIds

array of string

optional, max 1000 items

Unique identifiers of Customers. Required if no other filter is provided.

Emails

array of string

optional, max 1000 items

Emails of the Customers.

FirstNames

array of string

optional, max 1000 items

First names of the Customers.

LastNames

array of string

optional, max 1000 items

Last names of the Customers.

LoyaltyCodes

array of string

optional, max 1000 items

Loyalty codes of the Customers.

CreatedUtc

optional, max length 3 months

Interval in which Customer was created.

UpdatedUtc

optional, max length 3 months

Interval in which Customer was updated.

DeletedUtc

optional, max length 3 months

Interval in which Customer was deleted. ActivityStates value Deleted should be provided with this filter to get expected results.

ActivityStates

array of string Activity state

optional

Whether to return only active, only deleted or both records.

Extent

required

Extent of data to be returned.

Limitation

required

Limitation on the quantity of customers returned.

Customer extent

PropertyTypeContractDescription

Customers

bool

required

Whether the response should contain information about customers.

Documents

bool

required

Whether the response should contain identity documents of customers.

Addresses

bool

required

Whether the response should contain addresses of customers.

Response

{
    "Customers": [
        {
            "Address": {
                "Line1": "Somerford Road Hello House/135",
                "Line2": null,
                "City": "Christchurch",
                "PostalCode": "BH23 3PY",
                "CountryCode": "GB",
                "Latitude": null,
                "Longitude": null
            },
            "BirthDate": null,
            "BirthPlace": null,
            "CategoryId": null,
            "Classifications": [],
            "CreatedUtc": "2016-01-01T00:00:00Z",
            "Email": null,
            "FirstName": "John",
            "Sex": "Male",
            "Id": "35d4b117-4e60-44a3-9580-c582117eff98",
            "ChainId": "1df21f06-0cfc-4960-9c58-a3bf1261663e",
            "IdentityCard": null,
            "LanguageCode": null,
            "LastName": "Smith",
            "LoyaltyCode": null,
            "AccountingCode": null,
            "BillingCode": null,
            "NationalityCode": "US",
            "Notes": "",
            "CarRegistrationNumber": null,
            "Options": [],
            "Number": "1",
            "Phone": "00420123456789",
            "SecondLastName": null,
            "TaxIdentificationNumber": null,
            "Title": null,
            "UpdatedUtc": "2016-01-01T00:00:00Z",
            "CompanyId": "cb7d4a2f-10e0-4163-a176-ad03007efa8a",
            "MergeTargetId": null,
            "ActivityState": "Active"
        }
    ],
    "Documents": [
        {
            "Id": "e8a72a69-c20b-4278-b699-ab0400a32ecc",
            "CustomerId": "35d4b117-4e60-44a3-9580-c582117eff98",
            "Type": "IdentityCard",
            "Number": "123456",
            "Expiration": "2020-01-01",
            "Issuance": "2016-01-01",
            "IssuingCountryCode": "CZ",
            "IssuingCity": "Prague"
        }
    ],
    "Cursor": "35d4b117-4e60-44a3-9580-c582117eff98"
}
PropertyTypeContractDescription

Customers

array of Customer

required

The customers.

Documents

array of Document

required

The identity documents of customers.

Cursor

string

required

Unique identifier of the last and hence oldest customer item returned. This can be used in Limitation in a subsequent request to fetch the next batch of older customers. If Limitation is specified in the request message, then Cursor will always be included in the response message; this is true even when using Extents set to false so that no actual data is returned.

Customer

PropertyTypeContractDescription

Id

string

required

Unique identifier of the customer.

ChainId

string

optional

Unique identifier of the chain.

Number

string

required

Number of the customer.

FirstName

string

optional

First name of the customer.

LastName

string

required

Last name of the customer.

SecondLastName

string

optional

Second last name of the customer.

Title

string Title

optional

Title prefix of the customer.

Sex

string Sex

optional

Sex of the customer.

NationalityCode

string

optional

ISO 3166-1 code of the Country.

LanguageCode

string

optional

Language and culture code of the customers preferred language. E.g. en-US or fr-FR.

BirthDate

string

optional

Date of birth in ISO 8601 format.

BirthPlace

string

optional

Place of birth.

Email

string

optional

Email address of the customer.

Phone

string

optional

Phone number of the customer (possibly mobile).

TaxIdentificationNumber

string

optional

Tax identification number of the customer.

LoyaltyCode

string

optional

Loyalty code of the customer.

AccountingCode

string

optional

Accounting code of the customer.

BillingCode

string

optional

Billing code of the customer.

Notes

string

optional

Internal notes about the customer.

CarRegistrationNumber

string

optional

Registration number of the customer's car.

Classifications

required

Classifications of the customer.

Options

required

Options of the customer.

Address

optional

Address of the customer.

CreatedUtc

string

required

Creation date and time of the customer in UTC timezone in ISO 8601 format.

UpdatedUtc

string

required

Last update date and time of the customer in UTC timezone in ISO 8601 format.

ItalianDestinationCode

string

optional

Value of Italian destination code.

ItalianFiscalCode

string

optional

Value of Italian fiscal code.

CompanyId

string

optional

Unique identifier of Company the customer is associated with.

MergeTargetId

string

optional

Unique identifier of the account (Customer) to which this customer is linked.

ActivityState

string

required

Activity State of customer record, i.e. whether active or deleted.

Title

  • Mister

  • Miss

  • Misses

Sex

  • Male

  • Female

Document

PropertyTypeContractDescription

Id

string

required

Unique identifier of the document.

CustomerId

string

required

Identifier of the Customer.

Type

required

Type of the document.

Number

string

optional

Number of the document (e.g. passport number).

Expiration

string

optional

Expiration date in ISO 8601 format.

Issuance

string

optional

Date of issuance in ISO 8601 format.

IssuingCountryCode

string

optional

ISO 3166-1 code of the Country.

IssuingCity

string

optional

City from which document issued

Document type

  • Passport

  • IdentityCard

  • Visa

  • DriversLicense

Customer classification

  • PaymasterAccount

  • Blacklist

  • Media

  • LoyaltyProgram

  • PreviousComplaint

  • Returning

  • Staff

  • FriendOrFamily

  • TopManagement

  • Important

  • VeryImportant

  • Problematic

  • Cashlist

  • DisabledPerson

  • Military

  • InRoom

  • WaitingForRoom

  • Student

  • ...

Customer option

  • SendMarketingEmails

  • Invoiceable

  • BillAddressObjection

  • SendMarketingPostalMail

  • SendPartnerMarketingEmails

  • SendPartnerMarketingPostalMail

  • ...

Activity State

  • Active

  • Deleted

Search customers

Searches for customers that are active at the moment in the enterprise (e.g. companions of checked-in reservations or paymasters).

Request

[PlatformAddress]/api/connector/v1/customers/search

{
    "ClientToken": "E0D439EE522F44368DC78E1BFB03710C-D24FB11DBE31D4621C4817E028D9E1D",
    "AccessToken": "C66EF7B239D24632943D115EDE9CB810-EA00F8FD8294692C940F6B5A8F9453D",
    "Client": "Sample Client 1.0.0",
    "Name": "Smith",
    "ResourceId": null,
    "Extent": {
        "Customers": true,
        "Documents": false,
        "Addresses": false
    }
}
PropertyTypeContractDescription

ClientToken

string

required

Token identifying the client application.

AccessToken

string

required

Access token of the client application.

Client

string

required

Name and version of the client application.

Name

string

optional

Name to search by (applies to first name, last name and full name).

ResourceId

string

optional

Identifier of Resource to search by (members of reservation assigned there will be returned).

Extent

required

Extent of data to be returned.

Response

{
    "Customers": [
        {
            "Customer": {
                "Address": null,
                "BirthDate": null,
                "BirthPlace": null,
                "CategoryId": null,
                "Classifications": [],
                "CreatedUtc": "2016-01-01T00:00:00Z",
                "Email": null,
                "FirstName": "John",
                "Sex": "Male",
                "Id": "35d4b117-4e60-44a3-9580-c582117eff98",
                "IdentityCard": null,
                "LanguageCode": null,
                "LastName": "Smith",
                "LoyaltyCode": null,
                "NationalityCode": "US",
                "Notes": "",
                "Number": "1",
                "Options": [],
                "Passport": null,
                "Phone": "00420123456789",
                "SecondLastName": null,
                "TaxIdentificationNumber": null,
                "Title": null,
                "UpdatedUtc": "2016-01-01T00:00:00Z",
                "Visa": null
            },
            "Reservation": null
        }
    ]
}
PropertyTypeContractDescription

Customers

required

The customer search results.

Customer search result

PropertyTypeContractDescription

Customer

required

The found customer.

Reservation

optional

Reservation of the customer in case they are currently staying in the property.

Get customers open items

Returns all open items of the specified customers, i.e. all unpaid items and all deposited payments. Sum of the open items is the balance of the customer. If the Currency is specified, costs of the items are converted to that currency.

Request

[PlatformAddress]/api/connector/v1/customers/getOpenItems

{
    "ClientToken": "E0D439EE522F44368DC78E1BFB03710C-D24FB11DBE31D4621C4817E028D9E1D",
    "AccessToken": "C66EF7B239D24632943D115EDE9CB810-EA00F8FD8294692C940F6B5A8F9453D",
    "Client": "Sample Client 1.0.0",
    "CustomerIds": [
        "2a1a4315-7e6f-4131-af21-402cec59b8b9"
    ]
}
PropertyTypeContractDescription

ClientToken

string

required

Token identifying the client application.

AccessToken

string

required

Access token of the client application.

Client

string

required

Name and version of the client application.

CustomerIds

array of string

required, max 1000 items

Unique identifiers of the Customers.

Currency

string

optional

ISO-4217 code of the Currency the item costs should be converted to.

Response

{
    "Customers": [
        {
            "CustomerId": "2a1a4315-7e6f-4131-af21-402cec59b8b9",
            "OrderItems": [
                {
                    "Id": "35820535-b988-4d6f-80cf-ecb19cdc3e58",
                    "AccountId": "2a1a4315-7e6f-4131-af21-402cec59b8b9",
                    "OrderId": "6645113e-72cc-4f99-ab77-e4452911bf20",
                    "BillId": null,
                    "AccountingCategoryId": "d250149e-a29d-4c70-b607-a1759faf7320",
                    "Amount": {
                        "Currency": "GBP",
                        "NetValue": -5.00,
                        "GrossValue": -5.00,
                        "TaxValues": [
                            {
                                "Code": "UK-Z",
                                "Value": 0.0
                            }
                        ],
                        "Breakdown": {
                            "Items": [
                                {
                                    "TaxRateCode": "UK-Z",
                                    "NetValue": -5.00,
                                    "TaxValue": 0.0
                                }
                            ]
                        }
                    },
                    "RevenueType": "Additional",
                    "ConsumedUtc": "2017-04-04T15:13:39Z",
                    "ClosedUtc": null,
                    "AccountingState": "Open",
                    "Data": {
                        "Discriminator": "Rebate",
                        "Value": {
                            "RebatedItemId": null
                        }
                    }
                }
            ],
            "PaymentItems": []
        }
    ]
}
PropertyTypeContractDescription

Customers

required

The customers with their items.

Customer items

PropertyTypeContractDescription

CustomerId

string

required

Unique identifier of the Customer.

OrderItems

array of Order item

required

The open order items (consumed items such as nights or products).

PaymentItems

array of Payment item

required

The open payment items (such as cash, credit card payments or invoices).

Add customer

Adds a new customer to the system and returns details of the added customer. If a customer with the specified email already exists, and OverwriteExisting is set to true, then the existing customer profile information is overwritten and the existing customer data returned. If OverwriteExisting is set to false, an error response is returned. Note this operation supports Portfolio Access Tokens.

Request

[PlatformAddress]/api/connector/v1/customers/add

{
    "ClientToken": "E0D439EE522F44368DC78E1BFB03710C-D24FB11DBE31D4621C4817E028D9E1D",
    "AccessToken": "C66EF7B239D24632943D115EDE9CB810-EA00F8FD8294692C940F6B5A8F9453D",
    "ChainId": "1df21f06-0cfc-4960-9c58-a3bf1261663e",
    "Client": "Sample Client 1.0.0",
    "OverwriteExisting": false,
    "FirstName": "John",
    "LastName": "Doe",
    "SecondLastName": "the Second",
    "Title": "Mister",
    "Sex": "Male",
    "NationalityCode": "US",
    "BirthDate": "2000-01-01",
    "BirthPlace": "Prague, Czech Republic",
    "Email": "john@doe.com",
    "Phone": "00420123456789",
    "LoyaltyCode": null,
    "Notes": null,
    "IdentityCard": {
        "Number": "123456",
        "Expiration": "2020-01-01",
        "Issuance": "2016-01-01",
        "IssuingCountryCode": "US",
        "IssuingCity": "Seattle"
    },
    "Passport": null,
    "Visa": null,
    "DriversLicense": null,
    "Address": {
        "Line1": "Astronautů 2",
        "Line2": "",
        "City": "Havířov",
        "PostalCode": "736 01",
        "CountryCode": "CZ",
        "CountrySubdivisionCode": null
    },
    "ItalianDestinationCode": "1234567"
}
PropertyTypeContractDescription

ClientToken

string

required

Token identifying the client application.

AccessToken

string

required

Access token of the client application.

Client

string

required

Name and version of the client application.

ChainId

string

optional

Unique identifier of the chain. Required when using Portfolio Access Tokens, ignored otherwise.

OverwriteExisting

bool

required

Whether an existing customer should be overwritten in case of duplicity. This applies only to basic personal information (Title, FirstName, LastName, ...).

FirstName

string

optional

First name of the customer.

LastName

string

required

Last name of the customer.

SecondLastName

string

optional

Second last name of the customer.

Title

string Title

optional

Title prefix of the customer.

Sex

string Sex

optional

Sex of the customer.

NationalityCode

string

optional

ISO 3166-1 code of the Country.

BirthDate

string

optional

Date of birth in ISO 8601 format.

BirthPlace

string

optional

Place of birth.

Email

string

optional

Email address of the customer.

Phone

string

optional

Phone number of the customer (possibly mobile).

LoyaltyCode

string

optional

Loyalty code of the customer.

Notes

string

optional

Internal notes about the customer.

CarRegistrationNumber

string

optional

Registration number of the customer's car.

TaxIdentificationNumber

string

optional

Tax identification number of the customer.

IdentityCard

optional

Identity card details of the customer.

Passport

optional

Passport details of the customer.

Visa

optional

Visa details of the customer.

DriversLicense

optional

Drivers license details of the customer.

Address

optional

Address of the customer.

Classifications

optional

Classifications of the customer.

Options

optional

Options of the customer.

ItalianDestinationCode

string

optional

Value of Italian destination code.

ItalianFiscalCode

string

optional

Value of Italian fiscal code.

Address parameters

PropertyTypeContractDescription

Line1

string

optional

First line of the address.

Line2

string

optional

Second line of the address.

City

string

optional

The city.

PostalCode

string

optional

Postal code.

CountryCode

string

optional

ISO 3166-1 code of the [Countryconfiguration.md#country).

CountrySubdivisionCode

string

optional

ISO 3166-2 code of the administrative division, e.g. DE-BW.

Response

The created Customer or an existing Customer with the specified email.

Update customer

Updates personal information of a customer. Note that if any of the fields is left blank, it won't clear the field in Mews. The field will be left intact. In case of email update, the email will change in Mews only if there is no other customer profile in the hotel with such email. Otherwise an error response is returned. Note this operation supports Portfolio Access Tokens.

Request

[PlatformAddress]/api/connector/v1/customers/update

{
    "ClientToken": "E0D439EE522F44368DC78E1BFB03710C-D24FB11DBE31D4621C4817E028D9E1D",
    "AccessToken": "C66EF7B239D24632943D115EDE9CB810-EA00F8FD8294692C940F6B5A8F9453D",
    "ChainId": "1df21f06-0cfc-4960-9c58-a3bf1261663e",
    "Client": "Sample Client 1.0.0",
    "CustomerId": "35d4b117-4e60-44a3-9580-c582117eff98",
    "FirstName": "John",
    "LastName": "Smith",
    "SecondLastName": "the Second",
    "Title": "Mister",
    "Sex": "Male",
    "NationalityCode": "US",
    "BirthDate": "2000-01-01",
    "BirthPlace": "Prague, Czech Republic",
    "Email": "john.smith@gmail.com",
    "Phone": "00420123456789",
    "LoyaltyCode": null,
    "Notes": null,
    "IdentityCard": {
        "Number": "123456",
        "Expiration": "2020-01-01",
        "Issuance": "2016-01-01",
        "IssuingCountryCode": "US",
        "IssuingCity": "Seattle"
    },
    "Passport": null,
    "Visa": null,
    "DriversLicense": null,
    "ItalianDestinationCode": {
        "Value": "7654321"
    }
}
PropertyTypeContractDescription

ClientToken

string

required

Token identifying the client application.

AccessToken

string

required

Access token of the client application.

Client

string

required

Name and version of the client application.

ChainId

string

optional

Unique identifier of the chain. Required when using Portfolio Access Tokens, ignored otherwise.

CustomerId

string

required

Unique identifier of the Customer.

FirstName

string

optional

New first name.

LastName

string

optional

New last name.

SecondLastName

string

optional

New second last name.

Title

string Title

optional

New title.

Sex

string Sex

optional

Sex of the customer.

BirthDate

string

optional

New birth date in ISO 8601 format.

BithPlace

string

optional

New birth place.

NationalityCode

string

optional

ISO 3166-1 code of the Country.

Email

string

optional

New email address.

Phone

string

optional

New phone number.

LoyaltyCode

string

optional

Loyalty code of the customer.

Notes

string

optional

Internal notes about the customer. Old value will be overwritten.

CarRegistrationNumber

string

optional

New registration number of the customer's car.

TaxIdentificationNumber

string

optional

New tax identification number of the customer.

IdentityCard

optional

New identity card details.

Passport

optional

New passport details.

Visa

optional

New visa details.

DriversLicense

optional

New drivers license details.

Address

optional

New address details.

Classifications

optional

New classifications of the customer.

Options

optional

Options of the customer.

ItalianDestinationCode

optional

New Italian destination code of customer.

ItalianFiscalCode

optional

New Italian fiscal code of customer.

Response

The updated Customer.

Merge customers

Deprecated!

This operation is deprecated, please use Merge accounts instead.

Merges one customer to another. All entities attached to the source customer (e.g. orders, bills) are attached to the target customer. Profile information of the target customer are extended but not overwritten with profile information of the source customer.

Request

[PlatformAddress]/api/connector/v1/customers/merge

{
    "ClientToken": "E0D439EE522F44368DC78E1BFB03710C-D24FB11DBE31D4621C4817E028D9E1D",
    "AccessToken": "C66EF7B239D24632943D115EDE9CB810-EA00F8FD8294692C940F6B5A8F9453D",
    "Client": "Sample Client 1.0.0",
    "SourceCustomerId": "e11801ff-4148-4010-87f3-0d111e2893e3",
    "TargetCustomerId": "35d4b117-4e60-44a3-9580-c582117eff98"
}
PropertyTypeContractDescription

ClientToken

string

required

Token identifying the client application.

AccessToken

string

required

Access token of the client application.

Client

string

required

Name and version of the client application.

SourceCustomerId

string

required

Unique identifier of the source Customer.

TargetCustomerId

string

required

Unique identifier of the target Customer.

Response

{}

Add customer file

Attaches the specified file to the customer profile. Note this operation supports Portfolio Access Tokens.

Request

[PlatformAddress]/api/connector/v1/customers/addFile

{
    "ClientToken": "E0D439EE522F44368DC78E1BFB03710C-D24FB11DBE31D4621C4817E028D9E1D",
    "AccessToken": "C66EF7B239D24632943D115EDE9CB810-EA00F8FD8294692C940F6B5A8F9453D",
    "Client": "Sample Client 1.0.0",
    "CustomerId": "49aaff6b-32d8-48f5-8234-ce875aefc508",
    "ChainId": "1df21f06-0cfc-4960-9c58-a3bf1261663e",
    "Name": "test.pdf",
    "Type": "application/pdf",
    "Data": "JVBERi0xLjcKCjEgMCBvYmogICUgZW50cnkgcG9pbnQKPDwKICAvVHlwZSAvQ2F0YWxvZwogIC9QYWdlcyAyIDAgUgo+PgplbmRvYmoKCjIgMCBvYmoKPDwKICAvVHlwZSAvUGFnZXMKICAvTWVkaWFCb3ggWyAwIDAgMjAwIDIwMCBdCiAgL0NvdW50IDEKICAvS2lkcyBbIDMgMCBSIF0KPj4KZW5kb2JqCgozIDAgb2JqCjw8CiAgL1R5cGUgL1BhZ2UKICAvUGFyZW50IDIgMCBSCiAgL1Jlc291cmNlcyA8PAogICAgL0ZvbnQgPDwKICAgICAgL0YxIDQgMCBSIAogICAgPj4KICA+PgogIC9Db250ZW50cyA1IDAgUgo+PgplbmRvYmoKCjQgMCBvYmoKPDwKICAvVHlwZSAvRm9udAogIC9TdWJ0eXBlIC9UeXBlMQogIC9CYXNlRm9udCAvVGltZXMtUm9tYW4KPj4KZW5kb2JqCgo1IDAgb2JqICAlIHBhZ2UgY29udGVudAo8PAogIC9MZW5ndGggNDQKPj4Kc3RyZWFtCkJUCjcwIDUwIFRECi9GMSAxMiBUZgooSGVsbG8sIHdvcmxkISkgVGoKRVQKZW5kc3RyZWFtCmVuZG9iagoKeHJlZgowIDYKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDAwMDEwIDAwMDAwIG4gCjAwMDAwMDAwNzkgMDAwMDAgbiAKMDAwMDAwMDE3MyAwMDAwMCBuIAowMDAwMDAwMzAxIDAwMDAwIG4gCjAwMDAwMDAzODAgMDAwMDAgbiAKdHJhaWxlcgo8PAogIC9TaXplIDYKICAvUm9vdCAxIDAgUgo+PgpzdGFydHhyZWYKNDkyCiUlRU9G"
}
PropertyTypeContractDescription

ClientToken

string

required

Token identifying the client application.

AccessToken

string

required

Access token of the client application.

Client

string

required

Name and version of the client application.

CustomerId

string

required

Unique identifier of the Customer.

ChainId

string

optional

Unique identifier of the chain. Required when using Portfolio Access Tokens, ignored otherwise.

Name

string

required

Name of the file.

Type

string

required

MIME type of the file (e.g. application/pdf).

Data

string

required

Base64-encoded data of the file.

Response

{}

Last updated