Membership Plans API
Membership Plans
This document describes the query operations available for membership plans in the Teachify Admin API.
Overview
Membership plans define the subscription options available to students in your school. Each plan has specific features, pricing, and duration settings.
Available Queries
The API provides the following membership plan-related query:
membershipPlans
- Returns a paginated list of membership plans
Query Details
membershipPlans
Returns a paginated list of membership plans for the authenticated school.
Parameters
Parameter | Type | Description |
---|---|---|
subdomain | String! | School’s subdomain |
filter | AdminMembershipPlanFilter | Filter criteria (see Filtering) |
page | Int | Page number for pagination |
perPage | Int | Number of items per page (default: 20, maximum: 50) |
limit | Int | Alternative to perPage |
Returns
Returns a MembershipPlanPage
object with:
nodes
- Array of membership plan objectscurrentPage
- Current page numberhasNextPage
- Whether there is a next pagehasPreviousPage
- Whether there is a previous pagenodesCount
- Total number of membership plans matching the filter
Example
query { membershipPlans( subdomain: "myschool", filter: { active: true }, page: 1, perPage: 10 ) { nodes { id name description amount currency currencySymbol intervalCount interval planType recurring courses { id name } createdAt } currentPage hasNextPage hasPreviousPage nodesCount }}
Types
MembershipPlan
Field | Type | Description |
---|---|---|
id | String! | Unique identifier for the membership plan |
name | String! | Name of the membership plan |
description | String | Description of the membership plan |
amount | Float! | Price of the membership plan |
currency | String! | Currency code (e.g., USD, EUR) in ISO 4217 format |
currencySymbol | String! | Currency symbol (e.g., $, €, £, ¥) |
interval | String | Billing interval (month, year, day) |
intervalCount | Int | Number of intervals (e.g., 1, 3, 6) |
planType | String! | Plan type (recurring, fixed_date, specific_length) |
recurring | Boolean! | Whether the plan is recurring |
maxIntervalCount | Int | Maximum number of intervals for subscription |
isPurchased | Boolean! | Whether the user has joined this plan |
courses | [Course!]! | Courses included in this plan |
coverPhoto | String | URL to the plan’s cover photo |
slug | String! | URL-friendly identifier |
quantity | Int | Available quantity |
soldItemsCount | Int | Number of sold items |
remainingItemsCount | Int | Number of remaining items |
body | String | Additional content |
endedAt | Int | When the plan ends (Unix timestamp) |
faqSections | [FaqSection!] | FAQ sections for this plan |
Filtering
The membershipPlans
query accepts a filter
parameter of type AdminMembershipPlanFilter
:
input AdminMembershipPlanFilter { id: StringOperator active: Boolean visible: Boolean}
Field | Description |
---|---|
id | Filter by ID with string operations |
active | Filter by active status |
visible | Filter by visibility |
Example with Filtering
query { membershipPlans( subdomain: "myschool", filter: { active: true, visible: true }, page: 1, perPage: 10 ) { nodes { id name amount currency } nodesCount }}