# Members

Operations related to working with customers who are members of provider's loyalty program.

## Search members

> Search members based on customer information provided by Mews PMS.\
> \
> Mews PMS will use this operation to display existing members based on customer-provided data. All available customer data is sent.

```json
{"openapi":"3.1.1","info":{"title":"Mews Loyalty Reverse API","version":"2025.08.11"},"tags":[{"name":"Members","description":"Operations related to working with customers who are members of provider's loyalty program."}],"servers":[{"url":"[provider]","description":"Provider server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Bearer token provided by loyalty program provider."}},"parameters":{"acceptLanguage":{"name":"Accept-Language","in":"header","description":"Language preference for error messages and descriptions.\nIf not provided, English will be used as the default language.\n","schema":{"type":"string"}}},"schemas":{"searchMembersRequest":{"type":"object","description":"Request payload for searching loyalty program members based on customer information from Mews PMS.","additionalProperties":false,"required":["mewsEnterpriseId","memberFilter"],"properties":{"mewsEnterpriseId":{"$ref":"#/components/schemas/mewsEnterpriseId"},"providerEnterpriseId":{"$ref":"#/components/schemas/providerEnterpriseId"},"memberFilter":{"$ref":"#/components/schemas/memberFilter"}}},"mewsEnterpriseId":{"title":"Mews Enterprise Identifier","type":"string","format":"uuid","description":"The identifier of the Mews enterprise on whose behalf the request has been made."},"providerEnterpriseId":{"title":"Provider Enterprise Identifier","type":"string","description":"An optional identifier of the enterprise from the loyalty provider on whose behalf the request has been made."},"memberFilter":{"type":"object","description":"Filter criteria for searching loyalty members. At least one valid filter combination must be provided.","additionalProperties":false,"properties":{"providerMembershipId":{"type":"string","description":"Unique identifier for the membership in the provider's system."},"membershipNumber":{"type":"string","description":"Membership number assigned by the loyalty program."},"email":{"type":"string","format":"email","maxLength":255,"description":"Customer's email address for searching."},"firstName":{"type":"string","maxLength":255,"description":"Customer's first name for searching."},"lastName":{"type":"string","maxLength":255,"description":"Customer's last name for searching."},"phoneNumber":{"type":"string","description":"Customer's phone number for searching."},"city":{"type":"string","maxLength":255,"description":"Customer's city."},"postalCode":{"type":"string","maxLength":255,"description":"Customer's postal code."},"countryCode":{"type":"string","description":"ISO 3166-1 code of the country."}},"anyOf":[{"title":"Email filter","required":["email"]},{"title":"Membership number filter","required":["membershipNumber"]},{"title":"Provider membership ID filter","required":["providerMembershipId"]},{"title":"Name filter","required":["firstName","lastName"]},{"title":"Location filter","required":["lastName","city","countryCode"]}]},"searchMembersResponse":{"type":"object","description":"Response payload containing search results with matching loyalty program members.","additionalProperties":false,"required":["isPartialResult","data"],"properties":{"isPartialResult":{"type":"boolean","description":"If the number of matching results exceeds the allowed maximum number of result items (10), set `isPartialResult` to `true` to indicate an incomplete result set."},"data":{"type":"array","maxItems":10,"description":"Array of matching members.","items":{"$ref":"#/components/schemas/member"}}}},"member":{"type":"object","title":"Loyalty program member","description":"Represents a customer who is part of a loyalty program. This object combines personal details with loyalty membership information.","required":["firstName","lastName","membership"],"properties":{"firstName":{"type":"string","minLength":1,"maxLength":255},"lastName":{"type":"string","minLength":1,"maxLength":255},"email":{"type":"string","format":"email","maxLength":255},"birthday":{"type":"string","format":"date","description":"User's date of birth in ISO 8601 format (YYYY-MM-DD)"},"phoneNumber":{"type":"string"},"address":{"$ref":"#/components/schemas/address"},"membership":{"$ref":"#/components/schemas/searchMembership"}}},"address":{"type":"object","description":"Physical address information including street address, city, postal code, and country details.","additionalProperties":false,"properties":{"line1":{"type":"string","maxLength":1023},"line2":{"type":"string","maxLength":255},"city":{"type":"string","maxLength":255},"postalCode":{"type":"string"},"countryCode":{"type":"string"},"countrySubdivisionCode":{"type":"string"}},"title":"Customer address"},"searchMembership":{"description":"Membership information returned in search results, extending the base membership with search-specific details.","allOf":[{"$ref":"#/components/schemas/membership"},{"type":"object","required":["status"],"properties":{"status":{"type":"string","minLength":1,"enum":["pending","enrolled","canceled","declined"]}}}]},"membership":{"type":"object","description":"Contains membership information including provider membership ID, membership number, tier, points, and current status.","additionalProperties":false,"required":["providerMembershipId","membershipNumber","status"],"properties":{"providerMembershipId":{"$ref":"#/components/schemas/providerMembershipId"},"membershipNumber":{"$ref":"#/components/schemas/membershipNumber"},"tier":{"type":"string","maxLength":50},"points":{"type":"integer"},"status":{"type":"string","minLength":1,"enum":["pending","enrolled","canceled","declined","notFound"]},"expiresAt":{"type":"string","format":"date-time"},"deeplinkUrl":{"type":"string","format":"uri"}}},"providerMembershipId":{"type":"string","title":"Provider membership Identifier","description":"Unique internal identifier of membership from the loyalty provider. Can be the same as `membershipNumber` if no other value is needed.","maxLength":50},"membershipNumber":{"type":"string","title":"Membership number","description":"Member code or number, typically on loyalty card."},"problemDetail":{"type":"object","additionalProperties":true,"description":"A standardized format for problem details following [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457).","title":"Problem details","required":["type","status","title","detail"],"properties":{"type":{"type":"string","minLength":1,"description":"A URI reference that identifies the problem type. Can be any URI or one of the predefined error types.","anyOf":[{"title":"Predefined Problem Types","type":"string","enum":["https://purl.mews.com/problem/core/not-found","https://purl.mews.com/problem/core/bad-request","https://purl.mews.com/problem/core/unprocessable-content","https://purl.mews.com/problem/core/unauthorized","https://purl.mews.com/problem/core/request-timeout","https://purl.mews.com/problem/core/too-many-requests","https://purl.mews.com/problem/core/internal-server-error","https://purl.mews.com/problem/loyalty/invalid-member-search-criteria"]},{"title":"Custom Problem Type URI","type":"string","format":"uri"}]},"title":{"type":"string","minLength":1,"maxLength":255,"description":"A short, human-readable summary of the problem type."},"status":{"type":"integer","description":"The HTTP status code generated by the origin server for this occurrence of the problem.","minimum":100,"maximum":599},"detail":{"type":"string","minLength":1,"description":"A human-readable explanation specific to this occurrence of the problem."},"instance":{"type":"string","format":"uri","description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced."},"errors":{"type":"array","description":"An array of field-level error details, typically used to describe validation failures or missing/invalid input fields.","items":{"type":"object","additionalProperties":false,"required":["type","pointer"],"properties":{"type":{"type":"string","minLength":1,"description":"A URI reference that identifies the field-level error type. Can be any URI or one of the predefined error types.","anyOf":[{"title":"Custom Field Error Type URI","type":"string","format":"uri"},{"title":"Predefined Field Error Types","type":"string","enum":["https://purl.mews.com/problem/core/field-required","https://purl.mews.com/problem/core/field-invalid-format","https://purl.mews.com/problem/core/field-too-short","https://purl.mews.com/problem/core/field-too-long","https://purl.mews.com/problem/core/field-out-of-range","https://purl.mews.com/problem/core/field-invalid-type","https://purl.mews.com/problem/core/field-not-allowed-value","https://purl.mews.com/problem/core/field-duplicate","https://purl.mews.com/problem/core/field-email-invalid"]}]},"pointer":{"type":"string","description":"JSON Pointer to the field that has an error. See [RFC 6901](https://datatracker.ietf.org/doc/html/rfc6901) for the JSON Pointer specification.","minLength":1,"maxLength":255},"detail":{"type":"string","description":"A human-readable message describing the error.","maxLength":500}}}}}}},"responses":{"unauthorized":{"description":"Unauthorized","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/problemDetail"}}}},"requestTimeout":{"description":"Request Timeout","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/problemDetail"}}}},"internalServerError":{"description":"Internal Server Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/problemDetail"}}}}}},"paths":{"/members/search":{"post":{"tags":["Members"],"summary":"Search members","description":"Search members based on customer information provided by Mews PMS.\n\nMews PMS will use this operation to display existing members based on customer-provided data. All available customer data is sent.","operationId":"searchMembers","parameters":[{"$ref":"#/components/parameters/acceptLanguage"}],"requestBody":{"description":"Find members using customer details.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/searchMembersRequest"}}}},"responses":{"200":{"description":"Search result with list of matching members.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/searchMembersResponse"}}}},"400":{"description":"Bad Request - Returned when the request is invalid, such as missing required fields or containing data in an incorrect format (e.g., an improperly formatted email).","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/problemDetail"}}}},"401":{"$ref":"#/components/responses/unauthorized"},"408":{"$ref":"#/components/responses/requestTimeout"},"422":{"description":"Unprocessable Content - Used when the request is syntactically valid but fails due to business logic constraints, such as required parameter combinations or insufficient search parameters.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/problemDetail"}}}},"500":{"$ref":"#/components/responses/internalServerError"}}}}}}
```

