Students and customersStudent subscriptions

Student subscriptions

Students and customers · 5 операцій

GET

Get student subscriptions and balance

/api/student/subscription

Subscriptions (prepaid lesson packages) of a student with money balance, lessons left, price per lesson and cashback. A negative balance means the student owes money.

get_student_subscriptions

Параметри запиту · 1

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

Відповідь · 200

application/json

statusCodenumberобовʼязковийприклад 200
messagestringобовʼязковий—
dataanyПоля data ще не описані.
Помилки400401403429500
curl "https://your-school.rist.pro/api/student/subscription?studentId=1" \
  -H "Authorization: Bearer $RIST_API_KEY"
Приклад відповіді · 200
{
  "statusCode": 200,
  "message": "Operation completed successfully",
  "data": …
}
GET

List student discounts

/api/student/discount

Discounts of one student (pass studentId), including what they apply to and their validity.

list_student_discounts

Параметри запиту · 1

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

Відповідь · 200

application/json

statusCodenumberобовʼязковийприклад 200
messagestringобовʼязковий—
dataanyПоля data ще не описані.
Помилки400401403429500
curl "https://your-school.rist.pro/api/student/discount?studentId=1" \
  -H "Authorization: Bearer $RIST_API_KEY"
Приклад відповіді · 200
{
  "statusCode": 200,
  "message": "Operation completed successfully",
  "data": …
}
POST

Sell subscription to student

/api/student/subscription

Attach a subscription (prepaid lesson package from GET /api/subscription) to a student, limited to the given subjects and lesson types. Affects what lessons are charged from; confirm with the user first.

create_student_subscription

Тіло запиту

application/json · object

studentIdnumberобовʼязковиймін. 1
subscriptionIdnumberобовʼязковиймін. 1
typeOfBillstringобовʼязковийОдне з: SEPARATE BURNED
typeOfLessonIdsnumber[]обовʼязковиймін. 1 · елементів мін. 1
subjectIdsnumber[]обовʼязковиймін. 1 · елементів мін. 1
dateStartstringобовʼязковийможе бути null—
dateEndstringобовʼязковийможе бути null—
notestringобовʼязковийможе бути nullдовжина макс. 1500
giftLessonsnumberGift lessons this subscription grants, on top of the tariff's lessons. A plan, not a remainder: used ones are counted from charges, so editing it later does not rewrite the past.0–999
giftPlacementstringОдне з: SUFFICIENT_BALANCE INSUFFICIENT_BALANCE
customFieldsobjectдовільні ключі

Відповідь · 201

application/json

statusCodenumberобовʼязковийприклад 201
messagestringобовʼязковий—
dataobject—
Помилки400401403429500
curl -X POST "https://your-school.rist.pro/api/student/subscription" \
  -H "Authorization: Bearer $RIST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "studentId": 1,
    "subscriptionId": 1,
    "typeOfBill": "SEPARATE",
    "typeOfLessonIds": [
      1
    ],
    "subjectIds": [
      1
    ],
    "dateStart": "string",
    "dateEnd": "string",
    "note": "string",
    "giftLessons": 0,
    "giftPlacement": "SUFFICIENT_BALANCE",
    "customFields": {}
  }'
Приклад відповіді · 201
{
  "statusCode": 201,
  "message": "Operation completed successfully",
  "data": {}
}
PATCH

Edit student subscription

/api/student/subscription/{id}

Rewrite a student subscription. Send the full body as in POST /api/student/subscription, not only changed fields. There is no archive action: a subscription is archived once dateEnd has passed, so archive or restore it by changing dateEnd. Affects charges and balances; confirm with the user first.

update_student_subscription

Параметри шляху · 1

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

Тіло запиту

application/json · object

studentIdnumberобовʼязковиймін. 1
subscriptionIdnumberобовʼязковиймін. 1
typeOfBillstringобовʼязковийОдне з: SEPARATE BURNED
typeOfLessonIdsnumber[]обовʼязковиймін. 1 · елементів мін. 1
subjectIdsnumber[]обовʼязковиймін. 1 · елементів мін. 1
dateStartstringобовʼязковийможе бути null—
dateEndstringобовʼязковийможе бути null—
notestringобовʼязковийможе бути nullдовжина макс. 1500
giftLessonsnumberGift lessons this subscription grants, on top of the tariff's lessons. A plan, not a remainder: used ones are counted from charges, so editing it later does not rewrite the past.0–999
giftPlacementstringОдне з: SUFFICIENT_BALANCE INSUFFICIENT_BALANCE
customFieldsobjectдовільні ключі

Відповідь · 200

application/json

statusCodenumberобовʼязковийприклад 200
messagestringобовʼязковий—
dataobject—
Помилки400401403429500
curl -X PATCH "https://your-school.rist.pro/api/student/subscription/1" \
  -H "Authorization: Bearer $RIST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "studentId": 1,
    "subscriptionId": 1,
    "typeOfBill": "SEPARATE",
    "typeOfLessonIds": [
      1
    ],
    "subjectIds": [
      1
    ],
    "dateStart": "string",
    "dateEnd": "string",
    "note": "string",
    "giftLessons": 0,
    "giftPlacement": "SUFFICIENT_BALANCE",
    "customFields": {}
  }'
Приклад відповіді · 200
{
  "statusCode": 200,
  "message": "Operation completed successfully",
  "data": {}
}
PATCH

Add gift lessons

/api/student/subscription/gift-lessons/{id}

Add free lessons to a student subscription: giftLessons is how many to add, not the new total, so every call adds more. Not for the base or cashback bills. Confirm with the user first.

add_gift_lessons

Параметри шляху · 1

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

Тіло запиту

application/json · object

giftLessonsnumberобовʼязковий1–999

Відповідь · 200

application/json

statusCodenumberобовʼязковийприклад 200
messagestringобовʼязковий—
dataobject—
Помилки400401403429500
curl -X PATCH "https://your-school.rist.pro/api/student/subscription/gift-lessons/1" \
  -H "Authorization: Bearer $RIST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "giftLessons": 1
  }'
Приклад відповіді · 200
{
  "statusCode": 200,
  "message": "Operation completed successfully",
  "data": {}
}