Cancellation reasons
Learning · 3 операції
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
Параметри запиту · 6
pageмін. 1 · за замовчуванням 1pageSize1–250 · за замовчуванням 20reasonForCancellationIds—nameOfReasonдовжина макс. 150isArchivalза замовчуванням falseavailableOnly reasons the requester's role may cancel lessons with (the cancel modal select).Відповідь · 200
application/json
statusCodeприклад 200message—data4 поля
total—totalPages—currentPage—reasonsForCancellation11 полів
reasonForCancellationId—nameOfReason—responsibilityWho is responsible for the cancellation.Одне з: STUDENT TEACHER SCHOOL FORCE_MAJEUREtypeOfReasonОдне з: 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.updatedAtформат YYYY-MM-DDTHH:mm:sscreatedAtформат 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
Тіло запиту
application/json · object
nameOfReasonдовжина 1–150responsibilityWho is responsible for the cancellation; a property of the reason, not of each cancellation.Одне з: STUDENT TEACHER SCHOOL FORCE_MAJEUREtypeOfReasonОдне з: NUMERATOR_VALUE NATURAL_VALUEvalueOfWithdrawal0–1000000noteдовжина макс. 1500roleIdsRoles allowed to use the reason; an empty list means nobody (fail-closed).мін. 1Відповідь · 201
application/json
statusCodeприклад 201message—data11 полів
reasonForCancellationId—nameOfReason—responsibilityWho is responsible for the cancellation.Одне з: STUDENT TEACHER SCHOOL FORCE_MAJEUREtypeOfReasonОдне з: 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.updatedAtформат YYYY-MM-DDTHH:mm:sscreatedAtформат 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
Параметри шляху · 1
id—Тіло запиту
application/json · object
nameOfReasonдовжина 1–150responsibilityWho is responsible for the cancellation; a property of the reason, not of each cancellation.Одне з: STUDENT TEACHER SCHOOL FORCE_MAJEUREtypeOfReasonОдне з: NUMERATOR_VALUE NATURAL_VALUEvalueOfWithdrawal0–1000000noteдовжина макс. 1500roleIdsRoles allowed to use the reason; an empty list means nobody (fail-closed).мін. 1Відповідь · 200
application/json
statusCodeприклад 200message—data11 полів
reasonForCancellationId—nameOfReason—responsibilityWho is responsible for the cancellation.Одне з: STUDENT TEACHER SCHOOL FORCE_MAJEUREtypeOfReasonОдне з: 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.updatedAtформат YYYY-MM-DDTHH:mm:sscreatedAtформат 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"
}
}