## Enroll a customer

> Enrolls a customer from Mews into the provider's loyalty system by creating a new loyalty membership.

```json
{"openapi":"3.1.1","info":{"title":"Mews Loyalty Reverse API","version":"2025.08.11"},"tags":[{"name":"Members","description":"Operations related to working with customers who are members of provider's loyalty program."}],"servers":[{"url":"[provider]","description":"Provider server"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Bearer token provided by loyalty program provider."}},"parameters":{"acceptLanguage":{"name":"Accept-Language","in":"header","description":"Language preference for error messages and descriptions.\nIf not provided, English will be used as the default language.\n","schema":{"type":"string"}}},"schemas":{"enrollCustomerRequest":{"type":"object","description":"Request payload for enrolling a customer from Mews into the provider's loyalty program.","additionalProperties":false,"required":["customer","mewsEnterpriseId"],"properties":{"customer":{"allOf":[{"$ref":"#/components/schemas/customer"}]},"mewsEnterpriseId":{"$ref":"#/components/schemas/mewsEnterpriseId"},"providerEnterpriseId":{"$ref":"#/components/schemas/providerEnterpriseId"}}},"customer":{"type":"object","title":"Mews Customer","description":"Contains personal and contact information about a customer, including their unique Mews identifier used for referencing within the Mews platform.","required":["mewsCustomerId","firstName","lastName"],"properties":{"mewsCustomerId":{"type":"string","minLength":1,"format":"uuid"},"firstName":{"type":"string","minLength":1,"maxLength":255},"lastName":{"type":"string","minLength":1,"maxLength":255},"email":{"type":"string","format":"email","maxLength":255},"birthday":{"type":"string","format":"date","description":"Customer's date of birth in ISO 8601 format (YYYY-MM-DD)"},"phoneNumber":{"type":"string"},"address":{"$ref":"#/components/schemas/address"}}},"address":{"type":"object","description":"Physical address information including street address, city, postal code, and country details.","additionalProperties":false,"properties":{"line1":{"type":"string","maxLength":1023},"line2":{"type":"string","maxLength":255},"city":{"type":"string","maxLength":255},"postalCode":{"type":"string"},"countryCode":{"type":"string"},"countrySubdivisionCode":{"type":"string"}},"title":"Customer address"},"mewsEnterpriseId":{"title":"Mews Enterprise Identifier","type":"string","format":"uuid","description":"The identifier of the Mews enterprise on whose behalf the request has been made."},"providerEnterpriseId":{"title":"Provider Enterprise Identifier","type":"string","description":"An optional identifier of the enterprise from the loyalty provider on whose behalf the request has been made."},"enrollCustomerResponse":{"type":"object","description":"Response payload containing the newly created or updated membership information after enrollment.","additionalProperties":false,"required":["data"],"properties":{"data":{"$ref":"#/components/schemas/enrollmentMembership"}}},"enrollmentMembership":{"description":"Membership information returned when enrolling a customer, extending the base membership with enrollment-specific details.","allOf":[{"$ref":"#/components/schemas/membership"},{"type":"object","required":["status"],"properties":{"status":{"type":"string","minLength":1,"enum":["pending","enrolled"]}}}]},"membership":{"type":"object","description":"Contains membership information including provider membership ID, membership number, tier, points, and current status.","additionalProperties":false,"required":["providerMembershipId","membershipNumber","status"],"properties":{"providerMembershipId":{"$ref":"#/components/schemas/providerMembershipId"},"membershipNumber":{"$ref":"#/components/schemas/membershipNumber"},"tier":{"type":"string","maxLength":50},"points":{"type":"integer"},"status":{"type":"string","minLength":1,"enum":["pending","enrolled","canceled","declined","notFound"]},"expiresAt":{"type":"string","format":"date-time"},"deeplinkUrl":{"type":"string","format":"uri"}}},"providerMembershipId":{"type":"string","title":"Provider membership Identifier","description":"Unique internal identifier of membership from the loyalty provider. Can be the same as `membershipNumber` if no other value is needed.","maxLength":50},"membershipNumber":{"type":"string","title":"Membership number","description":"Member code or number, typically on loyalty card."},"problemDetail":{"type":"object","additionalProperties":true,"description":"A standardized format for problem details following [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457).","title":"Problem details","required":["type","status","title","detail"],"properties":{"type":{"type":"string","minLength":1,"description":"A URI reference that identifies the problem type. Can be any URI or one of the predefined error types.","anyOf":[{"title":"Predefined Problem Types","type":"string","enum":["https://purl.mews.com/problem/core/not-found","https://purl.mews.com/problem/core/bad-request","https://purl.mews.com/problem/core/unprocessable-content","https://purl.mews.com/problem/core/unauthorized","https://purl.mews.com/problem/core/request-timeout","https://purl.mews.com/problem/core/too-many-requests","https://purl.mews.com/problem/core/internal-server-error","https://purl.mews.com/problem/loyalty/invalid-member-search-criteria"]},{"title":"Custom Problem Type URI","type":"string","format":"uri"}]},"title":{"type":"string","minLength":1,"maxLength":255,"description":"A short, human-readable summary of the problem type."},"status":{"type":"integer","description":"The HTTP status code generated by the origin server for this occurrence of the problem.","minimum":100,"maximum":599},"detail":{"type":"string","minLength":1,"description":"A human-readable explanation specific to this occurrence of the problem."},"instance":{"type":"string","format":"uri","description":"A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced."},"errors":{"type":"array","description":"An array of field-level error details, typically used to describe validation failures or missing/invalid input fields.","items":{"type":"object","additionalProperties":false,"required":["type","pointer"],"properties":{"type":{"type":"string","minLength":1,"description":"A URI reference that identifies the field-level error type. Can be any URI or one of the predefined error types.","anyOf":[{"title":"Custom Field Error Type URI","type":"string","format":"uri"},{"title":"Predefined Field Error Types","type":"string","enum":["https://purl.mews.com/problem/core/field-required","https://purl.mews.com/problem/core/field-invalid-format","https://purl.mews.com/problem/core/field-too-short","https://purl.mews.com/problem/core/field-too-long","https://purl.mews.com/problem/core/field-out-of-range","https://purl.mews.com/problem/core/field-invalid-type","https://purl.mews.com/problem/core/field-not-allowed-value","https://purl.mews.com/problem/core/field-duplicate","https://purl.mews.com/problem/core/field-email-invalid"]}]},"pointer":{"type":"string","description":"JSON Pointer to the field that has an error. See [RFC 6901](https://datatracker.ietf.org/doc/html/rfc6901) for the JSON Pointer specification.","minLength":1,"maxLength":255},"detail":{"type":"string","description":"A human-readable message describing the error.","maxLength":500}}}}}}},"responses":{"unauthorized":{"description":"Unauthorized","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/problemDetail"}}}},"requestTimeout":{"description":"Request Timeout","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/problemDetail"}}}},"internalServerError":{"description":"Internal Server Error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/problemDetail"}}}}}},"paths":{"/members":{"post":{"tags":["Members"],"summary":"Enroll a customer","description":"Enrolls a customer from Mews into the provider's loyalty system by creating a new loyalty membership.","operationId":"enrollCustomer","parameters":[{"$ref":"#/components/parameters/acceptLanguage"}],"requestBody":{"description":"Enrolls a customer in the loyalty program.","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/enrollCustomerRequest"}}}},"responses":{"200":{"description":"Enrollment was accepted, member is successfully enrolled or their membership is pending.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/enrollCustomerResponse"}}}},"400":{"description":"Bad Request - Returned when the enrollment request is invalid, such as missing required fields or containing data in an incorrect format.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/problemDetail"}}}},"401":{"$ref":"#/components/responses/unauthorized"},"408":{"$ref":"#/components/responses/requestTimeout"},"422":{"description":"Unprocessable Entity","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/problemDetail"}}}},"500":{"$ref":"#/components/responses/internalServerError"}}}}}}
```
