Student subscriptions
Students and customers · 5 operations
Get student subscriptions and balance
/api/student/subscriptionSubscriptions (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
Query parameters · 1
studentId—Response · 200
application/json
curl "https://your-school.rist.pro/api/student/subscription?studentId=1" \
-H "Authorization: Bearer $RIST_API_KEY"const response = await fetch("https://your-school.rist.pro/api/student/subscription?studentId=1", {
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/student/subscription",
headers={"Authorization": f"Bearer {os.environ['RIST_API_KEY']}"},
params={
"studentId": 1
},
)
response.raise_for_status()
data = response.json()["data"]{
"statusCode": 200,
"message": "Operation completed successfully",
"data": …
}List student discounts
/api/student/discountDiscounts of one student (pass studentId), including what they apply to and their validity.
list_student_discounts
Query parameters · 1
studentId—Response · 200
application/json
curl "https://your-school.rist.pro/api/student/discount?studentId=1" \
-H "Authorization: Bearer $RIST_API_KEY"const response = await fetch("https://your-school.rist.pro/api/student/discount?studentId=1", {
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/student/discount",
headers={"Authorization": f"Bearer {os.environ['RIST_API_KEY']}"},
params={
"studentId": 1
},
)
response.raise_for_status()
data = response.json()["data"]{
"statusCode": 200,
"message": "Operation completed successfully",
"data": …
}Sell subscription to student
/api/student/subscriptionAttach 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
Request body
application/json · object
studentIdmin 1subscriptionIdmin 1typeOfBillOne of: SEPARATE BURNEDtypeOfLessonIdsmin 1 · items min 1subjectIdsmin 1 · items min 1dateStart—dateEnd—notelength max 1500giftLessonsGift 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–999giftPlacementOne of: SUFFICIENT_BALANCE INSUFFICIENT_BALANCEcustomFieldsany keysResponse · 201
application/json
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": {}
}'const response = await fetch("https://your-school.rist.pro/api/student/subscription", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.RIST_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"studentId": 1,
"subscriptionId": 1,
"typeOfBill": "SEPARATE",
"typeOfLessonIds": [
1
],
"subjectIds": [
1
],
"dateStart": "string",
"dateEnd": "string",
"note": "string",
"giftLessons": 0,
"giftPlacement": "SUFFICIENT_BALANCE",
"customFields": {}
}),
});
const { data } = await response.json();import os
import requests
response = requests.post(
"https://your-school.rist.pro/api/student/subscription",
headers={"Authorization": f"Bearer {os.environ['RIST_API_KEY']}"},
json={
"studentId": 1,
"subscriptionId": 1,
"typeOfBill": "SEPARATE",
"typeOfLessonIds": [
1
],
"subjectIds": [
1
],
"dateStart": "string",
"dateEnd": "string",
"note": "string",
"giftLessons": 0,
"giftPlacement": "SUFFICIENT_BALANCE",
"customFields": {}
},
)
response.raise_for_status()
data = response.json()["data"]{
"statusCode": 201,
"message": "Operation completed successfully",
"data": {}
}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
Path parameters · 1
id—Request body
application/json · object
studentIdmin 1subscriptionIdmin 1typeOfBillOne of: SEPARATE BURNEDtypeOfLessonIdsmin 1 · items min 1subjectIdsmin 1 · items min 1dateStart—dateEnd—notelength max 1500giftLessonsGift 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–999giftPlacementOne of: SUFFICIENT_BALANCE INSUFFICIENT_BALANCEcustomFieldsany keysResponse · 200
application/json
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": {}
}'const response = await fetch("https://your-school.rist.pro/api/student/subscription/1", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.RIST_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"studentId": 1,
"subscriptionId": 1,
"typeOfBill": "SEPARATE",
"typeOfLessonIds": [
1
],
"subjectIds": [
1
],
"dateStart": "string",
"dateEnd": "string",
"note": "string",
"giftLessons": 0,
"giftPlacement": "SUFFICIENT_BALANCE",
"customFields": {}
}),
});
const { data } = await response.json();import os
import requests
response = requests.patch(
"https://your-school.rist.pro/api/student/subscription/1",
headers={"Authorization": f"Bearer {os.environ['RIST_API_KEY']}"},
json={
"studentId": 1,
"subscriptionId": 1,
"typeOfBill": "SEPARATE",
"typeOfLessonIds": [
1
],
"subjectIds": [
1
],
"dateStart": "string",
"dateEnd": "string",
"note": "string",
"giftLessons": 0,
"giftPlacement": "SUFFICIENT_BALANCE",
"customFields": {}
},
)
response.raise_for_status()
data = response.json()["data"]{
"statusCode": 200,
"message": "Operation completed successfully",
"data": {}
}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
Path parameters · 1
id—Request body
application/json · object
giftLessons1–999Response · 200
application/json
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
}'const response = await fetch("https://your-school.rist.pro/api/student/subscription/gift-lessons/1", {
method: "PATCH",
headers: {
Authorization: `Bearer ${process.env.RIST_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"giftLessons": 1
}),
});
const { data } = await response.json();import os
import requests
response = requests.patch(
"https://your-school.rist.pro/api/student/subscription/gift-lessons/1",
headers={"Authorization": f"Bearer {os.environ['RIST_API_KEY']}"},
json={
"giftLessons": 1
},
)
response.raise_for_status()
data = response.json()["data"]{
"statusCode": 200,
"message": "Operation completed successfully",
"data": {}
}