Guest registration for the classes
Purpose: Use this API to register a guest for a class.
You must specify class_id as path params and mention the following in the body params - Check the body params section for more details.
On this page
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
POST /v1/classes/{class_id}/registrations
Base URL: https://api.zenoti.com
Request
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | bearer {{access_token}} |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| class_id | integer (int64) | Yes | Identifier of a class. |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| guest_id | string | Yes | Unique identifier of the guest. |
| session_id | integer (int64) | Yes | Identifier of the session of the class. |
| center_id | string | Yes | Unique identifier of the center. |
| waitlist | boolean | Yes | Denotes if the guest is to be added to the waitlist. True: Guest to be added to the waitlist. False: Guest is not to be added to the waitlist |
| notes | string | Yes | Notes on the registration of the guest |
| booking_source | integer (int32) | Yes | Denotes the source of the guest's registration of the guest. Website = 0, Webstore = 1, MobileApp = 2, Take5App = 3, and MobilePos = 4. |
| training_virtual_guests | object | Yes | |
| RegistrationId | integer (int64) | No | Id of the guest's registration |
| mobile_phone | object | No | |
| gender | enum (-1, 0, 1, 3) | No | Denotes the gender of the guest. NotSpecified = -1, Male = 1, Female = 0, Other = 3. |
| add_to_all | integer (int32) | No | Denotes the status of add to all. |
| expand | string[] | No | (optional) Contains an array of strings to expand the request. |
Response
Success (201 Created)
{}
Example
curl --request POST \
--url 'https://api.zenoti.com/v1/classes/{class_id}/registrations' \
--header 'Authorization: bearer {{access_token}}' \
--header 'Content-Type: application/json' \
--data '{
"guest_id": "string",
"session_id": 0,
"center_id": "string",
"waitlist": true,
"notes": "string",
"booking_source": 0,
"training_virtual_guests": {
"": "string",
"registration_id": "string",
"first_name": "string",
"last_name": "string",
"email": "string",
"mobile_phone": "string",
"gender": "string"
},
"RegistrationId": 0,
"mobile_phone": {
"country_code": 0,
"phone_code": "string",
"number": "string"
},
"gender": "-1",
"add_to_all": 0,
"expand": [
"string"
]
}'
const response = await fetch('https://api.zenoti.com/v1/classes/{class_id}/registrations', {
method: 'POST',
headers: {
'Authorization': 'bearer {{access_token}}',
'Content-Type': 'application/json'
},
body: JSON.stringify({
guest_id: 'string',
session_id: 0,
center_id: 'string',
waitlist: true,
notes: 'string',
booking_source: 0,
training_virtual_guests: {
'': 'string',
registration_id: 'string',
first_name: 'string',
last_name: 'string',
email: 'string',
mobile_phone: 'string',
gender: 'string'
},
RegistrationId: 0,
mobile_phone: { country_code: 0, phone_code: 'string', number: 'string' },
gender: '-1',
add_to_all: 0,
expand: [
'string'
]
})
});
const data = await response.json();
import requests
response = requests.post(
'https://api.zenoti.com/v1/classes/{class_id}/registrations',
headers={
'Authorization': 'bearer {{access_token}}',
},
json={'guest_id': 'string', 'session_id': 0, 'center_id': 'string', 'waitlist': True, 'notes': 'string', 'booking_source': 0, 'training_virtual_guests': {'': 'string', 'registration_id': 'string', 'first_name': 'string', 'last_name': 'string', 'email': 'string', 'mobile_phone': 'string', 'gender': 'string'}, 'RegistrationId': 0, 'mobile_phone': {'country_code': 0, 'phone_code': 'string', 'number': 'string'}, 'gender': '-1', 'add_to_all': 0, 'expand': ['string']}
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var content = new StringContent(
JsonSerializer.Serialize(new {
guest_id = "string",
session_id = 0,
center_id = "string",
waitlist = true,
notes = "string",
booking_source = 0,
training_virtual_guests = new {
= "string",
registration_id = "string",
first_name = "string",
last_name = "string",
email = "string",
mobile_phone = "string",
gender = "string"
},
RegistrationId = 0,
mobile_phone = new { country_code = 0, phone_code = "string", number = "string" },
gender = "-1",
add_to_all = 0,
expand = new[] {
"string"
}
}),
Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://api.zenoti.com/v1/classes/{class_id}/registrations", content);
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/v1/classes/{class_id}/registrations')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'bearer {{access_token}}'
request['Content-Type'] = 'application/json'
request.body = { guest_id: 'string', session_id: 0, center_id: 'string', waitlist: true, notes: 'string', booking_source: 0, training_virtual_guests: { : 'string', registration_id: 'string', first_name: 'string', last_name: 'string', email: 'string', mobile_phone: 'string', gender: 'string' }, RegistrationId: 0, mobile_phone: { country_code: 0, phone_code: 'string', number: 'string' }, gender: '-1', add_to_all: 0, expand: ['string'] }.to_json
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 |