Cancellation reasons
Learning · 3 operations
List cancellation reasons
/api/reason-for-cancellationLesson cancellation reasons with the percent of the lesson price still charged to students (valueOfWithdrawal). Pass available=true to get only the reasons the current role may use with PATCH /api/lesson/canceled/{id}.
list_reasons_for_cancellation
Query parameters · 6
pagemin 1 · default 1pageSize1–250 · default 20reasonForCancellationIds—nameOfReasonlength max 150isArchivaldefault falseavailableOnly reasons the requester's role may cancel lessons with (the cancel modal select).Response · 200
application/json
statusCodeexample 200message—data4 fields
total—totalPages—currentPage—reasonsForCancellation11 fields
reasonForCancellationId—nameOfReason—responsibilityWho is responsible for the cancellation.One of: STUDENT TEACHER SCHOOL FORCE_MAJEUREtypeOfReasonOne of: NUMERATOR_VALUE NATURAL_VALUEvalueOfWithdrawalNUMERATOR_VALUE: percent of the lesson price; NATURAL_VALUE: amount of money.note—order—isArchival—roleIdsRoles allowed to cancel a lesson with this reason.updatedAtformat YYYY-MM-DDTHH:mm:sscreatedAtformat YYYY-MM-DDTHH:mm:sscurl "https://your-school.rist.pro/api/reason-for-cancellation?nameOfReason=string&isArchival=false" \
-H "Authorization: Bearer $RIST_API_KEY"const response = await fetch("https://your-school.rist.pro/api/reason-for-cancellation?nameOfReason=string&isArchival=false", {
headers: {
Authorization: `Bearer ${process.env.RIST_API_KEY}`,
},
});
const { data } = await response.json();import os
import requests
response = requests.get(
"https://your-school.rist.pro/api/reason-for-cancellation",
headers={"Authorization": f"Bearer {os.environ['RIST_API_KEY']}"},
params={
"nameOfReason": "string",
"isArchival": False
},
)
response.raise_for_status()
data = response.json()["data"]{
"statusCode": 200,
"message": "Operation completed successfully",
"data": {
"total": 0,
"totalPages": 0,
"currentPage": 0,
"reasonsForCancellation": [
{
"reasonForCancellationId": 1,
"nameOfReason": "string",
"responsibility": "STUDENT",
"typeOfReason": "NUMERATOR_VALUE",
"valueOfWithdrawal": 0,
"note": "string",
"order": 0,
"isArchival": false,
"roleIds": [
1
],
"updatedAt": "2026-11-09T14:30:00",
"createdAt": "2026-11-09T14:30:00"
}
]
}
}Create lesson cancellation reason
/api/reason-for-cancellationAdd a reason to cancel a lesson: name, who is responsible (TEACHER, STUDENT, SCHOOL, FORCE_MAJEURE) and what the student is charged: typeOfReason NUMERATOR_VALUE takes valueOfWithdrawal as a percent of the lesson price (0 = free), NATURAL_VALUE as a fixed amount. roleIds are the roles that may pick the reason, and without them nobody can: pass at least the role of the user from whoami and say that other roles are added in the interface.
create_reason_for_cancellation
Request body
application/json · object
nameOfReasonlength 1–150responsibilityWho is responsible for the cancellation; a property of the reason, not of each cancellation.One of: STUDENT TEACHER SCHOOL FORCE_MAJEUREtypeOfReasonOne of: NUMERATOR_VALUE NATURAL_VALUEvalueOfWithdrawal0–1000000notelength max 1500roleIdsRoles allowed to use the reason; an empty list means nobody (fail-closed).min 1Response · 201
application/json
statusCodeexample 201message—data11 fields
reasonForCancellationId—nameOfReason—responsibilityWho is responsible for the cancellation.One of: STUDENT TEACHER SCHOOL FORCE_MAJEUREtypeOfReasonOne of: NUMERATOR_VALUE NATURAL_VALUEvalueOfWithdrawalNUMERATOR_VALUE: percent of the lesson price; NATURAL_VALUE: amount of money.note—order—isArchival—roleIdsRoles allowed to cancel a lesson with this reason.updatedAtformat YYYY-MM-DDTHH:mm:sscreatedAtformat YYYY-MM-DDTHH:mm:sscurl -X POST "https://your-school.rist.pro/api/reason-for-cancellation" \
-H "Authorization: Bearer $RIST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"nameOfReason": "string",
"responsibility": "STUDENT",
"typeOfReason": "NUMERATOR_VALUE",
"valueOfWithdrawal": 0,
"note": "string",
"roleIds": [
1
]
}'const response = await fetch("https://your-school.rist.pro/api/reason-for-cancellation", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RIST_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"nameOfReason": "string",
"responsibility": "STUDENT",
"typeOfReason": "NUMERATOR_VALUE",
"valueOfWithdrawal": 0,
"note": "string",
"roleIds": [
1
]
}),
});
const { data } = await response.json();import os
import requests
response = requests.post(
"https://your-school.rist.pro/api/reason-for-cancellation",
headers={"Authorization": f"Bearer {os.environ['RIST_API_KEY']}"},
json={
"nameOfReason": "string",
"responsibility": "STUDENT",
"typeOfReason": "NUMERATOR_VALUE",
"valueOfWithdrawal": 0,
"note": "string",
"roleIds": [
1
]
},
)
response.raise_for_status()
data = response.json()["data"]{
"statusCode": 201,
"message": "Operation completed successfully",
"data": {
"reasonForCancellationId": 1,
"nameOfReason": "string",
"responsibility": "STUDENT",
"typeOfReason": "NUMERATOR_VALUE",
"valueOfWithdrawal": 0,
"note": "string",
"order": 0,
"isArchival": false,
"roleIds": [
1
],
"updatedAt": "2026-11-09T14:30:00",
"createdAt": "2026-11-09T14:30:00"
}
}Update lesson cancellation reason
/api/reason-for-cancellation/{id}Change a cancellation reason; send name, typeOfReason and valueOfWithdrawal every time. roleIds, when sent, replace the whole list, so leave them out to keep the roles.
update_reason_for_cancellation
Path parameters · 1
id—Request body
application/json · object
nameOfReasonlength 1–150responsibilityWho is responsible for the cancellation; a property of the reason, not of each cancellation.One of: STUDENT TEACHER SCHOOL FORCE_MAJEUREtypeOfReasonOne of: NUMERATOR_VALUE NATURAL_VALUEvalueOfWithdrawal0–1000000notelength max 1500roleIdsRoles allowed to use the reason; an empty list means nobody (fail-closed).min 1Response · 200
application/json
statusCodeexample 200message—data11 fields
reasonForCancellationId—nameOfReason—responsibilityWho is responsible for the cancellation.One of: STUDENT TEACHER SCHOOL FORCE_MAJEUREtypeOfReasonOne of: NUMERATOR_VALUE NATURAL_VALUEvalueOfWithdrawalNUMERATOR_VALUE: percent of the lesson price; NATURAL_VALUE: amount of money.note—order—isArchival—roleIdsRoles allowed to cancel a lesson with this reason.updatedAtformat YYYY-MM-DDTHH:mm:sscreatedAtformat YYYY-MM-DDTHH:mm:sscurl -X PUT "https://your-school.rist.pro/api/reason-for-cancellation/1" \
-H "Authorization: Bearer $RIST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"nameOfReason": "string",
"responsibility": "STUDENT",
"typeOfReason": "NUMERATOR_VALUE",
"valueOfWithdrawal": 0,
"note": "string",
"roleIds": [
1
]
}'const response = await fetch("https://your-school.rist.pro/api/reason-for-cancellation/1", {
method: "PUT",
headers: {
Authorization: `Bearer ${process.env.RIST_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"nameOfReason": "string",
"responsibility": "STUDENT",
"typeOfReason": "NUMERATOR_VALUE",
"valueOfWithdrawal": 0,
"note": "string",
"roleIds": [
1
]
}),
});
const { data } = await response.json();import os
import requests
response = requests.put(
"https://your-school.rist.pro/api/reason-for-cancellation/1",
headers={"Authorization": f"Bearer {os.environ['RIST_API_KEY']}"},
json={
"nameOfReason": "string",
"responsibility": "STUDENT",
"typeOfReason": "NUMERATOR_VALUE",
"valueOfWithdrawal": 0,
"note": "string",
"roleIds": [
1
]
},
)
response.raise_for_status()
data = response.json()["data"]{
"statusCode": 200,
"message": "Operation completed successfully",
"data": {
"reasonForCancellationId": 1,
"nameOfReason": "string",
"responsibility": "STUDENT",
"typeOfReason": "NUMERATOR_VALUE",
"valueOfWithdrawal": 0,
"note": "string",
"order": 0,
"isArchival": false,
"roleIds": [
1
],
"updatedAt": "2026-11-09T14:30:00",
"createdAt": "2026-11-09T14:30:00"
}
}