List all memberships in a center
Supply unique identifier of the center as center_id and this API will retrieve the list of memberships associated with that center if the membership falls within the active sale period.
Before you begin
- You need a valid API key or access token. See Set up API authentication.
Permission: Manage API Keys (on the Administrator security object) — Required to access Zenoti APIs.
Endpoint
GET /v1/centers/{center_id}/memberships
Base URL: https://api.zenoti.com
Request
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | bearer {{access_token}} |
Query parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| center_id | string | Yes | — | Unique 32-character identifier of the center. |
| show_in_catalog | boolean | Yes | — | Displays the membership in catalog |
| expand | string | No | Null | Lists benefits of the membership |
| page | integer (int32) | No | — | The page number to be viewed |
| size | integer (int32) | No | — | The number of records per page |
Response
Success (200 OK)
{
"memberships": [
{
"...": "..."
}
],
"total_no_of_memberships": 6
}
Response fields
| Field | Type | Description |
|---|---|---|
| memberships | object[] | |
| memberships[].id | string | |
| memberships[].version_id | string | |
| memberships[].name | string | |
| memberships[].price | object | |
| memberships[].can_book | boolean | |
| memberships[].show_price | boolean | |
| memberships[].display_name | object | |
| memberships[].display_price | object | |
| memberships[].image_paths | object | |
| memberships[].is_recurring_membership | boolean | |
| memberships[].membership_type | integer | |
| memberships[].first_collection_after | integer | |
| memberships[].description | string | |
| memberships[].html_description | object | |
| memberships[].terms_and_conditions | object | |
| memberships[].terms_and_conditions_acceptance | object | |
| memberships[].enforce_mandatory_fields | boolean | |
| memberships[].payment_frequency | string | |
| total_no_of_memberships | integer |
Example
curl --request GET \
--url 'https://api.zenoti.com/v1/centers/{center_id}/memberships?center_id={{center_id}}&show_in_catalog={{show_in_catalog}}' \
--header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/v1/centers/{center_id}/memberships', {
method: 'GET',
headers: {
'Authorization': 'bearer {{access_token}}'
},
});
const data = await response.json();
import requests
response = requests.get(
'https://api.zenoti.com/v1/centers/{center_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/centers/{center_id}/memberships");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/v1/centers/{center_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 |
|---|---|
| 400 | 400 |
| 401 | Unauthorized -- invalid or expired access token |
| 429 | Too many requests -- rate limit exceeded |