# Memberships

Memberships sold to Clients: lookup, history, Group Event eligibility, freeze,
balance and validity changes.
Response fields keep the legacy name `abonement` (for example `abonement_id`). Requests
to the earlier `/loyalty/abonements` URLs still work and return the same result.

 - [GET /loyalty/memberships](https://developer.alteg.io/en/b2b-v1/openapi/memberships/get_client_memberships.md): Returns memberships found by client phone at the specified Location. Requires the authenticated Business User to have Loyalty access at that Location. `chain_id` can narrow results to a Chain. Each me
 - [GET /chains/{chain_id}/loyalty/memberships](https://developer.alteg.io/en/b2b-v1/openapi/memberships/get_membership_list.md): Requires Chain membership access. Supply `membership_ids` or both `created_after` and `created_before`; otherwise the request returns 400. The date range filters membership creation, not sales. This l
 - [GET /locations/{location_id}/client/{client_id}/loyalty/memberships/{membership_id}/history](https://developer.alteg.io/en/b2b-v1/openapi/memberships/get_client_membership_activity_history.md): Returns state changes and usage events for one membership belonging to the specified client at this Location. The client must belong to the Location, and the membership must be found among that client
 - [POST /chains/{chain_id}/loyalty/memberships/{membership_id}/freeze](https://developer.alteg.io/en/b2b-v1/openapi/memberships/chain_loyalty_memberships_freeze.md): Freezes a membership until the specified date. The membership's expiration date will be extended by the freeze period. Frozen memberships cannot be used for appointments. **Requirements:** - Membershi
 - [POST /chains/{chain_id}/loyalty/memberships/{membership_id}/unfreeze](https://developer.alteg.io/en/b2b-v1/openapi/memberships/chain_loyalty_memberships_unfreeze.md): Removes the freeze from a membership. The membership's expiration date will remain extended by the freeze period that was already applied during the freeze. **Note:** Requires chain-level permissions.
 - [POST /chains/{chain_id}/loyalty/memberships/{membership_id}/set_balance](https://developer.alteg.io/en/b2b-v1/openapi/memberships/chain_loyalty_memberships_set_balance.md): Modifies the remaining visit count for a membership. **For unified balance memberships:** - Use `united_balance_services_count` to set total visits **For separate balance memberships:** - Use `servi
 - [POST /chains/{chain_id}/loyalty/memberships/{membership_id}/set_period](https://developer.alteg.io/en/b2b-v1/openapi/memberships/chain_loyalty_memberships_set_period.md): Modifies the validity period (duration) of a membership. This changes how long the membership remains active before expiring. **Period units:** - 1 = day - 2 = week - 3 = month - 4 = year **Use cases
 - [GET /locations/{location_id}/client/{client_id}/loyalty/memberships/search_for_activity](https://developer.alteg.io/en/b2b-v1/openapi/memberships/search_memberships_for_event.md): Retrieves memberships that can be used to create a client schedule for a series of events. This method returns memberships that: - Belong to the specified client - Are valid and active - Can be applie
 - [GET /locations/{location_id}/client/{client_id}/loyalty/memberships/{membership_id}/check_for_activity](https://developer.alteg.io/en/b2b-v1/openapi/memberships/check_memberships_for_event.md): Validates a specific membership for creating activity schedules. Returns: - **Last possible appointment date** based on membership expiration - **Available visit count** for the selected membership
 - [GET /loyalty/generate_code/{location_id}/{product_id}](https://developer.alteg.io/en/b2b-v1/openapi/memberships/generate_loyalty_code.md): + Options + location_id (required, number, `1` ) - location ID + product_id (required, number, `1` ) - product ID (gift card/ membership)
