List all memberships of a guest

GET https://api.zenoti.com/v1/guests/{guest_id}/memberships

This API helps you to retrieve the membership history of the respective guest. You must specify the unique identifier of the guest as guest_id in the request. If you want to breakdown the list of memberships by their status, you must pass the expand parameter is_active. If you are using api_key to retrieve the data, it is mandatory to specify the center_id details in the request.

Before you begin

Permission: Manage API Keys (on the Administrator security object) — Required to access Zenoti APIs.

Endpoint

GET /v1/guests/{guest_id}/memberships

Base URL: https://api.zenoti.com

Request

Headers

Header Required Description
Authorization Yes bearer {{access_token}}

Path parameters

Parameter Type Required Description
guest_id string Yes Mandatory Unique 32-character ID of the guest for whom you want to retrieve the membership history.

Query parameters

Parameter Type Required Default Description
center_id string No — Unique 32-character ID of the center for which you want to retrieve the membership history of the specified guest. If you are using api_key to retrieve the data, it is mandatory for you to specify the center_id details in the request.
show_redeemable boolean No — (optional) Denotes if the API should list redeemable memberships of the guest.
show_guestpass_enabled_only boolean No — (optional) Denotes if the API must list guestpass enabled memberships of the guest.
guestpass_type integer (int32) No — (optional) Lists specific guest pass memberships (0:Both, 1:Classes, 2:Visits)
expand string[] No — (optional) Shows only the types listed. Default null and lists all. Default " show_only_guest_membership_detail" (show_only_user_membership_details, show_only_guest_membership_details)
is_active enum (-1, 0, 1) No Status of the membership 1 - Active, 0 - Others, -1 - All(default)

Request body

Field Type Required Description
RAW_BODY string (json) No

Response

Success (200 OK)

{}

Example

curl --request GET \
  --url 'https://api.zenoti.com/v1/guests/{guest_id}/memberships' \
  --header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/v1/guests/{guest_id}/memberships', {
  method: 'GET',
  headers: {
    'Authorization': 'bearer {{access_token}}'
  },
});
const data = await response.json();
import requests

response = requests.get(
    'https://api.zenoti.com/v1/guests/{guest_id}/memberships',
    headers={
        'Authorization': 'bearer {{access_token}}',
    },
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var response = await client.GetAsync(
    "https://api.zenoti.com/v1/guests/{guest_id}/memberships");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'

uri = URI('https://api.zenoti.com/v1/guests/{guest_id}/memberships')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'bearer {{access_token}}'
response = http.request(request)
data = JSON.parse(response.body)

Error codes

Status Description
401 Unauthorized -- invalid or expired access token
429 Too many requests -- rate limit exceeded