Create new guests using referral codes
This API creates new guests using correct referral codes.
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 /{api_url}/v1/guests
Base URL: https://api.zenoti.com
Request
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | bearer {{access_token}} |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| RAW_BODY | string | No |
Response
Success (201 Created)
{
"id": "9454b8bc-1f14-49d4-99b0-2a852f2dc990",
"offline_id": {},
"code": "CN007",
"center_id": "9ee3e18d-4bb8-403a-8c79-98dac599f306",
"preferred_service_id": "",
"is_online_booking_blocked": false,
"center_name": "Adyen SS",
"created_date": "2024-12-31T07:09:54",
"can_edit_personal_info": true,
"is_virtual_guest": false,
"is_guest_custom_form_filled": false,
"is_class_booking_blocked": false,
"is_blocked_for_no_show": false,
"no_show_un_block_date": {},
"personal_info": {
"user_name": "si1",
"first_name": "s1",
"last_name": "s1",
"middle_name": "s1",
"preferred_name": "",
"email": "s1@s1.com",
"mobile_phone": {
"...": "..."
},
"work_phone": {
"...": "..."
},
"home_phone": {
"...": "..."
},
"gender": 1,
"gender_name": "Male",
"date_of_birth": "1997-08-02T00:00:00",
"is_minor": false,
"nationality_id": 95,
"language_id": 1,
"anniversary_date": "2018-11-06T00:00:00",
"lock_guest_custom_data": false,
"pan": "",
"dob_incomplete_year": ""
},
"address_info": {},
"preferences": {},
"tags": {},
"referral": {
"referral_source": {},
"referred_by": {
"...": "..."
},
"referral_code": "s19454"
},
"primary_employee": {},
"guest_passes": {},
"guest_milestone_details": {},
"additional_details": {},
"blocked_therapists": {},
"validate_additional_details": false,
"has_statements": false,
"is_hac_member": false
}
Response fields
| Field | Type | Description |
|---|---|---|
| id | string | |
| offline_id | object | |
| code | string | |
| center_id | string | |
| preferred_service_id | string | |
| is_online_booking_blocked | boolean | |
| center_name | string | |
| created_date | string | |
| can_edit_personal_info | boolean | |
| is_virtual_guest | boolean | |
| is_guest_custom_form_filled | boolean | |
| is_class_booking_blocked | boolean | |
| is_blocked_for_no_show | boolean | |
| no_show_un_block_date | object | |
| personal_info | object | |
| personal_info.user_name | string | |
| personal_info.first_name | string | |
| personal_info.last_name | string | |
| personal_info.middle_name | string | |
| personal_info.preferred_name | string | |
| personal_info.email | string | |
| personal_info.mobile_phone | object | |
| personal_info.work_phone | object | |
| personal_info.home_phone | object | |
| personal_info.gender | integer | |
| personal_info.gender_name | string | |
| personal_info.date_of_birth | string | |
| personal_info.is_minor | boolean | |
| personal_info.nationality_id | integer | |
| personal_info.language_id | integer | |
| personal_info.anniversary_date | string | |
| personal_info.lock_guest_custom_data | boolean | |
| personal_info.pan | string | |
| personal_info.dob_incomplete_year | string | |
| address_info | object | |
| preferences | object | |
| tags | object | |
| referral | object | |
| referral.referral_source | object | |
| referral.referred_by | object | |
| referral.referral_code | string | |
| primary_employee | object | |
| guest_passes | object | |
| guest_milestone_details | object | |
| additional_details | object | |
| blocked_therapists | object | |
| validate_additional_details | boolean | |
| has_statements | boolean | |
| is_hac_member | boolean |
Example
curl --request POST \
--url 'https://api.zenoti.com/{api_url}/v1/guests' \
--header 'Authorization: bearer {{access_token}}' \
--header 'Content-Type: application/json' \
--data '{
"RAW_BODY": "string"
}'
const response = await fetch('https://api.zenoti.com/{api_url}/v1/guests', {
method: 'POST',
headers: {
'Authorization': 'bearer {{access_token}}',
'Content-Type': 'application/json'
},
body: JSON.stringify({ RAW_BODY: 'string' })
});
const data = await response.json();
import requests
response = requests.post(
'https://api.zenoti.com/{api_url}/v1/guests',
headers={
'Authorization': 'bearer {{access_token}}',
},
json={'RAW_BODY': 'string'}
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var content = new StringContent(
JsonSerializer.Serialize(new { RAW_BODY = "string" }),
Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://api.zenoti.com/{api_url}/v1/guests", content);
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/{api_url}/v1/guests')
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 = { RAW_BODY: 'string' }.to_json
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 |