Retrieve the packages associated with classes

GET https://api.zenoti.com/v1/classes/packages

This API helps you to retrieve the packages that have a benefit associated with the specified class.

You must provide the appropriate details in the API request for the search_type and item_ids parameters. Optionally, you can also specify the required details in the API request for several other parameters to filter the search results in the API response. Refer to the Request Parameters table for more information.

Before you begin

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

Endpoint

GET /v1/classes/packages

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

Request

Headers

Header Required Description
Authorization Yes bearer {{access_token}}

Query parameters

Parameter Type Required Default Description
search_type enum () Yes — Mandatory Item type to list membership details. You can specify any one of these values: Class = 0 and Center = 2.
page integer (int32) No — Optional Current page to be viewed. Returns all records if no value is specified.
size integer (int32) No — Optional Number of records to be listed per page. It returns all records if no value is specified.
item_ids string[] Yes — Mandatory You can specify the IDs of multiple items separated by commas: Class - int values and Center - guid values.

Response

Success (200 OK)

{
  "packages": [
    {
      "...": "..."
    }
  ],
  "page_details": {
    "total": 1,
    "page": 1,
    "size": 10
  },
  "error": {}
}

Response fields

Field Type Description
packages object[]
packages[].id string
packages[].name string
packages[].code string
packages[].category_name string
packages[].price_without_tax integer
packages[].type string
packages[].cost_inc_bundled_products boolean
packages[].display_name string
packages[].display_price object
packages[].description string
packages[].description_html object
packages[].duration integer
packages[].expiry_date string
packages[].expire_days integer
packages[].center_id string
packages[].center_name string
packages[].has_bundled_products boolean
packages[].bundled_product_price_check string
packages[].bundled_product_price_percentage integer
packages[].can_book boolean
packages[].terms_conditions object
packages[].scheduled_payment_frequency object
packages[].scheduled_payment_frequency_type integer
packages[].restrict_redemption_to_this_center integer
packages[].show_price boolean
packages[].price_details object
page_details object
page_details.total integer
page_details.page integer
page_details.size integer
error object

Example

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

response = requests.get(
    'https://api.zenoti.com/v1/classes/packages',
    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/classes/packages");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'

uri = URI('https://api.zenoti.com/v1/classes/packages')
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