Cancel a guest's registration to a class

PUT https://api.zenoti.com/v1/classes/{class_id}/registrations/{registration_id}/cancel

Purpose: The purpose of this API is to cancel the registration of a user to a class.

You must provide a unique identifier for the class_id as well as for the registration_id. The API then cancels the registration of a user to the class.

Before you begin

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

Endpoint

PUT /v1/classes/{class_id}/registrations/{registration_id}/cancel

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 (int32) Yes Unique identifier of the class.
registration_id integer (int32) Yes Unique identifier of the registration of the class session booking that is to be canceled.

Request body

Field Type Required Description
waive_fee boolean No As per your business policy, you can waive the cancelation fee. True: The cancellation fee is waived. False. The cancellation fee is not waived.

Response

Success (200 OK)

{}

Example

curl --request PUT \
  --url 'https://api.zenoti.com/v1/classes/{class_id}/registrations/{registration_id}/cancel' \
  --header 'Authorization: bearer {{access_token}}' \
  --header 'Content-Type: application/json' \
  --data '{
  "waive_fee": true
}'
const response = await fetch('https://api.zenoti.com/v1/classes/{class_id}/registrations/{registration_id}/cancel', {
  method: 'PUT',
  headers: {
    'Authorization': 'bearer {{access_token}}',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({ waive_fee: true })
});
const data = await response.json();
import requests

response = requests.put(
    'https://api.zenoti.com/v1/classes/{class_id}/registrations/{registration_id}/cancel',
    headers={
        'Authorization': 'bearer {{access_token}}',
    },
    json={'waive_fee': True}
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var content = new StringContent(
    JsonSerializer.Serialize(new { waive_fee = true }),
    Encoding.UTF8, "application/json");
var response = await client.PutAsync(
    "https://api.zenoti.com/v1/classes/{class_id}/registrations/{registration_id}/cancel", content);
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'

uri = URI('https://api.zenoti.com/v1/classes/{class_id}/registrations/{registration_id}/cancel')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Put.new(uri)
request['Authorization'] = 'bearer {{access_token}}'
request['Content-Type'] = 'application/json'
request.body = { waive_fee: true }.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