LearningCancellation reasons

Cancellation reasons

Learning · 3 операції

GET

List cancellation reasons

/api/reason-for-cancellation

Lesson 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

pagenumberмін. 1 · за замовчуванням 1
pageSizenumber1–250 · за замовчуванням 20
reasonForCancellationIdsnumber[]—
nameOfReasonstringобовʼязковийдовжина макс. 150
isArchivalobjectобовʼязковийза замовчуванням false
availablebooleanOnly reasons the requester's role may cancel lessons with (the cancel modal select).

Відповідь · 200

application/json

statusCodenumberобовʼязковийприклад 200
messagestringобовʼязковий—
dataobject4 поля
totalnumberобовʼязковий—
totalPagesnumberобовʼязковий—
currentPagenumberобовʼязковий—
reasonsForCancellationobject[]обовʼязковий11 полів
reasonForCancellationIdnumberобовʼязковий—
nameOfReasonstringобовʼязковий—
responsibilitystringобовʼязковийможе бути nullWho is responsible for the cancellation.Одне з: STUDENT TEACHER SCHOOL FORCE_MAJEURE
typeOfReasonstringобовʼязковийОдне з: NUMERATOR_VALUE NATURAL_VALUE
valueOfWithdrawalnumberобовʼязковийNUMERATOR_VALUE: percent of the lesson price; NATURAL_VALUE: amount of money.
notestringобовʼязковийможе бути null—
ordernumberобовʼязковий—
isArchivalbooleanобовʼязковий—
roleIdsnumber[]обовʼязковийRoles allowed to cancel a lesson with this reason.
updatedAtstringобовʼязковийформат YYYY-MM-DDTHH:mm:ss
createdAtstringобовʼязковийформат YYYY-MM-DDTHH:mm:ss
Помилки400401403429500
curl "https://your-school.rist.pro/api/reason-for-cancellation?nameOfReason=string&isArchival=false" \
  -H "Authorization: Bearer $RIST_API_KEY"
Приклад відповіді · 200
{
  "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"
      }
    ]
  }
}
POST

Create lesson cancellation reason

/api/reason-for-cancellation

Add 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

nameOfReasonstringобовʼязковийдовжина 1–150
responsibilitystringможе бути nullWho is responsible for the cancellation; a property of the reason, not of each cancellation.Одне з: STUDENT TEACHER SCHOOL FORCE_MAJEURE
typeOfReasonstringобовʼязковийОдне з: NUMERATOR_VALUE NATURAL_VALUE
valueOfWithdrawalnumberобовʼязковий0–1000000
notestringобовʼязковийможе бути nullдовжина макс. 1500
roleIdsnumber[]Roles allowed to use the reason; an empty list means nobody (fail-closed).мін. 1

Відповідь · 201

application/json

statusCodenumberобовʼязковийприклад 201
messagestringобовʼязковий—
dataobject11 полів
reasonForCancellationIdnumberобовʼязковий—
nameOfReasonstringобовʼязковий—
responsibilitystringобовʼязковийможе бути nullWho is responsible for the cancellation.Одне з: STUDENT TEACHER SCHOOL FORCE_MAJEURE
typeOfReasonstringобовʼязковийОдне з: NUMERATOR_VALUE NATURAL_VALUE
valueOfWithdrawalnumberобовʼязковийNUMERATOR_VALUE: percent of the lesson price; NATURAL_VALUE: amount of money.
notestringобовʼязковийможе бути null—
ordernumberобовʼязковий—
isArchivalbooleanобовʼязковий—
roleIdsnumber[]обовʼязковийRoles allowed to cancel a lesson with this reason.
updatedAtstringобовʼязковийформат YYYY-MM-DDTHH:mm:ss
createdAtstringобовʼязковийформат YYYY-MM-DDTHH:mm:ss
Помилки400401403429500
curl -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
    ]
  }'
Приклад відповіді · 201
{
  "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"
  }
}
PUT

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

idnumberобовʼязковий—

Тіло запиту

application/json · object

nameOfReasonstringобовʼязковийдовжина 1–150
responsibilitystringможе бути nullWho is responsible for the cancellation; a property of the reason, not of each cancellation.Одне з: STUDENT TEACHER SCHOOL FORCE_MAJEURE
typeOfReasonstringобовʼязковийОдне з: NUMERATOR_VALUE NATURAL_VALUE
valueOfWithdrawalnumberобовʼязковий0–1000000
notestringобовʼязковийможе бути nullдовжина макс. 1500
roleIdsnumber[]Roles allowed to use the reason; an empty list means nobody (fail-closed).мін. 1

Відповідь · 200

application/json

statusCodenumberобовʼязковийприклад 200
messagestringобовʼязковий—
dataobject11 полів
reasonForCancellationIdnumberобовʼязковий—
nameOfReasonstringобовʼязковий—
responsibilitystringобовʼязковийможе бути nullWho is responsible for the cancellation.Одне з: STUDENT TEACHER SCHOOL FORCE_MAJEURE
typeOfReasonstringобовʼязковийОдне з: NUMERATOR_VALUE NATURAL_VALUE
valueOfWithdrawalnumberобовʼязковийNUMERATOR_VALUE: percent of the lesson price; NATURAL_VALUE: amount of money.
notestringобовʼязковийможе бути null—
ordernumberобовʼязковий—
isArchivalbooleanобовʼязковий—
roleIdsnumber[]обовʼязковийRoles allowed to cancel a lesson with this reason.
updatedAtstringобовʼязковийформат YYYY-MM-DDTHH:mm:ss
createdAtstringобовʼязковийформат YYYY-MM-DDTHH:mm:ss
Помилки400401403429500
curl -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
    ]
  }'
Приклад відповіді · 200
{
  "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"
  }
}