diff --git a/b2b/urls.py b/b2b/urls.py index 53ca111581..b14c28a95b 100644 --- a/b2b/urls.py +++ b/b2b/urls.py @@ -1,9 +1,4 @@ """URL routing for the B2B API.""" -from django.urls import include, re_path - -import b2b.views.v0.urls as urls_v0 - -urlpatterns = [ - re_path(r"^api/v0/b2b/", include((urls_v0, "v0"))), -] +# moved to main.urls.v0 +urlpatterns = [] diff --git a/cms/urls.py b/cms/urls.py index 8e8c289ce0..7196a914e8 100644 --- a/cms/urls.py +++ b/cms/urls.py @@ -20,6 +20,8 @@ detail_path_char_pattern = r"\w\-\.+:" +app_name = "cms" + if WAGTAIL_APPEND_SLASH: custom_serve_pattern = ( rf"^({COURSE_INDEX_SLUG}/(?:[{detail_path_char_pattern}]+/)*)$" diff --git a/cms/wagtail_api/urls.py b/cms/wagtail_api/router.py similarity index 100% rename from cms/wagtail_api/urls.py rename to cms/wagtail_api/router.py diff --git a/cms/wagtail_api/schema.py b/cms/wagtail_api/schema.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/cms/wagtail_api/schema/serializers.py b/cms/wagtail_api/schema/serializers.py index 62d8660a4f..9a27ea36ab 100644 --- a/cms/wagtail_api/schema/serializers.py +++ b/cms/wagtail_api/schema/serializers.py @@ -105,33 +105,6 @@ class PageMetaSerializer(serializers.Serializer): last_published_at = serializers.DateTimeField(allow_null=True) -class PageSerializer(serializers.Serializer): - """ - Serializer for individual Wagtail pages. - """ - - id = serializers.IntegerField() - title = serializers.CharField() - meta = PageMetaSerializer() - - -class PageListMetaSerializer(serializers.Serializer): - """ - Serializer for metadata of a list of Wagtail pages. - """ - - total_count = serializers.IntegerField() - - -class PageListSerializer(serializers.Serializer): - """ - Serializer for a list of Wagtail pages. - """ - - meta = PageListMetaSerializer() - items = PageSerializer(many=True) - - class CertificatePageSerializer(serializers.Serializer): """ Serializer for certificate pages, including overrides and signatory items. @@ -146,15 +119,6 @@ class CertificatePageSerializer(serializers.Serializer): signatory_items = SignatoryItemSerializer(many=True) -class CertificatePageListSerializer(serializers.Serializer): - """ - Serializer for a list of certificate pages. - """ - - meta = PageListMetaSerializer() - items = CertificatePageSerializer(many=True) - - class CoursePageItemSerializer(serializers.ModelSerializer): """ Serializer for individual course page items, including all relevant fields. @@ -204,15 +168,6 @@ class Meta: topic_list = TopicSerializer(many=True) -class CoursePageListSerializer(serializers.Serializer): - """ - Serializer for a list of course pages, including metadata and items. - """ - - meta = PageListMetaSerializer() - items = CoursePageItemSerializer(many=True) - - class ProgramPageItemSerializer(serializers.ModelSerializer): """ Serializer for individual program page items, including all relevant fields. @@ -267,10 +222,28 @@ def get_description(self, instance): program_details = ProgramSerializer() -class ProgramPageListSerializer(serializers.Serializer): +class PageSerializer(serializers.Serializer): + """ + Serializer for individual Wagtail pages. + """ + + id = serializers.IntegerField() + title = serializers.CharField() + meta = PageMetaSerializer() + + +class PageListMetaSerializer(serializers.Serializer): """ - Serializer for a list of program pages, including metadata and items. + Serializer for metadata of a list of Wagtail pages. + """ + + total_count = serializers.IntegerField() + + +class PageListSerializer(serializers.Serializer): + """ + Serializer for a list of Wagtail pages. """ meta = PageListMetaSerializer() - items = ProgramPageItemSerializer(many=True) + items = PageSerializer(many=True) diff --git a/cms/wagtail_api/schema/views.py b/cms/wagtail_api/schema/views.py index 75f0005e2a..c88942d7d8 100644 --- a/cms/wagtail_api/schema/views.py +++ b/cms/wagtail_api/schema/views.py @@ -2,16 +2,16 @@ Views for Wagtail API Schema """ -from drf_spectacular.utils import OpenApiParameter, OpenApiResponse, extend_schema -from rest_framework.response import Response -from rest_framework.views import APIView - -from .serializers import ( +from cms.wagtail_apit.schema.serializers import ( CertificatePageListSerializer, CoursePageListSerializer, PageListSerializer, ProgramPageListSerializer, ) +from drf_spectacular.utils import OpenApiParameter, OpenApiResponse, extend_schema +from main.versioning import V2Versioning +from rest_framework.response import Response +from rest_framework.views import APIView class WagtailPagesSchemaView(APIView): @@ -19,6 +19,8 @@ class WagtailPagesSchemaView(APIView): View for listing all Wagtail pages with schema documentation. """ + versioning_class = V2Versioning + @extend_schema( summary="List all Wagtail Pages", description="Returns pages of all types", @@ -56,6 +58,8 @@ class WagtailCertificatePagesSchemaView(APIView): View for listing all Certificate Pages with schema documentation. """ + versioning_class = V2Versioning + @extend_schema( summary="List all Certificate Pages", description="Returns pages of type cms.CertificatePage", @@ -78,6 +82,8 @@ class WagtailCoursePagesSchemaView(APIView): View for listing all Course Pages with schema documentation. """ + versioning_class = V2Versioning + @extend_schema( summary="List all Course Pages", description="Returns pages of type cms.CoursePage", @@ -108,6 +114,8 @@ class WagtailProgramPagesSchemaView(APIView): View for listing all Program Pages with schema documentation. """ + versioning_class = V2Versioning + @extend_schema( summary="List all Program Pages", description="Returns pages of type cms.ProgramPage", @@ -138,6 +146,8 @@ class WagtailPagesRetrieveSchemaView(APIView): View for retrieving details of a specific Wagtail page with schema documentation. """ + versioning_class = V2Versioning + @extend_schema( summary="Get Wagtail Page Details", description="Returns details of a specific Wagtail page by ID", diff --git a/cms/wagtail_api/views.py b/cms/wagtail_api/views.py index 450aa078dc..d409bfeb36 100644 --- a/cms/wagtail_api/views.py +++ b/cms/wagtail_api/views.py @@ -5,6 +5,7 @@ from enum import Enum from django.db.models import F +from drf_spectacular.utils import extend_schema, extend_schema_view from rest_framework.permissions import AllowAny, IsAuthenticated from rest_framework.response import Response from wagtail.api.v2.views import PagesAPIViewSet @@ -33,6 +34,61 @@ def anonymous_access_allowed_types(cls): return [cls.COURSE.value, cls.PROGRAM.value, cls.CERTIFICATE.value] +@extend_schema_view( + list=extend_schema( + summary="List all Wagtail Pages", + description="Returns pages of all types", + operation_id="pages_list", + parameters=[ + OpenApiParameter( + name="type", + required=False, + type=str, + description="Filter by Wagtail page type", + ), + OpenApiParameter( + name="fields", + required=False, + type=str, + description="Specify fields (e.g. `*`)", + ), + ], + responses=PageListSerializer, + ), + retreive=extend_schema( + summary="Get Wagtail Page Details", + description="Returns details of a specific Wagtail page by ID", + operation_id="pages_retrieve", + parameters=[ + OpenApiParameter( + name="id", + type=int, + location=OpenApiParameter.PATH, + required=True, + description="ID of the Wagtail page", + ), + OpenApiParameter( + name="revision_id", + required=False, + type=int, + description="Optional certificate revision ID to retrieve a specific revision of the certificate page", + ), + ], + responses={ + 200: OpenApiResponse( + response={ + "oneOf": [ + {"$ref": "#/components/schemas/CoursePageItem"}, + {"$ref": "#/components/schemas/ProgramPageItem"}, + {"$ref": "#/components/schemas/CertificatePage"}, + {"$ref": "#/components/schemas/Page"}, + ] + }, + description="Returns a page of any known Wagtail page type", + ) + }, + ), +) class WagtailPagesAPIViewSet(PagesAPIViewSet): """ Custom API viewset for Wagtail pages with diff --git a/courses/urls/__init__.py b/courses/urls/__init__.py index 1abba248cd..fbf1611d36 100644 --- a/courses/urls/__init__.py +++ b/courses/urls/__init__.py @@ -1,21 +1,14 @@ """Course API URL routes""" -from django.urls import include, path +from django.urls import path from rest_framework import routers -import courses.urls.v1.urls as urls_v1 -import courses.urls.v2.urls as urls_v2 from courses.views import v1 router = routers.SimpleRouter() urlpatterns = [ - path("api/v1/", include(urls_v1, "v1")), - path("api/v2/", include(urls_v2, "v2")), -] - -urlpatterns += [ path( "api/records/program//share/", v1.LearnerRecordShareView.as_view(), @@ -36,9 +29,6 @@ v1.LearnerRecordFromUUIDView.as_view(), name="shared_learner_record_from_uuid", ), -] - -urlpatterns += [ path( "enrollments/", v1.CreateEnrollmentView.as_view(), diff --git a/ecommerce/urls.py b/ecommerce/urls.py index 34b3b14c76..e57acf5521 100644 --- a/ecommerce/urls.py +++ b/ecommerce/urls.py @@ -21,7 +21,6 @@ ProductViewSet, UserDiscountViewSet, ) -from ecommerce.views.v0.urls import urlpatterns as v0_urls from main.routers import SimpleRouterWithNesting router = SimpleRouterWithNesting() @@ -74,7 +73,6 @@ ) urlpatterns = [ - path("api/v0/", include((v0_urls, "v0"))), path("api/", include(router.urls)), re_path( "checkout/to_payment", diff --git a/ecommerce/views/v0/urls.py b/ecommerce/views/v0/urls.py index 3e6eb069b8..6b1dbf09b4 100644 --- a/ecommerce/views/v0/urls.py +++ b/ecommerce/views/v0/urls.py @@ -65,6 +65,8 @@ parents_query_lookups=["discount"], ) +app_name = "ecommerce" + urlpatterns = [ path( "baskets/create_from_product//", diff --git a/main/settings.py b/main/settings.py index c6a610c85d..025bf09f92 100644 --- a/main/settings.py +++ b/main/settings.py @@ -1102,7 +1102,7 @@ "DEFAULT_PERMISSION_CLASSES": ("rest_framework.permissions.IsAuthenticated",), "EXCEPTION_HANDLER": "main.exceptions.exception_handler", "TEST_REQUEST_DEFAULT_FORMAT": "json", - "DEFAULT_VERSIONING": "rest_framework.versioning.NamespaceVersioning", + "DEFAULT_VERSIONING_CLASS": "rest_framework.versioning.NamespaceVersioning", "DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema", "ALLOWED_VERSIONS": ["v0", "v1", "v2"], "DEFAULT_RENDERER_CLASSES": ("rest_framework.renderers.JSONRenderer",) diff --git a/main/urls.py b/main/urls/__init__.py similarity index 98% rename from main/urls.py rename to main/urls/__init__.py index 339d9d27a8..b9020bbd46 100644 --- a/main/urls.py +++ b/main/urls/__init__.py @@ -25,7 +25,7 @@ from wagtail.documents import urls as wagtaildocs_urls from cms.views import instructor_page -from cms.wagtail_api.urls import api_router as wagtail_api_router +from cms.wagtail_api.router import api_router as wagtail_api_router from main.views import ( cms_signin_redirect_to_site_signin, index, diff --git a/main/urls/v0.py b/main/urls/v0.py new file mode 100644 index 0000000000..e9b8790ae8 --- /dev/null +++ b/main/urls/v0.py @@ -0,0 +1,8 @@ +from django.urls import include, path + +app_name = "v0" + +urlpatterns = [ + path("b2b/", include("b2b.views.v0.urls")), + path("", include("ecommerce.views.v0.urls")), +] diff --git a/main/urls/v1.py b/main/urls/v1.py new file mode 100644 index 0000000000..50641aab0e --- /dev/null +++ b/main/urls/v1.py @@ -0,0 +1,5 @@ +from django.urls import include, path + +app_name = "v1" + +urlpatterns = [path("", include("courses.urls.v1.urls"))] diff --git a/main/urls/v2.py b/main/urls/v2.py new file mode 100644 index 0000000000..937edfe772 --- /dev/null +++ b/main/urls/v2.py @@ -0,0 +1,7 @@ +from django.urls import include, path + +app_name = "v2" + +urlpatterns = [ + path("", include("courses.urls.v2.urls")), +] diff --git a/openapi/hooks.py b/openapi/hooks.py index e948b157e9..d6c581d43a 100644 --- a/openapi/hooks.py +++ b/openapi/hooks.py @@ -102,7 +102,6 @@ def exclude_paths_hook(endpoints, **kwargs): # noqa: ARG001 "/api/checkout/", "/api/instructor/", "/api/v0/checkout/", - "/api/v2/pages/", "/api/v2/images/", "/api/v2/documents/", ] @@ -113,86 +112,3 @@ def exclude_paths_hook(endpoints, **kwargs): # noqa: ARG001 for (path, path_regex, method, callback) in endpoints if not any(path.startswith(prefix) for prefix in EXCLUDED_PATHS) ] - - -def insert_wagtail_pages_schema(endpoints): - """ - Insert Wagtail pages schema into the OpenAPI endpoints. - """ - - from cms.wagtail_api.schema.views import ( # noqa: PLC0415 - WagtailCertificatePagesSchemaView, - WagtailCoursePagesSchemaView, - WagtailPagesRetrieveSchemaView, - WagtailPagesSchemaView, - WagtailProgramPagesSchemaView, - ) - - class WrappedPagesView(WagtailPagesSchemaView): - pass - - class WrappedCertificateView(WagtailCertificatePagesSchemaView): - pass - - class WrappedCourseView(WagtailCoursePagesSchemaView): - pass - - class WrappedProgramView(WagtailProgramPagesSchemaView): - pass - - class WrappedPagesRetrieveView(WagtailPagesRetrieveSchemaView): - pass - - pages_view = WrappedPagesView.as_view() - certificate_view = WrappedCertificateView.as_view() - course_view = WrappedCourseView.as_view() - program_view = WrappedProgramView.as_view() - retrieve_view = WrappedPagesRetrieveView.as_view() - - # manually attach the class for schema inspection - pages_view.cls = WrappedPagesView - certificate_view.cls = WrappedCertificateView - course_view.cls = WrappedCourseView - program_view.cls = WrappedProgramView - retrieve_view.cls = WrappedPagesRetrieveView - endpoints.append( - ( - "/api/v2/pages/", - "^api/v2/pages/$", - "GET", - pages_view, - ) - ) - endpoints.append( - ( - "/api/v2/pages/?fields=*&type=cms.certificatepage", - "^api/v2/pages/?fields=*&type=cms.certificatepage$", - "GET", - certificate_view, - ) - ) - endpoints.append( - ( - "/api/v2/pages/?fields=*&type=cms.coursepage", - "^api/v2/pages/?fields=*&type=cms.coursepage$", - "GET", - course_view, - ) - ) - endpoints.append( - ( - "/api/v2/pages/?fields=*&type=cms.programpage", - "^api/v2/pages/?fields=*&type=cms.programpage$", - "GET", - program_view, - ) - ) - endpoints.append( - ( - "/api/v2/pages/{id}/", - "^api/v2/pages/(?P[0-9]+)/$", - "GET", - retrieve_view, - ) - ) - return endpoints diff --git a/openapi/settings_spectacular.py b/openapi/settings_spectacular.py index 5777510af2..717ac9641c 100644 --- a/openapi/settings_spectacular.py +++ b/openapi/settings_spectacular.py @@ -18,6 +18,5 @@ ], "PREPROCESSING_HOOKS": [ "openapi.hooks.exclude_paths_hook", - "openapi.hooks.insert_wagtail_pages_schema", ], } diff --git a/openapi/specs/v0.yaml b/openapi/specs/v0.yaml index 11b98c89ec..ac380119e6 100644 --- a/openapi/specs/v0.yaml +++ b/openapi/specs/v0.yaml @@ -3,7939 +3,5 @@ info: title: MITx Online API version: 0.0.1 (v0) description: MIT public API -paths: - /api/records/program/{id}/: - get: - operationId: learner_record_retrieve_by_id - description: Get learner record using program ID - parameters: - - in: path - name: id - schema: - type: integer - required: true - tags: - - api - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/LearnerRecord' - description: '' - /api/records/program/{id}/revoke/: - post: - operationId: api_records_program_revoke_create - description: |- - Disables sharing links for the learner's record. This only applies to the - anonymous ones; shares sent to partner schools are always allowed once they - are sent. - parameters: - - in: path - name: id - schema: - type: integer - required: true - tags: - - api - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/LearnerRecord' - description: '' - /api/records/program/{id}/share/: - post: - operationId: api_records_program_share_create - description: |- - Sets up a sharing link for the learner's record. Returns back the entire - learner record. - parameters: - - in: path - name: id - schema: - type: integer - required: true - tags: - - api - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PartnerSchoolRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PartnerSchoolRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PartnerSchoolRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/LearnerRecord' - description: '' - /api/records/shared/{uuid}/: - get: - operationId: learner_record_retrieve_by_uuid - description: Get learner record using share UUID - parameters: - - in: path - name: uuid - schema: - type: string - format: uuid - required: true - tags: - - api - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/LearnerRecord' - description: '' - /api/v0/b2b/attach/{enrollment_code}/: - post: - operationId: b2b_attach_create - description: |- - Use the provided enrollment code to attach the user to a B2B contract. - - This will not create an order, nor will it enroll the user. It will - attach the user to the contract and log that the code was used for this - purpose (but will _not_ invalidate the code, since we're not actually - using it at this point). - - This will respect the activation and expiration dates (of both the contract - and the discount), and will make sure there's sufficient available seats - in the contract. It will also make sure the code hasn't been used for - attachment purposes before. - - If the user is already in the contract, then we skip it. - - Returns: - - 201: Code successfully redeemed and user attached to new contract(s) - - 200: Code valid but user already attached to all associated contracts - - 404: Invalid or expired enrollment code - - list of ContractPageSerializer - the contracts for the user - parameters: - - in: path - name: enrollment_code - schema: - type: string - required: true - tags: - - b2b - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ContractPage' - description: '' - /api/v0/b2b/contracts/: - get: - operationId: b2b_contracts_list - description: Viewset for the ContractPage model. - tags: - - b2b - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ContractPage' - description: '' - /api/v0/b2b/contracts/{contract_slug}/: - get: - operationId: b2b_contracts_retrieve - description: Viewset for the ContractPage model. - parameters: - - in: path - name: contract_slug - schema: - type: string - description: The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/ - required: true - tags: - - b2b - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ContractPage' - description: '' - /api/v0/b2b/enroll/{readable_id}/: - post: - operationId: b2b_enroll_create - description: Create an enrollment for the given course run. - parameters: - - in: path - name: readable_id - schema: - type: string - required: true - tags: - - b2b - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CreateB2BEnrollment' - description: '' - /api/v0/b2b/organizations/: - get: - operationId: b2b_organizations_list - description: Viewset for the OrganizationPage model. - tags: - - b2b - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/OrganizationPage' - description: '' - /api/v0/b2b/organizations/{organization_slug}/: - get: - operationId: b2b_organizations_retrieve - description: Viewset for the OrganizationPage model. - parameters: - - in: path - name: organization_slug - schema: - type: string - description: The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/ - required: true - tags: - - b2b - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/OrganizationPage' - description: '' - /api/v0/baskets/: - get: - operationId: baskets_list - description: Retrives the current user's baskets. - tags: - - baskets - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/BasketWithProduct' - description: '' - /api/v0/baskets/{parent_lookup_basket}/items/: - get: - operationId: baskets_items_list - description: Returns the basket items for the current user. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the basket item - required: true - - in: path - name: parent_lookup_basket - schema: - type: integer - description: ID of the parent basket - required: true - tags: - - baskets - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/BasketItem' - description: '' - post: - operationId: baskets_items_create - description: Returns the basket items for the current user. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the basket item - required: true - - in: path - name: parent_lookup_basket - schema: - type: integer - description: ID of the parent basket - required: true - tags: - - baskets - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/BasketItem' - description: '' - /api/v0/baskets/{parent_lookup_basket}/items/{id}/: - get: - operationId: baskets_items_retrieve - description: Returns the basket items for the current user. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the basket item - required: true - - in: path - name: parent_lookup_basket - schema: - type: integer - description: ID of the parent basket - required: true - tags: - - baskets - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BasketItem' - description: '' - put: - operationId: baskets_items_update - description: Returns the basket items for the current user. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the basket item - required: true - - in: path - name: parent_lookup_basket - schema: - type: integer - description: ID of the parent basket - required: true - tags: - - baskets - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BasketItem' - description: '' - patch: - operationId: baskets_items_partial_update - description: Returns the basket items for the current user. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the basket item - required: true - - in: path - name: parent_lookup_basket - schema: - type: integer - description: ID of the parent basket - required: true - tags: - - baskets - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BasketItem' - description: '' - delete: - operationId: baskets_items_destroy - description: Returns the basket items for the current user. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the basket item - required: true - - in: path - name: parent_lookup_basket - schema: - type: integer - description: ID of the parent basket - required: true - tags: - - baskets - responses: - '204': - description: No response body - /api/v0/baskets/{id}/: - get: - operationId: baskets_retrieve - description: Retrieve a basket for the current user. - parameters: - - in: path - name: id - schema: - type: integer - required: true - tags: - - baskets - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BasketWithProduct' - description: '' - /api/v0/baskets/add_discount/: - post: - operationId: baskets_add_discount_create - description: Creates or updates a basket for the current user, adding the discount - if valid. - parameters: - - in: query - name: discount_code - schema: - type: string - required: true - tags: - - baskets - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BasketWithProduct' - description: '' - /api/v0/baskets/checkout/: - get: - operationId: baskets_checkout_retrieve - description: Returns the payload necessary to redirect the user to CyberSource - for payment. - tags: - - baskets - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CheckoutPayload' - description: '' - /api/v0/baskets/clear/: - delete: - operationId: baskets_clear_destroy - description: Clears the basket for the current user. - tags: - - baskets - responses: - '204': - description: Basket cleared successfully - /api/v0/baskets/create_from_product/{product_id}/: - post: - operationId: baskets_create_from_product_create - description: Creates or updates a basket for the current user, adding the selected - product. - parameters: - - in: path - name: product_id - schema: - type: integer - required: true - tags: - - baskets - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BasketWithProduct' - description: '' - /api/v0/baskets/create_from_product/{product_id}/{discount_code}/: - post: - operationId: create_basket_from_product_with_discount - description: Creates or updates a basket for the current user, adding the selected - product and discount. - parameters: - - in: path - name: discount_code - schema: - type: string - required: true - - in: path - name: product_id - schema: - type: integer - required: true - tags: - - baskets - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BasketWithProduct' - description: '' - /api/v0/baskets/create_with_products/: - post: - operationId: baskets_create_with_products_create - description: Creates or updates a basket for the current user, adding the selected - product. - tags: - - baskets - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateBasketWithProductsRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CreateBasketWithProductsRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/CreateBasketWithProductsRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BasketWithProduct' - description: '' - /api/v0/change-emails/: - post: - operationId: change_emails_create - description: Viewset for creating and updating email change requests - tags: - - change-emails - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ChangeEmailRequestCreateRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/ChangeEmailRequestCreateRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/ChangeEmailRequestCreateRequest' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ChangeEmailRequestCreate' - description: '' - /api/v0/change-emails/{code}/: - put: - operationId: change_emails_update - description: Viewset for creating and updating email change requests - parameters: - - in: path - name: code - schema: - type: string - required: true - tags: - - change-emails - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ChangeEmailRequestUpdateRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/ChangeEmailRequestUpdateRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/ChangeEmailRequestUpdateRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ChangeEmailRequestUpdate' - description: '' - patch: - operationId: change_emails_partial_update - description: Viewset for creating and updating email change requests - parameters: - - in: path - name: code - schema: - type: string - required: true - tags: - - change-emails - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedChangeEmailRequestUpdateRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedChangeEmailRequestUpdateRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedChangeEmailRequestUpdateRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ChangeEmailRequestUpdate' - description: '' - /api/v0/countries/: - get: - operationId: countries_list - description: Get generator for countries/states list - tags: - - countries - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Country' - description: '' - /api/v0/discounts/: - get: - operationId: discounts_list - description: API view set for Discounts - parameters: - - in: query - name: is_redeemed - schema: - type: string - enum: - - 'no' - - 'yes' - description: |- - * `yes` - yes - * `no` - no - - name: limit - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: offset - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - - in: query - name: payment_type - schema: - type: string - nullable: true - enum: - - customer-support - - financial-assistance - - legacy - - marketing - - sales - - staff - description: |- - * `marketing` - marketing - * `sales` - sales - * `financial-assistance` - financial-assistance - * `customer-support` - customer-support - * `staff` - staff - * `legacy` - legacy - - in: query - name: q - schema: - type: string - description: q - - in: query - name: redemption_type - schema: - type: string - enum: - - one-time - - one-time-per-user - - unlimited - description: |- - * `one-time` - one-time - * `one-time-per-user` - one-time-per-user - * `unlimited` - unlimited - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedV0DiscountList' - description: '' - post: - operationId: discounts_create - description: API view set for Discounts - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/V0DiscountRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/V0DiscountRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/V0DiscountRequest' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/V0Discount' - description: '' - /api/v0/discounts/{parent_lookup_discount}/assignees/: - get: - operationId: discounts_assignees_list - description: API view set for User Discounts. This one is for use within a Discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - name: limit - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: offset - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedUserDiscountMetaList' - description: '' - post: - operationId: discounts_assignees_create - description: Create an association between a user and a discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UserDiscountMetaRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/UserDiscountMetaRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/UserDiscountMetaRequest' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/UserDiscountMeta' - description: '' - /api/v0/discounts/{parent_lookup_discount}/assignees/{id}/: - get: - operationId: discounts_assignees_retrieve - description: API view set for User Discounts. This one is for use within a Discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/UserDiscountMeta' - description: '' - put: - operationId: discounts_assignees_update - description: API view set for User Discounts. This one is for use within a Discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UserDiscountMetaRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/UserDiscountMetaRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/UserDiscountMetaRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/UserDiscountMeta' - description: '' - patch: - operationId: discounts_assignees_partial_update - description: Partial update for a user discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedUserDiscountMetaRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedUserDiscountMetaRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedUserDiscountMetaRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/UserDiscountMeta' - description: '' - delete: - operationId: discounts_assignees_destroy - description: Delete a user discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '204': - description: No response body - /api/v0/discounts/{parent_lookup_discount}/products/: - get: - operationId: discounts_products_list - description: API view set for Discounts - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the discount product - required: true - - name: limit - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: offset - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedDiscountProductList' - description: '' - post: - operationId: discounts_products_create - description: API view set for Discounts - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the discount product - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountProductRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/DiscountProductRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/DiscountProductRequest' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountProduct' - description: '' - /api/v0/discounts/{parent_lookup_discount}/products/{id}/: - get: - operationId: discounts_products_retrieve - description: API view set for Discounts - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the discount product - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountProduct' - description: '' - put: - operationId: discounts_products_update - description: API view set for Discounts - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the discount product - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountProductRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/DiscountProductRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/DiscountProductRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountProduct' - description: '' - patch: - operationId: discounts_products_partial_update - description: Partial update for a discount product. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the discount product - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedDiscountProductRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedDiscountProductRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedDiscountProductRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountProduct' - description: '' - delete: - operationId: discounts_products_destroy - description: Delete a linked product from a discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the discount product - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '204': - description: No response body - /api/v0/discounts/{parent_lookup_discount}/tiers/: - get: - operationId: discounts_tiers_list - description: API view set for Flexible Pricing Tiers. This one is for use within - a Discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - name: limit - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: offset - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedFlexiblePriceTierList' - description: '' - post: - operationId: discounts_tiers_create - description: API view set for Flexible Pricing Tiers. This one is for use within - a Discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FlexiblePriceTierRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/FlexiblePriceTierRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/FlexiblePriceTierRequest' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/FlexiblePriceTier' - description: '' - /api/v0/discounts/{parent_lookup_discount}/tiers/{id}/: - get: - operationId: discounts_tiers_retrieve - description: API view set for Flexible Pricing Tiers. This one is for use within - a Discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/FlexiblePriceTier' - description: '' - put: - operationId: discounts_tiers_update - description: API view set for Flexible Pricing Tiers. This one is for use within - a Discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FlexiblePriceTierRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/FlexiblePriceTierRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/FlexiblePriceTierRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/FlexiblePriceTier' - description: '' - patch: - operationId: discounts_tiers_partial_update - description: API view set for Flexible Pricing Tiers. This one is for use within - a Discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedFlexiblePriceTierRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedFlexiblePriceTierRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedFlexiblePriceTierRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/FlexiblePriceTier' - description: '' - delete: - operationId: discounts_tiers_destroy - description: API view set for Flexible Pricing Tiers. This one is for use within - a Discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '204': - description: No response body - /api/v0/discounts/{parent_lookup_redeemed_discount}/redemptions/: - get: - operationId: discounts_redemptions_list - description: API view set for Discount Redemptions - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - name: limit - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: offset - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - - in: path - name: parent_lookup_redeemed_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedDiscountRedemptionList' - description: '' - post: - operationId: discounts_redemptions_create - description: API view set for Discount Redemptions - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_redeemed_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountRedemptionRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/DiscountRedemptionRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/DiscountRedemptionRequest' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountRedemption' - description: '' - /api/v0/discounts/{parent_lookup_redeemed_discount}/redemptions/{id}/: - get: - operationId: discounts_redemptions_retrieve - description: API view set for Discount Redemptions - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_redeemed_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountRedemption' - description: '' - put: - operationId: discounts_redemptions_update - description: API view set for Discount Redemptions - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_redeemed_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountRedemptionRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/DiscountRedemptionRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/DiscountRedemptionRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountRedemption' - description: '' - patch: - operationId: discounts_redemptions_partial_update - description: API view set for Discount Redemptions - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_redeemed_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedDiscountRedemptionRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedDiscountRedemptionRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedDiscountRedemptionRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountRedemption' - description: '' - delete: - operationId: discounts_redemptions_destroy - description: API view set for Discount Redemptions - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_redeemed_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '204': - description: No response body - /api/v0/discounts/{id}/: - get: - operationId: discounts_retrieve - description: API view set for Discounts - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this discount. - required: true - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V0Discount' - description: '' - put: - operationId: discounts_update - description: API view set for Discounts - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this discount. - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/V0DiscountRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/V0DiscountRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/V0DiscountRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V0Discount' - description: '' - patch: - operationId: discounts_partial_update - description: API view set for Discounts - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this discount. - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedV0DiscountRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedV0DiscountRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedV0DiscountRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V0Discount' - description: '' - delete: - operationId: discounts_destroy - description: API view set for Discounts - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this discount. - required: true - tags: - - discounts - responses: - '204': - description: No response body - /api/v0/discounts/create_batch/: - post: - operationId: discounts_create_batch_create - description: |- - Create a batch of codes. This is used in the staff-dashboard. - POST arguments are the same as in generate_discount_code - look there - for details. - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/V0DiscountRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/V0DiscountRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/V0DiscountRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V0Discount' - description: '' - /api/v0/orders/history/: - get: - operationId: orders_history_list - description: Retrives the current user's order history. - parameters: - - name: limit - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: offset - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - tags: - - orders - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedOrderHistoryList' - description: '' - /api/v0/orders/history/{id}/: - get: - operationId: orders_history_retrieve - description: Retrieve a historical order for the current user. - parameters: - - in: path - name: id - schema: - type: integer - required: true - tags: - - orders - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/OrderHistory' - description: '' - /api/v0/orders/receipt/{id}/: - get: - operationId: orders_receipt_retrieve - description: Viewset to retrieve an order so it can be viewed as a receipt. - parameters: - - in: path - name: id - schema: - type: integer - required: true - tags: - - orders - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Order' - description: '' - /api/v0/products/: - get: - operationId: products_list - description: List and view products within the system. - parameters: - - name: limit - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: offset - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - tags: - - products - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedProductList' - description: '' - /api/v0/products/{id}/: - get: - operationId: products_retrieve - description: List and view products within the system. - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this product. - required: true - tags: - - products - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Product' - description: '' - /api/v0/products/{id}/user_flexible_price/: - get: - operationId: products_user_flexible_price_retrieve - description: Retrieve a product with user-specific flexible price information - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this product. - required: true - tags: - - products - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ProductFlexiblePrice' - description: '' - /api/v0/products/all/: - get: - operationId: products_all_list - description: |- - This doesn't filter unenrollable products out, and adds name search for - courseware object readable id. It's really for the staff dashboard. - parameters: - - name: limit - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: offset - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - tags: - - products - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedProductList' - description: '' - post: - operationId: products_all_create - description: |- - This doesn't filter unenrollable products out, and adds name search for - courseware object readable id. It's really for the staff dashboard. - tags: - - products - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ProductRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/ProductRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/ProductRequest' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/Product' - description: '' - /api/v0/products/all/{id}/: - get: - operationId: products_all_retrieve - description: |- - This doesn't filter unenrollable products out, and adds name search for - courseware object readable id. It's really for the staff dashboard. - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this product. - required: true - tags: - - products - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Product' - description: '' - put: - operationId: products_all_update - description: |- - This doesn't filter unenrollable products out, and adds name search for - courseware object readable id. It's really for the staff dashboard. - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this product. - required: true - tags: - - products - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ProductRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/ProductRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/ProductRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Product' - description: '' - patch: - operationId: products_all_partial_update - description: |- - This doesn't filter unenrollable products out, and adds name search for - courseware object readable id. It's really for the staff dashboard. - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this product. - required: true - tags: - - products - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedProductRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedProductRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedProductRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Product' - description: '' - delete: - operationId: products_all_destroy - description: |- - This doesn't filter unenrollable products out, and adds name search for - courseware object readable id. It's really for the staff dashboard. - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this product. - required: true - tags: - - products - responses: - '204': - description: No response body - /api/v0/user_search/: - get: - operationId: user_search_list - description: |- - Provides an API for listing system users. This is for the staff - dashboard. - parameters: - - name: l - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: o - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - - name: search - required: false - in: query - description: A search term. - schema: - type: string - tags: - - user_search - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedStaffDashboardUserList' - description: '' - /api/v0/user_search/{id}/: - get: - operationId: user_search_retrieve - description: |- - Provides an API for listing system users. This is for the staff - dashboard. - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this user. - required: true - tags: - - user_search - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/StaffDashboardUser' - description: '' - /api/v0/userinfo/: - get: - operationId: userinfo_retrieve - description: |- - Retrieve the current user's info only if they have an edx_username, otherwise return 409 - - This is to prevent issues with Open edX OAuth client that expect an edx_username to be present - tags: - - userinfo - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: '' - /api/v0/users/{id}/: - get: - operationId: users_retrieve - description: User retrieve viewsets - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this user. - required: true - tags: - - users - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PublicUser' - description: '' - /api/v0/users/current_user/: - get: - operationId: users_current_user_retrieve - description: User retrieve and update viewsets for the current user - tags: - - users - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: '' - patch: - operationId: users_current_user_partial_update - description: User retrieve and update viewsets for the current user - tags: - - users - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedUserRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedUserRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedUserRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: '' - /api/v0/users/me: - get: - operationId: users_me_retrieve - description: User retrieve and update viewsets for the current user - tags: - - users - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: '' - patch: - operationId: users_me_partial_update - description: User retrieve and update viewsets for the current user - tags: - - users - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedUserRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedUserRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedUserRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: '' - /api/v1/course_runs/: - get: - operationId: course_runs_list - description: API view set for CourseRuns - parameters: - - in: query - name: id - schema: - type: integer - - in: query - name: live - schema: - type: boolean - tags: - - course_runs - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/V1CourseRunWithCourse' - description: '' - /api/v1/course_runs/{id}/: - get: - operationId: course_runs_retrieve - description: API view set for CourseRuns - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course run. - required: true - tags: - - course_runs - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V1CourseRunWithCourse' - description: '' - /api/v1/courses/: - get: - operationId: api_v1_courses_list - description: List all courses - API v1 - parameters: - - in: query - name: courserun_is_enrollable - schema: - type: boolean - - in: query - name: id - schema: - type: integer - - in: query - name: live - schema: - type: boolean - - name: page - required: false - in: query - description: A page number within the paginated result set. - schema: - type: integer - - in: query - name: page__live - schema: - type: boolean - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: readable_id - schema: - type: string - tags: - - courses - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedV1CourseWithCourseRunsList' - description: '' - /api/v1/courses/{id}/: - get: - operationId: api_v1_courses_retrieve - description: Retrieve a specific course - API v1 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course. - required: true - tags: - - courses - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V1CourseWithCourseRuns' - description: '' - /api/v1/departments/: - get: - operationId: departments_list_v1 - description: List departments - v1 - tags: - - departments - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/DepartmentWithCount' - description: '' - /api/v1/departments/{id}/: - get: - operationId: departments_retrieve_v1 - description: Get department details - v1 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this department. - required: true - tags: - - departments - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DepartmentWithCount' - description: '' - /api/v1/enrollments/: - get: - operationId: enrollments_list - description: API view set for user enrollments - tags: - - enrollments - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/CourseRunEnrollment' - description: '' - post: - operationId: enrollments_create - description: API view set for user enrollments - tags: - - enrollments - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequest' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollment' - description: '' - /api/v1/enrollments/{id}/: - put: - operationId: enrollments_update - description: API view set for user enrollments - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course run enrollment. - required: true - tags: - - enrollments - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollment' - description: '' - patch: - operationId: enrollments_partial_update - description: Update enrollment email preferences - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course run enrollment. - required: true - tags: - - enrollments - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedUpdateCourseRunEnrollmentRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedUpdateCourseRunEnrollmentRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedUpdateCourseRunEnrollmentRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollment' - description: '' - delete: - operationId: enrollments_destroy - description: API view set for user enrollments - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course run enrollment. - required: true - tags: - - enrollments - responses: - '204': - description: No response body - /api/v1/program_enrollments/: - get: - operationId: program_enrollments_list - description: |- - Returns a unified set of program and course enrollments for the current - user. - tags: - - program_enrollments - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/UserProgramEnrollmentDetail' - description: '' - /api/v1/program_enrollments/{id}/: - get: - operationId: program_enrollments_retrieve - description: Retrieve a specific program enrollment. - parameters: - - in: path - name: id - schema: - type: integer - description: Program enrollment ID - required: true - tags: - - program_enrollments - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/UserProgramEnrollmentDetail' - description: '' - delete: - operationId: program_enrollments_destroy - description: |- - Unenroll the user from this program. This is simpler than the corresponding - function for CourseRunEnrollments; edX doesn't really know what programs - are so there's nothing to process there. - parameters: - - in: path - name: id - schema: - type: integer - description: Program enrollment ID - required: true - tags: - - program_enrollments - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/UserProgramEnrollmentDetail' - description: '' - /api/v1/programs/: - get: - operationId: programs_list_v1 - description: List Programs - v1 - parameters: - - in: query - name: id - schema: - type: integer - - in: query - name: live - schema: - type: boolean - - name: page - required: false - in: query - description: A page number within the paginated result set. - schema: - type: integer - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: readable_id - schema: - type: string - tags: - - programs - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedV1ProgramList' - description: '' - /api/v1/programs/{id}/: - get: - operationId: programs_retrieve_v1 - description: API view set for Programs - v1 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this program. - required: true - tags: - - programs - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V1Program' - description: '' - /api/v2/course_certificates/{cert_uuid}/: - get: - operationId: course_certificates_retrieve - description: Get a course certificate by UUID. - parameters: - - in: path - name: cert_uuid - schema: - type: string - format: uuid - required: true - tags: - - course_certificates - security: - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V2CourseRunCertificate' - description: '' - /api/v2/courses/: - get: - operationId: api_v2_courses_list - description: List all courses - API v2 - parameters: - - in: query - name: contract_id - schema: - type: number - description: Only show courses belonging to this B2B contract - - in: query - name: courserun_is_enrollable - schema: - type: boolean - description: Course Run Is Enrollable - - in: query - name: id - schema: - type: array - items: - type: integer - description: Multiple values may be separated by commas. - explode: false - style: form - - in: query - name: include_approved_financial_aid - schema: - type: boolean - description: Include approved financial assistance information - - in: query - name: live - schema: - type: boolean - - in: query - name: org_id - schema: - type: number - description: Only show courses belonging to this B2B/UAI organization - - name: page - required: false - in: query - description: A page number within the paginated result set. - schema: - type: integer - - in: query - name: page__live - schema: - type: boolean - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: readable_id - schema: - type: string - tags: - - courses - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedCourseWithCourseRunsSerializerV2List' - description: '' - /api/v2/courses/{id}/: - get: - operationId: api_v2_courses_retrieve - description: Retrieve a specific course - API v2 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course. - required: true - tags: - - courses - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CourseWithCourseRunsSerializerV2' - description: '' - /api/v2/departments/: - get: - operationId: departments_list_v2 - description: List departments - v2 - tags: - - departments - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/DepartmentWithCoursesAndPrograms' - description: '' - /api/v2/departments/{id}/: - get: - operationId: departments_retrieve_v2 - description: Get department details - v2 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this department. - required: true - tags: - - departments - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DepartmentWithCoursesAndPrograms' - description: '' - /api/v2/enrollments/: - get: - operationId: user_enrollments_list_v2 - description: List user enrollments with B2B organization and contract information - - API v2. Use ?exclude_b2b=true to filter out enrollments linked to course - runs with B2B contracts. Use ?org_id= to filter enrollments by specific - B2B organization. - parameters: - - in: query - name: exclude_b2b - schema: - type: boolean - description: Exclude B2B enrollments (enrollments linked to course runs with - B2B contracts) - - in: query - name: org_id - schema: - type: number - description: Filter by B2B organization ID - tags: - - enrollments - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/CourseRunEnrollmentRequestV2' - description: '' - post: - operationId: user_enrollments_create_v2 - description: Create a new user enrollment - API v2 - tags: - - enrollments - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequestV2Request' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequestV2Request' - multipart/form-data: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequestV2Request' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequestV2' - description: '' - /api/v2/enrollments/{id}/: - delete: - operationId: user_enrollments_destroy_v2 - description: Unenroll from a course - API v2 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course run enrollment. - required: true - tags: - - enrollments - responses: - '204': - description: No response body - /api/v2/pages/: - get: - operationId: pages_list - description: Returns pages of all types - summary: List all Wagtail Pages - parameters: - - in: query - name: fields - schema: - type: string - description: Specify fields (e.g. `*`) - - in: query - name: type - schema: - type: string - description: Filter by Wagtail page type - tags: - - pages - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PageList' - description: '' - /api/v2/pages/{id}/: - get: - operationId: pages_retrieve - description: Returns details of a specific Wagtail page by ID - summary: Get Wagtail Page Details - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the Wagtail page - required: true - - in: query - name: revision_id - schema: - type: integer - description: Optional certificate revision ID to retrieve a specific revision - of the certificate page - tags: - - pages - responses: - '200': - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/CoursePageItem' - - $ref: '#/components/schemas/ProgramPageItem' - - $ref: '#/components/schemas/CertificatePage' - - $ref: '#/components/schemas/Page' - description: Returns a page of any known Wagtail page type - /api/v2/pages/?fields=*&type=cms.certificatepage: - get: - operationId: pages_?fields=*&type=cms.certificatepage_retrieve - description: Returns pages of type cms.CertificatePage - summary: List all Certificate Pages - tags: - - pages - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CertificatePageList' - description: '' - /api/v2/pages/?fields=*&type=cms.coursepage: - get: - operationId: pages_?fields=*&type=cms.coursepage_retrieve - description: Returns pages of type cms.CoursePage - summary: List all Course Pages - parameters: - - in: query - name: readable_id - schema: - type: string - description: filter by course readable_id - tags: - - pages - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CoursePageList' - description: '' - /api/v2/pages/?fields=*&type=cms.programpage: - get: - operationId: pages_?fields=*&type=cms.programpage_retrieve - description: Returns pages of type cms.ProgramPage - summary: List all Program Pages - parameters: - - in: query - name: readable_id - schema: - type: string - description: filter by program readable_id - tags: - - pages - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ProgramPageList' - description: '' - /api/v2/program-collections/: - get: - operationId: program_collections_list - description: Readonly viewset for ProgramCollection objects. - parameters: - - name: page - required: false - in: query - description: A page number within the paginated result set. - schema: - type: integer - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - program-collections - security: - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedV2ProgramCollectionList' - description: '' - /api/v2/program-collections/{id}/: - get: - operationId: program_collections_retrieve - description: Readonly viewset for ProgramCollection objects. - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this Program Collection. - required: true - tags: - - program-collections - security: - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V2ProgramCollection' - description: '' - /api/v2/program_certificates/{cert_uuid}/: - get: - operationId: program_certificates_retrieve - description: Get a program certificate by UUID. - parameters: - - in: path - name: cert_uuid - schema: - type: string - format: uuid - required: true - tags: - - program_certificates - security: - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V2ProgramCertificate' - description: '' - /api/v2/program_enrollments/: - get: - operationId: v2_program_enrollments_list - description: |- - Returns a unified set of program and course enrollments for the current - user using v2 serializers. - tags: - - program_enrollments - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/V2UserProgramEnrollmentDetail' - description: '' - /api/v2/program_enrollments/{id}/: - get: - operationId: v2_program_enrollments_retrieve - description: Retrieve a specific program enrollment using v2 serializers. - parameters: - - in: path - name: id - schema: - type: integer - description: Program enrollment ID - required: true - tags: - - program_enrollments - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V2UserProgramEnrollmentDetail' - description: '' - delete: - operationId: v2_program_enrollments_destroy - description: |- - Unenroll the user from this program. This is simpler than the corresponding - function for CourseRunEnrollments; edX doesn't really know what programs - are so there's nothing to process there. - parameters: - - in: path - name: id - schema: - type: integer - description: Program enrollment ID - required: true - tags: - - program_enrollments - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/V2UserProgramEnrollmentDetail' - description: '' - /api/v2/programs/: - get: - operationId: programs_list_v2 - description: List Programs - v2 - parameters: - - in: query - name: contract_id - schema: - type: number - - in: query - name: id - schema: - type: array - items: - type: integer - description: Multiple values may be separated by commas. - explode: false - style: form - - in: query - name: live - schema: - type: boolean - - in: query - name: org_id - schema: - type: number - - name: page - required: false - in: query - description: A page number within the paginated result set. - schema: - type: integer - - in: query - name: page__live - schema: - type: boolean - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: readable_id - schema: - type: string - tags: - - programs - security: - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedV2ProgramList' - description: '' - /api/v2/programs/{id}/: - get: - operationId: programs_retrieve_v2 - description: API view set for Programs - v2 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this program. - required: true - tags: - - programs - security: - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V2Program' - description: '' - /api/v2/verifiable_course_credential/{credential_id}/download/: - get: - operationId: verifiable_course_credential_download_list - description: Returns the json for the verifiable credential with the given ID - parameters: - - in: path - name: credential_id - schema: - type: string - format: uuid - required: true - tags: - - verifiable_course_credential - security: - - {} - responses: - '200': - description: No response body - /api/v2/verifiable_program_credential/{credential_id}/download/: - get: - operationId: verifiable_program_credential_download_list - description: Returns the json for the verifiable credential with the given ID - parameters: - - in: path - name: credential_id - schema: - type: string - format: uuid - required: true - tags: - - verifiable_program_credential - security: - - {} - responses: - '200': - description: No response body - /api/v2/verified_program_enrollments/{program_id}/{courserun_id}/: - post: - operationId: verified_program_enrollments_create - description: |- - Create a program-related course enrollment for the learner. - - Some special handling is needed for program-related course run enrollments - when the learner has an enrollment in the program. The learner should get a - course run enrollment that matches their program enrollment at no additional - charge. However, if the learner is enrolling in a course that's an elective, - and they have already enrolled in enough electives to satisfy the program's - requirements, they should then get an audit enrollment. (This won't preclude - them from getting a certificate for the course itself but they'll have to buy - the upgrade separately.) - parameters: - - in: path - name: courserun_id - schema: - type: string - description: Readable ID for the course run to enroll in. - required: true - - in: path - name: program_id - schema: - type: string - description: Readable ID for the program. - required: true - tags: - - verified_program_enrollments - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequestV2' - description: '' - '204': - description: No response body - '404': - description: No response body - /enrollments/: - post: - operationId: api_enrollments_create - description: View to handle direct POST requests to enroll in a course run. - tags: - - enrollments - responses: - '200': - description: No response body - '302': - description: No response body -components: - schemas: - AvailabilityEnum: - enum: - - anytime - - dated - type: string - description: |- - * `anytime` - anytime - * `dated` - dated - x-enum-descriptions: - - anytime - - dated - BaseCourse: - type: object - description: Basic course model serializer - properties: - id: - type: integer - readOnly: true - title: - type: string - maxLength: 255 - readable_id: - type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - type: - type: string - description: Returns the type of object this is serializing. - readOnly: true - required: - - id - - readable_id - - title - - type - BaseProgram: - type: object - description: Basic program model serializer - properties: - title: - type: string - maxLength: 255 - readable_id: - type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - id: - type: integer - readOnly: true - type: - type: string - readOnly: true - required: - - id - - readable_id - - title - - type - Basket: - type: object - description: Basket model serializer - properties: - id: - type: integer - readOnly: true - user: - type: integer - basket_items: - type: array - items: - $ref: '#/components/schemas/BasketItem' - readOnly: true - required: - - basket_items - - id - - user - BasketDiscountDetail: - type: object - description: BasketDiscount model serializer - properties: - redeemed_discount: - $ref: '#/components/schemas/V0Discount' - redeemed_basket: - $ref: '#/components/schemas/Basket' - required: - - redeemed_basket - - redeemed_discount - BasketItem: - type: object - description: BasketItem model serializer - properties: - basket: - type: integer - product: - type: integer - id: - type: integer - readOnly: true - required: - - basket - - id - - product - BasketWithProduct: - type: object - description: Serializer for Basket model with product details - properties: - id: - type: integer - readOnly: true - user: - type: integer - basket_items: - type: array - items: - type: object - properties: - basket: - type: integer - product: - type: object - properties: - id: - type: integer - price: - type: number - description: - type: string - is_active: - type: boolean - purchasable_object: - type: object - id: - type: integer - readOnly: true - total_price: - type: number - format: double - description: Get total price of all items in basket before discounts - readOnly: true - discounted_price: - type: number - format: double - description: Get total price after any discounts are applied - readOnly: true - discounts: - type: array - items: - $ref: '#/components/schemas/BasketDiscountDetail' - readOnly: true - required: - - basket_items - - discounted_price - - discounts - - id - - total_price - - user - BlankEnum: - enum: - - '' - CertificatePage: - type: object - description: Serializer for certificate pages, including overrides and signatory - items. - properties: - id: - type: integer - meta: - $ref: '#/components/schemas/PageMeta' - title: - type: string - product_name: - type: string - CEUs: - type: string - overrides: - type: array - items: - $ref: '#/components/schemas/Override' - signatory_items: - type: array - items: - $ref: '#/components/schemas/SignatoryItem' - required: - - CEUs - - id - - meta - - overrides - - product_name - - signatory_items - - title - CertificatePageList: - type: object - description: Serializer for a list of certificate pages. - properties: - meta: - $ref: '#/components/schemas/PageListMeta' - items: - type: array - items: - $ref: '#/components/schemas/CertificatePage' - required: - - items - - meta - CertificatePageModel: - type: object - description: Extends the CertificatePageSerializer to work with a model object. - properties: - id: - type: integer - meta: - allOf: - - $ref: '#/components/schemas/PageMetaModel' - readOnly: true - title: - type: string - product_name: - type: string - CEUs: - type: string - overrides: - type: array - items: - $ref: '#/components/schemas/Override' - signatory_items: - type: array - items: - $ref: '#/components/schemas/SignatoryItem' - required: - - CEUs - - id - - meta - - overrides - - product_name - - signatory_items - - title - ChangeEmailRequestCreate: - type: object - description: Serializer for starting a user email change - properties: - new_email: - type: string - format: email - required: - - new_email - ChangeEmailRequestCreateRequest: - type: object - description: Serializer for starting a user email change - properties: - new_email: - type: string - format: email - minLength: 1 - password: - type: string - writeOnly: true - minLength: 1 - required: - - new_email - - password - ChangeEmailRequestUpdate: - type: object - description: Serializer for confirming a user email change - properties: - confirmed: - type: boolean - required: - - confirmed - ChangeEmailRequestUpdateRequest: - type: object - description: Serializer for confirming a user email change - properties: - confirmed: - type: boolean - required: - - confirmed - CheckoutPayload: - type: object - description: Serializes the payload for the checkout data. - properties: - no_checkout: - type: boolean - readOnly: true - default: false - description: Set if the order was automatically completed and no checkout - process is required. - url: - type: string - readOnly: true - default: '' - description: The URL to POST the form to. - method: - type: string - readOnly: true - default: POST - description: The method to use for the checkout form (always POST). - payload: - readOnly: true - default: {} - description: The data for the form. - order_id: - type: integer - readOnly: true - default: 0 - description: If the order was automatically completed, the ID of the new - order. - error: - allOf: - - $ref: '#/components/schemas/ErrorEnum' - readOnly: true - description: |- - Error message for the order, if there is one. - - * `enroll-blocked` - enroll-blocked - * `enroll-duplicated` - enroll-duplicated - * `course-non-upgradable` - course-non-upgradable - * `discount-invalid` - discount-invalid - * `b2b-error-missing-enrollment-code` - b2b-error-missing-enrollment-code - * `b2b-invalid-basket` - b2b-invalid-basket - * `basket-empty` - basket-empty - required: - - error - - method - - no_checkout - - order_id - - payload - - url - CompanySizeEnum: - enum: - - 1 - - 9 - - 99 - - 999 - - 9999 - - 10000 - - 0 - description: |- - * `None` - ---- - * `1` - Small/Start-up (1+ employees) - * `9` - Small/Home office (1-9 employees) - * `99` - Small (10-99 employees) - * `999` - Small to medium-sized (100-999 employees) - * `9999` - Medium-sized (1000-9999 employees) - * `10000` - Large Enterprise (10,000+ employees) - * `0` - Other (N/A or Don't know) - x-enum-descriptions: - - Small/Start-up (1+ employees) - - Small/Home office (1-9 employees) - - Small (10-99 employees) - - Small to medium-sized (100-999 employees) - - Medium-sized (1000-9999 employees) - - Large Enterprise (10,000+ employees) - - Other (N/A or Don't know) - ContractPage: - type: object - description: Serializer for the ContractPage model. - properties: - id: - type: integer - readOnly: true - name: - type: string - readOnly: true - description: The name of the contract. - description: - type: string - readOnly: true - description: Any useful extra information about the contract. - welcome_message: - type: string - readOnly: true - description: A welcome message for learners. - welcome_message_extra: - type: string - readOnly: true - description: Additional welcome message content for learners. - integration_type: - allOf: - - $ref: '#/components/schemas/IntegrationTypeEnum' - readOnly: true - description: |- - The type of integration for this contract. - - * `sso` - SSO - * `non-sso` - Non-SSO - * `managed` - Managed - * `code` - Enrollment Code - * `auto` - Auto Enrollment - membership_type: - type: string - organization: - type: integer - readOnly: true - description: The organization that owns this contract. - contract_start: - type: string - format: date - readOnly: true - nullable: true - description: The start date of the contract. - contract_end: - type: string - format: date - readOnly: true - nullable: true - description: The end date of the contract. - active: - type: boolean - readOnly: true - description: Whether this contract is active or not. Date rules still apply. - slug: - type: string - readOnly: true - description: The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/ - pattern: ^[-\w]+$ - programs: - type: array - items: - type: integer - readOnly: true - required: - - active - - contract_end - - contract_start - - description - - id - - integration_type - - membership_type - - name - - organization - - programs - - slug - - welcome_message - - welcome_message_extra - Country: - type: object - description: Serializer for pycountry countries, with states for US/CA - properties: - code: - type: string - description: Get the country alpha_2 code - readOnly: true - name: - type: string - description: Get the country name (common name preferred if available) - readOnly: true - states: - type: array - items: - type: object - additionalProperties: {} - description: Get a list of states/provinces if USA or Canada - readOnly: true - required: - - code - - name - - states - Course: - type: object - description: Course model serializer - properties: - id: - type: integer - readOnly: true - title: - type: string - maxLength: 255 - readable_id: - type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - next_run_id: - type: integer - nullable: true - description: Get next run id - readOnly: true - departments: - type: array - items: - $ref: '#/components/schemas/Department' - readOnly: true - page: - allOf: - - $ref: '#/components/schemas/CoursePage' - readOnly: true - programs: - allOf: - - $ref: '#/components/schemas/Program' - nullable: true - readOnly: true - required: - - departments - - id - - next_run_id - - page - - programs - - readable_id - - title - CoursePage: - type: object - description: Course page model serializer - properties: - feature_image_src: - type: string - description: Serializes the source of the feature_image - readOnly: true - page_url: - type: string - format: uri - readOnly: true - description: - type: string - description: Get cleaned description text. - readOnly: true - live: - type: boolean - readOnly: true - length: - type: string - description: Get cleaned length text. - readOnly: true - effort: - type: string - nullable: true - description: Get cleaned effort text. - readOnly: true - financial_assistance_form_url: - type: string - format: uri - readOnly: true - current_price: - type: integer - nullable: true - description: Get the current price of the course product. - readOnly: true - instructors: - type: array - items: {} - description: Get instructor information - readOnly: true - required: - - current_price - - description - - effort - - feature_image_src - - financial_assistance_form_url - - instructors - - length - - live - - page_url - CoursePageItem: - type: object - description: Serializer for individual course page items, including all relevant - fields. - properties: - id: - type: integer - readOnly: true - meta: - $ref: '#/components/schemas/PageMeta' - title: - type: string - description: The page title as you'd like it to be seen by the public - maxLength: 255 - description: - type: string - description: The description shown on the home page and product page. - length: - type: string - description: A short description indicating how long it takes to complete - (e.g. '4 weeks'). - maxLength: 50 - effort: - type: string - nullable: true - description: A short description indicating how much effort is required - (e.g. 1-3 hours per week). - maxLength: 100 - min_weekly_hours: - type: string - description: The minimum number of hours per week required to complete the - course. - maxLength: 5 - max_weekly_hours: - type: string - description: The maximum number of hours per week required to complete the - course. - maxLength: 5 - min_weeks: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: The minimum number of weeks required to complete the course/program. - max_weeks: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: The maximum number of weeks required to complete the course/program. - price: - type: array - items: - $ref: '#/components/schemas/PriceItem' - min_price: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: Specify the minimum product price. This is used by MIT Learn. - max_price: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: Specify the maximum product price. This is used by MIT Learn. - prerequisites: - type: string - nullable: true - description: A short description indicating prerequisites of this course/program. - faq_url: - type: string - format: uri - nullable: true - description: URL a relevant FAQ page or entry for the course/program. - maxLength: 200 - about: - type: string - nullable: true - description: Details about this course/program. - what_you_learn: - type: string - nullable: true - description: '*Required for Verifiable Credential generation. What you will - learn from this course.' - feature_image: - $ref: '#/components/schemas/FeatureImage' - video_url: - type: string - format: uri - nullable: true - description: URL to the video to be displayed for this course/program. It - can be an HLS or Youtube video URL. - maxLength: 200 - faculty_section_title: - type: string - nullable: true - description: The title text to display in the faculty cards section of the - product page. - maxLength: 255 - faculty: - type: array - items: - $ref: '#/components/schemas/Faculty' - certificate_page: - allOf: - - $ref: '#/components/schemas/CertificatePage' - nullable: true - course_details: - $ref: '#/components/schemas/V2Course' - topic_list: - type: array - items: - $ref: '#/components/schemas/Topic' - include_in_learn_catalog: - type: boolean - nullable: true - description: If true, Learn should include this in its catalog. - ingest_content_files_for_ai: - type: boolean - nullable: true - description: If true, allow the AI chatbots to ingest the course's content - files. - required: - - about - - certificate_page - - course_details - - description - - effort - - faculty - - faculty_section_title - - faq_url - - feature_image - - id - - include_in_learn_catalog - - ingest_content_files_for_ai - - length - - max_price - - max_weekly_hours - - max_weeks - - meta - - min_price - - min_weekly_hours - - min_weeks - - prerequisites - - price - - title - - topic_list - - video_url - - what_you_learn - CoursePageList: - type: object - description: Serializer for a list of course pages, including metadata and items. - properties: - meta: - $ref: '#/components/schemas/PageListMeta' - items: - type: array - items: - $ref: '#/components/schemas/CoursePageItem' - required: - - items - - meta - CourseRequest: - type: object - description: Course model serializer - properties: - title: - type: string - minLength: 1 - maxLength: 255 - readable_id: - type: string - minLength: 1 - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - required: - - readable_id - - title - CourseRunCertificate: - type: object - description: CourseRunCertificate model serializer - properties: - uuid: - type: string - format: uuid - readOnly: true - link: - type: string - description: |- - Get the link at which this certificate will be served - Format: /certificate// - Example: /certificate/93ebd74e-5f88-4b47-bb09-30a6d575328f/ - readOnly: true - required: - - link - - uuid - CourseRunEnrollment: - type: object - description: CourseRunEnrollment model serializer - properties: - run: - allOf: - - $ref: '#/components/schemas/V1CourseRunWithCourse' - readOnly: true - id: - type: integer - readOnly: true - edx_emails_subscription: - type: boolean - certificate: - allOf: - - $ref: '#/components/schemas/CourseRunCertificate' - nullable: true - readOnly: true - enrollment_mode: - allOf: - - $ref: '#/components/schemas/EnrollmentModeEnum' - readOnly: true - approved_flexible_price_exists: - type: boolean - readOnly: true - grades: - type: array - items: - $ref: '#/components/schemas/CourseRunGrade' - readOnly: true - required: - - approved_flexible_price_exists - - certificate - - enrollment_mode - - grades - - id - - run - CourseRunEnrollmentRequest: - type: object - description: CourseRunEnrollment model serializer - properties: - edx_emails_subscription: - type: boolean - run_id: - type: integer - writeOnly: true - required: - - run_id - CourseRunEnrollmentRequestV2: - type: object - description: CourseRunEnrollment model serializer - properties: - run: - allOf: - - $ref: '#/components/schemas/V2CourseRunWithCourse' - readOnly: true - id: - type: integer - readOnly: true - edx_emails_subscription: - type: boolean - certificate: - allOf: - - $ref: '#/components/schemas/CourseRunCertificate' - nullable: true - readOnly: true - enrollment_mode: - allOf: - - $ref: '#/components/schemas/EnrollmentModeEnum' - readOnly: true - approved_flexible_price_exists: - type: boolean - readOnly: true - grades: - type: array - items: - $ref: '#/components/schemas/CourseRunGrade' - readOnly: true - b2b_organization_id: - type: integer - nullable: true - readOnly: true - b2b_contract_id: - type: integer - nullable: true - readOnly: true - required: - - approved_flexible_price_exists - - b2b_contract_id - - b2b_organization_id - - certificate - - enrollment_mode - - grades - - id - - run - CourseRunEnrollmentRequestV2Request: - type: object - description: CourseRunEnrollment model serializer - properties: - edx_emails_subscription: - type: boolean - run_id: - type: integer - writeOnly: true - required: - - run_id - CourseRunGrade: - type: object - description: CourseRunGrade serializer - properties: - grade: - type: number - format: double - maximum: 1.0 - minimum: 0.0 - letter_grade: - type: string - nullable: true - maxLength: 6 - passed: - type: boolean - set_by_admin: - type: boolean - grade_percent: - type: number - format: double - description: Returns the grade field value as a number out of 100 (or Decimal(0) - if the value is None) - readOnly: true - required: - - grade - - grade_percent - CourseRunV2: - type: object - description: CourseRun model serializer - properties: - title: - type: string - description: The title of the course. This value is synced automatically - with edX studio. - maxLength: 255 - start_date: - type: string - format: date-time - nullable: true - description: The day the course begins. This value is synced automatically - with edX studio. - end_date: - type: string - format: date-time - nullable: true - description: The last day the course is active. This value is synced automatically - with edX studio. - enrollment_start: - type: string - format: date-time - nullable: true - description: The first day students can enroll. This value is synced automatically - with edX studio. - enrollment_end: - type: string - format: date-time - nullable: true - description: The last day students can enroll. This value is synced automatically - with edX studio. - expiration_date: - type: string - format: date-time - nullable: true - description: The date beyond which the learner should not see link to this - course run on their dashboard. - courseware_url: - type: string - nullable: true - description: Get the courseware URL - readOnly: true - courseware_id: - type: string - maxLength: 255 - certificate_available_date: - type: string - format: date-time - nullable: true - description: The day certificates should be available to users. This value - is synced automatically with edX studio. - upgrade_deadline: - type: string - format: date-time - nullable: true - description: The date beyond which the learner can not enroll in paid course - mode. - is_upgradable: - type: boolean - description: Check if the course run is upgradable - readOnly: true - is_enrollable: - type: boolean - description: Check if the course run is enrollable - readOnly: true - is_archived: - type: boolean - description: Check if the course run is archived - readOnly: true - is_self_paced: - type: boolean - run_tag: - type: string - description: 'A string that identifies the set of runs that this run belongs - to (example: ''R2'')' - maxLength: 100 - id: - type: integer - readOnly: true - live: - type: boolean - course_number: - type: string - description: Get the course number - readOnly: true - products: - type: array - items: - allOf: - - $ref: '#/components/schemas/ProductFlexibilePrice' - readOnly: true - approved_flexible_price_exists: - type: boolean - readOnly: true - b2b_contract: - type: integer - nullable: true - required: - - approved_flexible_price_exists - - course_number - - courseware_id - - courseware_url - - id - - is_archived - - is_enrollable - - is_upgradable - - products - - run_tag - - title - CourseWithCourseRunsSerializerV2: - type: object - description: Course model serializer - also serializes child course runs - properties: - id: - type: integer - readOnly: true - title: - type: string - maxLength: 255 - readable_id: - type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - next_run_id: - type: integer - nullable: true - description: Get next run id - readOnly: true - departments: - type: array - items: - $ref: '#/components/schemas/Department' - readOnly: true - page: - allOf: - - $ref: '#/components/schemas/CoursePage' - readOnly: true - programs: - type: array - items: - $ref: '#/components/schemas/BaseProgram' - nullable: true - readOnly: true - topics: - type: array - items: - type: object - additionalProperties: {} - description: List topics of a course - readOnly: true - certificate_type: - type: string - readOnly: true - required_prerequisites: - type: boolean - description: |- - Check if the prerequisites field is populated in the course page CMS. - Returns: - bool: True when the prerequisites field is populated in the course page CMS. False otherwise. - readOnly: true - duration: - type: string - description: Get the duration of the course from the course page CMS. - readOnly: true - min_weeks: - type: integer - nullable: true - description: Get the min weeks of the course from the CMS page. - readOnly: true - max_weeks: - type: integer - nullable: true - description: Get the max weeks of the course from the CMS page. - readOnly: true - min_price: - type: integer - nullable: true - description: Get the min price of the product from the CMS page. - readOnly: true - max_price: - type: integer - nullable: true - description: Get the max price of the product from the CMS page. - readOnly: true - time_commitment: - type: string - nullable: true - description: Get the time commitment of the course from the course page - CMS. - readOnly: true - availability: - type: string - description: Get course availability - readOnly: true - min_weekly_hours: - type: string - nullable: true - description: Get the min weekly hours of the course from the course page - CMS. - readOnly: true - max_weekly_hours: - type: string - nullable: true - description: Get the max weekly hours of the course from the course page - CMS. - readOnly: true - include_in_learn_catalog: - type: boolean - readOnly: true - ingest_content_files_for_ai: - type: boolean - readOnly: true - courseruns: - type: array - items: - $ref: '#/components/schemas/CourseRunV2' - readOnly: true - required: - - availability - - certificate_type - - courseruns - - departments - - duration - - id - - include_in_learn_catalog - - ingest_content_files_for_ai - - max_price - - max_weekly_hours - - max_weeks - - min_price - - min_weekly_hours - - min_weeks - - next_run_id - - page - - programs - - readable_id - - required_prerequisites - - time_commitment - - title - - topics - CreateB2BEnrollment: - type: object - description: |- - Serializer for the result from create_b2b_enrollment. - - There's always a result, and it should be one of the B2B messages that are - defined in main.constants. The other fields appear or not depending on the - result type. - properties: - result: - allOf: - - $ref: '#/components/schemas/ResultEnum' - readOnly: true - order: - type: integer - readOnly: true - price: - type: string - format: decimal - readOnly: true - checkout_result: - $ref: '#/components/schemas/GenerateCheckoutPayload' - required: - - order - - price - - result - CreateBasketWithProductIDRequest: - type: object - description: Defines the schema for a product ID and quantity in the CreateBasketWithProductsSerializer. - properties: - product_id: - type: integer - quantity: - type: integer - minimum: 1 - required: - - product_id - - quantity - CreateBasketWithProductsRequest: - type: object - description: Serializer for creating a basket with products. (For OpenAPI spec.) - properties: - system_slug: - type: string - minLength: 1 - product_ids: - type: array - items: - $ref: '#/components/schemas/CreateBasketWithProductIDRequest' - checkout: - type: boolean - discount_code: - type: string - minLength: 1 - required: - - checkout - - discount_code - - product_ids - - system_slug - Department: - type: object - description: Department model serializer - properties: - name: - type: string - maxLength: 128 - required: - - name - DepartmentRequest: - type: object - description: Department model serializer - properties: - name: - type: string - minLength: 1 - maxLength: 128 - required: - - name - DepartmentWithCount: - type: object - description: CourseRun model serializer that includes the number of courses - and programs associated with each departments - properties: - name: - type: string - maxLength: 128 - courses: - type: integer - programs: - type: integer - required: - - courses - - name - - programs - DepartmentWithCoursesAndPrograms: - type: object - description: Department model serializer that includes the number of courses - and programs associated with each - properties: - id: - type: integer - readOnly: true - name: - type: string - maxLength: 128 - slug: - type: string - maxLength: 128 - pattern: ^[-a-zA-Z0-9_]+$ - course_ids: - type: array - items: - type: integer - readOnly: true - program_ids: - type: array - items: - type: integer - readOnly: true - required: - - course_ids - - id - - name - - program_ids - - slug - Discount: - type: object - properties: - id: - type: integer - readOnly: true - amount: - type: string - format: decimal - pattern: ^-?\d{0,15}(?:\.\d{0,5})?$ - automatic: - type: boolean - discount_type: - $ref: '#/components/schemas/DiscountTypeEnum' - redemption_type: - $ref: '#/components/schemas/RedemptionTypeEnum' - max_redemptions: - type: integer - maximum: 2147483647 - minimum: 0 - nullable: true - discount_code: - type: string - maxLength: 100 - payment_type: - nullable: true - oneOf: - - $ref: '#/components/schemas/PaymentTypeEnum' - - $ref: '#/components/schemas/NullEnum' - is_redeemed: - type: boolean - description: Returns True if the discount has been redeemed - readOnly: true - activation_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable before this - date. - expiration_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable after this - date. - required: - - amount - - discount_code - - discount_type - - id - - is_redeemed - - redemption_type - DiscountProduct: - type: object - properties: - id: - type: integer - readOnly: true - discount: - $ref: '#/components/schemas/V0Discount' - product: - $ref: '#/components/schemas/Product' - required: - - discount - - id - - product - DiscountProductRequest: - type: object - properties: - discount: - $ref: '#/components/schemas/V0DiscountRequest' - product: - $ref: '#/components/schemas/ProductRequest' - required: - - discount - - product - DiscountRedemption: - type: object - description: Serializes a discount redemption. - properties: - id: - type: integer - readOnly: true - redemption_date: - type: string - format: date-time - readOnly: true - redeemed_by: - $ref: '#/components/schemas/User' - redeemed_discount: - $ref: '#/components/schemas/V0Discount' - redeemed_order: - $ref: '#/components/schemas/Order' - required: - - id - - redeemed_by - - redeemed_discount - - redeemed_order - - redemption_date - DiscountRedemptionRequest: - type: object - description: Serializes a discount redemption. - properties: - redeemed_by: - $ref: '#/components/schemas/UserRequest' - redeemed_discount: - $ref: '#/components/schemas/V0DiscountRequest' - redeemed_order: - $ref: '#/components/schemas/OrderRequest' - required: - - redeemed_by - - redeemed_discount - - redeemed_order - DiscountTypeEnum: - enum: - - percent-off - - dollars-off - - fixed-price - type: string - description: |- - * `percent-off` - percent-off - * `dollars-off` - dollars-off - * `fixed-price` - fixed-price - x-enum-descriptions: - - percent-off - - dollars-off - - fixed-price - EnrollmentModeEnum: - enum: - - audit - - verified - type: string - description: |- - * `audit` - audit - * `verified` - verified - x-enum-descriptions: - - audit - - verified - ErrorEnum: - enum: - - enroll-blocked - - enroll-duplicated - - course-non-upgradable - - discount-invalid - - b2b-error-missing-enrollment-code - - b2b-invalid-basket - - basket-empty - type: string - description: |- - * `enroll-blocked` - enroll-blocked - * `enroll-duplicated` - enroll-duplicated - * `course-non-upgradable` - course-non-upgradable - * `discount-invalid` - discount-invalid - * `b2b-error-missing-enrollment-code` - b2b-error-missing-enrollment-code - * `b2b-invalid-basket` - b2b-invalid-basket - * `basket-empty` - basket-empty - x-enum-descriptions: - - enroll-blocked - - enroll-duplicated - - course-non-upgradable - - discount-invalid - - b2b-error-missing-enrollment-code - - b2b-invalid-basket - - basket-empty - ExtendedLegalAddress: - type: object - description: Serializer class that includes email address as part of the legal - address - properties: - country: - type: string - maxLength: 2 - state: - type: string - nullable: true - maxLength: 10 - email: - type: string - description: Get email from the linked user object - readOnly: true - required: - - country - - email - Faculty: - type: object - description: Serializer for faculty details used in course pages. - properties: - id: - type: integer - instructor_name: - type: string - instructor_title: - type: string - instructor_bio_short: - type: string - instructor_bio_long: - type: string - feature_image_src: - type: string - required: - - feature_image_src - - id - - instructor_bio_long - - instructor_bio_short - - instructor_name - - instructor_title - FeatureImage: - type: object - description: Serializer for feature images used in course pages. - properties: - title: - type: string - image_url: - type: string - format: uri - height: - type: integer - width: - type: integer - required: - - height - - image_url - - title - - width - FlexiblePriceTier: - type: object - properties: - id: - type: integer - readOnly: true - courseware_object: - allOf: - - $ref: '#/components/schemas/BaseCourse' - readOnly: true - discount: - type: integer - current: - type: boolean - income_threshold_usd: - type: number - format: double - required: - - courseware_object - - discount - - id - - income_threshold_usd - FlexiblePriceTierRequest: - type: object - properties: - discount: - type: integer - current: - type: boolean - income_threshold_usd: - type: number - format: double - required: - - discount - - income_threshold_usd - GenderEnum: - enum: - - m - - f - - t - - nb - - o - type: string - description: |- - * `m` - Male - * `f` - Female - * `t` - Transgender - * `nb` - Non-binary/non-conforming - * `o` - Other/Prefer Not to Say - x-enum-descriptions: - - Male - - Female - - Transgender - - Non-binary/non-conforming - - Other/Prefer Not to Say - GenerateCheckoutPayload: - type: object - description: |- - Serializer for the result from ecommerce.api.generate_checkout_payload. - - The B2B enrollment API will return the result of the checkout call if the - user needs to pay for the cart because of an error creating the checkout - payload. In that case, we really just need the error states; it will also - include a HttpResponseRedirect that we don't really care about for the API's - purposes. - properties: - country_blocked: - type: boolean - nullable: true - default: false - purchased_same_courserun: - type: boolean - nullable: true - default: false - purchased_non_upgradeable_courserun: - type: boolean - nullable: true - default: false - invalid_discounts: - type: boolean - nullable: true - default: false - no_checkout: - type: boolean - nullable: true - default: false - HighestEducationEnum: - enum: - - Doctorate - - Master's or professional degree - - Bachelor's degree - - Associate degree - - Secondary/high school - - Junior secondary/junior high/middle school - - Elementary/primary school - - No formal education - - Other education - description: |- - * `None` - ---- - * `Doctorate` - Doctorate - * `Master's or professional degree` - Master's or professional degree - * `Bachelor's degree` - Bachelor's degree - * `Associate degree` - Associate degree - * `Secondary/high school` - Secondary/high school - * `Junior secondary/junior high/middle school` - Junior secondary/junior high/middle school - * `Elementary/primary school` - Elementary/primary school - * `No formal education` - No formal education - * `Other education` - Other education - x-enum-descriptions: - - Doctorate - - Master's or professional degree - - Bachelor's degree - - Associate degree - - Secondary/high school - - Junior secondary/junior high/middle school - - Elementary/primary school - - No formal education - - Other education - IntegrationTypeEnum: - enum: - - sso - - non-sso - - managed - - code - - auto - type: string - description: |- - * `sso` - SSO - * `non-sso` - Non-SSO - * `managed` - Managed - * `code` - Enrollment Code - * `auto` - Auto Enrollment - x-enum-descriptions: - - SSO - - Non-SSO - - Managed - - Enrollment Code - - Auto Enrollment - LearnerProgramRecordShare: - type: object - properties: - share_uuid: - type: string - format: uuid - readOnly: true - created_on: - type: string - format: date-time - readOnly: true - updated_on: - type: string - format: date-time - readOnly: true - is_active: - type: boolean - user: - type: integer - program: - type: integer - partner_school: - type: integer - nullable: true - required: - - created_on - - program - - share_uuid - - updated_on - - user - LearnerRecord: - type: object - description: |- - Gathers the various data needed to display the learner's program record. - Pass the program you want the record for and attach the learner via context - object. - properties: - user: - type: object - additionalProperties: - type: string - description: User information including name, email, and username - program: - type: object - additionalProperties: - type: object - additionalProperties: {} - description: Program details including title, readable_id, courses, and - requirements - sharing: - type: array - items: - $ref: '#/components/schemas/LearnerProgramRecordShare' - description: Active program record shares for this user - partner_schools: - type: array - items: - $ref: '#/components/schemas/PartnerSchool' - description: List of partner schools - required: - - partner_schools - - program - - sharing - - user - LegalAddress: - type: object - description: Serializer for legal address - properties: - country: - type: string - maxLength: 2 - state: - type: string - nullable: true - maxLength: 10 - required: - - country - LegalAddressRequest: - type: object - description: Serializer for legal address - properties: - country: - type: string - minLength: 1 - maxLength: 2 - state: - type: string - nullable: true - maxLength: 10 - required: - - country - Line: - type: object - description: Serializes order lines. - properties: - quantity: - type: integer - item_description: - type: string - unit_price: - type: string - format: decimal - pattern: ^-?\d{0,7}(?:\.\d{0,2})?$ - total_price: - type: string - format: decimal - pattern: ^-?\d{0,7}(?:\.\d{0,2})?$ - id: - type: integer - product: - allOf: - - $ref: '#/components/schemas/Product' - readOnly: true - required: - - id - - item_description - - product - - quantity - - total_price - - unit_price - Nested: - type: object - properties: - id: - type: integer - readOnly: true - created_on: - type: string - format: date-time - readOnly: true - updated_on: - type: string - format: date-time - readOnly: true - amount: - type: string - format: decimal - pattern: ^-?\d{0,15}(?:\.\d{0,5})?$ - automatic: - type: boolean - discount_type: - $ref: '#/components/schemas/DiscountTypeEnum' - redemption_type: - $ref: '#/components/schemas/RedemptionTypeEnum' - payment_type: - nullable: true - oneOf: - - $ref: '#/components/schemas/PaymentTypeEnum' - - $ref: '#/components/schemas/NullEnum' - max_redemptions: - type: integer - maximum: 2147483647 - minimum: 0 - nullable: true - discount_code: - type: string - maxLength: 100 - activation_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable before this - date. - expiration_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable after this - date. - is_bulk: - type: boolean - is_program_discount: - type: boolean - nullable: true - description: Discount is only for creating verified course run enrollments - for a program. - required: - - amount - - created_on - - discount_code - - discount_type - - id - - redemption_type - - updated_on - NodeTypeEnum: - enum: - - operator - - course - - program - type: string - description: |- - * `operator` - operator - * `course` - course - * `program` - program - x-enum-descriptions: - - operator - - course - - program - NullEnum: - enum: - - null - Order: - type: object - properties: - id: - type: integer - readOnly: true - state: - $ref: '#/components/schemas/StateEnum' - purchaser: - type: array - items: - $ref: '#/components/schemas/ExtendedLegalAddress' - readOnly: true - total_price_paid: - type: string - format: decimal - pattern: ^-?\d{0,15}(?:\.\d{0,5})?$ - lines: - type: array - items: - $ref: '#/components/schemas/TransactionLine' - readOnly: true - discounts: - type: array - items: - $ref: '#/components/schemas/RedeemedDiscount' - readOnly: true - refunds: - type: array - items: - type: object - properties: - amount: - type: number - date: - type: string - format: date-time - readOnly: true - reference_number: - type: string - nullable: true - maxLength: 255 - created_on: - type: string - format: date-time - readOnly: true - transactions: - type: object - properties: - card_number: - type: string - card_type: - type: string - name: - type: string - bill_to_email: - type: string - payment_method: - type: string - readOnly: true - street_address: - type: object - properties: - line: - type: array - items: - type: string - postal_code: - type: string - state: - type: string - city: - type: string - country: - type: string - readOnly: true - required: - - created_on - - discounts - - id - - lines - - purchaser - - refunds - - state - - street_address - - total_price_paid - - transactions - OrderHistory: - type: object - properties: - id: - type: integer - readOnly: true - state: - $ref: '#/components/schemas/StateEnum' - reference_number: - type: string - nullable: true - maxLength: 255 - purchaser: - $ref: '#/components/schemas/PublicUser' - total_price_paid: - type: string - format: decimal - pattern: ^-?\d{0,15}(?:\.\d{0,5})?$ - lines: - type: array - items: - $ref: '#/components/schemas/Line' - created_on: - type: string - format: date-time - readOnly: true - titles: - type: array - items: {} - readOnly: true - updated_on: - type: string - format: date-time - readOnly: true - required: - - created_on - - id - - lines - - purchaser - - state - - titles - - total_price_paid - - updated_on - OrderRequest: - type: object - properties: - state: - $ref: '#/components/schemas/StateEnum' - total_price_paid: - type: string - format: decimal - pattern: ^-?\d{0,15}(?:\.\d{0,5})?$ - reference_number: - type: string - nullable: true - maxLength: 255 - required: - - state - - total_price_paid - OrganizationPage: - type: object - description: Serializer for the OrganizationPage model. - properties: - id: - type: integer - readOnly: true - name: - type: string - readOnly: true - description: The name of the organization - description: - type: string - readOnly: true - description: Any useful extra information about the organization - logo: - type: string - format: uri - readOnly: true - description: The organization's logo. Will be displayed in the app in various - places. - slug: - type: string - readOnly: true - description: The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/ - pattern: ^[-\w]+$ - contracts: - type: array - items: - $ref: '#/components/schemas/ContractPage' - readOnly: true - required: - - contracts - - description - - id - - logo - - name - - slug - Override: - type: object - description: Serializer for overrides used in certificate pages. - properties: - type: - type: string - value: - $ref: '#/components/schemas/OverrideValue' - id: - type: string - required: - - id - - type - - value - OverrideValue: - type: object - description: Serializer for override values used in certificate pages. - properties: - readable_id: - type: string - CEUs: - type: string - format: decimal - pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ - required: - - CEUs - - readable_id - Page: - type: object - description: Serializer for individual Wagtail pages. - properties: - id: - type: integer - title: - type: string - meta: - $ref: '#/components/schemas/PageMeta' - required: - - id - - meta - - title - PageList: - type: object - description: Serializer for a list of Wagtail pages. - properties: - meta: - $ref: '#/components/schemas/PageListMeta' - items: - type: array - items: - $ref: '#/components/schemas/Page' - required: - - items - - meta - PageListMeta: - type: object - description: Serializer for metadata of a list of Wagtail pages. - properties: - total_count: - type: integer - required: - - total_count - PageMeta: - type: object - description: Serializer for page metadata used in various Wagtail pages. - properties: - type: - type: string - detail_url: - type: string - format: uri - html_url: - type: string - format: uri - slug: - type: string - show_in_menus: - type: boolean - seo_title: - type: string - search_description: - type: string - first_published_at: - type: string - format: date-time - nullable: true - alias_of: - type: string - nullable: true - locale: - type: string - live: - type: boolean - last_published_at: - type: string - format: date-time - nullable: true - required: - - alias_of - - detail_url - - first_published_at - - html_url - - last_published_at - - live - - locale - - search_description - - seo_title - - show_in_menus - - slug - - type - PageMetaModel: - type: object - description: Extends the PageMetaSerializer to work with a Page object - properties: - type: - type: string - description: |- - Get the page type, in a more simple manner than Wagtail. - - The Wagtail version of this is PageTypeField, and it tries to modify the - context, which we neither need nor is in the correct format for it. - readOnly: true - detail_url: - type: string - description: |- - Get the detail URL, which should be the API call for this page. - - The Wagtail version of this is DetailUrlField and it also tries to make - changes to the context that we don't need. - readOnly: true - html_url: - type: string - description: Return PageHtmlUrlField. This is wrapped for OpenAPI schema - generation. - readOnly: true - slug: - type: string - show_in_menus: - type: boolean - seo_title: - type: string - search_description: - type: string - first_published_at: - type: string - format: date-time - nullable: true - alias_of: - type: string - nullable: true - locale: - type: string - description: Return PageLocaleField. This is wrapped for OpenAPI schema - generation. - readOnly: true - live: - type: boolean - last_published_at: - type: string - format: date-time - nullable: true - required: - - alias_of - - detail_url - - first_published_at - - html_url - - last_published_at - - live - - locale - - search_description - - seo_title - - show_in_menus - - slug - - type - PaginatedCourseWithCourseRunsSerializerV2List: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=4 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=2 - results: - type: array - items: - $ref: '#/components/schemas/CourseWithCourseRunsSerializerV2' - PaginatedDiscountProductList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 - results: - type: array - items: - $ref: '#/components/schemas/DiscountProduct' - PaginatedDiscountRedemptionList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 - results: - type: array - items: - $ref: '#/components/schemas/DiscountRedemption' - PaginatedFlexiblePriceTierList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 - results: - type: array - items: - $ref: '#/components/schemas/FlexiblePriceTier' - PaginatedOrderHistoryList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 - results: - type: array - items: - $ref: '#/components/schemas/OrderHistory' - PaginatedProductList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 - results: - type: array - items: - $ref: '#/components/schemas/Product' - PaginatedStaffDashboardUserList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?o=400&l=100 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?o=200&l=100 - results: - type: array - items: - $ref: '#/components/schemas/StaffDashboardUser' - PaginatedUserDiscountMetaList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 - results: - type: array - items: - $ref: '#/components/schemas/UserDiscountMeta' - PaginatedV0DiscountList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 - results: - type: array - items: - $ref: '#/components/schemas/V0Discount' - PaginatedV1CourseWithCourseRunsList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=4 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=2 - results: - type: array - items: - $ref: '#/components/schemas/V1CourseWithCourseRuns' - PaginatedV1ProgramList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=4 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=2 - results: - type: array - items: - $ref: '#/components/schemas/V1Program' - PaginatedV2ProgramCollectionList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=4 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=2 - results: - type: array - items: - $ref: '#/components/schemas/V2ProgramCollection' - PaginatedV2ProgramList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=4 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=2 - results: - type: array - items: - $ref: '#/components/schemas/V2Program' - PartnerSchool: - type: object - properties: - id: - type: integer - readOnly: true - created_on: - type: string - format: date-time - readOnly: true - updated_on: - type: string - format: date-time - readOnly: true - name: - type: string - maxLength: 255 - email: - type: string - required: - - created_on - - email - - id - - name - - updated_on - PartnerSchoolRequest: - type: object - properties: - name: - type: string - minLength: 1 - maxLength: 255 - email: - type: string - minLength: 1 - required: - - email - - name - PatchedChangeEmailRequestUpdateRequest: - type: object - description: Serializer for confirming a user email change - properties: - confirmed: - type: boolean - PatchedDiscountProductRequest: - type: object - properties: - discount: - $ref: '#/components/schemas/V0DiscountRequest' - product: - $ref: '#/components/schemas/ProductRequest' - PatchedDiscountRedemptionRequest: - type: object - description: Serializes a discount redemption. - properties: - redeemed_by: - $ref: '#/components/schemas/UserRequest' - redeemed_discount: - $ref: '#/components/schemas/V0DiscountRequest' - redeemed_order: - $ref: '#/components/schemas/OrderRequest' - PatchedFlexiblePriceTierRequest: - type: object - properties: - discount: - type: integer - current: - type: boolean - income_threshold_usd: - type: number - format: double - PatchedProductRequest: - type: object - description: Serializes a product, including the purchasable object. - properties: - price: - type: string - format: decimal - pattern: ^-?\d{0,5}(?:\.\d{0,2})?$ - description: - type: string - minLength: 1 - is_active: - type: boolean - description: Controls visibility of the product in the app. - PatchedUpdateCourseRunEnrollmentRequest: - type: object - properties: - receive_emails: - type: boolean - description: Whether to receive course emails - PatchedUserDiscountMetaRequest: - type: object - description: Serializes UserDiscount but only allows depth = 1 - properties: - discount: - $ref: '#/components/schemas/V0DiscountRequest' - user: - $ref: '#/components/schemas/UserRequest' - PatchedUserRequest: - type: object - description: Serializer for users - properties: - username: - type: string - nullable: true - minLength: 1 - maxLength: 30 - name: - type: string - maxLength: 255 - email: - type: string - format: email - nullable: true - minLength: 1 - password: - type: string - writeOnly: true - minLength: 1 - legal_address: - allOf: - - $ref: '#/components/schemas/LegalAddressRequest' - nullable: true - user_profile: - allOf: - - $ref: '#/components/schemas/UserProfileRequest' - nullable: true - is_active: - type: boolean - default: true - PatchedV0DiscountRequest: - type: object - description: Serializes a discount. - properties: - amount: - type: string - format: decimal - pattern: ^-?\d{0,15}(?:\.\d{0,5})?$ - automatic: - type: boolean - discount_type: - $ref: '#/components/schemas/DiscountTypeEnum' - redemption_type: - $ref: '#/components/schemas/RedemptionTypeEnum' - max_redemptions: - type: integer - maximum: 2147483647 - minimum: 0 - nullable: true - discount_code: - type: string - minLength: 1 - maxLength: 100 - payment_type: - nullable: true - oneOf: - - $ref: '#/components/schemas/PaymentTypeEnum' - - $ref: '#/components/schemas/NullEnum' - activation_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable before this - date. - expiration_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable after this - date. - PaymentTypeEnum: - enum: - - marketing - - sales - - financial-assistance - - customer-support - - staff - - legacy - type: string - description: |- - * `marketing` - marketing - * `sales` - sales - * `financial-assistance` - financial-assistance - * `customer-support` - customer-support - * `staff` - staff - * `legacy` - legacy - x-enum-descriptions: - - marketing - - sales - - financial-assistance - - customer-support - - staff - - legacy - PriceItem: - type: object - description: Serializer for price items used in course pages. - properties: - type: - type: string - value: - type: object - additionalProperties: {} - id: - type: string - format: uuid - required: - - id - - type - - value - Product: - type: object - description: Serializes a product, including the purchasable object. - properties: - id: - type: integer - readOnly: true - price: - type: string - format: decimal - pattern: ^-?\d{0,5}(?:\.\d{0,2})?$ - description: - type: string - is_active: - type: boolean - description: Controls visibility of the product in the app. - purchasable_object: - oneOf: - - type: object - properties: - id: - type: integer - run_tag: - type: string - start_date: - type: string - format: date-time - end_date: - type: string - format: date-time - - type: object - properties: - id: - type: integer - title: - type: string - run_tag: - type: string - start_date: - type: string - format: date-time - end_date: - type: string - format: date-time - course: - type: object - properties: - id: - type: integer - title: - type: string - page: - type: object - readable_id: - type: string - enrollment_start: - type: string - format: date-time - enrollment_end: - type: string - format: date-time - course_number: - type: string - readOnly: true - required: - - description - - id - - price - - purchasable_object - ProductFlexibilePrice: - type: object - description: Simple serializer for Product without related purchasable objects - properties: - id: - type: integer - readOnly: true - price: - type: string - format: decimal - pattern: ^-?\d{0,5}(?:\.\d{0,2})?$ - description: - type: string - is_active: - type: boolean - description: Controls visibility of the product in the app. - product_flexible_price: - allOf: - - $ref: '#/components/schemas/Discount' - nullable: true - readOnly: true - required: - - description - - id - - price - - product_flexible_price - ProductFlexibilePriceRequest: - type: object - description: Simple serializer for Product without related purchasable objects - properties: - price: - type: string - format: decimal - pattern: ^-?\d{0,5}(?:\.\d{0,2})?$ - description: - type: string - minLength: 1 - is_active: - type: boolean - description: Controls visibility of the product in the app. - required: - - description - - price - ProductFlexiblePrice: - type: object - description: Simple serializer for Product without related purchasable objects - properties: - id: - type: integer - readOnly: true - price: - type: string - format: decimal - pattern: ^-?\d{0,5}(?:\.\d{0,2})?$ - description: - type: string - is_active: - type: boolean - description: Controls visibility of the product in the app. - product_flexible_price: - allOf: - - $ref: '#/components/schemas/V0Discount' - nullable: true - readOnly: true - required: - - description - - id - - price - - product_flexible_price - ProductRequest: - type: object - description: Serializes a product, including the purchasable object. - properties: - price: - type: string - format: decimal - pattern: ^-?\d{0,5}(?:\.\d{0,2})?$ - description: - type: string - minLength: 1 - is_active: - type: boolean - description: Controls visibility of the product in the app. - required: - - description - - price - Program: - type: object - properties: - id: - type: integer - title: - type: string - readable_id: - type: string - required: - - id - - readable_id - - title - ProgramCertificate: - type: object - description: ProgramCertificate model serializer - properties: - uuid: - type: string - format: uuid - readOnly: true - link: - type: string - description: |- - Get the link at which this certificate will be served - Format: /certificate/program// - Example: /certificate/program/93ebd74e-5f88-4b47-bb09-30a6d575328f/ - readOnly: true - required: - - link - - uuid - ProgramPage: - type: object - description: Program page model serializer - properties: - feature_image_src: - type: string - description: Serializes the source of the feature_image - readOnly: true - page_url: - type: string - format: uri - readOnly: true - financial_assistance_form_url: - type: string - format: uri - readOnly: true - description: - type: string - description: The description shown on the home page and product page. - readOnly: true - live: - type: boolean - readOnly: true - length: - type: string - description: A short description indicating how long it takes to complete - (e.g. '4 weeks'). - maxLength: 50 - effort: - type: string - nullable: true - description: A short description indicating how much effort is required - (e.g. 1-3 hours per week). - maxLength: 100 - price: - type: string - description: Get the price text from the program page. - readOnly: true - required: - - description - - feature_image_src - - financial_assistance_form_url - - live - - page_url - - price - ProgramPageItem: - type: object - description: Serializer for individual program page items, including all relevant - fields. - properties: - id: - type: integer - readOnly: true - meta: - $ref: '#/components/schemas/PageMeta' - title: - type: string - description: The page title as you'd like it to be seen by the public - maxLength: 255 - description: - type: string - description: The description shown on the home page and product page. - readOnly: true - length: - type: string - description: A short description indicating how long it takes to complete - (e.g. '4 weeks'). - maxLength: 50 - effort: - type: string - nullable: true - description: A short description indicating how much effort is required - (e.g. 1-3 hours per week). - maxLength: 100 - min_weekly_hours: - type: string - description: The minimum number of hours per week required to complete the - course. - maxLength: 5 - max_weekly_hours: - type: string - description: The maximum number of hours per week required to complete the - course. - maxLength: 5 - min_weeks: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: The minimum number of weeks required to complete the course/program. - max_weeks: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: The maximum number of weeks required to complete the course/program. - price: - type: array - items: - $ref: '#/components/schemas/PriceItem' - min_price: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: Specify the minimum product price. This is used by MIT Learn. - max_price: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: Specify the maximum product price. This is used by MIT Learn. - prerequisites: - type: string - nullable: true - description: A short description indicating prerequisites of this course/program. - faq_url: - type: string - format: uri - nullable: true - description: URL a relevant FAQ page or entry for the course/program. - maxLength: 200 - about: - type: string - nullable: true - description: Details about this course/program. - what_you_learn: - type: string - nullable: true - description: '*Required for Verifiable Credential generation. What you will - learn from this course.' - feature_image: - $ref: '#/components/schemas/FeatureImage' - video_url: - type: string - format: uri - nullable: true - description: URL to the video to be displayed for this course/program. It - can be an HLS or Youtube video URL. - maxLength: 200 - faculty_section_title: - type: string - nullable: true - description: The title text to display in the faculty cards section of the - product page. - maxLength: 255 - faculty: - type: array - items: - $ref: '#/components/schemas/Faculty' - certificate_page: - $ref: '#/components/schemas/CertificatePage' - program_details: - $ref: '#/components/schemas/V2Program' - required: - - about - - certificate_page - - description - - effort - - faculty - - faculty_section_title - - faq_url - - feature_image - - id - - length - - max_price - - max_weekly_hours - - max_weeks - - meta - - min_price - - min_weekly_hours - - min_weeks - - prerequisites - - price - - program_details - - title - - video_url - - what_you_learn - ProgramPageList: - type: object - description: Serializer for a list of program pages, including metadata and - items. - properties: - meta: - $ref: '#/components/schemas/PageListMeta' - items: - type: array - items: - $ref: '#/components/schemas/ProgramPageItem' - required: - - items - - meta - PublicUser: - type: object - description: Serializer for public user data - properties: - id: - type: integer - readOnly: true - username: - type: string - nullable: true - maxLength: 30 - name: - type: string - maxLength: 255 - created_on: - type: string - format: date-time - readOnly: true - updated_on: - type: string - format: date-time - readOnly: true - required: - - created_on - - id - - updated_on - RedeemedDiscount: - type: object - description: DiscountRedemption model serializer - properties: - redeemed_discount: - allOf: - - $ref: '#/components/schemas/Nested' - readOnly: true - required: - - redeemed_discount - RedemptionTypeEnum: - enum: - - one-time - - one-time-per-user - - unlimited - type: string - description: |- - * `one-time` - one-time - * `one-time-per-user` - one-time-per-user - * `unlimited` - unlimited - x-enum-descriptions: - - one-time - - one-time-per-user - - unlimited - ResultEnum: - enum: - - b2b-disallowed - - b2b-error-no-contract - - b2b-error-no-product - - b2b-error-missing-enrollment-code - - b2b-error-invalid-enrollment-code - - b2b-error-requires-checkout - - b2b-enroll-success - type: string - description: |- - * `b2b-disallowed` - b2b-disallowed - * `b2b-error-no-contract` - b2b-error-no-contract - * `b2b-error-no-product` - b2b-error-no-product - * `b2b-error-missing-enrollment-code` - b2b-error-missing-enrollment-code - * `b2b-error-invalid-enrollment-code` - b2b-error-invalid-enrollment-code - * `b2b-error-requires-checkout` - b2b-error-requires-checkout - * `b2b-enroll-success` - b2b-enroll-success - x-enum-descriptions: - - b2b-disallowed - - b2b-error-no-contract - - b2b-error-no-product - - b2b-error-missing-enrollment-code - - b2b-error-invalid-enrollment-code - - b2b-error-requires-checkout - - b2b-enroll-success - SignatoryItem: - type: object - description: Serializer for signatory items used in certificate pages. - properties: - name: - type: string - title_1: - type: string - title_2: - type: string - title_3: - type: string - organization: - type: string - signature_image: - type: string - required: - - name - - organization - - signature_image - - title_1 - - title_2 - - title_3 - StaffDashboardUser: - type: object - description: Serializer for data we care about in the staff dashboard - properties: - id: - type: integer - readOnly: true - username: - type: string - maxLength: 500 - name: - type: string - maxLength: 255 - email: - type: string - format: email - maxLength: 254 - legal_address: - allOf: - - $ref: '#/components/schemas/LegalAddress' - nullable: true - is_staff: - type: boolean - description: The user can access the admin site - is_superuser: - type: boolean - title: Superuser status - description: Designates that this user has all permissions without explicitly - assigning them. - required: - - email - - id - - legal_address - - username - StateEnum: - enum: - - pending - - fulfilled - - canceled - - declined - - errored - - refunded - - review - - partially_refunded - type: string - description: |- - * `pending` - Pending - * `fulfilled` - Fulfilled - * `canceled` - Canceled - * `declined` - Declined - * `errored` - Errored - * `refunded` - Refunded - * `review` - Review - * `partially_refunded` - Partially Refunded - x-enum-descriptions: - - Pending - - Fulfilled - - Canceled - - Declined - - Errored - - Refunded - - Review - - Partially Refunded - Topic: - type: object - description: Serializer for topics used in course pages. - properties: - name: - type: string - parent: - type: string - required: - - name - TransactionLine: - type: object - description: Serializes a line item from a transaction. - properties: - quantity: - type: integer - CEUs: - type: string - content_title: - type: string - readable_id: - type: string - start_date: - type: string - format: date-time - end_date: - type: string - format: date-time - total_paid: - type: string - discount: - type: string - price: - type: string - required: - - CEUs - - content_title - - discount - - end_date - - price - - quantity - - readable_id - - start_date - - total_paid - User: - type: object - description: Serializer for users - properties: - id: - type: integer - readOnly: true - username: - type: string - nullable: true - maxLength: 30 - name: - type: string - maxLength: 255 - email: - type: string - format: email - nullable: true - legal_address: - allOf: - - $ref: '#/components/schemas/LegalAddress' - nullable: true - user_profile: - allOf: - - $ref: '#/components/schemas/UserProfile' - nullable: true - is_anonymous: - type: boolean - readOnly: true - is_authenticated: - type: boolean - readOnly: true - is_editor: - type: boolean - description: Returns True if the user has editor permissions for the CMS - readOnly: true - is_staff: - type: boolean - readOnly: true - description: The user can access the admin site - is_superuser: - type: boolean - readOnly: true - title: Superuser status - description: Designates that this user has all permissions without explicitly - assigning them. - created_on: - type: string - format: date-time - readOnly: true - updated_on: - type: string - format: date-time - readOnly: true - grants: - type: array - items: - type: string - readOnly: true - is_active: - type: boolean - default: true - b2b_organizations: - type: array - items: - $ref: '#/components/schemas/OrganizationPage' - readOnly: true - global_id: - type: string - readOnly: true - nullable: true - description: The SSO ID (usually a Keycloak UUID) for the user. - required: - - b2b_organizations - - created_on - - global_id - - grants - - id - - is_anonymous - - is_authenticated - - is_editor - - is_staff - - is_superuser - - legal_address - - updated_on - UserDiscountMeta: - type: object - description: Serializes UserDiscount but only allows depth = 1 - properties: - id: - type: integer - readOnly: true - discount: - $ref: '#/components/schemas/V0Discount' - user: - $ref: '#/components/schemas/User' - required: - - discount - - id - - user - UserDiscountMetaRequest: - type: object - description: Serializes UserDiscount but only allows depth = 1 - properties: - discount: - $ref: '#/components/schemas/V0DiscountRequest' - user: - $ref: '#/components/schemas/UserRequest' - required: - - discount - - user - UserProfile: - type: object - description: Serializer for profile - properties: - gender: - nullable: true - oneOf: - - $ref: '#/components/schemas/GenderEnum' - - $ref: '#/components/schemas/BlankEnum' - - $ref: '#/components/schemas/NullEnum' - year_of_birth: - type: integer - maximum: 2147483647 - minimum: -2147483648 - nullable: true - addl_field_flag: - type: boolean - description: Flags if we've asked the user for additional information - company: - type: string - nullable: true - maxLength: 128 - job_title: - type: string - nullable: true - maxLength: 128 - industry: - type: string - nullable: true - maxLength: 60 - job_function: - type: string - nullable: true - maxLength: 60 - company_size: - nullable: true - oneOf: - - $ref: '#/components/schemas/CompanySizeEnum' - - $ref: '#/components/schemas/NullEnum' - years_experience: - nullable: true - oneOf: - - $ref: '#/components/schemas/YearsExperienceEnum' - - $ref: '#/components/schemas/NullEnum' - leadership_level: - type: string - nullable: true - maxLength: 60 - highest_education: - nullable: true - oneOf: - - $ref: '#/components/schemas/HighestEducationEnum' - - $ref: '#/components/schemas/BlankEnum' - - $ref: '#/components/schemas/NullEnum' - type_is_student: - type: boolean - nullable: true - description: The learner identifies as type Student - type_is_professional: - type: boolean - nullable: true - description: The learner identifies as type Professional - type_is_educator: - type: boolean - nullable: true - description: The learner identifies as type Educator - type_is_other: - type: boolean - nullable: true - description: The learner identifies as type Other (not professional, student, - or educator) - UserProfileRequest: - type: object - description: Serializer for profile - properties: - gender: - nullable: true - oneOf: - - $ref: '#/components/schemas/GenderEnum' - - $ref: '#/components/schemas/BlankEnum' - - $ref: '#/components/schemas/NullEnum' - year_of_birth: - type: integer - maximum: 2147483647 - minimum: -2147483648 - nullable: true - addl_field_flag: - type: boolean - description: Flags if we've asked the user for additional information - company: - type: string - nullable: true - maxLength: 128 - job_title: - type: string - nullable: true - maxLength: 128 - industry: - type: string - nullable: true - maxLength: 60 - job_function: - type: string - nullable: true - maxLength: 60 - company_size: - nullable: true - oneOf: - - $ref: '#/components/schemas/CompanySizeEnum' - - $ref: '#/components/schemas/NullEnum' - years_experience: - nullable: true - oneOf: - - $ref: '#/components/schemas/YearsExperienceEnum' - - $ref: '#/components/schemas/NullEnum' - leadership_level: - type: string - nullable: true - maxLength: 60 - highest_education: - nullable: true - oneOf: - - $ref: '#/components/schemas/HighestEducationEnum' - - $ref: '#/components/schemas/BlankEnum' - - $ref: '#/components/schemas/NullEnum' - type_is_student: - type: boolean - nullable: true - description: The learner identifies as type Student - type_is_professional: - type: boolean - nullable: true - description: The learner identifies as type Professional - type_is_educator: - type: boolean - nullable: true - description: The learner identifies as type Educator - type_is_other: - type: boolean - nullable: true - description: The learner identifies as type Other (not professional, student, - or educator) - UserProgramEnrollmentDetail: - type: object - properties: - program: - $ref: '#/components/schemas/V1Program' - enrollments: - type: array - items: - $ref: '#/components/schemas/CourseRunEnrollment' - certificate: - allOf: - - $ref: '#/components/schemas/V1ProgramCertificate' - nullable: true - readOnly: true - required: - - certificate - - enrollments - - program - UserRequest: - type: object - description: Serializer for users - properties: - username: - type: string - nullable: true - minLength: 1 - maxLength: 30 - name: - type: string - maxLength: 255 - email: - type: string - format: email - nullable: true - minLength: 1 - password: - type: string - writeOnly: true - minLength: 1 - legal_address: - allOf: - - $ref: '#/components/schemas/LegalAddressRequest' - nullable: true - user_profile: - allOf: - - $ref: '#/components/schemas/UserProfileRequest' - nullable: true - is_active: - type: boolean - default: true - required: - - legal_address - V0Discount: - type: object - description: Serializes a discount. - properties: - id: - type: integer - readOnly: true - amount: - type: string - format: decimal - pattern: ^-?\d{0,15}(?:\.\d{0,5})?$ - automatic: - type: boolean - discount_type: - $ref: '#/components/schemas/DiscountTypeEnum' - redemption_type: - $ref: '#/components/schemas/RedemptionTypeEnum' - max_redemptions: - type: integer - maximum: 2147483647 - minimum: 0 - nullable: true - discount_code: - type: string - maxLength: 100 - payment_type: - nullable: true - oneOf: - - $ref: '#/components/schemas/PaymentTypeEnum' - - $ref: '#/components/schemas/NullEnum' - is_redeemed: - type: boolean - description: Returns True if the discount has been redeemed - readOnly: true - activation_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable before this - date. - expiration_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable after this - date. - required: - - amount - - discount_code - - discount_type - - id - - is_redeemed - - redemption_type - V0DiscountRequest: - type: object - description: Serializes a discount. - properties: - amount: - type: string - format: decimal - pattern: ^-?\d{0,15}(?:\.\d{0,5})?$ - automatic: - type: boolean - discount_type: - $ref: '#/components/schemas/DiscountTypeEnum' - redemption_type: - $ref: '#/components/schemas/RedemptionTypeEnum' - max_redemptions: - type: integer - maximum: 2147483647 - minimum: 0 - nullable: true - discount_code: - type: string - minLength: 1 - maxLength: 100 - payment_type: - nullable: true - oneOf: - - $ref: '#/components/schemas/PaymentTypeEnum' - - $ref: '#/components/schemas/NullEnum' - activation_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable before this - date. - expiration_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable after this - date. - required: - - amount - - discount_code - - discount_type - - redemption_type - V1BaseCourseRun: - type: object - description: CourseRun model serializer - properties: - title: - type: string - description: The title of the course. This value is synced automatically - with edX studio. - maxLength: 255 - start_date: - type: string - format: date-time - nullable: true - description: The day the course begins. This value is synced automatically - with edX studio. - end_date: - type: string - format: date-time - nullable: true - description: The last day the course is active. This value is synced automatically - with edX studio. - enrollment_start: - type: string - format: date-time - nullable: true - description: The first day students can enroll. This value is synced automatically - with edX studio. - enrollment_end: - type: string - format: date-time - nullable: true - description: The last day students can enroll. This value is synced automatically - with edX studio. - expiration_date: - type: string - format: date-time - nullable: true - description: The date beyond which the learner should not see link to this - course run on their dashboard. - courseware_url: - type: string - nullable: true - description: Get the courseware URL - readOnly: true - courseware_id: - type: string - maxLength: 255 - certificate_available_date: - type: string - format: date-time - nullable: true - description: The day certificates should be available to users. This value - is synced automatically with edX studio. - upgrade_deadline: - type: string - format: date-time - nullable: true - description: The date beyond which the learner can not enroll in paid course - mode. - is_upgradable: - type: boolean - description: Check if the course run is upgradable - readOnly: true - is_enrollable: - type: boolean - description: Check if the course run is enrollable - readOnly: true - is_archived: - type: boolean - description: Check if the course run is archived - readOnly: true - is_self_paced: - type: boolean - run_tag: - type: string - description: 'A string that identifies the set of runs that this run belongs - to (example: ''R2'')' - maxLength: 100 - id: - type: integer - readOnly: true - live: - type: boolean - course_number: - type: string - description: Get the course number - readOnly: true - products: - type: array - items: - allOf: - - $ref: '#/components/schemas/ProductFlexibilePrice' - readOnly: true - approved_flexible_price_exists: - type: boolean - readOnly: true - required: - - approved_flexible_price_exists - - course_number - - courseware_id - - courseware_url - - id - - is_archived - - is_enrollable - - is_upgradable - - products - - run_tag - - title - V1CourseRunWithCourse: - type: object - description: CourseRun model serializer - also serializes the parent Course. - properties: - title: - type: string - description: The title of the course. This value is synced automatically - with edX studio. - maxLength: 255 - start_date: - type: string - format: date-time - nullable: true - description: The day the course begins. This value is synced automatically - with edX studio. - end_date: - type: string - format: date-time - nullable: true - description: The last day the course is active. This value is synced automatically - with edX studio. - enrollment_start: - type: string - format: date-time - nullable: true - description: The first day students can enroll. This value is synced automatically - with edX studio. - enrollment_end: - type: string - format: date-time - nullable: true - description: The last day students can enroll. This value is synced automatically - with edX studio. - expiration_date: - type: string - format: date-time - nullable: true - description: The date beyond which the learner should not see link to this - course run on their dashboard. - courseware_url: - type: string - nullable: true - description: Get the courseware URL - readOnly: true - courseware_id: - type: string - maxLength: 255 - certificate_available_date: - type: string - format: date-time - nullable: true - description: The day certificates should be available to users. This value - is synced automatically with edX studio. - upgrade_deadline: - type: string - format: date-time - nullable: true - description: The date beyond which the learner can not enroll in paid course - mode. - is_upgradable: - type: boolean - description: Check if the course run is upgradable - readOnly: true - is_enrollable: - type: boolean - description: Check if the course run is enrollable - readOnly: true - is_archived: - type: boolean - description: Check if the course run is archived - readOnly: true - is_self_paced: - type: boolean - run_tag: - type: string - description: 'A string that identifies the set of runs that this run belongs - to (example: ''R2'')' - maxLength: 100 - id: - type: integer - readOnly: true - live: - type: boolean - course_number: - type: string - description: Get the course number - readOnly: true - products: - type: array - items: - allOf: - - $ref: '#/components/schemas/ProductFlexibilePrice' - readOnly: true - description: List of products associated with this course run - approved_flexible_price_exists: - type: boolean - readOnly: true - course: - allOf: - - $ref: '#/components/schemas/Course' - readOnly: true - required: - - approved_flexible_price_exists - - course - - course_number - - courseware_id - - courseware_url - - id - - is_archived - - is_enrollable - - is_upgradable - - products - - run_tag - - title - V1CourseRunWithCourseRequest: - type: object - description: CourseRun model serializer - also serializes the parent Course. - properties: - title: - type: string - minLength: 1 - description: The title of the course. This value is synced automatically - with edX studio. - maxLength: 255 - start_date: - type: string - format: date-time - nullable: true - description: The day the course begins. This value is synced automatically - with edX studio. - end_date: - type: string - format: date-time - nullable: true - description: The last day the course is active. This value is synced automatically - with edX studio. - enrollment_start: - type: string - format: date-time - nullable: true - description: The first day students can enroll. This value is synced automatically - with edX studio. - enrollment_end: - type: string - format: date-time - nullable: true - description: The last day students can enroll. This value is synced automatically - with edX studio. - expiration_date: - type: string - format: date-time - nullable: true - description: The date beyond which the learner should not see link to this - course run on their dashboard. - courseware_id: - type: string - minLength: 1 - maxLength: 255 - certificate_available_date: - type: string - format: date-time - nullable: true - description: The day certificates should be available to users. This value - is synced automatically with edX studio. - upgrade_deadline: - type: string - format: date-time - nullable: true - description: The date beyond which the learner can not enroll in paid course - mode. - is_self_paced: - type: boolean - run_tag: - type: string - minLength: 1 - description: 'A string that identifies the set of runs that this run belongs - to (example: ''R2'')' - maxLength: 100 - live: - type: boolean - required: - - courseware_id - - run_tag - - title - V1CourseWithCourseRuns: - type: object - description: Course model serializer - also serializes child course runs - properties: - id: - type: integer - readOnly: true - title: - type: string - maxLength: 255 - readable_id: - type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - next_run_id: - type: integer - nullable: true - description: Get next run id - readOnly: true - departments: - type: array - items: - $ref: '#/components/schemas/Department' - readOnly: true - page: - allOf: - - $ref: '#/components/schemas/CoursePage' - readOnly: true - programs: - allOf: - - $ref: '#/components/schemas/Program' - nullable: true - readOnly: true - courseruns: - type: array - items: - $ref: '#/components/schemas/V1BaseCourseRun' - readOnly: true - required: - - courseruns - - departments - - id - - next_run_id - - page - - programs - - readable_id - - title - V1Program: - type: object - description: Program model serializer - properties: - title: - type: string - maxLength: 255 - readable_id: - type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - id: - type: integer - readOnly: true - courses: - allOf: - - $ref: '#/components/schemas/V1CourseWithCourseRuns' - readOnly: true - requirements: - type: object - properties: - required: - type: array - items: - oneOf: - - type: integer - description: List of required course IDs - electives: - type: array - items: - oneOf: - - type: integer - description: List of elective course IDs - readOnly: true - req_tree: - type: array - items: - $ref: '#/components/schemas/V1ProgramRequirement' - readOnly: true - page: - allOf: - - $ref: '#/components/schemas/ProgramPage' - readOnly: true - program_type: - type: string - nullable: true - maxLength: 255 - departments: - type: array - items: - $ref: '#/components/schemas/Department' - readOnly: true - live: - type: boolean - required: - - courses - - departments - - id - - page - - readable_id - - req_tree - - requirements - - title - V1ProgramCertificate: - type: object - description: ProgramCertificate model serializer - properties: - uuid: - type: string - format: uuid - readOnly: true - link: - type: string - description: |- - Get the link at which this certificate will be served - Format: /certificate/program// - Example: /certificate/program/93ebd74e-5f88-4b47-bb09-30a6d575328f/ - readOnly: true - required: - - link - - uuid - V1ProgramRequirement: - type: object - description: Serializer for a ProgramRequirement - properties: - id: - type: integer - nullable: true - data: - $ref: '#/components/schemas/V1ProgramRequirementData' - children: - type: array - items: - $ref: '#/components/schemas/V1ProgramRequirement' - default: [] - required: - - data - V1ProgramRequirementData: - type: object - description: Serializer for ProgramRequirement data - properties: - node_type: - $ref: '#/components/schemas/NodeTypeEnum' - course: - type: string - nullable: true - required_program: - type: string - nullable: true - program: - type: string - title: - type: string - nullable: true - operator: - type: string - nullable: true - operator_value: - type: string - nullable: true - elective_flag: - type: boolean - nullable: true - default: false - required: - - node_type - V2Course: - type: object - description: Course model serializer - properties: - id: - type: integer - readOnly: true - title: - type: string - maxLength: 255 - readable_id: - type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - next_run_id: - type: integer - nullable: true - description: Get next run id - readOnly: true - departments: - type: array - items: - $ref: '#/components/schemas/Department' - readOnly: true - page: - allOf: - - $ref: '#/components/schemas/CoursePage' - readOnly: true - programs: - type: array - items: - $ref: '#/components/schemas/BaseProgram' - nullable: true - readOnly: true - topics: - type: array - items: - type: object - additionalProperties: {} - description: List topics of a course - readOnly: true - certificate_type: - type: string - readOnly: true - required_prerequisites: - type: boolean - description: |- - Check if the prerequisites field is populated in the course page CMS. - Returns: - bool: True when the prerequisites field is populated in the course page CMS. False otherwise. - readOnly: true - duration: - type: string - description: Get the duration of the course from the course page CMS. - readOnly: true - min_weeks: - type: integer - nullable: true - description: Get the min weeks of the course from the CMS page. - readOnly: true - max_weeks: - type: integer - nullable: true - description: Get the max weeks of the course from the CMS page. - readOnly: true - min_price: - type: integer - nullable: true - description: Get the min price of the product from the CMS page. - readOnly: true - max_price: - type: integer - nullable: true - description: Get the max price of the product from the CMS page. - readOnly: true - time_commitment: - type: string - nullable: true - description: Get the time commitment of the course from the course page - CMS. - readOnly: true - availability: - type: string - description: Get course availability - readOnly: true - min_weekly_hours: - type: string - nullable: true - description: Get the min weekly hours of the course from the course page - CMS. - readOnly: true - max_weekly_hours: - type: string - nullable: true - description: Get the max weekly hours of the course from the course page - CMS. - readOnly: true - include_in_learn_catalog: - type: boolean - readOnly: true - ingest_content_files_for_ai: - type: boolean - readOnly: true - required: - - availability - - certificate_type - - departments - - duration - - id - - include_in_learn_catalog - - ingest_content_files_for_ai - - max_price - - max_weekly_hours - - max_weeks - - min_price - - min_weekly_hours - - min_weeks - - next_run_id - - page - - programs - - readable_id - - required_prerequisites - - time_commitment - - title - - topics - V2CourseRequest: - type: object - description: Course model serializer - properties: - title: - type: string - minLength: 1 - maxLength: 255 - readable_id: - type: string - minLength: 1 - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - required: - - readable_id - - title - V2CourseRunCertificate: - type: object - description: Serializer for course certificates. - properties: - user: - $ref: '#/components/schemas/PublicUser' - uuid: - type: string - format: uuid - readOnly: true - is_revoked: - type: boolean - readOnly: true - title: Revoked - description: Indicates whether or not the certificate is revoked - certificate_page: - allOf: - - $ref: '#/components/schemas/CertificatePageModel' - readOnly: true - verifiable_credential_json: - readOnly: true - course_run: - $ref: '#/components/schemas/V2CourseRunWithCourse' - certificate_page_revision: - type: integer - readOnly: true - nullable: true - required: - - certificate_page - - certificate_page_revision - - course_run - - is_revoked - - user - - uuid - - verifiable_credential_json - V2CourseRunWithCourse: - type: object - description: CourseRun model serializer - also serializes the parent Course. - properties: - title: - type: string - description: The title of the course. This value is synced automatically - with edX studio. - maxLength: 255 - start_date: - type: string - format: date-time - nullable: true - description: The day the course begins. This value is synced automatically - with edX studio. - end_date: - type: string - format: date-time - nullable: true - description: The last day the course is active. This value is synced automatically - with edX studio. - enrollment_start: - type: string - format: date-time - nullable: true - description: The first day students can enroll. This value is synced automatically - with edX studio. - enrollment_end: - type: string - format: date-time - nullable: true - description: The last day students can enroll. This value is synced automatically - with edX studio. - expiration_date: - type: string - format: date-time - nullable: true - description: The date beyond which the learner should not see link to this - course run on their dashboard. - courseware_url: - type: string - nullable: true - description: Get the courseware URL - readOnly: true - courseware_id: - type: string - maxLength: 255 - certificate_available_date: - type: string - format: date-time - nullable: true - description: The day certificates should be available to users. This value - is synced automatically with edX studio. - upgrade_deadline: - type: string - format: date-time - nullable: true - description: The date beyond which the learner can not enroll in paid course - mode. - is_upgradable: - type: boolean - description: Check if the course run is upgradable - readOnly: true - is_enrollable: - type: boolean - description: Check if the course run is enrollable - readOnly: true - is_archived: - type: boolean - description: Check if the course run is archived - readOnly: true - is_self_paced: - type: boolean - run_tag: - type: string - description: 'A string that identifies the set of runs that this run belongs - to (example: ''R2'')' - maxLength: 100 - id: - type: integer - readOnly: true - live: - type: boolean - course_number: - type: string - description: Get the course number - readOnly: true - products: - type: array - items: - allOf: - - $ref: '#/components/schemas/ProductFlexibilePrice' - readOnly: true - approved_flexible_price_exists: - type: boolean - readOnly: true - b2b_contract: - type: integer - nullable: true - course: - allOf: - - $ref: '#/components/schemas/V2Course' - readOnly: true - required: - - approved_flexible_price_exists - - course - - course_number - - courseware_id - - courseware_url - - id - - is_archived - - is_enrollable - - is_upgradable - - products - - run_tag - - title - V2CourseRunWithCourseRequest: - type: object - description: CourseRun model serializer - also serializes the parent Course. - properties: - title: - type: string - minLength: 1 - description: The title of the course. This value is synced automatically - with edX studio. - maxLength: 255 - start_date: - type: string - format: date-time - nullable: true - description: The day the course begins. This value is synced automatically - with edX studio. - end_date: - type: string - format: date-time - nullable: true - description: The last day the course is active. This value is synced automatically - with edX studio. - enrollment_start: - type: string - format: date-time - nullable: true - description: The first day students can enroll. This value is synced automatically - with edX studio. - enrollment_end: - type: string - format: date-time - nullable: true - description: The last day students can enroll. This value is synced automatically - with edX studio. - expiration_date: - type: string - format: date-time - nullable: true - description: The date beyond which the learner should not see link to this - course run on their dashboard. - courseware_id: - type: string - minLength: 1 - maxLength: 255 - certificate_available_date: - type: string - format: date-time - nullable: true - description: The day certificates should be available to users. This value - is synced automatically with edX studio. - upgrade_deadline: - type: string - format: date-time - nullable: true - description: The date beyond which the learner can not enroll in paid course - mode. - is_self_paced: - type: boolean - run_tag: - type: string - minLength: 1 - description: 'A string that identifies the set of runs that this run belongs - to (example: ''R2'')' - maxLength: 100 - live: - type: boolean - b2b_contract: - type: integer - nullable: true - required: - - courseware_id - - run_tag - - title - V2Program: - type: object - description: Program Model Serializer v2 - properties: - title: - type: string - maxLength: 255 - readable_id: - type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - id: - type: integer - readOnly: true - courses: - type: array - items: - type: integer - readOnly: true - collections: - type: array - items: - type: integer - readOnly: true - requirements: - type: object - properties: - courses: - type: object - properties: - required: - type: array - items: - type: object - properties: - id: - type: integer - readable_id: - type: string - description: List of required courses with id and readable_id - electives: - type: array - items: - type: object - properties: - id: - type: integer - readable_id: - type: string - description: List of elective courses with id and readable_id - programs: - type: object - properties: - required: - type: array - items: - type: object - properties: - id: - type: integer - readable_id: - type: string - description: List of required programs with id and readable_id - electives: - type: array - items: - type: object - properties: - id: - type: integer - readable_id: - type: string - description: List of elective programs with id and readable_id - readOnly: true - req_tree: - type: array - items: - $ref: '#/components/schemas/V2ProgramRequirement' - readOnly: true - page: - allOf: - - $ref: '#/components/schemas/ProgramPage' - readOnly: true - program_type: - type: string - nullable: true - maxLength: 255 - certificate_type: - type: string - readOnly: true - departments: - type: array - items: - $ref: '#/components/schemas/Department' - readOnly: true - live: - type: boolean - topics: - type: array - items: - type: object - properties: - name: - type: string - readOnly: true - availability: - $ref: '#/components/schemas/AvailabilityEnum' - start_date: - type: string - nullable: true - description: Get the start date of the program by finding the first available - run. - readOnly: true - end_date: - type: string - format: date-time - nullable: true - enrollment_start: - type: string - format: date-time - nullable: true - enrollment_end: - type: string - format: date-time - nullable: true - required_prerequisites: - type: boolean - description: Check if the prerequisites field is populated in the program - page CMS. - readOnly: true - duration: - type: string - nullable: true - description: Get the length/duration field from the program page CMS. - readOnly: true - min_weeks: - type: integer - nullable: true - description: Get the min weeks of the program from the CMS page. - readOnly: true - max_weeks: - type: integer - nullable: true - description: Get the max weeks of the program from the CMS page. - readOnly: true - min_price: - type: integer - nullable: true - description: Get the min price of the product from the CMS page. - readOnly: true - max_price: - type: integer - nullable: true - description: Get the max price of the product from the CMS page. - readOnly: true - time_commitment: - type: string - nullable: true - description: Get the effort/time_commitment field from the program page - CMS. - readOnly: true - min_weekly_hours: - type: string - nullable: true - description: Get the min weekly hours of the course from the course page - CMS. - readOnly: true - max_weekly_hours: - type: string - nullable: true - description: Get the max weekly hours of the course from the course page - CMS. - readOnly: true - required: - - certificate_type - - collections - - courses - - departments - - duration - - id - - max_price - - max_weekly_hours - - max_weeks - - min_price - - min_weekly_hours - - min_weeks - - page - - readable_id - - req_tree - - required_prerequisites - - requirements - - start_date - - time_commitment - - title - - topics - V2ProgramCertificate: - type: object - description: Serializer for course certificates. - properties: - user: - $ref: '#/components/schemas/PublicUser' - uuid: - type: string - format: uuid - readOnly: true - is_revoked: - type: boolean - readOnly: true - title: Revoked - description: Indicates whether or not the certificate is revoked - certificate_page: - allOf: - - $ref: '#/components/schemas/CertificatePageModel' - readOnly: true - verifiable_credential_json: - readOnly: true - program: - $ref: '#/components/schemas/V2Program' - certificate_page_revision: - type: integer - readOnly: true - nullable: true - required: - - certificate_page - - certificate_page_revision - - is_revoked - - program - - user - - uuid - - verifiable_credential_json - V2ProgramCollection: - type: object - description: Serializer for ProgramCollection - properties: - id: - type: integer - readOnly: true - title: - type: string - description: - type: string - programs: - type: array - items: - type: object - properties: - id: - type: integer - title: - type: string - order: - type: integer - readOnly: true - created_on: - type: string - format: date-time - readOnly: true - updated_on: - type: string - format: date-time - readOnly: true - required: - - created_on - - description - - id - - programs - - title - - updated_on - V2ProgramRequirement: - type: object - description: Serializer for a ProgramRequirement - properties: - id: - type: integer - nullable: true - data: - $ref: '#/components/schemas/V2ProgramRequirementData' - children: - type: array - items: - $ref: '#/components/schemas/V2ProgramRequirement' - default: [] - required: - - data - V2ProgramRequirementData: - type: object - description: Serializer for ProgramRequirement data - properties: - node_type: - $ref: '#/components/schemas/NodeTypeEnum' - course: - type: integer - nullable: true - program: - type: integer - nullable: true - required_program: - type: integer - nullable: true - title: - type: string - nullable: true - operator: - type: string - nullable: true - operator_value: - type: string - nullable: true - elective_flag: - type: boolean - nullable: true - default: false - required: - - node_type - V2UserProgramEnrollmentDetail: - type: object - description: |- - Serializer for user program enrollments with associated course enrollments. - - This aggregates a program, its course enrollments for the user, and any - program certificate that has been earned. - properties: - program: - $ref: '#/components/schemas/V2Program' - enrollments: - type: array - items: - $ref: '#/components/schemas/CourseRunEnrollmentRequestV2' - certificate: - allOf: - - $ref: '#/components/schemas/ProgramCertificate' - nullable: true - readOnly: true - required: - - certificate - - enrollments - - program - YearsExperienceEnum: - enum: - - 2 - - 5 - - 10 - - 15 - - 20 - - 21 - - 0 - description: |- - * `None` - ---- - * `2` - Less than 2 years - * `5` - 2-5 years - * `10` - 6 - 10 years - * `15` - 11 - 15 years - * `20` - 16 - 20 years - * `21` - More than 20 years - * `0` - Prefer not to say - x-enum-descriptions: - - Less than 2 years - - 2-5 years - - 6 - 10 years - - 11 - 15 years - - 16 - 20 years - - More than 20 years - - Prefer not to say +paths: {} +components: {} diff --git a/openapi/specs/v1.yaml b/openapi/specs/v1.yaml index 1ee5f8f690..d47b227aea 100644 --- a/openapi/specs/v1.yaml +++ b/openapi/specs/v1.yaml @@ -3,7939 +3,5 @@ info: title: MITx Online API version: 0.0.1 (v1) description: MIT public API -paths: - /api/records/program/{id}/: - get: - operationId: learner_record_retrieve_by_id - description: Get learner record using program ID - parameters: - - in: path - name: id - schema: - type: integer - required: true - tags: - - api - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/LearnerRecord' - description: '' - /api/records/program/{id}/revoke/: - post: - operationId: api_records_program_revoke_create - description: |- - Disables sharing links for the learner's record. This only applies to the - anonymous ones; shares sent to partner schools are always allowed once they - are sent. - parameters: - - in: path - name: id - schema: - type: integer - required: true - tags: - - api - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/LearnerRecord' - description: '' - /api/records/program/{id}/share/: - post: - operationId: api_records_program_share_create - description: |- - Sets up a sharing link for the learner's record. Returns back the entire - learner record. - parameters: - - in: path - name: id - schema: - type: integer - required: true - tags: - - api - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PartnerSchoolRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PartnerSchoolRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PartnerSchoolRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/LearnerRecord' - description: '' - /api/records/shared/{uuid}/: - get: - operationId: learner_record_retrieve_by_uuid - description: Get learner record using share UUID - parameters: - - in: path - name: uuid - schema: - type: string - format: uuid - required: true - tags: - - api - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/LearnerRecord' - description: '' - /api/v0/b2b/attach/{enrollment_code}/: - post: - operationId: b2b_attach_create - description: |- - Use the provided enrollment code to attach the user to a B2B contract. - - This will not create an order, nor will it enroll the user. It will - attach the user to the contract and log that the code was used for this - purpose (but will _not_ invalidate the code, since we're not actually - using it at this point). - - This will respect the activation and expiration dates (of both the contract - and the discount), and will make sure there's sufficient available seats - in the contract. It will also make sure the code hasn't been used for - attachment purposes before. - - If the user is already in the contract, then we skip it. - - Returns: - - 201: Code successfully redeemed and user attached to new contract(s) - - 200: Code valid but user already attached to all associated contracts - - 404: Invalid or expired enrollment code - - list of ContractPageSerializer - the contracts for the user - parameters: - - in: path - name: enrollment_code - schema: - type: string - required: true - tags: - - b2b - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ContractPage' - description: '' - /api/v0/b2b/contracts/: - get: - operationId: b2b_contracts_list - description: Viewset for the ContractPage model. - tags: - - b2b - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ContractPage' - description: '' - /api/v0/b2b/contracts/{contract_slug}/: - get: - operationId: b2b_contracts_retrieve - description: Viewset for the ContractPage model. - parameters: - - in: path - name: contract_slug - schema: - type: string - description: The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/ - required: true - tags: - - b2b - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ContractPage' - description: '' - /api/v0/b2b/enroll/{readable_id}/: - post: - operationId: b2b_enroll_create - description: Create an enrollment for the given course run. - parameters: - - in: path - name: readable_id - schema: - type: string - required: true - tags: - - b2b - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CreateB2BEnrollment' - description: '' - /api/v0/b2b/organizations/: - get: - operationId: b2b_organizations_list - description: Viewset for the OrganizationPage model. - tags: - - b2b - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/OrganizationPage' - description: '' - /api/v0/b2b/organizations/{organization_slug}/: - get: - operationId: b2b_organizations_retrieve - description: Viewset for the OrganizationPage model. - parameters: - - in: path - name: organization_slug - schema: - type: string - description: The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/ - required: true - tags: - - b2b - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/OrganizationPage' - description: '' - /api/v0/baskets/: - get: - operationId: baskets_list - description: Retrives the current user's baskets. - tags: - - baskets - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/BasketWithProduct' - description: '' - /api/v0/baskets/{parent_lookup_basket}/items/: - get: - operationId: baskets_items_list - description: Returns the basket items for the current user. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the basket item - required: true - - in: path - name: parent_lookup_basket - schema: - type: integer - description: ID of the parent basket - required: true - tags: - - baskets - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/BasketItem' - description: '' - post: - operationId: baskets_items_create - description: Returns the basket items for the current user. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the basket item - required: true - - in: path - name: parent_lookup_basket - schema: - type: integer - description: ID of the parent basket - required: true - tags: - - baskets - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/BasketItem' - description: '' - /api/v0/baskets/{parent_lookup_basket}/items/{id}/: - get: - operationId: baskets_items_retrieve - description: Returns the basket items for the current user. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the basket item - required: true - - in: path - name: parent_lookup_basket - schema: - type: integer - description: ID of the parent basket - required: true - tags: - - baskets - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BasketItem' - description: '' - put: - operationId: baskets_items_update - description: Returns the basket items for the current user. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the basket item - required: true - - in: path - name: parent_lookup_basket - schema: - type: integer - description: ID of the parent basket - required: true - tags: - - baskets - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BasketItem' - description: '' - patch: - operationId: baskets_items_partial_update - description: Returns the basket items for the current user. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the basket item - required: true - - in: path - name: parent_lookup_basket - schema: - type: integer - description: ID of the parent basket - required: true - tags: - - baskets - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BasketItem' - description: '' - delete: - operationId: baskets_items_destroy - description: Returns the basket items for the current user. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the basket item - required: true - - in: path - name: parent_lookup_basket - schema: - type: integer - description: ID of the parent basket - required: true - tags: - - baskets - responses: - '204': - description: No response body - /api/v0/baskets/{id}/: - get: - operationId: baskets_retrieve - description: Retrieve a basket for the current user. - parameters: - - in: path - name: id - schema: - type: integer - required: true - tags: - - baskets - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BasketWithProduct' - description: '' - /api/v0/baskets/add_discount/: - post: - operationId: baskets_add_discount_create - description: Creates or updates a basket for the current user, adding the discount - if valid. - parameters: - - in: query - name: discount_code - schema: - type: string - required: true - tags: - - baskets - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BasketWithProduct' - description: '' - /api/v0/baskets/checkout/: - get: - operationId: baskets_checkout_retrieve - description: Returns the payload necessary to redirect the user to CyberSource - for payment. - tags: - - baskets - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CheckoutPayload' - description: '' - /api/v0/baskets/clear/: - delete: - operationId: baskets_clear_destroy - description: Clears the basket for the current user. - tags: - - baskets - responses: - '204': - description: Basket cleared successfully - /api/v0/baskets/create_from_product/{product_id}/: - post: - operationId: baskets_create_from_product_create - description: Creates or updates a basket for the current user, adding the selected - product. - parameters: - - in: path - name: product_id - schema: - type: integer - required: true - tags: - - baskets - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BasketWithProduct' - description: '' - /api/v0/baskets/create_from_product/{product_id}/{discount_code}/: - post: - operationId: create_basket_from_product_with_discount - description: Creates or updates a basket for the current user, adding the selected - product and discount. - parameters: - - in: path - name: discount_code - schema: - type: string - required: true - - in: path - name: product_id - schema: - type: integer - required: true - tags: - - baskets - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BasketWithProduct' - description: '' - /api/v0/baskets/create_with_products/: - post: - operationId: baskets_create_with_products_create - description: Creates or updates a basket for the current user, adding the selected - product. - tags: - - baskets - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateBasketWithProductsRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CreateBasketWithProductsRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/CreateBasketWithProductsRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BasketWithProduct' - description: '' - /api/v0/change-emails/: - post: - operationId: change_emails_create - description: Viewset for creating and updating email change requests - tags: - - change-emails - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ChangeEmailRequestCreateRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/ChangeEmailRequestCreateRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/ChangeEmailRequestCreateRequest' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ChangeEmailRequestCreate' - description: '' - /api/v0/change-emails/{code}/: - put: - operationId: change_emails_update - description: Viewset for creating and updating email change requests - parameters: - - in: path - name: code - schema: - type: string - required: true - tags: - - change-emails - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ChangeEmailRequestUpdateRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/ChangeEmailRequestUpdateRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/ChangeEmailRequestUpdateRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ChangeEmailRequestUpdate' - description: '' - patch: - operationId: change_emails_partial_update - description: Viewset for creating and updating email change requests - parameters: - - in: path - name: code - schema: - type: string - required: true - tags: - - change-emails - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedChangeEmailRequestUpdateRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedChangeEmailRequestUpdateRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedChangeEmailRequestUpdateRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ChangeEmailRequestUpdate' - description: '' - /api/v0/countries/: - get: - operationId: countries_list - description: Get generator for countries/states list - tags: - - countries - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Country' - description: '' - /api/v0/discounts/: - get: - operationId: discounts_list - description: API view set for Discounts - parameters: - - in: query - name: is_redeemed - schema: - type: string - enum: - - 'no' - - 'yes' - description: |- - * `yes` - yes - * `no` - no - - name: limit - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: offset - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - - in: query - name: payment_type - schema: - type: string - nullable: true - enum: - - customer-support - - financial-assistance - - legacy - - marketing - - sales - - staff - description: |- - * `marketing` - marketing - * `sales` - sales - * `financial-assistance` - financial-assistance - * `customer-support` - customer-support - * `staff` - staff - * `legacy` - legacy - - in: query - name: q - schema: - type: string - description: q - - in: query - name: redemption_type - schema: - type: string - enum: - - one-time - - one-time-per-user - - unlimited - description: |- - * `one-time` - one-time - * `one-time-per-user` - one-time-per-user - * `unlimited` - unlimited - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedV0DiscountList' - description: '' - post: - operationId: discounts_create - description: API view set for Discounts - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/V0DiscountRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/V0DiscountRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/V0DiscountRequest' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/V0Discount' - description: '' - /api/v0/discounts/{parent_lookup_discount}/assignees/: - get: - operationId: discounts_assignees_list - description: API view set for User Discounts. This one is for use within a Discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - name: limit - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: offset - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedUserDiscountMetaList' - description: '' - post: - operationId: discounts_assignees_create - description: Create an association between a user and a discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UserDiscountMetaRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/UserDiscountMetaRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/UserDiscountMetaRequest' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/UserDiscountMeta' - description: '' - /api/v0/discounts/{parent_lookup_discount}/assignees/{id}/: - get: - operationId: discounts_assignees_retrieve - description: API view set for User Discounts. This one is for use within a Discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/UserDiscountMeta' - description: '' - put: - operationId: discounts_assignees_update - description: API view set for User Discounts. This one is for use within a Discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UserDiscountMetaRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/UserDiscountMetaRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/UserDiscountMetaRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/UserDiscountMeta' - description: '' - patch: - operationId: discounts_assignees_partial_update - description: Partial update for a user discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedUserDiscountMetaRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedUserDiscountMetaRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedUserDiscountMetaRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/UserDiscountMeta' - description: '' - delete: - operationId: discounts_assignees_destroy - description: Delete a user discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '204': - description: No response body - /api/v0/discounts/{parent_lookup_discount}/products/: - get: - operationId: discounts_products_list - description: API view set for Discounts - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the discount product - required: true - - name: limit - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: offset - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedDiscountProductList' - description: '' - post: - operationId: discounts_products_create - description: API view set for Discounts - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the discount product - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountProductRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/DiscountProductRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/DiscountProductRequest' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountProduct' - description: '' - /api/v0/discounts/{parent_lookup_discount}/products/{id}/: - get: - operationId: discounts_products_retrieve - description: API view set for Discounts - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the discount product - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountProduct' - description: '' - put: - operationId: discounts_products_update - description: API view set for Discounts - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the discount product - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountProductRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/DiscountProductRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/DiscountProductRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountProduct' - description: '' - patch: - operationId: discounts_products_partial_update - description: Partial update for a discount product. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the discount product - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedDiscountProductRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedDiscountProductRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedDiscountProductRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountProduct' - description: '' - delete: - operationId: discounts_products_destroy - description: Delete a linked product from a discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the discount product - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '204': - description: No response body - /api/v0/discounts/{parent_lookup_discount}/tiers/: - get: - operationId: discounts_tiers_list - description: API view set for Flexible Pricing Tiers. This one is for use within - a Discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - name: limit - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: offset - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedFlexiblePriceTierList' - description: '' - post: - operationId: discounts_tiers_create - description: API view set for Flexible Pricing Tiers. This one is for use within - a Discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FlexiblePriceTierRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/FlexiblePriceTierRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/FlexiblePriceTierRequest' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/FlexiblePriceTier' - description: '' - /api/v0/discounts/{parent_lookup_discount}/tiers/{id}/: - get: - operationId: discounts_tiers_retrieve - description: API view set for Flexible Pricing Tiers. This one is for use within - a Discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/FlexiblePriceTier' - description: '' - put: - operationId: discounts_tiers_update - description: API view set for Flexible Pricing Tiers. This one is for use within - a Discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FlexiblePriceTierRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/FlexiblePriceTierRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/FlexiblePriceTierRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/FlexiblePriceTier' - description: '' - patch: - operationId: discounts_tiers_partial_update - description: API view set for Flexible Pricing Tiers. This one is for use within - a Discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedFlexiblePriceTierRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedFlexiblePriceTierRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedFlexiblePriceTierRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/FlexiblePriceTier' - description: '' - delete: - operationId: discounts_tiers_destroy - description: API view set for Flexible Pricing Tiers. This one is for use within - a Discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '204': - description: No response body - /api/v0/discounts/{parent_lookup_redeemed_discount}/redemptions/: - get: - operationId: discounts_redemptions_list - description: API view set for Discount Redemptions - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - name: limit - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: offset - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - - in: path - name: parent_lookup_redeemed_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedDiscountRedemptionList' - description: '' - post: - operationId: discounts_redemptions_create - description: API view set for Discount Redemptions - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_redeemed_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountRedemptionRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/DiscountRedemptionRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/DiscountRedemptionRequest' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountRedemption' - description: '' - /api/v0/discounts/{parent_lookup_redeemed_discount}/redemptions/{id}/: - get: - operationId: discounts_redemptions_retrieve - description: API view set for Discount Redemptions - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_redeemed_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountRedemption' - description: '' - put: - operationId: discounts_redemptions_update - description: API view set for Discount Redemptions - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_redeemed_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountRedemptionRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/DiscountRedemptionRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/DiscountRedemptionRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountRedemption' - description: '' - patch: - operationId: discounts_redemptions_partial_update - description: API view set for Discount Redemptions - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_redeemed_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedDiscountRedemptionRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedDiscountRedemptionRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedDiscountRedemptionRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountRedemption' - description: '' - delete: - operationId: discounts_redemptions_destroy - description: API view set for Discount Redemptions - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_redeemed_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '204': - description: No response body - /api/v0/discounts/{id}/: - get: - operationId: discounts_retrieve - description: API view set for Discounts - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this discount. - required: true - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V0Discount' - description: '' - put: - operationId: discounts_update - description: API view set for Discounts - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this discount. - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/V0DiscountRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/V0DiscountRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/V0DiscountRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V0Discount' - description: '' - patch: - operationId: discounts_partial_update - description: API view set for Discounts - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this discount. - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedV0DiscountRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedV0DiscountRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedV0DiscountRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V0Discount' - description: '' - delete: - operationId: discounts_destroy - description: API view set for Discounts - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this discount. - required: true - tags: - - discounts - responses: - '204': - description: No response body - /api/v0/discounts/create_batch/: - post: - operationId: discounts_create_batch_create - description: |- - Create a batch of codes. This is used in the staff-dashboard. - POST arguments are the same as in generate_discount_code - look there - for details. - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/V0DiscountRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/V0DiscountRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/V0DiscountRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V0Discount' - description: '' - /api/v0/orders/history/: - get: - operationId: orders_history_list - description: Retrives the current user's order history. - parameters: - - name: limit - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: offset - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - tags: - - orders - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedOrderHistoryList' - description: '' - /api/v0/orders/history/{id}/: - get: - operationId: orders_history_retrieve - description: Retrieve a historical order for the current user. - parameters: - - in: path - name: id - schema: - type: integer - required: true - tags: - - orders - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/OrderHistory' - description: '' - /api/v0/orders/receipt/{id}/: - get: - operationId: orders_receipt_retrieve - description: Viewset to retrieve an order so it can be viewed as a receipt. - parameters: - - in: path - name: id - schema: - type: integer - required: true - tags: - - orders - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Order' - description: '' - /api/v0/products/: - get: - operationId: products_list - description: List and view products within the system. - parameters: - - name: limit - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: offset - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - tags: - - products - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedProductList' - description: '' - /api/v0/products/{id}/: - get: - operationId: products_retrieve - description: List and view products within the system. - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this product. - required: true - tags: - - products - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Product' - description: '' - /api/v0/products/{id}/user_flexible_price/: - get: - operationId: products_user_flexible_price_retrieve - description: Retrieve a product with user-specific flexible price information - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this product. - required: true - tags: - - products - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ProductFlexiblePrice' - description: '' - /api/v0/products/all/: - get: - operationId: products_all_list - description: |- - This doesn't filter unenrollable products out, and adds name search for - courseware object readable id. It's really for the staff dashboard. - parameters: - - name: limit - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: offset - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - tags: - - products - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedProductList' - description: '' - post: - operationId: products_all_create - description: |- - This doesn't filter unenrollable products out, and adds name search for - courseware object readable id. It's really for the staff dashboard. - tags: - - products - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ProductRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/ProductRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/ProductRequest' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/Product' - description: '' - /api/v0/products/all/{id}/: - get: - operationId: products_all_retrieve - description: |- - This doesn't filter unenrollable products out, and adds name search for - courseware object readable id. It's really for the staff dashboard. - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this product. - required: true - tags: - - products - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Product' - description: '' - put: - operationId: products_all_update - description: |- - This doesn't filter unenrollable products out, and adds name search for - courseware object readable id. It's really for the staff dashboard. - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this product. - required: true - tags: - - products - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ProductRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/ProductRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/ProductRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Product' - description: '' - patch: - operationId: products_all_partial_update - description: |- - This doesn't filter unenrollable products out, and adds name search for - courseware object readable id. It's really for the staff dashboard. - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this product. - required: true - tags: - - products - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedProductRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedProductRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedProductRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Product' - description: '' - delete: - operationId: products_all_destroy - description: |- - This doesn't filter unenrollable products out, and adds name search for - courseware object readable id. It's really for the staff dashboard. - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this product. - required: true - tags: - - products - responses: - '204': - description: No response body - /api/v0/user_search/: - get: - operationId: user_search_list - description: |- - Provides an API for listing system users. This is for the staff - dashboard. - parameters: - - name: l - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: o - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - - name: search - required: false - in: query - description: A search term. - schema: - type: string - tags: - - user_search - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedStaffDashboardUserList' - description: '' - /api/v0/user_search/{id}/: - get: - operationId: user_search_retrieve - description: |- - Provides an API for listing system users. This is for the staff - dashboard. - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this user. - required: true - tags: - - user_search - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/StaffDashboardUser' - description: '' - /api/v0/userinfo/: - get: - operationId: userinfo_retrieve - description: |- - Retrieve the current user's info only if they have an edx_username, otherwise return 409 - - This is to prevent issues with Open edX OAuth client that expect an edx_username to be present - tags: - - userinfo - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: '' - /api/v0/users/{id}/: - get: - operationId: users_retrieve - description: User retrieve viewsets - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this user. - required: true - tags: - - users - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PublicUser' - description: '' - /api/v0/users/current_user/: - get: - operationId: users_current_user_retrieve - description: User retrieve and update viewsets for the current user - tags: - - users - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: '' - patch: - operationId: users_current_user_partial_update - description: User retrieve and update viewsets for the current user - tags: - - users - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedUserRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedUserRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedUserRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: '' - /api/v0/users/me: - get: - operationId: users_me_retrieve - description: User retrieve and update viewsets for the current user - tags: - - users - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: '' - patch: - operationId: users_me_partial_update - description: User retrieve and update viewsets for the current user - tags: - - users - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedUserRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedUserRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedUserRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: '' - /api/v1/course_runs/: - get: - operationId: course_runs_list - description: API view set for CourseRuns - parameters: - - in: query - name: id - schema: - type: integer - - in: query - name: live - schema: - type: boolean - tags: - - course_runs - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/V1CourseRunWithCourse' - description: '' - /api/v1/course_runs/{id}/: - get: - operationId: course_runs_retrieve - description: API view set for CourseRuns - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course run. - required: true - tags: - - course_runs - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V1CourseRunWithCourse' - description: '' - /api/v1/courses/: - get: - operationId: api_v1_courses_list - description: List all courses - API v1 - parameters: - - in: query - name: courserun_is_enrollable - schema: - type: boolean - - in: query - name: id - schema: - type: integer - - in: query - name: live - schema: - type: boolean - - name: page - required: false - in: query - description: A page number within the paginated result set. - schema: - type: integer - - in: query - name: page__live - schema: - type: boolean - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: readable_id - schema: - type: string - tags: - - courses - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedV1CourseWithCourseRunsList' - description: '' - /api/v1/courses/{id}/: - get: - operationId: api_v1_courses_retrieve - description: Retrieve a specific course - API v1 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course. - required: true - tags: - - courses - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V1CourseWithCourseRuns' - description: '' - /api/v1/departments/: - get: - operationId: departments_list_v1 - description: List departments - v1 - tags: - - departments - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/DepartmentWithCount' - description: '' - /api/v1/departments/{id}/: - get: - operationId: departments_retrieve_v1 - description: Get department details - v1 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this department. - required: true - tags: - - departments - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DepartmentWithCount' - description: '' - /api/v1/enrollments/: - get: - operationId: enrollments_list - description: API view set for user enrollments - tags: - - enrollments - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/CourseRunEnrollment' - description: '' - post: - operationId: enrollments_create - description: API view set for user enrollments - tags: - - enrollments - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequest' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollment' - description: '' - /api/v1/enrollments/{id}/: - put: - operationId: enrollments_update - description: API view set for user enrollments - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course run enrollment. - required: true - tags: - - enrollments - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollment' - description: '' - patch: - operationId: enrollments_partial_update - description: Update enrollment email preferences - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course run enrollment. - required: true - tags: - - enrollments - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedUpdateCourseRunEnrollmentRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedUpdateCourseRunEnrollmentRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedUpdateCourseRunEnrollmentRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollment' - description: '' - delete: - operationId: enrollments_destroy - description: API view set for user enrollments - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course run enrollment. - required: true - tags: - - enrollments - responses: - '204': - description: No response body - /api/v1/program_enrollments/: - get: - operationId: program_enrollments_list - description: |- - Returns a unified set of program and course enrollments for the current - user. - tags: - - program_enrollments - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/UserProgramEnrollmentDetail' - description: '' - /api/v1/program_enrollments/{id}/: - get: - operationId: program_enrollments_retrieve - description: Retrieve a specific program enrollment. - parameters: - - in: path - name: id - schema: - type: integer - description: Program enrollment ID - required: true - tags: - - program_enrollments - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/UserProgramEnrollmentDetail' - description: '' - delete: - operationId: program_enrollments_destroy - description: |- - Unenroll the user from this program. This is simpler than the corresponding - function for CourseRunEnrollments; edX doesn't really know what programs - are so there's nothing to process there. - parameters: - - in: path - name: id - schema: - type: integer - description: Program enrollment ID - required: true - tags: - - program_enrollments - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/UserProgramEnrollmentDetail' - description: '' - /api/v1/programs/: - get: - operationId: programs_list_v1 - description: List Programs - v1 - parameters: - - in: query - name: id - schema: - type: integer - - in: query - name: live - schema: - type: boolean - - name: page - required: false - in: query - description: A page number within the paginated result set. - schema: - type: integer - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: readable_id - schema: - type: string - tags: - - programs - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedV1ProgramList' - description: '' - /api/v1/programs/{id}/: - get: - operationId: programs_retrieve_v1 - description: API view set for Programs - v1 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this program. - required: true - tags: - - programs - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V1Program' - description: '' - /api/v2/course_certificates/{cert_uuid}/: - get: - operationId: course_certificates_retrieve - description: Get a course certificate by UUID. - parameters: - - in: path - name: cert_uuid - schema: - type: string - format: uuid - required: true - tags: - - course_certificates - security: - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V2CourseRunCertificate' - description: '' - /api/v2/courses/: - get: - operationId: api_v2_courses_list - description: List all courses - API v2 - parameters: - - in: query - name: contract_id - schema: - type: number - description: Only show courses belonging to this B2B contract - - in: query - name: courserun_is_enrollable - schema: - type: boolean - description: Course Run Is Enrollable - - in: query - name: id - schema: - type: array - items: - type: integer - description: Multiple values may be separated by commas. - explode: false - style: form - - in: query - name: include_approved_financial_aid - schema: - type: boolean - description: Include approved financial assistance information - - in: query - name: live - schema: - type: boolean - - in: query - name: org_id - schema: - type: number - description: Only show courses belonging to this B2B/UAI organization - - name: page - required: false - in: query - description: A page number within the paginated result set. - schema: - type: integer - - in: query - name: page__live - schema: - type: boolean - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: readable_id - schema: - type: string - tags: - - courses - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedCourseWithCourseRunsSerializerV2List' - description: '' - /api/v2/courses/{id}/: - get: - operationId: api_v2_courses_retrieve - description: Retrieve a specific course - API v2 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course. - required: true - tags: - - courses - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CourseWithCourseRunsSerializerV2' - description: '' - /api/v2/departments/: - get: - operationId: departments_list_v2 - description: List departments - v2 - tags: - - departments - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/DepartmentWithCoursesAndPrograms' - description: '' - /api/v2/departments/{id}/: - get: - operationId: departments_retrieve_v2 - description: Get department details - v2 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this department. - required: true - tags: - - departments - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DepartmentWithCoursesAndPrograms' - description: '' - /api/v2/enrollments/: - get: - operationId: user_enrollments_list_v2 - description: List user enrollments with B2B organization and contract information - - API v2. Use ?exclude_b2b=true to filter out enrollments linked to course - runs with B2B contracts. Use ?org_id= to filter enrollments by specific - B2B organization. - parameters: - - in: query - name: exclude_b2b - schema: - type: boolean - description: Exclude B2B enrollments (enrollments linked to course runs with - B2B contracts) - - in: query - name: org_id - schema: - type: number - description: Filter by B2B organization ID - tags: - - enrollments - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/CourseRunEnrollmentRequestV2' - description: '' - post: - operationId: user_enrollments_create_v2 - description: Create a new user enrollment - API v2 - tags: - - enrollments - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequestV2Request' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequestV2Request' - multipart/form-data: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequestV2Request' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequestV2' - description: '' - /api/v2/enrollments/{id}/: - delete: - operationId: user_enrollments_destroy_v2 - description: Unenroll from a course - API v2 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course run enrollment. - required: true - tags: - - enrollments - responses: - '204': - description: No response body - /api/v2/pages/: - get: - operationId: pages_list - description: Returns pages of all types - summary: List all Wagtail Pages - parameters: - - in: query - name: fields - schema: - type: string - description: Specify fields (e.g. `*`) - - in: query - name: type - schema: - type: string - description: Filter by Wagtail page type - tags: - - pages - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PageList' - description: '' - /api/v2/pages/{id}/: - get: - operationId: pages_retrieve - description: Returns details of a specific Wagtail page by ID - summary: Get Wagtail Page Details - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the Wagtail page - required: true - - in: query - name: revision_id - schema: - type: integer - description: Optional certificate revision ID to retrieve a specific revision - of the certificate page - tags: - - pages - responses: - '200': - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/CoursePageItem' - - $ref: '#/components/schemas/ProgramPageItem' - - $ref: '#/components/schemas/CertificatePage' - - $ref: '#/components/schemas/Page' - description: Returns a page of any known Wagtail page type - /api/v2/pages/?fields=*&type=cms.certificatepage: - get: - operationId: pages_?fields=*&type=cms.certificatepage_retrieve - description: Returns pages of type cms.CertificatePage - summary: List all Certificate Pages - tags: - - pages - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CertificatePageList' - description: '' - /api/v2/pages/?fields=*&type=cms.coursepage: - get: - operationId: pages_?fields=*&type=cms.coursepage_retrieve - description: Returns pages of type cms.CoursePage - summary: List all Course Pages - parameters: - - in: query - name: readable_id - schema: - type: string - description: filter by course readable_id - tags: - - pages - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CoursePageList' - description: '' - /api/v2/pages/?fields=*&type=cms.programpage: - get: - operationId: pages_?fields=*&type=cms.programpage_retrieve - description: Returns pages of type cms.ProgramPage - summary: List all Program Pages - parameters: - - in: query - name: readable_id - schema: - type: string - description: filter by program readable_id - tags: - - pages - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ProgramPageList' - description: '' - /api/v2/program-collections/: - get: - operationId: program_collections_list - description: Readonly viewset for ProgramCollection objects. - parameters: - - name: page - required: false - in: query - description: A page number within the paginated result set. - schema: - type: integer - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - program-collections - security: - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedV2ProgramCollectionList' - description: '' - /api/v2/program-collections/{id}/: - get: - operationId: program_collections_retrieve - description: Readonly viewset for ProgramCollection objects. - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this Program Collection. - required: true - tags: - - program-collections - security: - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V2ProgramCollection' - description: '' - /api/v2/program_certificates/{cert_uuid}/: - get: - operationId: program_certificates_retrieve - description: Get a program certificate by UUID. - parameters: - - in: path - name: cert_uuid - schema: - type: string - format: uuid - required: true - tags: - - program_certificates - security: - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V2ProgramCertificate' - description: '' - /api/v2/program_enrollments/: - get: - operationId: v2_program_enrollments_list - description: |- - Returns a unified set of program and course enrollments for the current - user using v2 serializers. - tags: - - program_enrollments - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/V2UserProgramEnrollmentDetail' - description: '' - /api/v2/program_enrollments/{id}/: - get: - operationId: v2_program_enrollments_retrieve - description: Retrieve a specific program enrollment using v2 serializers. - parameters: - - in: path - name: id - schema: - type: integer - description: Program enrollment ID - required: true - tags: - - program_enrollments - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V2UserProgramEnrollmentDetail' - description: '' - delete: - operationId: v2_program_enrollments_destroy - description: |- - Unenroll the user from this program. This is simpler than the corresponding - function for CourseRunEnrollments; edX doesn't really know what programs - are so there's nothing to process there. - parameters: - - in: path - name: id - schema: - type: integer - description: Program enrollment ID - required: true - tags: - - program_enrollments - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/V2UserProgramEnrollmentDetail' - description: '' - /api/v2/programs/: - get: - operationId: programs_list_v2 - description: List Programs - v2 - parameters: - - in: query - name: contract_id - schema: - type: number - - in: query - name: id - schema: - type: array - items: - type: integer - description: Multiple values may be separated by commas. - explode: false - style: form - - in: query - name: live - schema: - type: boolean - - in: query - name: org_id - schema: - type: number - - name: page - required: false - in: query - description: A page number within the paginated result set. - schema: - type: integer - - in: query - name: page__live - schema: - type: boolean - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: readable_id - schema: - type: string - tags: - - programs - security: - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedV2ProgramList' - description: '' - /api/v2/programs/{id}/: - get: - operationId: programs_retrieve_v2 - description: API view set for Programs - v2 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this program. - required: true - tags: - - programs - security: - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V2Program' - description: '' - /api/v2/verifiable_course_credential/{credential_id}/download/: - get: - operationId: verifiable_course_credential_download_list - description: Returns the json for the verifiable credential with the given ID - parameters: - - in: path - name: credential_id - schema: - type: string - format: uuid - required: true - tags: - - verifiable_course_credential - security: - - {} - responses: - '200': - description: No response body - /api/v2/verifiable_program_credential/{credential_id}/download/: - get: - operationId: verifiable_program_credential_download_list - description: Returns the json for the verifiable credential with the given ID - parameters: - - in: path - name: credential_id - schema: - type: string - format: uuid - required: true - tags: - - verifiable_program_credential - security: - - {} - responses: - '200': - description: No response body - /api/v2/verified_program_enrollments/{program_id}/{courserun_id}/: - post: - operationId: verified_program_enrollments_create - description: |- - Create a program-related course enrollment for the learner. - - Some special handling is needed for program-related course run enrollments - when the learner has an enrollment in the program. The learner should get a - course run enrollment that matches their program enrollment at no additional - charge. However, if the learner is enrolling in a course that's an elective, - and they have already enrolled in enough electives to satisfy the program's - requirements, they should then get an audit enrollment. (This won't preclude - them from getting a certificate for the course itself but they'll have to buy - the upgrade separately.) - parameters: - - in: path - name: courserun_id - schema: - type: string - description: Readable ID for the course run to enroll in. - required: true - - in: path - name: program_id - schema: - type: string - description: Readable ID for the program. - required: true - tags: - - verified_program_enrollments - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequestV2' - description: '' - '204': - description: No response body - '404': - description: No response body - /enrollments/: - post: - operationId: api_enrollments_create - description: View to handle direct POST requests to enroll in a course run. - tags: - - enrollments - responses: - '200': - description: No response body - '302': - description: No response body -components: - schemas: - AvailabilityEnum: - enum: - - anytime - - dated - type: string - description: |- - * `anytime` - anytime - * `dated` - dated - x-enum-descriptions: - - anytime - - dated - BaseCourse: - type: object - description: Basic course model serializer - properties: - id: - type: integer - readOnly: true - title: - type: string - maxLength: 255 - readable_id: - type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - type: - type: string - description: Returns the type of object this is serializing. - readOnly: true - required: - - id - - readable_id - - title - - type - BaseProgram: - type: object - description: Basic program model serializer - properties: - title: - type: string - maxLength: 255 - readable_id: - type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - id: - type: integer - readOnly: true - type: - type: string - readOnly: true - required: - - id - - readable_id - - title - - type - Basket: - type: object - description: Basket model serializer - properties: - id: - type: integer - readOnly: true - user: - type: integer - basket_items: - type: array - items: - $ref: '#/components/schemas/BasketItem' - readOnly: true - required: - - basket_items - - id - - user - BasketDiscountDetail: - type: object - description: BasketDiscount model serializer - properties: - redeemed_discount: - $ref: '#/components/schemas/V0Discount' - redeemed_basket: - $ref: '#/components/schemas/Basket' - required: - - redeemed_basket - - redeemed_discount - BasketItem: - type: object - description: BasketItem model serializer - properties: - basket: - type: integer - product: - type: integer - id: - type: integer - readOnly: true - required: - - basket - - id - - product - BasketWithProduct: - type: object - description: Serializer for Basket model with product details - properties: - id: - type: integer - readOnly: true - user: - type: integer - basket_items: - type: array - items: - type: object - properties: - basket: - type: integer - product: - type: object - properties: - id: - type: integer - price: - type: number - description: - type: string - is_active: - type: boolean - purchasable_object: - type: object - id: - type: integer - readOnly: true - total_price: - type: number - format: double - description: Get total price of all items in basket before discounts - readOnly: true - discounted_price: - type: number - format: double - description: Get total price after any discounts are applied - readOnly: true - discounts: - type: array - items: - $ref: '#/components/schemas/BasketDiscountDetail' - readOnly: true - required: - - basket_items - - discounted_price - - discounts - - id - - total_price - - user - BlankEnum: - enum: - - '' - CertificatePage: - type: object - description: Serializer for certificate pages, including overrides and signatory - items. - properties: - id: - type: integer - meta: - $ref: '#/components/schemas/PageMeta' - title: - type: string - product_name: - type: string - CEUs: - type: string - overrides: - type: array - items: - $ref: '#/components/schemas/Override' - signatory_items: - type: array - items: - $ref: '#/components/schemas/SignatoryItem' - required: - - CEUs - - id - - meta - - overrides - - product_name - - signatory_items - - title - CertificatePageList: - type: object - description: Serializer for a list of certificate pages. - properties: - meta: - $ref: '#/components/schemas/PageListMeta' - items: - type: array - items: - $ref: '#/components/schemas/CertificatePage' - required: - - items - - meta - CertificatePageModel: - type: object - description: Extends the CertificatePageSerializer to work with a model object. - properties: - id: - type: integer - meta: - allOf: - - $ref: '#/components/schemas/PageMetaModel' - readOnly: true - title: - type: string - product_name: - type: string - CEUs: - type: string - overrides: - type: array - items: - $ref: '#/components/schemas/Override' - signatory_items: - type: array - items: - $ref: '#/components/schemas/SignatoryItem' - required: - - CEUs - - id - - meta - - overrides - - product_name - - signatory_items - - title - ChangeEmailRequestCreate: - type: object - description: Serializer for starting a user email change - properties: - new_email: - type: string - format: email - required: - - new_email - ChangeEmailRequestCreateRequest: - type: object - description: Serializer for starting a user email change - properties: - new_email: - type: string - format: email - minLength: 1 - password: - type: string - writeOnly: true - minLength: 1 - required: - - new_email - - password - ChangeEmailRequestUpdate: - type: object - description: Serializer for confirming a user email change - properties: - confirmed: - type: boolean - required: - - confirmed - ChangeEmailRequestUpdateRequest: - type: object - description: Serializer for confirming a user email change - properties: - confirmed: - type: boolean - required: - - confirmed - CheckoutPayload: - type: object - description: Serializes the payload for the checkout data. - properties: - no_checkout: - type: boolean - readOnly: true - default: false - description: Set if the order was automatically completed and no checkout - process is required. - url: - type: string - readOnly: true - default: '' - description: The URL to POST the form to. - method: - type: string - readOnly: true - default: POST - description: The method to use for the checkout form (always POST). - payload: - readOnly: true - default: {} - description: The data for the form. - order_id: - type: integer - readOnly: true - default: 0 - description: If the order was automatically completed, the ID of the new - order. - error: - allOf: - - $ref: '#/components/schemas/ErrorEnum' - readOnly: true - description: |- - Error message for the order, if there is one. - - * `enroll-blocked` - enroll-blocked - * `enroll-duplicated` - enroll-duplicated - * `course-non-upgradable` - course-non-upgradable - * `discount-invalid` - discount-invalid - * `b2b-error-missing-enrollment-code` - b2b-error-missing-enrollment-code - * `b2b-invalid-basket` - b2b-invalid-basket - * `basket-empty` - basket-empty - required: - - error - - method - - no_checkout - - order_id - - payload - - url - CompanySizeEnum: - enum: - - 1 - - 9 - - 99 - - 999 - - 9999 - - 10000 - - 0 - description: |- - * `None` - ---- - * `1` - Small/Start-up (1+ employees) - * `9` - Small/Home office (1-9 employees) - * `99` - Small (10-99 employees) - * `999` - Small to medium-sized (100-999 employees) - * `9999` - Medium-sized (1000-9999 employees) - * `10000` - Large Enterprise (10,000+ employees) - * `0` - Other (N/A or Don't know) - x-enum-descriptions: - - Small/Start-up (1+ employees) - - Small/Home office (1-9 employees) - - Small (10-99 employees) - - Small to medium-sized (100-999 employees) - - Medium-sized (1000-9999 employees) - - Large Enterprise (10,000+ employees) - - Other (N/A or Don't know) - ContractPage: - type: object - description: Serializer for the ContractPage model. - properties: - id: - type: integer - readOnly: true - name: - type: string - readOnly: true - description: The name of the contract. - description: - type: string - readOnly: true - description: Any useful extra information about the contract. - welcome_message: - type: string - readOnly: true - description: A welcome message for learners. - welcome_message_extra: - type: string - readOnly: true - description: Additional welcome message content for learners. - integration_type: - allOf: - - $ref: '#/components/schemas/IntegrationTypeEnum' - readOnly: true - description: |- - The type of integration for this contract. - - * `sso` - SSO - * `non-sso` - Non-SSO - * `managed` - Managed - * `code` - Enrollment Code - * `auto` - Auto Enrollment - membership_type: - type: string - organization: - type: integer - readOnly: true - description: The organization that owns this contract. - contract_start: - type: string - format: date - readOnly: true - nullable: true - description: The start date of the contract. - contract_end: - type: string - format: date - readOnly: true - nullable: true - description: The end date of the contract. - active: - type: boolean - readOnly: true - description: Whether this contract is active or not. Date rules still apply. - slug: - type: string - readOnly: true - description: The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/ - pattern: ^[-\w]+$ - programs: - type: array - items: - type: integer - readOnly: true - required: - - active - - contract_end - - contract_start - - description - - id - - integration_type - - membership_type - - name - - organization - - programs - - slug - - welcome_message - - welcome_message_extra - Country: - type: object - description: Serializer for pycountry countries, with states for US/CA - properties: - code: - type: string - description: Get the country alpha_2 code - readOnly: true - name: - type: string - description: Get the country name (common name preferred if available) - readOnly: true - states: - type: array - items: - type: object - additionalProperties: {} - description: Get a list of states/provinces if USA or Canada - readOnly: true - required: - - code - - name - - states - Course: - type: object - description: Course model serializer - properties: - id: - type: integer - readOnly: true - title: - type: string - maxLength: 255 - readable_id: - type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - next_run_id: - type: integer - nullable: true - description: Get next run id - readOnly: true - departments: - type: array - items: - $ref: '#/components/schemas/Department' - readOnly: true - page: - allOf: - - $ref: '#/components/schemas/CoursePage' - readOnly: true - programs: - allOf: - - $ref: '#/components/schemas/Program' - nullable: true - readOnly: true - required: - - departments - - id - - next_run_id - - page - - programs - - readable_id - - title - CoursePage: - type: object - description: Course page model serializer - properties: - feature_image_src: - type: string - description: Serializes the source of the feature_image - readOnly: true - page_url: - type: string - format: uri - readOnly: true - description: - type: string - description: Get cleaned description text. - readOnly: true - live: - type: boolean - readOnly: true - length: - type: string - description: Get cleaned length text. - readOnly: true - effort: - type: string - nullable: true - description: Get cleaned effort text. - readOnly: true - financial_assistance_form_url: - type: string - format: uri - readOnly: true - current_price: - type: integer - nullable: true - description: Get the current price of the course product. - readOnly: true - instructors: - type: array - items: {} - description: Get instructor information - readOnly: true - required: - - current_price - - description - - effort - - feature_image_src - - financial_assistance_form_url - - instructors - - length - - live - - page_url - CoursePageItem: - type: object - description: Serializer for individual course page items, including all relevant - fields. - properties: - id: - type: integer - readOnly: true - meta: - $ref: '#/components/schemas/PageMeta' - title: - type: string - description: The page title as you'd like it to be seen by the public - maxLength: 255 - description: - type: string - description: The description shown on the home page and product page. - length: - type: string - description: A short description indicating how long it takes to complete - (e.g. '4 weeks'). - maxLength: 50 - effort: - type: string - nullable: true - description: A short description indicating how much effort is required - (e.g. 1-3 hours per week). - maxLength: 100 - min_weekly_hours: - type: string - description: The minimum number of hours per week required to complete the - course. - maxLength: 5 - max_weekly_hours: - type: string - description: The maximum number of hours per week required to complete the - course. - maxLength: 5 - min_weeks: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: The minimum number of weeks required to complete the course/program. - max_weeks: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: The maximum number of weeks required to complete the course/program. - price: - type: array - items: - $ref: '#/components/schemas/PriceItem' - min_price: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: Specify the minimum product price. This is used by MIT Learn. - max_price: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: Specify the maximum product price. This is used by MIT Learn. - prerequisites: - type: string - nullable: true - description: A short description indicating prerequisites of this course/program. - faq_url: - type: string - format: uri - nullable: true - description: URL a relevant FAQ page or entry for the course/program. - maxLength: 200 - about: - type: string - nullable: true - description: Details about this course/program. - what_you_learn: - type: string - nullable: true - description: '*Required for Verifiable Credential generation. What you will - learn from this course.' - feature_image: - $ref: '#/components/schemas/FeatureImage' - video_url: - type: string - format: uri - nullable: true - description: URL to the video to be displayed for this course/program. It - can be an HLS or Youtube video URL. - maxLength: 200 - faculty_section_title: - type: string - nullable: true - description: The title text to display in the faculty cards section of the - product page. - maxLength: 255 - faculty: - type: array - items: - $ref: '#/components/schemas/Faculty' - certificate_page: - allOf: - - $ref: '#/components/schemas/CertificatePage' - nullable: true - course_details: - $ref: '#/components/schemas/V2Course' - topic_list: - type: array - items: - $ref: '#/components/schemas/Topic' - include_in_learn_catalog: - type: boolean - nullable: true - description: If true, Learn should include this in its catalog. - ingest_content_files_for_ai: - type: boolean - nullable: true - description: If true, allow the AI chatbots to ingest the course's content - files. - required: - - about - - certificate_page - - course_details - - description - - effort - - faculty - - faculty_section_title - - faq_url - - feature_image - - id - - include_in_learn_catalog - - ingest_content_files_for_ai - - length - - max_price - - max_weekly_hours - - max_weeks - - meta - - min_price - - min_weekly_hours - - min_weeks - - prerequisites - - price - - title - - topic_list - - video_url - - what_you_learn - CoursePageList: - type: object - description: Serializer for a list of course pages, including metadata and items. - properties: - meta: - $ref: '#/components/schemas/PageListMeta' - items: - type: array - items: - $ref: '#/components/schemas/CoursePageItem' - required: - - items - - meta - CourseRequest: - type: object - description: Course model serializer - properties: - title: - type: string - minLength: 1 - maxLength: 255 - readable_id: - type: string - minLength: 1 - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - required: - - readable_id - - title - CourseRunCertificate: - type: object - description: CourseRunCertificate model serializer - properties: - uuid: - type: string - format: uuid - readOnly: true - link: - type: string - description: |- - Get the link at which this certificate will be served - Format: /certificate// - Example: /certificate/93ebd74e-5f88-4b47-bb09-30a6d575328f/ - readOnly: true - required: - - link - - uuid - CourseRunEnrollment: - type: object - description: CourseRunEnrollment model serializer - properties: - run: - allOf: - - $ref: '#/components/schemas/V1CourseRunWithCourse' - readOnly: true - id: - type: integer - readOnly: true - edx_emails_subscription: - type: boolean - certificate: - allOf: - - $ref: '#/components/schemas/CourseRunCertificate' - nullable: true - readOnly: true - enrollment_mode: - allOf: - - $ref: '#/components/schemas/EnrollmentModeEnum' - readOnly: true - approved_flexible_price_exists: - type: boolean - readOnly: true - grades: - type: array - items: - $ref: '#/components/schemas/CourseRunGrade' - readOnly: true - required: - - approved_flexible_price_exists - - certificate - - enrollment_mode - - grades - - id - - run - CourseRunEnrollmentRequest: - type: object - description: CourseRunEnrollment model serializer - properties: - edx_emails_subscription: - type: boolean - run_id: - type: integer - writeOnly: true - required: - - run_id - CourseRunEnrollmentRequestV2: - type: object - description: CourseRunEnrollment model serializer - properties: - run: - allOf: - - $ref: '#/components/schemas/V2CourseRunWithCourse' - readOnly: true - id: - type: integer - readOnly: true - edx_emails_subscription: - type: boolean - certificate: - allOf: - - $ref: '#/components/schemas/CourseRunCertificate' - nullable: true - readOnly: true - enrollment_mode: - allOf: - - $ref: '#/components/schemas/EnrollmentModeEnum' - readOnly: true - approved_flexible_price_exists: - type: boolean - readOnly: true - grades: - type: array - items: - $ref: '#/components/schemas/CourseRunGrade' - readOnly: true - b2b_organization_id: - type: integer - nullable: true - readOnly: true - b2b_contract_id: - type: integer - nullable: true - readOnly: true - required: - - approved_flexible_price_exists - - b2b_contract_id - - b2b_organization_id - - certificate - - enrollment_mode - - grades - - id - - run - CourseRunEnrollmentRequestV2Request: - type: object - description: CourseRunEnrollment model serializer - properties: - edx_emails_subscription: - type: boolean - run_id: - type: integer - writeOnly: true - required: - - run_id - CourseRunGrade: - type: object - description: CourseRunGrade serializer - properties: - grade: - type: number - format: double - maximum: 1.0 - minimum: 0.0 - letter_grade: - type: string - nullable: true - maxLength: 6 - passed: - type: boolean - set_by_admin: - type: boolean - grade_percent: - type: number - format: double - description: Returns the grade field value as a number out of 100 (or Decimal(0) - if the value is None) - readOnly: true - required: - - grade - - grade_percent - CourseRunV2: - type: object - description: CourseRun model serializer - properties: - title: - type: string - description: The title of the course. This value is synced automatically - with edX studio. - maxLength: 255 - start_date: - type: string - format: date-time - nullable: true - description: The day the course begins. This value is synced automatically - with edX studio. - end_date: - type: string - format: date-time - nullable: true - description: The last day the course is active. This value is synced automatically - with edX studio. - enrollment_start: - type: string - format: date-time - nullable: true - description: The first day students can enroll. This value is synced automatically - with edX studio. - enrollment_end: - type: string - format: date-time - nullable: true - description: The last day students can enroll. This value is synced automatically - with edX studio. - expiration_date: - type: string - format: date-time - nullable: true - description: The date beyond which the learner should not see link to this - course run on their dashboard. - courseware_url: - type: string - nullable: true - description: Get the courseware URL - readOnly: true - courseware_id: - type: string - maxLength: 255 - certificate_available_date: - type: string - format: date-time - nullable: true - description: The day certificates should be available to users. This value - is synced automatically with edX studio. - upgrade_deadline: - type: string - format: date-time - nullable: true - description: The date beyond which the learner can not enroll in paid course - mode. - is_upgradable: - type: boolean - description: Check if the course run is upgradable - readOnly: true - is_enrollable: - type: boolean - description: Check if the course run is enrollable - readOnly: true - is_archived: - type: boolean - description: Check if the course run is archived - readOnly: true - is_self_paced: - type: boolean - run_tag: - type: string - description: 'A string that identifies the set of runs that this run belongs - to (example: ''R2'')' - maxLength: 100 - id: - type: integer - readOnly: true - live: - type: boolean - course_number: - type: string - description: Get the course number - readOnly: true - products: - type: array - items: - allOf: - - $ref: '#/components/schemas/ProductFlexibilePrice' - readOnly: true - approved_flexible_price_exists: - type: boolean - readOnly: true - b2b_contract: - type: integer - nullable: true - required: - - approved_flexible_price_exists - - course_number - - courseware_id - - courseware_url - - id - - is_archived - - is_enrollable - - is_upgradable - - products - - run_tag - - title - CourseWithCourseRunsSerializerV2: - type: object - description: Course model serializer - also serializes child course runs - properties: - id: - type: integer - readOnly: true - title: - type: string - maxLength: 255 - readable_id: - type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - next_run_id: - type: integer - nullable: true - description: Get next run id - readOnly: true - departments: - type: array - items: - $ref: '#/components/schemas/Department' - readOnly: true - page: - allOf: - - $ref: '#/components/schemas/CoursePage' - readOnly: true - programs: - type: array - items: - $ref: '#/components/schemas/BaseProgram' - nullable: true - readOnly: true - topics: - type: array - items: - type: object - additionalProperties: {} - description: List topics of a course - readOnly: true - certificate_type: - type: string - readOnly: true - required_prerequisites: - type: boolean - description: |- - Check if the prerequisites field is populated in the course page CMS. - Returns: - bool: True when the prerequisites field is populated in the course page CMS. False otherwise. - readOnly: true - duration: - type: string - description: Get the duration of the course from the course page CMS. - readOnly: true - min_weeks: - type: integer - nullable: true - description: Get the min weeks of the course from the CMS page. - readOnly: true - max_weeks: - type: integer - nullable: true - description: Get the max weeks of the course from the CMS page. - readOnly: true - min_price: - type: integer - nullable: true - description: Get the min price of the product from the CMS page. - readOnly: true - max_price: - type: integer - nullable: true - description: Get the max price of the product from the CMS page. - readOnly: true - time_commitment: - type: string - nullable: true - description: Get the time commitment of the course from the course page - CMS. - readOnly: true - availability: - type: string - description: Get course availability - readOnly: true - min_weekly_hours: - type: string - nullable: true - description: Get the min weekly hours of the course from the course page - CMS. - readOnly: true - max_weekly_hours: - type: string - nullable: true - description: Get the max weekly hours of the course from the course page - CMS. - readOnly: true - include_in_learn_catalog: - type: boolean - readOnly: true - ingest_content_files_for_ai: - type: boolean - readOnly: true - courseruns: - type: array - items: - $ref: '#/components/schemas/CourseRunV2' - readOnly: true - required: - - availability - - certificate_type - - courseruns - - departments - - duration - - id - - include_in_learn_catalog - - ingest_content_files_for_ai - - max_price - - max_weekly_hours - - max_weeks - - min_price - - min_weekly_hours - - min_weeks - - next_run_id - - page - - programs - - readable_id - - required_prerequisites - - time_commitment - - title - - topics - CreateB2BEnrollment: - type: object - description: |- - Serializer for the result from create_b2b_enrollment. - - There's always a result, and it should be one of the B2B messages that are - defined in main.constants. The other fields appear or not depending on the - result type. - properties: - result: - allOf: - - $ref: '#/components/schemas/ResultEnum' - readOnly: true - order: - type: integer - readOnly: true - price: - type: string - format: decimal - readOnly: true - checkout_result: - $ref: '#/components/schemas/GenerateCheckoutPayload' - required: - - order - - price - - result - CreateBasketWithProductIDRequest: - type: object - description: Defines the schema for a product ID and quantity in the CreateBasketWithProductsSerializer. - properties: - product_id: - type: integer - quantity: - type: integer - minimum: 1 - required: - - product_id - - quantity - CreateBasketWithProductsRequest: - type: object - description: Serializer for creating a basket with products. (For OpenAPI spec.) - properties: - system_slug: - type: string - minLength: 1 - product_ids: - type: array - items: - $ref: '#/components/schemas/CreateBasketWithProductIDRequest' - checkout: - type: boolean - discount_code: - type: string - minLength: 1 - required: - - checkout - - discount_code - - product_ids - - system_slug - Department: - type: object - description: Department model serializer - properties: - name: - type: string - maxLength: 128 - required: - - name - DepartmentRequest: - type: object - description: Department model serializer - properties: - name: - type: string - minLength: 1 - maxLength: 128 - required: - - name - DepartmentWithCount: - type: object - description: CourseRun model serializer that includes the number of courses - and programs associated with each departments - properties: - name: - type: string - maxLength: 128 - courses: - type: integer - programs: - type: integer - required: - - courses - - name - - programs - DepartmentWithCoursesAndPrograms: - type: object - description: Department model serializer that includes the number of courses - and programs associated with each - properties: - id: - type: integer - readOnly: true - name: - type: string - maxLength: 128 - slug: - type: string - maxLength: 128 - pattern: ^[-a-zA-Z0-9_]+$ - course_ids: - type: array - items: - type: integer - readOnly: true - program_ids: - type: array - items: - type: integer - readOnly: true - required: - - course_ids - - id - - name - - program_ids - - slug - Discount: - type: object - properties: - id: - type: integer - readOnly: true - amount: - type: string - format: decimal - pattern: ^-?\d{0,15}(?:\.\d{0,5})?$ - automatic: - type: boolean - discount_type: - $ref: '#/components/schemas/DiscountTypeEnum' - redemption_type: - $ref: '#/components/schemas/RedemptionTypeEnum' - max_redemptions: - type: integer - maximum: 2147483647 - minimum: 0 - nullable: true - discount_code: - type: string - maxLength: 100 - payment_type: - nullable: true - oneOf: - - $ref: '#/components/schemas/PaymentTypeEnum' - - $ref: '#/components/schemas/NullEnum' - is_redeemed: - type: boolean - description: Returns True if the discount has been redeemed - readOnly: true - activation_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable before this - date. - expiration_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable after this - date. - required: - - amount - - discount_code - - discount_type - - id - - is_redeemed - - redemption_type - DiscountProduct: - type: object - properties: - id: - type: integer - readOnly: true - discount: - $ref: '#/components/schemas/V0Discount' - product: - $ref: '#/components/schemas/Product' - required: - - discount - - id - - product - DiscountProductRequest: - type: object - properties: - discount: - $ref: '#/components/schemas/V0DiscountRequest' - product: - $ref: '#/components/schemas/ProductRequest' - required: - - discount - - product - DiscountRedemption: - type: object - description: Serializes a discount redemption. - properties: - id: - type: integer - readOnly: true - redemption_date: - type: string - format: date-time - readOnly: true - redeemed_by: - $ref: '#/components/schemas/User' - redeemed_discount: - $ref: '#/components/schemas/V0Discount' - redeemed_order: - $ref: '#/components/schemas/Order' - required: - - id - - redeemed_by - - redeemed_discount - - redeemed_order - - redemption_date - DiscountRedemptionRequest: - type: object - description: Serializes a discount redemption. - properties: - redeemed_by: - $ref: '#/components/schemas/UserRequest' - redeemed_discount: - $ref: '#/components/schemas/V0DiscountRequest' - redeemed_order: - $ref: '#/components/schemas/OrderRequest' - required: - - redeemed_by - - redeemed_discount - - redeemed_order - DiscountTypeEnum: - enum: - - percent-off - - dollars-off - - fixed-price - type: string - description: |- - * `percent-off` - percent-off - * `dollars-off` - dollars-off - * `fixed-price` - fixed-price - x-enum-descriptions: - - percent-off - - dollars-off - - fixed-price - EnrollmentModeEnum: - enum: - - audit - - verified - type: string - description: |- - * `audit` - audit - * `verified` - verified - x-enum-descriptions: - - audit - - verified - ErrorEnum: - enum: - - enroll-blocked - - enroll-duplicated - - course-non-upgradable - - discount-invalid - - b2b-error-missing-enrollment-code - - b2b-invalid-basket - - basket-empty - type: string - description: |- - * `enroll-blocked` - enroll-blocked - * `enroll-duplicated` - enroll-duplicated - * `course-non-upgradable` - course-non-upgradable - * `discount-invalid` - discount-invalid - * `b2b-error-missing-enrollment-code` - b2b-error-missing-enrollment-code - * `b2b-invalid-basket` - b2b-invalid-basket - * `basket-empty` - basket-empty - x-enum-descriptions: - - enroll-blocked - - enroll-duplicated - - course-non-upgradable - - discount-invalid - - b2b-error-missing-enrollment-code - - b2b-invalid-basket - - basket-empty - ExtendedLegalAddress: - type: object - description: Serializer class that includes email address as part of the legal - address - properties: - country: - type: string - maxLength: 2 - state: - type: string - nullable: true - maxLength: 10 - email: - type: string - description: Get email from the linked user object - readOnly: true - required: - - country - - email - Faculty: - type: object - description: Serializer for faculty details used in course pages. - properties: - id: - type: integer - instructor_name: - type: string - instructor_title: - type: string - instructor_bio_short: - type: string - instructor_bio_long: - type: string - feature_image_src: - type: string - required: - - feature_image_src - - id - - instructor_bio_long - - instructor_bio_short - - instructor_name - - instructor_title - FeatureImage: - type: object - description: Serializer for feature images used in course pages. - properties: - title: - type: string - image_url: - type: string - format: uri - height: - type: integer - width: - type: integer - required: - - height - - image_url - - title - - width - FlexiblePriceTier: - type: object - properties: - id: - type: integer - readOnly: true - courseware_object: - allOf: - - $ref: '#/components/schemas/BaseCourse' - readOnly: true - discount: - type: integer - current: - type: boolean - income_threshold_usd: - type: number - format: double - required: - - courseware_object - - discount - - id - - income_threshold_usd - FlexiblePriceTierRequest: - type: object - properties: - discount: - type: integer - current: - type: boolean - income_threshold_usd: - type: number - format: double - required: - - discount - - income_threshold_usd - GenderEnum: - enum: - - m - - f - - t - - nb - - o - type: string - description: |- - * `m` - Male - * `f` - Female - * `t` - Transgender - * `nb` - Non-binary/non-conforming - * `o` - Other/Prefer Not to Say - x-enum-descriptions: - - Male - - Female - - Transgender - - Non-binary/non-conforming - - Other/Prefer Not to Say - GenerateCheckoutPayload: - type: object - description: |- - Serializer for the result from ecommerce.api.generate_checkout_payload. - - The B2B enrollment API will return the result of the checkout call if the - user needs to pay for the cart because of an error creating the checkout - payload. In that case, we really just need the error states; it will also - include a HttpResponseRedirect that we don't really care about for the API's - purposes. - properties: - country_blocked: - type: boolean - nullable: true - default: false - purchased_same_courserun: - type: boolean - nullable: true - default: false - purchased_non_upgradeable_courserun: - type: boolean - nullable: true - default: false - invalid_discounts: - type: boolean - nullable: true - default: false - no_checkout: - type: boolean - nullable: true - default: false - HighestEducationEnum: - enum: - - Doctorate - - Master's or professional degree - - Bachelor's degree - - Associate degree - - Secondary/high school - - Junior secondary/junior high/middle school - - Elementary/primary school - - No formal education - - Other education - description: |- - * `None` - ---- - * `Doctorate` - Doctorate - * `Master's or professional degree` - Master's or professional degree - * `Bachelor's degree` - Bachelor's degree - * `Associate degree` - Associate degree - * `Secondary/high school` - Secondary/high school - * `Junior secondary/junior high/middle school` - Junior secondary/junior high/middle school - * `Elementary/primary school` - Elementary/primary school - * `No formal education` - No formal education - * `Other education` - Other education - x-enum-descriptions: - - Doctorate - - Master's or professional degree - - Bachelor's degree - - Associate degree - - Secondary/high school - - Junior secondary/junior high/middle school - - Elementary/primary school - - No formal education - - Other education - IntegrationTypeEnum: - enum: - - sso - - non-sso - - managed - - code - - auto - type: string - description: |- - * `sso` - SSO - * `non-sso` - Non-SSO - * `managed` - Managed - * `code` - Enrollment Code - * `auto` - Auto Enrollment - x-enum-descriptions: - - SSO - - Non-SSO - - Managed - - Enrollment Code - - Auto Enrollment - LearnerProgramRecordShare: - type: object - properties: - share_uuid: - type: string - format: uuid - readOnly: true - created_on: - type: string - format: date-time - readOnly: true - updated_on: - type: string - format: date-time - readOnly: true - is_active: - type: boolean - user: - type: integer - program: - type: integer - partner_school: - type: integer - nullable: true - required: - - created_on - - program - - share_uuid - - updated_on - - user - LearnerRecord: - type: object - description: |- - Gathers the various data needed to display the learner's program record. - Pass the program you want the record for and attach the learner via context - object. - properties: - user: - type: object - additionalProperties: - type: string - description: User information including name, email, and username - program: - type: object - additionalProperties: - type: object - additionalProperties: {} - description: Program details including title, readable_id, courses, and - requirements - sharing: - type: array - items: - $ref: '#/components/schemas/LearnerProgramRecordShare' - description: Active program record shares for this user - partner_schools: - type: array - items: - $ref: '#/components/schemas/PartnerSchool' - description: List of partner schools - required: - - partner_schools - - program - - sharing - - user - LegalAddress: - type: object - description: Serializer for legal address - properties: - country: - type: string - maxLength: 2 - state: - type: string - nullable: true - maxLength: 10 - required: - - country - LegalAddressRequest: - type: object - description: Serializer for legal address - properties: - country: - type: string - minLength: 1 - maxLength: 2 - state: - type: string - nullable: true - maxLength: 10 - required: - - country - Line: - type: object - description: Serializes order lines. - properties: - quantity: - type: integer - item_description: - type: string - unit_price: - type: string - format: decimal - pattern: ^-?\d{0,7}(?:\.\d{0,2})?$ - total_price: - type: string - format: decimal - pattern: ^-?\d{0,7}(?:\.\d{0,2})?$ - id: - type: integer - product: - allOf: - - $ref: '#/components/schemas/Product' - readOnly: true - required: - - id - - item_description - - product - - quantity - - total_price - - unit_price - Nested: - type: object - properties: - id: - type: integer - readOnly: true - created_on: - type: string - format: date-time - readOnly: true - updated_on: - type: string - format: date-time - readOnly: true - amount: - type: string - format: decimal - pattern: ^-?\d{0,15}(?:\.\d{0,5})?$ - automatic: - type: boolean - discount_type: - $ref: '#/components/schemas/DiscountTypeEnum' - redemption_type: - $ref: '#/components/schemas/RedemptionTypeEnum' - payment_type: - nullable: true - oneOf: - - $ref: '#/components/schemas/PaymentTypeEnum' - - $ref: '#/components/schemas/NullEnum' - max_redemptions: - type: integer - maximum: 2147483647 - minimum: 0 - nullable: true - discount_code: - type: string - maxLength: 100 - activation_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable before this - date. - expiration_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable after this - date. - is_bulk: - type: boolean - is_program_discount: - type: boolean - nullable: true - description: Discount is only for creating verified course run enrollments - for a program. - required: - - amount - - created_on - - discount_code - - discount_type - - id - - redemption_type - - updated_on - NodeTypeEnum: - enum: - - operator - - course - - program - type: string - description: |- - * `operator` - operator - * `course` - course - * `program` - program - x-enum-descriptions: - - operator - - course - - program - NullEnum: - enum: - - null - Order: - type: object - properties: - id: - type: integer - readOnly: true - state: - $ref: '#/components/schemas/StateEnum' - purchaser: - type: array - items: - $ref: '#/components/schemas/ExtendedLegalAddress' - readOnly: true - total_price_paid: - type: string - format: decimal - pattern: ^-?\d{0,15}(?:\.\d{0,5})?$ - lines: - type: array - items: - $ref: '#/components/schemas/TransactionLine' - readOnly: true - discounts: - type: array - items: - $ref: '#/components/schemas/RedeemedDiscount' - readOnly: true - refunds: - type: array - items: - type: object - properties: - amount: - type: number - date: - type: string - format: date-time - readOnly: true - reference_number: - type: string - nullable: true - maxLength: 255 - created_on: - type: string - format: date-time - readOnly: true - transactions: - type: object - properties: - card_number: - type: string - card_type: - type: string - name: - type: string - bill_to_email: - type: string - payment_method: - type: string - readOnly: true - street_address: - type: object - properties: - line: - type: array - items: - type: string - postal_code: - type: string - state: - type: string - city: - type: string - country: - type: string - readOnly: true - required: - - created_on - - discounts - - id - - lines - - purchaser - - refunds - - state - - street_address - - total_price_paid - - transactions - OrderHistory: - type: object - properties: - id: - type: integer - readOnly: true - state: - $ref: '#/components/schemas/StateEnum' - reference_number: - type: string - nullable: true - maxLength: 255 - purchaser: - $ref: '#/components/schemas/PublicUser' - total_price_paid: - type: string - format: decimal - pattern: ^-?\d{0,15}(?:\.\d{0,5})?$ - lines: - type: array - items: - $ref: '#/components/schemas/Line' - created_on: - type: string - format: date-time - readOnly: true - titles: - type: array - items: {} - readOnly: true - updated_on: - type: string - format: date-time - readOnly: true - required: - - created_on - - id - - lines - - purchaser - - state - - titles - - total_price_paid - - updated_on - OrderRequest: - type: object - properties: - state: - $ref: '#/components/schemas/StateEnum' - total_price_paid: - type: string - format: decimal - pattern: ^-?\d{0,15}(?:\.\d{0,5})?$ - reference_number: - type: string - nullable: true - maxLength: 255 - required: - - state - - total_price_paid - OrganizationPage: - type: object - description: Serializer for the OrganizationPage model. - properties: - id: - type: integer - readOnly: true - name: - type: string - readOnly: true - description: The name of the organization - description: - type: string - readOnly: true - description: Any useful extra information about the organization - logo: - type: string - format: uri - readOnly: true - description: The organization's logo. Will be displayed in the app in various - places. - slug: - type: string - readOnly: true - description: The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/ - pattern: ^[-\w]+$ - contracts: - type: array - items: - $ref: '#/components/schemas/ContractPage' - readOnly: true - required: - - contracts - - description - - id - - logo - - name - - slug - Override: - type: object - description: Serializer for overrides used in certificate pages. - properties: - type: - type: string - value: - $ref: '#/components/schemas/OverrideValue' - id: - type: string - required: - - id - - type - - value - OverrideValue: - type: object - description: Serializer for override values used in certificate pages. - properties: - readable_id: - type: string - CEUs: - type: string - format: decimal - pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ - required: - - CEUs - - readable_id - Page: - type: object - description: Serializer for individual Wagtail pages. - properties: - id: - type: integer - title: - type: string - meta: - $ref: '#/components/schemas/PageMeta' - required: - - id - - meta - - title - PageList: - type: object - description: Serializer for a list of Wagtail pages. - properties: - meta: - $ref: '#/components/schemas/PageListMeta' - items: - type: array - items: - $ref: '#/components/schemas/Page' - required: - - items - - meta - PageListMeta: - type: object - description: Serializer for metadata of a list of Wagtail pages. - properties: - total_count: - type: integer - required: - - total_count - PageMeta: - type: object - description: Serializer for page metadata used in various Wagtail pages. - properties: - type: - type: string - detail_url: - type: string - format: uri - html_url: - type: string - format: uri - slug: - type: string - show_in_menus: - type: boolean - seo_title: - type: string - search_description: - type: string - first_published_at: - type: string - format: date-time - nullable: true - alias_of: - type: string - nullable: true - locale: - type: string - live: - type: boolean - last_published_at: - type: string - format: date-time - nullable: true - required: - - alias_of - - detail_url - - first_published_at - - html_url - - last_published_at - - live - - locale - - search_description - - seo_title - - show_in_menus - - slug - - type - PageMetaModel: - type: object - description: Extends the PageMetaSerializer to work with a Page object - properties: - type: - type: string - description: |- - Get the page type, in a more simple manner than Wagtail. - - The Wagtail version of this is PageTypeField, and it tries to modify the - context, which we neither need nor is in the correct format for it. - readOnly: true - detail_url: - type: string - description: |- - Get the detail URL, which should be the API call for this page. - - The Wagtail version of this is DetailUrlField and it also tries to make - changes to the context that we don't need. - readOnly: true - html_url: - type: string - description: Return PageHtmlUrlField. This is wrapped for OpenAPI schema - generation. - readOnly: true - slug: - type: string - show_in_menus: - type: boolean - seo_title: - type: string - search_description: - type: string - first_published_at: - type: string - format: date-time - nullable: true - alias_of: - type: string - nullable: true - locale: - type: string - description: Return PageLocaleField. This is wrapped for OpenAPI schema - generation. - readOnly: true - live: - type: boolean - last_published_at: - type: string - format: date-time - nullable: true - required: - - alias_of - - detail_url - - first_published_at - - html_url - - last_published_at - - live - - locale - - search_description - - seo_title - - show_in_menus - - slug - - type - PaginatedCourseWithCourseRunsSerializerV2List: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=4 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=2 - results: - type: array - items: - $ref: '#/components/schemas/CourseWithCourseRunsSerializerV2' - PaginatedDiscountProductList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 - results: - type: array - items: - $ref: '#/components/schemas/DiscountProduct' - PaginatedDiscountRedemptionList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 - results: - type: array - items: - $ref: '#/components/schemas/DiscountRedemption' - PaginatedFlexiblePriceTierList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 - results: - type: array - items: - $ref: '#/components/schemas/FlexiblePriceTier' - PaginatedOrderHistoryList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 - results: - type: array - items: - $ref: '#/components/schemas/OrderHistory' - PaginatedProductList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 - results: - type: array - items: - $ref: '#/components/schemas/Product' - PaginatedStaffDashboardUserList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?o=400&l=100 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?o=200&l=100 - results: - type: array - items: - $ref: '#/components/schemas/StaffDashboardUser' - PaginatedUserDiscountMetaList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 - results: - type: array - items: - $ref: '#/components/schemas/UserDiscountMeta' - PaginatedV0DiscountList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 - results: - type: array - items: - $ref: '#/components/schemas/V0Discount' - PaginatedV1CourseWithCourseRunsList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=4 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=2 - results: - type: array - items: - $ref: '#/components/schemas/V1CourseWithCourseRuns' - PaginatedV1ProgramList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=4 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=2 - results: - type: array - items: - $ref: '#/components/schemas/V1Program' - PaginatedV2ProgramCollectionList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=4 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=2 - results: - type: array - items: - $ref: '#/components/schemas/V2ProgramCollection' - PaginatedV2ProgramList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=4 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=2 - results: - type: array - items: - $ref: '#/components/schemas/V2Program' - PartnerSchool: - type: object - properties: - id: - type: integer - readOnly: true - created_on: - type: string - format: date-time - readOnly: true - updated_on: - type: string - format: date-time - readOnly: true - name: - type: string - maxLength: 255 - email: - type: string - required: - - created_on - - email - - id - - name - - updated_on - PartnerSchoolRequest: - type: object - properties: - name: - type: string - minLength: 1 - maxLength: 255 - email: - type: string - minLength: 1 - required: - - email - - name - PatchedChangeEmailRequestUpdateRequest: - type: object - description: Serializer for confirming a user email change - properties: - confirmed: - type: boolean - PatchedDiscountProductRequest: - type: object - properties: - discount: - $ref: '#/components/schemas/V0DiscountRequest' - product: - $ref: '#/components/schemas/ProductRequest' - PatchedDiscountRedemptionRequest: - type: object - description: Serializes a discount redemption. - properties: - redeemed_by: - $ref: '#/components/schemas/UserRequest' - redeemed_discount: - $ref: '#/components/schemas/V0DiscountRequest' - redeemed_order: - $ref: '#/components/schemas/OrderRequest' - PatchedFlexiblePriceTierRequest: - type: object - properties: - discount: - type: integer - current: - type: boolean - income_threshold_usd: - type: number - format: double - PatchedProductRequest: - type: object - description: Serializes a product, including the purchasable object. - properties: - price: - type: string - format: decimal - pattern: ^-?\d{0,5}(?:\.\d{0,2})?$ - description: - type: string - minLength: 1 - is_active: - type: boolean - description: Controls visibility of the product in the app. - PatchedUpdateCourseRunEnrollmentRequest: - type: object - properties: - receive_emails: - type: boolean - description: Whether to receive course emails - PatchedUserDiscountMetaRequest: - type: object - description: Serializes UserDiscount but only allows depth = 1 - properties: - discount: - $ref: '#/components/schemas/V0DiscountRequest' - user: - $ref: '#/components/schemas/UserRequest' - PatchedUserRequest: - type: object - description: Serializer for users - properties: - username: - type: string - nullable: true - minLength: 1 - maxLength: 30 - name: - type: string - maxLength: 255 - email: - type: string - format: email - nullable: true - minLength: 1 - password: - type: string - writeOnly: true - minLength: 1 - legal_address: - allOf: - - $ref: '#/components/schemas/LegalAddressRequest' - nullable: true - user_profile: - allOf: - - $ref: '#/components/schemas/UserProfileRequest' - nullable: true - is_active: - type: boolean - default: true - PatchedV0DiscountRequest: - type: object - description: Serializes a discount. - properties: - amount: - type: string - format: decimal - pattern: ^-?\d{0,15}(?:\.\d{0,5})?$ - automatic: - type: boolean - discount_type: - $ref: '#/components/schemas/DiscountTypeEnum' - redemption_type: - $ref: '#/components/schemas/RedemptionTypeEnum' - max_redemptions: - type: integer - maximum: 2147483647 - minimum: 0 - nullable: true - discount_code: - type: string - minLength: 1 - maxLength: 100 - payment_type: - nullable: true - oneOf: - - $ref: '#/components/schemas/PaymentTypeEnum' - - $ref: '#/components/schemas/NullEnum' - activation_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable before this - date. - expiration_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable after this - date. - PaymentTypeEnum: - enum: - - marketing - - sales - - financial-assistance - - customer-support - - staff - - legacy - type: string - description: |- - * `marketing` - marketing - * `sales` - sales - * `financial-assistance` - financial-assistance - * `customer-support` - customer-support - * `staff` - staff - * `legacy` - legacy - x-enum-descriptions: - - marketing - - sales - - financial-assistance - - customer-support - - staff - - legacy - PriceItem: - type: object - description: Serializer for price items used in course pages. - properties: - type: - type: string - value: - type: object - additionalProperties: {} - id: - type: string - format: uuid - required: - - id - - type - - value - Product: - type: object - description: Serializes a product, including the purchasable object. - properties: - id: - type: integer - readOnly: true - price: - type: string - format: decimal - pattern: ^-?\d{0,5}(?:\.\d{0,2})?$ - description: - type: string - is_active: - type: boolean - description: Controls visibility of the product in the app. - purchasable_object: - oneOf: - - type: object - properties: - id: - type: integer - run_tag: - type: string - start_date: - type: string - format: date-time - end_date: - type: string - format: date-time - - type: object - properties: - id: - type: integer - title: - type: string - run_tag: - type: string - start_date: - type: string - format: date-time - end_date: - type: string - format: date-time - course: - type: object - properties: - id: - type: integer - title: - type: string - page: - type: object - readable_id: - type: string - enrollment_start: - type: string - format: date-time - enrollment_end: - type: string - format: date-time - course_number: - type: string - readOnly: true - required: - - description - - id - - price - - purchasable_object - ProductFlexibilePrice: - type: object - description: Simple serializer for Product without related purchasable objects - properties: - id: - type: integer - readOnly: true - price: - type: string - format: decimal - pattern: ^-?\d{0,5}(?:\.\d{0,2})?$ - description: - type: string - is_active: - type: boolean - description: Controls visibility of the product in the app. - product_flexible_price: - allOf: - - $ref: '#/components/schemas/Discount' - nullable: true - readOnly: true - required: - - description - - id - - price - - product_flexible_price - ProductFlexibilePriceRequest: - type: object - description: Simple serializer for Product without related purchasable objects - properties: - price: - type: string - format: decimal - pattern: ^-?\d{0,5}(?:\.\d{0,2})?$ - description: - type: string - minLength: 1 - is_active: - type: boolean - description: Controls visibility of the product in the app. - required: - - description - - price - ProductFlexiblePrice: - type: object - description: Simple serializer for Product without related purchasable objects - properties: - id: - type: integer - readOnly: true - price: - type: string - format: decimal - pattern: ^-?\d{0,5}(?:\.\d{0,2})?$ - description: - type: string - is_active: - type: boolean - description: Controls visibility of the product in the app. - product_flexible_price: - allOf: - - $ref: '#/components/schemas/V0Discount' - nullable: true - readOnly: true - required: - - description - - id - - price - - product_flexible_price - ProductRequest: - type: object - description: Serializes a product, including the purchasable object. - properties: - price: - type: string - format: decimal - pattern: ^-?\d{0,5}(?:\.\d{0,2})?$ - description: - type: string - minLength: 1 - is_active: - type: boolean - description: Controls visibility of the product in the app. - required: - - description - - price - Program: - type: object - properties: - id: - type: integer - title: - type: string - readable_id: - type: string - required: - - id - - readable_id - - title - ProgramCertificate: - type: object - description: ProgramCertificate model serializer - properties: - uuid: - type: string - format: uuid - readOnly: true - link: - type: string - description: |- - Get the link at which this certificate will be served - Format: /certificate/program// - Example: /certificate/program/93ebd74e-5f88-4b47-bb09-30a6d575328f/ - readOnly: true - required: - - link - - uuid - ProgramPage: - type: object - description: Program page model serializer - properties: - feature_image_src: - type: string - description: Serializes the source of the feature_image - readOnly: true - page_url: - type: string - format: uri - readOnly: true - financial_assistance_form_url: - type: string - format: uri - readOnly: true - description: - type: string - description: The description shown on the home page and product page. - readOnly: true - live: - type: boolean - readOnly: true - length: - type: string - description: A short description indicating how long it takes to complete - (e.g. '4 weeks'). - maxLength: 50 - effort: - type: string - nullable: true - description: A short description indicating how much effort is required - (e.g. 1-3 hours per week). - maxLength: 100 - price: - type: string - description: Get the price text from the program page. - readOnly: true - required: - - description - - feature_image_src - - financial_assistance_form_url - - live - - page_url - - price - ProgramPageItem: - type: object - description: Serializer for individual program page items, including all relevant - fields. - properties: - id: - type: integer - readOnly: true - meta: - $ref: '#/components/schemas/PageMeta' - title: - type: string - description: The page title as you'd like it to be seen by the public - maxLength: 255 - description: - type: string - description: The description shown on the home page and product page. - readOnly: true - length: - type: string - description: A short description indicating how long it takes to complete - (e.g. '4 weeks'). - maxLength: 50 - effort: - type: string - nullable: true - description: A short description indicating how much effort is required - (e.g. 1-3 hours per week). - maxLength: 100 - min_weekly_hours: - type: string - description: The minimum number of hours per week required to complete the - course. - maxLength: 5 - max_weekly_hours: - type: string - description: The maximum number of hours per week required to complete the - course. - maxLength: 5 - min_weeks: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: The minimum number of weeks required to complete the course/program. - max_weeks: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: The maximum number of weeks required to complete the course/program. - price: - type: array - items: - $ref: '#/components/schemas/PriceItem' - min_price: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: Specify the minimum product price. This is used by MIT Learn. - max_price: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: Specify the maximum product price. This is used by MIT Learn. - prerequisites: - type: string - nullable: true - description: A short description indicating prerequisites of this course/program. - faq_url: - type: string - format: uri - nullable: true - description: URL a relevant FAQ page or entry for the course/program. - maxLength: 200 - about: - type: string - nullable: true - description: Details about this course/program. - what_you_learn: - type: string - nullable: true - description: '*Required for Verifiable Credential generation. What you will - learn from this course.' - feature_image: - $ref: '#/components/schemas/FeatureImage' - video_url: - type: string - format: uri - nullable: true - description: URL to the video to be displayed for this course/program. It - can be an HLS or Youtube video URL. - maxLength: 200 - faculty_section_title: - type: string - nullable: true - description: The title text to display in the faculty cards section of the - product page. - maxLength: 255 - faculty: - type: array - items: - $ref: '#/components/schemas/Faculty' - certificate_page: - $ref: '#/components/schemas/CertificatePage' - program_details: - $ref: '#/components/schemas/V2Program' - required: - - about - - certificate_page - - description - - effort - - faculty - - faculty_section_title - - faq_url - - feature_image - - id - - length - - max_price - - max_weekly_hours - - max_weeks - - meta - - min_price - - min_weekly_hours - - min_weeks - - prerequisites - - price - - program_details - - title - - video_url - - what_you_learn - ProgramPageList: - type: object - description: Serializer for a list of program pages, including metadata and - items. - properties: - meta: - $ref: '#/components/schemas/PageListMeta' - items: - type: array - items: - $ref: '#/components/schemas/ProgramPageItem' - required: - - items - - meta - PublicUser: - type: object - description: Serializer for public user data - properties: - id: - type: integer - readOnly: true - username: - type: string - nullable: true - maxLength: 30 - name: - type: string - maxLength: 255 - created_on: - type: string - format: date-time - readOnly: true - updated_on: - type: string - format: date-time - readOnly: true - required: - - created_on - - id - - updated_on - RedeemedDiscount: - type: object - description: DiscountRedemption model serializer - properties: - redeemed_discount: - allOf: - - $ref: '#/components/schemas/Nested' - readOnly: true - required: - - redeemed_discount - RedemptionTypeEnum: - enum: - - one-time - - one-time-per-user - - unlimited - type: string - description: |- - * `one-time` - one-time - * `one-time-per-user` - one-time-per-user - * `unlimited` - unlimited - x-enum-descriptions: - - one-time - - one-time-per-user - - unlimited - ResultEnum: - enum: - - b2b-disallowed - - b2b-error-no-contract - - b2b-error-no-product - - b2b-error-missing-enrollment-code - - b2b-error-invalid-enrollment-code - - b2b-error-requires-checkout - - b2b-enroll-success - type: string - description: |- - * `b2b-disallowed` - b2b-disallowed - * `b2b-error-no-contract` - b2b-error-no-contract - * `b2b-error-no-product` - b2b-error-no-product - * `b2b-error-missing-enrollment-code` - b2b-error-missing-enrollment-code - * `b2b-error-invalid-enrollment-code` - b2b-error-invalid-enrollment-code - * `b2b-error-requires-checkout` - b2b-error-requires-checkout - * `b2b-enroll-success` - b2b-enroll-success - x-enum-descriptions: - - b2b-disallowed - - b2b-error-no-contract - - b2b-error-no-product - - b2b-error-missing-enrollment-code - - b2b-error-invalid-enrollment-code - - b2b-error-requires-checkout - - b2b-enroll-success - SignatoryItem: - type: object - description: Serializer for signatory items used in certificate pages. - properties: - name: - type: string - title_1: - type: string - title_2: - type: string - title_3: - type: string - organization: - type: string - signature_image: - type: string - required: - - name - - organization - - signature_image - - title_1 - - title_2 - - title_3 - StaffDashboardUser: - type: object - description: Serializer for data we care about in the staff dashboard - properties: - id: - type: integer - readOnly: true - username: - type: string - maxLength: 500 - name: - type: string - maxLength: 255 - email: - type: string - format: email - maxLength: 254 - legal_address: - allOf: - - $ref: '#/components/schemas/LegalAddress' - nullable: true - is_staff: - type: boolean - description: The user can access the admin site - is_superuser: - type: boolean - title: Superuser status - description: Designates that this user has all permissions without explicitly - assigning them. - required: - - email - - id - - legal_address - - username - StateEnum: - enum: - - pending - - fulfilled - - canceled - - declined - - errored - - refunded - - review - - partially_refunded - type: string - description: |- - * `pending` - Pending - * `fulfilled` - Fulfilled - * `canceled` - Canceled - * `declined` - Declined - * `errored` - Errored - * `refunded` - Refunded - * `review` - Review - * `partially_refunded` - Partially Refunded - x-enum-descriptions: - - Pending - - Fulfilled - - Canceled - - Declined - - Errored - - Refunded - - Review - - Partially Refunded - Topic: - type: object - description: Serializer for topics used in course pages. - properties: - name: - type: string - parent: - type: string - required: - - name - TransactionLine: - type: object - description: Serializes a line item from a transaction. - properties: - quantity: - type: integer - CEUs: - type: string - content_title: - type: string - readable_id: - type: string - start_date: - type: string - format: date-time - end_date: - type: string - format: date-time - total_paid: - type: string - discount: - type: string - price: - type: string - required: - - CEUs - - content_title - - discount - - end_date - - price - - quantity - - readable_id - - start_date - - total_paid - User: - type: object - description: Serializer for users - properties: - id: - type: integer - readOnly: true - username: - type: string - nullable: true - maxLength: 30 - name: - type: string - maxLength: 255 - email: - type: string - format: email - nullable: true - legal_address: - allOf: - - $ref: '#/components/schemas/LegalAddress' - nullable: true - user_profile: - allOf: - - $ref: '#/components/schemas/UserProfile' - nullable: true - is_anonymous: - type: boolean - readOnly: true - is_authenticated: - type: boolean - readOnly: true - is_editor: - type: boolean - description: Returns True if the user has editor permissions for the CMS - readOnly: true - is_staff: - type: boolean - readOnly: true - description: The user can access the admin site - is_superuser: - type: boolean - readOnly: true - title: Superuser status - description: Designates that this user has all permissions without explicitly - assigning them. - created_on: - type: string - format: date-time - readOnly: true - updated_on: - type: string - format: date-time - readOnly: true - grants: - type: array - items: - type: string - readOnly: true - is_active: - type: boolean - default: true - b2b_organizations: - type: array - items: - $ref: '#/components/schemas/OrganizationPage' - readOnly: true - global_id: - type: string - readOnly: true - nullable: true - description: The SSO ID (usually a Keycloak UUID) for the user. - required: - - b2b_organizations - - created_on - - global_id - - grants - - id - - is_anonymous - - is_authenticated - - is_editor - - is_staff - - is_superuser - - legal_address - - updated_on - UserDiscountMeta: - type: object - description: Serializes UserDiscount but only allows depth = 1 - properties: - id: - type: integer - readOnly: true - discount: - $ref: '#/components/schemas/V0Discount' - user: - $ref: '#/components/schemas/User' - required: - - discount - - id - - user - UserDiscountMetaRequest: - type: object - description: Serializes UserDiscount but only allows depth = 1 - properties: - discount: - $ref: '#/components/schemas/V0DiscountRequest' - user: - $ref: '#/components/schemas/UserRequest' - required: - - discount - - user - UserProfile: - type: object - description: Serializer for profile - properties: - gender: - nullable: true - oneOf: - - $ref: '#/components/schemas/GenderEnum' - - $ref: '#/components/schemas/BlankEnum' - - $ref: '#/components/schemas/NullEnum' - year_of_birth: - type: integer - maximum: 2147483647 - minimum: -2147483648 - nullable: true - addl_field_flag: - type: boolean - description: Flags if we've asked the user for additional information - company: - type: string - nullable: true - maxLength: 128 - job_title: - type: string - nullable: true - maxLength: 128 - industry: - type: string - nullable: true - maxLength: 60 - job_function: - type: string - nullable: true - maxLength: 60 - company_size: - nullable: true - oneOf: - - $ref: '#/components/schemas/CompanySizeEnum' - - $ref: '#/components/schemas/NullEnum' - years_experience: - nullable: true - oneOf: - - $ref: '#/components/schemas/YearsExperienceEnum' - - $ref: '#/components/schemas/NullEnum' - leadership_level: - type: string - nullable: true - maxLength: 60 - highest_education: - nullable: true - oneOf: - - $ref: '#/components/schemas/HighestEducationEnum' - - $ref: '#/components/schemas/BlankEnum' - - $ref: '#/components/schemas/NullEnum' - type_is_student: - type: boolean - nullable: true - description: The learner identifies as type Student - type_is_professional: - type: boolean - nullable: true - description: The learner identifies as type Professional - type_is_educator: - type: boolean - nullable: true - description: The learner identifies as type Educator - type_is_other: - type: boolean - nullable: true - description: The learner identifies as type Other (not professional, student, - or educator) - UserProfileRequest: - type: object - description: Serializer for profile - properties: - gender: - nullable: true - oneOf: - - $ref: '#/components/schemas/GenderEnum' - - $ref: '#/components/schemas/BlankEnum' - - $ref: '#/components/schemas/NullEnum' - year_of_birth: - type: integer - maximum: 2147483647 - minimum: -2147483648 - nullable: true - addl_field_flag: - type: boolean - description: Flags if we've asked the user for additional information - company: - type: string - nullable: true - maxLength: 128 - job_title: - type: string - nullable: true - maxLength: 128 - industry: - type: string - nullable: true - maxLength: 60 - job_function: - type: string - nullable: true - maxLength: 60 - company_size: - nullable: true - oneOf: - - $ref: '#/components/schemas/CompanySizeEnum' - - $ref: '#/components/schemas/NullEnum' - years_experience: - nullable: true - oneOf: - - $ref: '#/components/schemas/YearsExperienceEnum' - - $ref: '#/components/schemas/NullEnum' - leadership_level: - type: string - nullable: true - maxLength: 60 - highest_education: - nullable: true - oneOf: - - $ref: '#/components/schemas/HighestEducationEnum' - - $ref: '#/components/schemas/BlankEnum' - - $ref: '#/components/schemas/NullEnum' - type_is_student: - type: boolean - nullable: true - description: The learner identifies as type Student - type_is_professional: - type: boolean - nullable: true - description: The learner identifies as type Professional - type_is_educator: - type: boolean - nullable: true - description: The learner identifies as type Educator - type_is_other: - type: boolean - nullable: true - description: The learner identifies as type Other (not professional, student, - or educator) - UserProgramEnrollmentDetail: - type: object - properties: - program: - $ref: '#/components/schemas/V1Program' - enrollments: - type: array - items: - $ref: '#/components/schemas/CourseRunEnrollment' - certificate: - allOf: - - $ref: '#/components/schemas/V1ProgramCertificate' - nullable: true - readOnly: true - required: - - certificate - - enrollments - - program - UserRequest: - type: object - description: Serializer for users - properties: - username: - type: string - nullable: true - minLength: 1 - maxLength: 30 - name: - type: string - maxLength: 255 - email: - type: string - format: email - nullable: true - minLength: 1 - password: - type: string - writeOnly: true - minLength: 1 - legal_address: - allOf: - - $ref: '#/components/schemas/LegalAddressRequest' - nullable: true - user_profile: - allOf: - - $ref: '#/components/schemas/UserProfileRequest' - nullable: true - is_active: - type: boolean - default: true - required: - - legal_address - V0Discount: - type: object - description: Serializes a discount. - properties: - id: - type: integer - readOnly: true - amount: - type: string - format: decimal - pattern: ^-?\d{0,15}(?:\.\d{0,5})?$ - automatic: - type: boolean - discount_type: - $ref: '#/components/schemas/DiscountTypeEnum' - redemption_type: - $ref: '#/components/schemas/RedemptionTypeEnum' - max_redemptions: - type: integer - maximum: 2147483647 - minimum: 0 - nullable: true - discount_code: - type: string - maxLength: 100 - payment_type: - nullable: true - oneOf: - - $ref: '#/components/schemas/PaymentTypeEnum' - - $ref: '#/components/schemas/NullEnum' - is_redeemed: - type: boolean - description: Returns True if the discount has been redeemed - readOnly: true - activation_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable before this - date. - expiration_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable after this - date. - required: - - amount - - discount_code - - discount_type - - id - - is_redeemed - - redemption_type - V0DiscountRequest: - type: object - description: Serializes a discount. - properties: - amount: - type: string - format: decimal - pattern: ^-?\d{0,15}(?:\.\d{0,5})?$ - automatic: - type: boolean - discount_type: - $ref: '#/components/schemas/DiscountTypeEnum' - redemption_type: - $ref: '#/components/schemas/RedemptionTypeEnum' - max_redemptions: - type: integer - maximum: 2147483647 - minimum: 0 - nullable: true - discount_code: - type: string - minLength: 1 - maxLength: 100 - payment_type: - nullable: true - oneOf: - - $ref: '#/components/schemas/PaymentTypeEnum' - - $ref: '#/components/schemas/NullEnum' - activation_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable before this - date. - expiration_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable after this - date. - required: - - amount - - discount_code - - discount_type - - redemption_type - V1BaseCourseRun: - type: object - description: CourseRun model serializer - properties: - title: - type: string - description: The title of the course. This value is synced automatically - with edX studio. - maxLength: 255 - start_date: - type: string - format: date-time - nullable: true - description: The day the course begins. This value is synced automatically - with edX studio. - end_date: - type: string - format: date-time - nullable: true - description: The last day the course is active. This value is synced automatically - with edX studio. - enrollment_start: - type: string - format: date-time - nullable: true - description: The first day students can enroll. This value is synced automatically - with edX studio. - enrollment_end: - type: string - format: date-time - nullable: true - description: The last day students can enroll. This value is synced automatically - with edX studio. - expiration_date: - type: string - format: date-time - nullable: true - description: The date beyond which the learner should not see link to this - course run on their dashboard. - courseware_url: - type: string - nullable: true - description: Get the courseware URL - readOnly: true - courseware_id: - type: string - maxLength: 255 - certificate_available_date: - type: string - format: date-time - nullable: true - description: The day certificates should be available to users. This value - is synced automatically with edX studio. - upgrade_deadline: - type: string - format: date-time - nullable: true - description: The date beyond which the learner can not enroll in paid course - mode. - is_upgradable: - type: boolean - description: Check if the course run is upgradable - readOnly: true - is_enrollable: - type: boolean - description: Check if the course run is enrollable - readOnly: true - is_archived: - type: boolean - description: Check if the course run is archived - readOnly: true - is_self_paced: - type: boolean - run_tag: - type: string - description: 'A string that identifies the set of runs that this run belongs - to (example: ''R2'')' - maxLength: 100 - id: - type: integer - readOnly: true - live: - type: boolean - course_number: - type: string - description: Get the course number - readOnly: true - products: - type: array - items: - allOf: - - $ref: '#/components/schemas/ProductFlexibilePrice' - readOnly: true - approved_flexible_price_exists: - type: boolean - readOnly: true - required: - - approved_flexible_price_exists - - course_number - - courseware_id - - courseware_url - - id - - is_archived - - is_enrollable - - is_upgradable - - products - - run_tag - - title - V1CourseRunWithCourse: - type: object - description: CourseRun model serializer - also serializes the parent Course. - properties: - title: - type: string - description: The title of the course. This value is synced automatically - with edX studio. - maxLength: 255 - start_date: - type: string - format: date-time - nullable: true - description: The day the course begins. This value is synced automatically - with edX studio. - end_date: - type: string - format: date-time - nullable: true - description: The last day the course is active. This value is synced automatically - with edX studio. - enrollment_start: - type: string - format: date-time - nullable: true - description: The first day students can enroll. This value is synced automatically - with edX studio. - enrollment_end: - type: string - format: date-time - nullable: true - description: The last day students can enroll. This value is synced automatically - with edX studio. - expiration_date: - type: string - format: date-time - nullable: true - description: The date beyond which the learner should not see link to this - course run on their dashboard. - courseware_url: - type: string - nullable: true - description: Get the courseware URL - readOnly: true - courseware_id: - type: string - maxLength: 255 - certificate_available_date: - type: string - format: date-time - nullable: true - description: The day certificates should be available to users. This value - is synced automatically with edX studio. - upgrade_deadline: - type: string - format: date-time - nullable: true - description: The date beyond which the learner can not enroll in paid course - mode. - is_upgradable: - type: boolean - description: Check if the course run is upgradable - readOnly: true - is_enrollable: - type: boolean - description: Check if the course run is enrollable - readOnly: true - is_archived: - type: boolean - description: Check if the course run is archived - readOnly: true - is_self_paced: - type: boolean - run_tag: - type: string - description: 'A string that identifies the set of runs that this run belongs - to (example: ''R2'')' - maxLength: 100 - id: - type: integer - readOnly: true - live: - type: boolean - course_number: - type: string - description: Get the course number - readOnly: true - products: - type: array - items: - allOf: - - $ref: '#/components/schemas/ProductFlexibilePrice' - readOnly: true - description: List of products associated with this course run - approved_flexible_price_exists: - type: boolean - readOnly: true - course: - allOf: - - $ref: '#/components/schemas/Course' - readOnly: true - required: - - approved_flexible_price_exists - - course - - course_number - - courseware_id - - courseware_url - - id - - is_archived - - is_enrollable - - is_upgradable - - products - - run_tag - - title - V1CourseRunWithCourseRequest: - type: object - description: CourseRun model serializer - also serializes the parent Course. - properties: - title: - type: string - minLength: 1 - description: The title of the course. This value is synced automatically - with edX studio. - maxLength: 255 - start_date: - type: string - format: date-time - nullable: true - description: The day the course begins. This value is synced automatically - with edX studio. - end_date: - type: string - format: date-time - nullable: true - description: The last day the course is active. This value is synced automatically - with edX studio. - enrollment_start: - type: string - format: date-time - nullable: true - description: The first day students can enroll. This value is synced automatically - with edX studio. - enrollment_end: - type: string - format: date-time - nullable: true - description: The last day students can enroll. This value is synced automatically - with edX studio. - expiration_date: - type: string - format: date-time - nullable: true - description: The date beyond which the learner should not see link to this - course run on their dashboard. - courseware_id: - type: string - minLength: 1 - maxLength: 255 - certificate_available_date: - type: string - format: date-time - nullable: true - description: The day certificates should be available to users. This value - is synced automatically with edX studio. - upgrade_deadline: - type: string - format: date-time - nullable: true - description: The date beyond which the learner can not enroll in paid course - mode. - is_self_paced: - type: boolean - run_tag: - type: string - minLength: 1 - description: 'A string that identifies the set of runs that this run belongs - to (example: ''R2'')' - maxLength: 100 - live: - type: boolean - required: - - courseware_id - - run_tag - - title - V1CourseWithCourseRuns: - type: object - description: Course model serializer - also serializes child course runs - properties: - id: - type: integer - readOnly: true - title: - type: string - maxLength: 255 - readable_id: - type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - next_run_id: - type: integer - nullable: true - description: Get next run id - readOnly: true - departments: - type: array - items: - $ref: '#/components/schemas/Department' - readOnly: true - page: - allOf: - - $ref: '#/components/schemas/CoursePage' - readOnly: true - programs: - allOf: - - $ref: '#/components/schemas/Program' - nullable: true - readOnly: true - courseruns: - type: array - items: - $ref: '#/components/schemas/V1BaseCourseRun' - readOnly: true - required: - - courseruns - - departments - - id - - next_run_id - - page - - programs - - readable_id - - title - V1Program: - type: object - description: Program model serializer - properties: - title: - type: string - maxLength: 255 - readable_id: - type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - id: - type: integer - readOnly: true - courses: - allOf: - - $ref: '#/components/schemas/V1CourseWithCourseRuns' - readOnly: true - requirements: - type: object - properties: - required: - type: array - items: - oneOf: - - type: integer - description: List of required course IDs - electives: - type: array - items: - oneOf: - - type: integer - description: List of elective course IDs - readOnly: true - req_tree: - type: array - items: - $ref: '#/components/schemas/V1ProgramRequirement' - readOnly: true - page: - allOf: - - $ref: '#/components/schemas/ProgramPage' - readOnly: true - program_type: - type: string - nullable: true - maxLength: 255 - departments: - type: array - items: - $ref: '#/components/schemas/Department' - readOnly: true - live: - type: boolean - required: - - courses - - departments - - id - - page - - readable_id - - req_tree - - requirements - - title - V1ProgramCertificate: - type: object - description: ProgramCertificate model serializer - properties: - uuid: - type: string - format: uuid - readOnly: true - link: - type: string - description: |- - Get the link at which this certificate will be served - Format: /certificate/program// - Example: /certificate/program/93ebd74e-5f88-4b47-bb09-30a6d575328f/ - readOnly: true - required: - - link - - uuid - V1ProgramRequirement: - type: object - description: Serializer for a ProgramRequirement - properties: - id: - type: integer - nullable: true - data: - $ref: '#/components/schemas/V1ProgramRequirementData' - children: - type: array - items: - $ref: '#/components/schemas/V1ProgramRequirement' - default: [] - required: - - data - V1ProgramRequirementData: - type: object - description: Serializer for ProgramRequirement data - properties: - node_type: - $ref: '#/components/schemas/NodeTypeEnum' - course: - type: string - nullable: true - required_program: - type: string - nullable: true - program: - type: string - title: - type: string - nullable: true - operator: - type: string - nullable: true - operator_value: - type: string - nullable: true - elective_flag: - type: boolean - nullable: true - default: false - required: - - node_type - V2Course: - type: object - description: Course model serializer - properties: - id: - type: integer - readOnly: true - title: - type: string - maxLength: 255 - readable_id: - type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - next_run_id: - type: integer - nullable: true - description: Get next run id - readOnly: true - departments: - type: array - items: - $ref: '#/components/schemas/Department' - readOnly: true - page: - allOf: - - $ref: '#/components/schemas/CoursePage' - readOnly: true - programs: - type: array - items: - $ref: '#/components/schemas/BaseProgram' - nullable: true - readOnly: true - topics: - type: array - items: - type: object - additionalProperties: {} - description: List topics of a course - readOnly: true - certificate_type: - type: string - readOnly: true - required_prerequisites: - type: boolean - description: |- - Check if the prerequisites field is populated in the course page CMS. - Returns: - bool: True when the prerequisites field is populated in the course page CMS. False otherwise. - readOnly: true - duration: - type: string - description: Get the duration of the course from the course page CMS. - readOnly: true - min_weeks: - type: integer - nullable: true - description: Get the min weeks of the course from the CMS page. - readOnly: true - max_weeks: - type: integer - nullable: true - description: Get the max weeks of the course from the CMS page. - readOnly: true - min_price: - type: integer - nullable: true - description: Get the min price of the product from the CMS page. - readOnly: true - max_price: - type: integer - nullable: true - description: Get the max price of the product from the CMS page. - readOnly: true - time_commitment: - type: string - nullable: true - description: Get the time commitment of the course from the course page - CMS. - readOnly: true - availability: - type: string - description: Get course availability - readOnly: true - min_weekly_hours: - type: string - nullable: true - description: Get the min weekly hours of the course from the course page - CMS. - readOnly: true - max_weekly_hours: - type: string - nullable: true - description: Get the max weekly hours of the course from the course page - CMS. - readOnly: true - include_in_learn_catalog: - type: boolean - readOnly: true - ingest_content_files_for_ai: - type: boolean - readOnly: true - required: - - availability - - certificate_type - - departments - - duration - - id - - include_in_learn_catalog - - ingest_content_files_for_ai - - max_price - - max_weekly_hours - - max_weeks - - min_price - - min_weekly_hours - - min_weeks - - next_run_id - - page - - programs - - readable_id - - required_prerequisites - - time_commitment - - title - - topics - V2CourseRequest: - type: object - description: Course model serializer - properties: - title: - type: string - minLength: 1 - maxLength: 255 - readable_id: - type: string - minLength: 1 - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - required: - - readable_id - - title - V2CourseRunCertificate: - type: object - description: Serializer for course certificates. - properties: - user: - $ref: '#/components/schemas/PublicUser' - uuid: - type: string - format: uuid - readOnly: true - is_revoked: - type: boolean - readOnly: true - title: Revoked - description: Indicates whether or not the certificate is revoked - certificate_page: - allOf: - - $ref: '#/components/schemas/CertificatePageModel' - readOnly: true - verifiable_credential_json: - readOnly: true - course_run: - $ref: '#/components/schemas/V2CourseRunWithCourse' - certificate_page_revision: - type: integer - readOnly: true - nullable: true - required: - - certificate_page - - certificate_page_revision - - course_run - - is_revoked - - user - - uuid - - verifiable_credential_json - V2CourseRunWithCourse: - type: object - description: CourseRun model serializer - also serializes the parent Course. - properties: - title: - type: string - description: The title of the course. This value is synced automatically - with edX studio. - maxLength: 255 - start_date: - type: string - format: date-time - nullable: true - description: The day the course begins. This value is synced automatically - with edX studio. - end_date: - type: string - format: date-time - nullable: true - description: The last day the course is active. This value is synced automatically - with edX studio. - enrollment_start: - type: string - format: date-time - nullable: true - description: The first day students can enroll. This value is synced automatically - with edX studio. - enrollment_end: - type: string - format: date-time - nullable: true - description: The last day students can enroll. This value is synced automatically - with edX studio. - expiration_date: - type: string - format: date-time - nullable: true - description: The date beyond which the learner should not see link to this - course run on their dashboard. - courseware_url: - type: string - nullable: true - description: Get the courseware URL - readOnly: true - courseware_id: - type: string - maxLength: 255 - certificate_available_date: - type: string - format: date-time - nullable: true - description: The day certificates should be available to users. This value - is synced automatically with edX studio. - upgrade_deadline: - type: string - format: date-time - nullable: true - description: The date beyond which the learner can not enroll in paid course - mode. - is_upgradable: - type: boolean - description: Check if the course run is upgradable - readOnly: true - is_enrollable: - type: boolean - description: Check if the course run is enrollable - readOnly: true - is_archived: - type: boolean - description: Check if the course run is archived - readOnly: true - is_self_paced: - type: boolean - run_tag: - type: string - description: 'A string that identifies the set of runs that this run belongs - to (example: ''R2'')' - maxLength: 100 - id: - type: integer - readOnly: true - live: - type: boolean - course_number: - type: string - description: Get the course number - readOnly: true - products: - type: array - items: - allOf: - - $ref: '#/components/schemas/ProductFlexibilePrice' - readOnly: true - approved_flexible_price_exists: - type: boolean - readOnly: true - b2b_contract: - type: integer - nullable: true - course: - allOf: - - $ref: '#/components/schemas/V2Course' - readOnly: true - required: - - approved_flexible_price_exists - - course - - course_number - - courseware_id - - courseware_url - - id - - is_archived - - is_enrollable - - is_upgradable - - products - - run_tag - - title - V2CourseRunWithCourseRequest: - type: object - description: CourseRun model serializer - also serializes the parent Course. - properties: - title: - type: string - minLength: 1 - description: The title of the course. This value is synced automatically - with edX studio. - maxLength: 255 - start_date: - type: string - format: date-time - nullable: true - description: The day the course begins. This value is synced automatically - with edX studio. - end_date: - type: string - format: date-time - nullable: true - description: The last day the course is active. This value is synced automatically - with edX studio. - enrollment_start: - type: string - format: date-time - nullable: true - description: The first day students can enroll. This value is synced automatically - with edX studio. - enrollment_end: - type: string - format: date-time - nullable: true - description: The last day students can enroll. This value is synced automatically - with edX studio. - expiration_date: - type: string - format: date-time - nullable: true - description: The date beyond which the learner should not see link to this - course run on their dashboard. - courseware_id: - type: string - minLength: 1 - maxLength: 255 - certificate_available_date: - type: string - format: date-time - nullable: true - description: The day certificates should be available to users. This value - is synced automatically with edX studio. - upgrade_deadline: - type: string - format: date-time - nullable: true - description: The date beyond which the learner can not enroll in paid course - mode. - is_self_paced: - type: boolean - run_tag: - type: string - minLength: 1 - description: 'A string that identifies the set of runs that this run belongs - to (example: ''R2'')' - maxLength: 100 - live: - type: boolean - b2b_contract: - type: integer - nullable: true - required: - - courseware_id - - run_tag - - title - V2Program: - type: object - description: Program Model Serializer v2 - properties: - title: - type: string - maxLength: 255 - readable_id: - type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - id: - type: integer - readOnly: true - courses: - type: array - items: - type: integer - readOnly: true - collections: - type: array - items: - type: integer - readOnly: true - requirements: - type: object - properties: - courses: - type: object - properties: - required: - type: array - items: - type: object - properties: - id: - type: integer - readable_id: - type: string - description: List of required courses with id and readable_id - electives: - type: array - items: - type: object - properties: - id: - type: integer - readable_id: - type: string - description: List of elective courses with id and readable_id - programs: - type: object - properties: - required: - type: array - items: - type: object - properties: - id: - type: integer - readable_id: - type: string - description: List of required programs with id and readable_id - electives: - type: array - items: - type: object - properties: - id: - type: integer - readable_id: - type: string - description: List of elective programs with id and readable_id - readOnly: true - req_tree: - type: array - items: - $ref: '#/components/schemas/V2ProgramRequirement' - readOnly: true - page: - allOf: - - $ref: '#/components/schemas/ProgramPage' - readOnly: true - program_type: - type: string - nullable: true - maxLength: 255 - certificate_type: - type: string - readOnly: true - departments: - type: array - items: - $ref: '#/components/schemas/Department' - readOnly: true - live: - type: boolean - topics: - type: array - items: - type: object - properties: - name: - type: string - readOnly: true - availability: - $ref: '#/components/schemas/AvailabilityEnum' - start_date: - type: string - nullable: true - description: Get the start date of the program by finding the first available - run. - readOnly: true - end_date: - type: string - format: date-time - nullable: true - enrollment_start: - type: string - format: date-time - nullable: true - enrollment_end: - type: string - format: date-time - nullable: true - required_prerequisites: - type: boolean - description: Check if the prerequisites field is populated in the program - page CMS. - readOnly: true - duration: - type: string - nullable: true - description: Get the length/duration field from the program page CMS. - readOnly: true - min_weeks: - type: integer - nullable: true - description: Get the min weeks of the program from the CMS page. - readOnly: true - max_weeks: - type: integer - nullable: true - description: Get the max weeks of the program from the CMS page. - readOnly: true - min_price: - type: integer - nullable: true - description: Get the min price of the product from the CMS page. - readOnly: true - max_price: - type: integer - nullable: true - description: Get the max price of the product from the CMS page. - readOnly: true - time_commitment: - type: string - nullable: true - description: Get the effort/time_commitment field from the program page - CMS. - readOnly: true - min_weekly_hours: - type: string - nullable: true - description: Get the min weekly hours of the course from the course page - CMS. - readOnly: true - max_weekly_hours: - type: string - nullable: true - description: Get the max weekly hours of the course from the course page - CMS. - readOnly: true - required: - - certificate_type - - collections - - courses - - departments - - duration - - id - - max_price - - max_weekly_hours - - max_weeks - - min_price - - min_weekly_hours - - min_weeks - - page - - readable_id - - req_tree - - required_prerequisites - - requirements - - start_date - - time_commitment - - title - - topics - V2ProgramCertificate: - type: object - description: Serializer for course certificates. - properties: - user: - $ref: '#/components/schemas/PublicUser' - uuid: - type: string - format: uuid - readOnly: true - is_revoked: - type: boolean - readOnly: true - title: Revoked - description: Indicates whether or not the certificate is revoked - certificate_page: - allOf: - - $ref: '#/components/schemas/CertificatePageModel' - readOnly: true - verifiable_credential_json: - readOnly: true - program: - $ref: '#/components/schemas/V2Program' - certificate_page_revision: - type: integer - readOnly: true - nullable: true - required: - - certificate_page - - certificate_page_revision - - is_revoked - - program - - user - - uuid - - verifiable_credential_json - V2ProgramCollection: - type: object - description: Serializer for ProgramCollection - properties: - id: - type: integer - readOnly: true - title: - type: string - description: - type: string - programs: - type: array - items: - type: object - properties: - id: - type: integer - title: - type: string - order: - type: integer - readOnly: true - created_on: - type: string - format: date-time - readOnly: true - updated_on: - type: string - format: date-time - readOnly: true - required: - - created_on - - description - - id - - programs - - title - - updated_on - V2ProgramRequirement: - type: object - description: Serializer for a ProgramRequirement - properties: - id: - type: integer - nullable: true - data: - $ref: '#/components/schemas/V2ProgramRequirementData' - children: - type: array - items: - $ref: '#/components/schemas/V2ProgramRequirement' - default: [] - required: - - data - V2ProgramRequirementData: - type: object - description: Serializer for ProgramRequirement data - properties: - node_type: - $ref: '#/components/schemas/NodeTypeEnum' - course: - type: integer - nullable: true - program: - type: integer - nullable: true - required_program: - type: integer - nullable: true - title: - type: string - nullable: true - operator: - type: string - nullable: true - operator_value: - type: string - nullable: true - elective_flag: - type: boolean - nullable: true - default: false - required: - - node_type - V2UserProgramEnrollmentDetail: - type: object - description: |- - Serializer for user program enrollments with associated course enrollments. - - This aggregates a program, its course enrollments for the user, and any - program certificate that has been earned. - properties: - program: - $ref: '#/components/schemas/V2Program' - enrollments: - type: array - items: - $ref: '#/components/schemas/CourseRunEnrollmentRequestV2' - certificate: - allOf: - - $ref: '#/components/schemas/ProgramCertificate' - nullable: true - readOnly: true - required: - - certificate - - enrollments - - program - YearsExperienceEnum: - enum: - - 2 - - 5 - - 10 - - 15 - - 20 - - 21 - - 0 - description: |- - * `None` - ---- - * `2` - Less than 2 years - * `5` - 2-5 years - * `10` - 6 - 10 years - * `15` - 11 - 15 years - * `20` - 16 - 20 years - * `21` - More than 20 years - * `0` - Prefer not to say - x-enum-descriptions: - - Less than 2 years - - 2-5 years - - 6 - 10 years - - 11 - 15 years - - 16 - 20 years - - More than 20 years - - Prefer not to say +paths: {} +components: {} diff --git a/openapi/specs/v2.yaml b/openapi/specs/v2.yaml index abd621881c..095251f536 100644 --- a/openapi/specs/v2.yaml +++ b/openapi/specs/v2.yaml @@ -4,7213 +4,825 @@ info: version: 0.0.1 (v2) description: MIT public API paths: - /api/records/program/{id}/: - get: - operationId: learner_record_retrieve_by_id - description: Get learner record using program ID - parameters: - - in: path - name: id - schema: - type: integer - required: true - tags: - - api - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/LearnerRecord' - description: '' - /api/records/program/{id}/revoke/: - post: - operationId: api_records_program_revoke_create - description: |- - Disables sharing links for the learner's record. This only applies to the - anonymous ones; shares sent to partner schools are always allowed once they - are sent. - parameters: - - in: path - name: id - schema: - type: integer - required: true - tags: - - api - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/LearnerRecord' - description: '' - /api/records/program/{id}/share/: - post: - operationId: api_records_program_share_create - description: |- - Sets up a sharing link for the learner's record. Returns back the entire - learner record. - parameters: - - in: path - name: id - schema: - type: integer - required: true - tags: - - api - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PartnerSchoolRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PartnerSchoolRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PartnerSchoolRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/LearnerRecord' - description: '' - /api/records/shared/{uuid}/: - get: - operationId: learner_record_retrieve_by_uuid - description: Get learner record using share UUID - parameters: - - in: path - name: uuid - schema: - type: string - format: uuid - required: true - tags: - - api - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/LearnerRecord' - description: '' - /api/v0/b2b/attach/{enrollment_code}/: - post: - operationId: b2b_attach_create - description: |- - Use the provided enrollment code to attach the user to a B2B contract. - - This will not create an order, nor will it enroll the user. It will - attach the user to the contract and log that the code was used for this - purpose (but will _not_ invalidate the code, since we're not actually - using it at this point). - - This will respect the activation and expiration dates (of both the contract - and the discount), and will make sure there's sufficient available seats - in the contract. It will also make sure the code hasn't been used for - attachment purposes before. - - If the user is already in the contract, then we skip it. - - Returns: - - 201: Code successfully redeemed and user attached to new contract(s) - - 200: Code valid but user already attached to all associated contracts - - 404: Invalid or expired enrollment code - - list of ContractPageSerializer - the contracts for the user - parameters: - - in: path - name: enrollment_code - schema: - type: string - required: true - tags: - - b2b - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ContractPage' - description: '' - /api/v0/b2b/contracts/: - get: - operationId: b2b_contracts_list - description: Viewset for the ContractPage model. - tags: - - b2b - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/ContractPage' - description: '' - /api/v0/b2b/contracts/{contract_slug}/: + /api/v2/pages/: get: - operationId: b2b_contracts_retrieve - description: Viewset for the ContractPage model. - parameters: - - in: path - name: contract_slug - schema: - type: string - description: The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/ - required: true - tags: - - b2b - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ContractPage' - description: '' - /api/v0/b2b/enroll/{readable_id}/: - post: - operationId: b2b_enroll_create - description: Create an enrollment for the given course run. + operationId: pages_list + description: Returns pages of all types + summary: List all Wagtail Pages parameters: - - in: path - name: readable_id + - in: query + name: fields schema: type: string - required: true - tags: - - b2b - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CreateB2BEnrollment' - description: '' - /api/v0/b2b/organizations/: - get: - operationId: b2b_organizations_list - description: Viewset for the OrganizationPage model. - tags: - - b2b - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/OrganizationPage' - description: '' - /api/v0/b2b/organizations/{organization_slug}/: - get: - operationId: b2b_organizations_retrieve - description: Viewset for the OrganizationPage model. - parameters: - - in: path - name: organization_slug + description: Specify fields (e.g. `*`) + - in: query + name: type schema: type: string - description: The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/ - required: true - tags: - - b2b - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/OrganizationPage' - description: '' - /api/v0/baskets/: - get: - operationId: baskets_list - description: Retrives the current user's baskets. + description: Filter by Wagtail page type tags: - - baskets + - pages responses: '200': content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/BasketWithProduct' + $ref: '#/components/schemas/PageList' description: '' - /api/v0/baskets/{parent_lookup_basket}/items/: + /api/v2/pages/{id}/: get: - operationId: baskets_items_list - description: Returns the basket items for the current user. + operationId: pages_retrieve + description: Returns details of a specific Wagtail page by ID + summary: Get Wagtail Page Details parameters: - in: path name: id schema: type: integer - description: ID of the basket item + description: ID of the Wagtail page required: true - - in: path - name: parent_lookup_basket + - in: query + name: revision_id schema: type: integer - description: ID of the parent basket - required: true + description: Optional certificate revision ID to retrieve a specific revision + of the certificate page tags: - - baskets + - pages responses: '200': content: application/json: schema: - type: array - items: - $ref: '#/components/schemas/BasketItem' - description: '' - post: - operationId: baskets_items_create - description: Returns the basket items for the current user. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the basket item - required: true - - in: path - name: parent_lookup_basket - schema: - type: integer - description: ID of the parent basket - required: true - tags: - - baskets - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/BasketItem' - description: '' - /api/v0/baskets/{parent_lookup_basket}/items/{id}/: + oneOf: + - $ref: '#/components/schemas/CoursePageItem' + - $ref: '#/components/schemas/ProgramPageItem' + - $ref: '#/components/schemas/CertificatePage' + - $ref: '#/components/schemas/Page' + description: Returns a page of any known Wagtail page type + /api/v2/pages/?fields=*&type=cms.certificatepage: get: - operationId: baskets_items_retrieve - description: Returns the basket items for the current user. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the basket item - required: true - - in: path - name: parent_lookup_basket - schema: - type: integer - description: ID of the parent basket - required: true - tags: - - baskets - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BasketItem' - description: '' - put: - operationId: baskets_items_update - description: Returns the basket items for the current user. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the basket item - required: true - - in: path - name: parent_lookup_basket - schema: - type: integer - description: ID of the parent basket - required: true - tags: - - baskets - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BasketItem' - description: '' - patch: - operationId: baskets_items_partial_update - description: Returns the basket items for the current user. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the basket item - required: true - - in: path - name: parent_lookup_basket - schema: - type: integer - description: ID of the parent basket - required: true + operationId: pages_?fields=*&type=cms.certificatepage_retrieve + description: Returns pages of type cms.CertificatePage + summary: List all Certificate Pages tags: - - baskets + - pages responses: '200': content: application/json: schema: - $ref: '#/components/schemas/BasketItem' + $ref: '#/components/schemas/CertificatePageList' description: '' - delete: - operationId: baskets_items_destroy - description: Returns the basket items for the current user. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the basket item - required: true - - in: path - name: parent_lookup_basket - schema: - type: integer - description: ID of the parent basket - required: true - tags: - - baskets - responses: - '204': - description: No response body - /api/v0/baskets/{id}/: + /api/v2/pages/?fields=*&type=cms.coursepage: get: - operationId: baskets_retrieve - description: Retrieve a basket for the current user. + operationId: pages_?fields=*&type=cms.coursepage_retrieve + description: Returns pages of type cms.CoursePage + summary: List all Course Pages parameters: - - in: path - name: id + - in: query + name: readable_id schema: - type: integer - required: true + type: string + description: filter by course readable_id tags: - - baskets + - pages responses: '200': content: application/json: schema: - $ref: '#/components/schemas/BasketWithProduct' + $ref: '#/components/schemas/CoursePageList' description: '' - /api/v0/baskets/add_discount/: - post: - operationId: baskets_add_discount_create - description: Creates or updates a basket for the current user, adding the discount - if valid. + /api/v2/pages/?fields=*&type=cms.programpage: + get: + operationId: pages_?fields=*&type=cms.programpage_retrieve + description: Returns pages of type cms.ProgramPage + summary: List all Program Pages parameters: - in: query - name: discount_code + name: readable_id schema: type: string - required: true + description: filter by program readable_id tags: - - baskets + - pages responses: '200': content: application/json: schema: - $ref: '#/components/schemas/BasketWithProduct' + $ref: '#/components/schemas/ProgramPageList' description: '' - /api/v0/baskets/checkout/: - get: - operationId: baskets_checkout_retrieve - description: Returns the payload necessary to redirect the user to CyberSource - for payment. - tags: - - baskets - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CheckoutPayload' - description: '' - /api/v0/baskets/clear/: - delete: - operationId: baskets_clear_destroy - description: Clears the basket for the current user. - tags: - - baskets - responses: - '204': - description: Basket cleared successfully - /api/v0/baskets/create_from_product/{product_id}/: - post: - operationId: baskets_create_from_product_create - description: Creates or updates a basket for the current user, adding the selected - product. - parameters: - - in: path - name: product_id - schema: - type: integer - required: true - tags: - - baskets - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BasketWithProduct' - description: '' - /api/v0/baskets/create_from_product/{product_id}/{discount_code}/: - post: - operationId: create_basket_from_product_with_discount - description: Creates or updates a basket for the current user, adding the selected - product and discount. - parameters: - - in: path - name: discount_code - schema: - type: string - required: true - - in: path - name: product_id - schema: - type: integer - required: true - tags: - - baskets - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BasketWithProduct' - description: '' - /api/v0/baskets/create_with_products/: - post: - operationId: baskets_create_with_products_create - description: Creates or updates a basket for the current user, adding the selected - product. - tags: - - baskets - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateBasketWithProductsRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CreateBasketWithProductsRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/CreateBasketWithProductsRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/BasketWithProduct' - description: '' - /api/v0/change-emails/: - post: - operationId: change_emails_create - description: Viewset for creating and updating email change requests - tags: - - change-emails - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ChangeEmailRequestCreateRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/ChangeEmailRequestCreateRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/ChangeEmailRequestCreateRequest' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/ChangeEmailRequestCreate' - description: '' - /api/v0/change-emails/{code}/: - put: - operationId: change_emails_update - description: Viewset for creating and updating email change requests - parameters: - - in: path - name: code - schema: - type: string - required: true - tags: - - change-emails - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ChangeEmailRequestUpdateRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/ChangeEmailRequestUpdateRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/ChangeEmailRequestUpdateRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ChangeEmailRequestUpdate' - description: '' - patch: - operationId: change_emails_partial_update - description: Viewset for creating and updating email change requests - parameters: - - in: path - name: code - schema: - type: string - required: true - tags: - - change-emails - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedChangeEmailRequestUpdateRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedChangeEmailRequestUpdateRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedChangeEmailRequestUpdateRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ChangeEmailRequestUpdate' - description: '' - /api/v0/countries/: - get: - operationId: countries_list - description: Get generator for countries/states list - tags: - - countries - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Country' - description: '' - /api/v0/discounts/: - get: - operationId: discounts_list - description: API view set for Discounts - parameters: - - in: query - name: is_redeemed - schema: - type: string - enum: - - 'no' - - 'yes' - description: |- - * `yes` - yes - * `no` - no - - name: limit - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: offset - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - - in: query - name: payment_type - schema: - type: string - nullable: true - enum: - - customer-support - - financial-assistance - - legacy - - marketing - - sales - - staff - description: |- - * `marketing` - marketing - * `sales` - sales - * `financial-assistance` - financial-assistance - * `customer-support` - customer-support - * `staff` - staff - * `legacy` - legacy - - in: query - name: q - schema: - type: string - description: q - - in: query - name: redemption_type - schema: - type: string - enum: - - one-time - - one-time-per-user - - unlimited - description: |- - * `one-time` - one-time - * `one-time-per-user` - one-time-per-user - * `unlimited` - unlimited - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedV0DiscountList' - description: '' - post: - operationId: discounts_create - description: API view set for Discounts - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/V0DiscountRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/V0DiscountRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/V0DiscountRequest' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/V0Discount' - description: '' - /api/v0/discounts/{parent_lookup_discount}/assignees/: - get: - operationId: discounts_assignees_list - description: API view set for User Discounts. This one is for use within a Discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - name: limit - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: offset - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedUserDiscountMetaList' - description: '' - post: - operationId: discounts_assignees_create - description: Create an association between a user and a discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UserDiscountMetaRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/UserDiscountMetaRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/UserDiscountMetaRequest' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/UserDiscountMeta' - description: '' - /api/v0/discounts/{parent_lookup_discount}/assignees/{id}/: - get: - operationId: discounts_assignees_retrieve - description: API view set for User Discounts. This one is for use within a Discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/UserDiscountMeta' - description: '' - put: - operationId: discounts_assignees_update - description: API view set for User Discounts. This one is for use within a Discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UserDiscountMetaRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/UserDiscountMetaRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/UserDiscountMetaRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/UserDiscountMeta' - description: '' - patch: - operationId: discounts_assignees_partial_update - description: Partial update for a user discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedUserDiscountMetaRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedUserDiscountMetaRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedUserDiscountMetaRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/UserDiscountMeta' - description: '' - delete: - operationId: discounts_assignees_destroy - description: Delete a user discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '204': - description: No response body - /api/v0/discounts/{parent_lookup_discount}/products/: - get: - operationId: discounts_products_list - description: API view set for Discounts - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the discount product - required: true - - name: limit - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: offset - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedDiscountProductList' - description: '' - post: - operationId: discounts_products_create - description: API view set for Discounts - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the discount product - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountProductRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/DiscountProductRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/DiscountProductRequest' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountProduct' - description: '' - /api/v0/discounts/{parent_lookup_discount}/products/{id}/: - get: - operationId: discounts_products_retrieve - description: API view set for Discounts - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the discount product - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountProduct' - description: '' - put: - operationId: discounts_products_update - description: API view set for Discounts - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the discount product - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountProductRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/DiscountProductRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/DiscountProductRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountProduct' - description: '' - patch: - operationId: discounts_products_partial_update - description: Partial update for a discount product. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the discount product - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedDiscountProductRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedDiscountProductRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedDiscountProductRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountProduct' - description: '' - delete: - operationId: discounts_products_destroy - description: Delete a linked product from a discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the discount product - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '204': - description: No response body - /api/v0/discounts/{parent_lookup_discount}/tiers/: - get: - operationId: discounts_tiers_list - description: API view set for Flexible Pricing Tiers. This one is for use within - a Discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - name: limit - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: offset - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedFlexiblePriceTierList' - description: '' - post: - operationId: discounts_tiers_create - description: API view set for Flexible Pricing Tiers. This one is for use within - a Discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FlexiblePriceTierRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/FlexiblePriceTierRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/FlexiblePriceTierRequest' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/FlexiblePriceTier' - description: '' - /api/v0/discounts/{parent_lookup_discount}/tiers/{id}/: - get: - operationId: discounts_tiers_retrieve - description: API view set for Flexible Pricing Tiers. This one is for use within - a Discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/FlexiblePriceTier' - description: '' - put: - operationId: discounts_tiers_update - description: API view set for Flexible Pricing Tiers. This one is for use within - a Discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FlexiblePriceTierRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/FlexiblePriceTierRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/FlexiblePriceTierRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/FlexiblePriceTier' - description: '' - patch: - operationId: discounts_tiers_partial_update - description: API view set for Flexible Pricing Tiers. This one is for use within - a Discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedFlexiblePriceTierRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedFlexiblePriceTierRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedFlexiblePriceTierRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/FlexiblePriceTier' - description: '' - delete: - operationId: discounts_tiers_destroy - description: API view set for Flexible Pricing Tiers. This one is for use within - a Discount. - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '204': - description: No response body - /api/v0/discounts/{parent_lookup_redeemed_discount}/redemptions/: - get: - operationId: discounts_redemptions_list - description: API view set for Discount Redemptions - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - name: limit - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: offset - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - - in: path - name: parent_lookup_redeemed_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedDiscountRedemptionList' - description: '' - post: - operationId: discounts_redemptions_create - description: API view set for Discount Redemptions - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_redeemed_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountRedemptionRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/DiscountRedemptionRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/DiscountRedemptionRequest' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountRedemption' - description: '' - /api/v0/discounts/{parent_lookup_redeemed_discount}/redemptions/{id}/: - get: - operationId: discounts_redemptions_retrieve - description: API view set for Discount Redemptions - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_redeemed_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountRedemption' - description: '' - put: - operationId: discounts_redemptions_update - description: API view set for Discount Redemptions - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_redeemed_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountRedemptionRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/DiscountRedemptionRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/DiscountRedemptionRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountRedemption' - description: '' - patch: - operationId: discounts_redemptions_partial_update - description: API view set for Discount Redemptions - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_redeemed_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedDiscountRedemptionRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedDiscountRedemptionRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedDiscountRedemptionRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DiscountRedemption' - description: '' - delete: - operationId: discounts_redemptions_destroy - description: API view set for Discount Redemptions - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the user discount - required: true - - in: path - name: parent_lookup_redeemed_discount - schema: - type: integer - description: ID of the parent discount - required: true - tags: - - discounts - responses: - '204': - description: No response body - /api/v0/discounts/{id}/: - get: - operationId: discounts_retrieve - description: API view set for Discounts - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this discount. - required: true - tags: - - discounts - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V0Discount' - description: '' - put: - operationId: discounts_update - description: API view set for Discounts - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this discount. - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/V0DiscountRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/V0DiscountRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/V0DiscountRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V0Discount' - description: '' - patch: - operationId: discounts_partial_update - description: API view set for Discounts - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this discount. - required: true - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedV0DiscountRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedV0DiscountRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedV0DiscountRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V0Discount' - description: '' - delete: - operationId: discounts_destroy - description: API view set for Discounts - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this discount. - required: true - tags: - - discounts - responses: - '204': - description: No response body - /api/v0/discounts/create_batch/: - post: - operationId: discounts_create_batch_create - description: |- - Create a batch of codes. This is used in the staff-dashboard. - POST arguments are the same as in generate_discount_code - look there - for details. - tags: - - discounts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/V0DiscountRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/V0DiscountRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/V0DiscountRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V0Discount' - description: '' - /api/v0/orders/history/: - get: - operationId: orders_history_list - description: Retrives the current user's order history. - parameters: - - name: limit - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: offset - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - tags: - - orders - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedOrderHistoryList' - description: '' - /api/v0/orders/history/{id}/: - get: - operationId: orders_history_retrieve - description: Retrieve a historical order for the current user. - parameters: - - in: path - name: id - schema: - type: integer - required: true - tags: - - orders - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/OrderHistory' - description: '' - /api/v0/orders/receipt/{id}/: - get: - operationId: orders_receipt_retrieve - description: Viewset to retrieve an order so it can be viewed as a receipt. - parameters: - - in: path - name: id - schema: - type: integer - required: true - tags: - - orders - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Order' - description: '' - /api/v0/products/: - get: - operationId: products_list - description: List and view products within the system. - parameters: - - name: limit - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: offset - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - tags: - - products - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedProductList' - description: '' - /api/v0/products/{id}/: - get: - operationId: products_retrieve - description: List and view products within the system. - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this product. - required: true - tags: - - products - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Product' - description: '' - /api/v0/products/{id}/user_flexible_price/: - get: - operationId: products_user_flexible_price_retrieve - description: Retrieve a product with user-specific flexible price information - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this product. - required: true - tags: - - products - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ProductFlexiblePrice' - description: '' - /api/v0/products/all/: - get: - operationId: products_all_list - description: |- - This doesn't filter unenrollable products out, and adds name search for - courseware object readable id. It's really for the staff dashboard. - parameters: - - name: limit - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: offset - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - tags: - - products - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedProductList' - description: '' - post: - operationId: products_all_create - description: |- - This doesn't filter unenrollable products out, and adds name search for - courseware object readable id. It's really for the staff dashboard. - tags: - - products - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ProductRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/ProductRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/ProductRequest' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/Product' - description: '' - /api/v0/products/all/{id}/: - get: - operationId: products_all_retrieve - description: |- - This doesn't filter unenrollable products out, and adds name search for - courseware object readable id. It's really for the staff dashboard. - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this product. - required: true - tags: - - products - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Product' - description: '' - put: - operationId: products_all_update - description: |- - This doesn't filter unenrollable products out, and adds name search for - courseware object readable id. It's really for the staff dashboard. - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this product. - required: true - tags: - - products - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/ProductRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/ProductRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/ProductRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Product' - description: '' - patch: - operationId: products_all_partial_update - description: |- - This doesn't filter unenrollable products out, and adds name search for - courseware object readable id. It's really for the staff dashboard. - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this product. - required: true - tags: - - products - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedProductRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedProductRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedProductRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Product' - description: '' - delete: - operationId: products_all_destroy - description: |- - This doesn't filter unenrollable products out, and adds name search for - courseware object readable id. It's really for the staff dashboard. - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this product. - required: true - tags: - - products - responses: - '204': - description: No response body - /api/v0/user_search/: - get: - operationId: user_search_list - description: |- - Provides an API for listing system users. This is for the staff - dashboard. - parameters: - - name: l - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - name: o - required: false - in: query - description: The initial index from which to return the results. - schema: - type: integer - - name: search - required: false - in: query - description: A search term. - schema: - type: string - tags: - - user_search - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedStaffDashboardUserList' - description: '' - /api/v0/user_search/{id}/: - get: - operationId: user_search_retrieve - description: |- - Provides an API for listing system users. This is for the staff - dashboard. - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this user. - required: true - tags: - - user_search - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/StaffDashboardUser' - description: '' - /api/v0/userinfo/: - get: - operationId: userinfo_retrieve - description: |- - Retrieve the current user's info only if they have an edx_username, otherwise return 409 - - This is to prevent issues with Open edX OAuth client that expect an edx_username to be present - tags: - - userinfo - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: '' - /api/v0/users/{id}/: - get: - operationId: users_retrieve - description: User retrieve viewsets - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this user. - required: true - tags: - - users - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PublicUser' - description: '' - /api/v0/users/current_user/: - get: - operationId: users_current_user_retrieve - description: User retrieve and update viewsets for the current user - tags: - - users - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: '' - patch: - operationId: users_current_user_partial_update - description: User retrieve and update viewsets for the current user - tags: - - users - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedUserRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedUserRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedUserRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: '' - /api/v0/users/me: - get: - operationId: users_me_retrieve - description: User retrieve and update viewsets for the current user - tags: - - users - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: '' - patch: - operationId: users_me_partial_update - description: User retrieve and update viewsets for the current user - tags: - - users - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedUserRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedUserRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedUserRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: '' - /api/v1/course_runs/: - get: - operationId: course_runs_list - description: API view set for CourseRuns - parameters: - - in: query - name: id - schema: - type: integer - - in: query - name: live - schema: - type: boolean - tags: - - course_runs - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/V1CourseRunWithCourse' - description: '' - /api/v1/course_runs/{id}/: - get: - operationId: course_runs_retrieve - description: API view set for CourseRuns - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course run. - required: true - tags: - - course_runs - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V1CourseRunWithCourse' - description: '' - /api/v1/courses/: - get: - operationId: api_v1_courses_list - description: List all courses - API v1 - parameters: - - in: query - name: courserun_is_enrollable - schema: - type: boolean - - in: query - name: id - schema: - type: integer - - in: query - name: live - schema: - type: boolean - - name: page - required: false - in: query - description: A page number within the paginated result set. - schema: - type: integer - - in: query - name: page__live - schema: - type: boolean - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: readable_id - schema: - type: string - tags: - - courses - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedV1CourseWithCourseRunsList' - description: '' - /api/v1/courses/{id}/: - get: - operationId: api_v1_courses_retrieve - description: Retrieve a specific course - API v1 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course. - required: true - tags: - - courses - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V1CourseWithCourseRuns' - description: '' - /api/v1/departments/: - get: - operationId: departments_list_v1 - description: List departments - v1 - tags: - - departments - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/DepartmentWithCount' - description: '' - /api/v1/departments/{id}/: - get: - operationId: departments_retrieve_v1 - description: Get department details - v1 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this department. - required: true - tags: - - departments - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DepartmentWithCount' - description: '' - /api/v1/enrollments/: - get: - operationId: enrollments_list - description: API view set for user enrollments - tags: - - enrollments - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/CourseRunEnrollment' - description: '' - post: - operationId: enrollments_create - description: API view set for user enrollments - tags: - - enrollments - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequest' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollment' - description: '' - /api/v1/enrollments/{id}/: - put: - operationId: enrollments_update - description: API view set for user enrollments - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course run enrollment. - required: true - tags: - - enrollments - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequest' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollment' - description: '' - patch: - operationId: enrollments_partial_update - description: Update enrollment email preferences - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course run enrollment. - required: true - tags: - - enrollments - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedUpdateCourseRunEnrollmentRequest' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedUpdateCourseRunEnrollmentRequest' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedUpdateCourseRunEnrollmentRequest' - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollment' - description: '' - delete: - operationId: enrollments_destroy - description: API view set for user enrollments - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course run enrollment. - required: true - tags: - - enrollments - responses: - '204': - description: No response body - /api/v1/program_enrollments/: - get: - operationId: program_enrollments_list - description: |- - Returns a unified set of program and course enrollments for the current - user. - tags: - - program_enrollments - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/UserProgramEnrollmentDetail' - description: '' - /api/v1/program_enrollments/{id}/: - get: - operationId: program_enrollments_retrieve - description: Retrieve a specific program enrollment. - parameters: - - in: path - name: id - schema: - type: integer - description: Program enrollment ID - required: true - tags: - - program_enrollments - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/UserProgramEnrollmentDetail' - description: '' - delete: - operationId: program_enrollments_destroy - description: |- - Unenroll the user from this program. This is simpler than the corresponding - function for CourseRunEnrollments; edX doesn't really know what programs - are so there's nothing to process there. - parameters: - - in: path - name: id - schema: - type: integer - description: Program enrollment ID - required: true - tags: - - program_enrollments - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/UserProgramEnrollmentDetail' - description: '' - /api/v1/programs/: - get: - operationId: programs_list_v1 - description: List Programs - v1 - parameters: - - in: query - name: id - schema: - type: integer - - in: query - name: live - schema: - type: boolean - - name: page - required: false - in: query - description: A page number within the paginated result set. - schema: - type: integer - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: readable_id - schema: - type: string - tags: - - programs - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedV1ProgramList' - description: '' - /api/v1/programs/{id}/: - get: - operationId: programs_retrieve_v1 - description: API view set for Programs - v1 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this program. - required: true - tags: - - programs - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V1Program' - description: '' - /api/v2/course_certificates/{cert_uuid}/: - get: - operationId: course_certificates_retrieve - description: Get a course certificate by UUID. - parameters: - - in: path - name: cert_uuid - schema: - type: string - format: uuid - required: true - tags: - - course_certificates - security: - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V2CourseRunCertificate' - description: '' - /api/v2/courses/: - get: - operationId: api_v2_courses_list - description: List all courses - API v2 - parameters: - - in: query - name: contract_id - schema: - type: number - description: Only show courses belonging to this B2B contract - - in: query - name: courserun_is_enrollable - schema: - type: boolean - description: Course Run Is Enrollable - - in: query - name: id - schema: - type: array - items: - type: integer - description: Multiple values may be separated by commas. - explode: false - style: form - - in: query - name: include_approved_financial_aid - schema: - type: boolean - description: Include approved financial assistance information - - in: query - name: live - schema: - type: boolean - - in: query - name: org_id - schema: - type: number - description: Only show courses belonging to this B2B/UAI organization - - name: page - required: false - in: query - description: A page number within the paginated result set. - schema: - type: integer - - in: query - name: page__live - schema: - type: boolean - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: readable_id - schema: - type: string - tags: - - courses - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedCourseWithCourseRunsSerializerV2List' - description: '' - /api/v2/courses/{id}/: - get: - operationId: api_v2_courses_retrieve - description: Retrieve a specific course - API v2 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course. - required: true - tags: - - courses - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CourseWithCourseRunsSerializerV2' - description: '' - /api/v2/departments/: - get: - operationId: departments_list_v2 - description: List departments - v2 - tags: - - departments - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/DepartmentWithCoursesAndPrograms' - description: '' - /api/v2/departments/{id}/: - get: - operationId: departments_retrieve_v2 - description: Get department details - v2 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this department. - required: true - tags: - - departments - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/DepartmentWithCoursesAndPrograms' - description: '' - /api/v2/enrollments/: - get: - operationId: user_enrollments_list_v2 - description: List user enrollments with B2B organization and contract information - - API v2. Use ?exclude_b2b=true to filter out enrollments linked to course - runs with B2B contracts. Use ?org_id= to filter enrollments by specific - B2B organization. - parameters: - - in: query - name: exclude_b2b - schema: - type: boolean - description: Exclude B2B enrollments (enrollments linked to course runs with - B2B contracts) - - in: query - name: org_id - schema: - type: number - description: Filter by B2B organization ID - tags: - - enrollments - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/CourseRunEnrollmentRequestV2' - description: '' - post: - operationId: user_enrollments_create_v2 - description: Create a new user enrollment - API v2 - tags: - - enrollments - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequestV2Request' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequestV2Request' - multipart/form-data: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequestV2Request' - required: true - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequestV2' - description: '' - /api/v2/enrollments/{id}/: - delete: - operationId: user_enrollments_destroy_v2 - description: Unenroll from a course - API v2 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this course run enrollment. - required: true - tags: - - enrollments - responses: - '204': - description: No response body - /api/v2/pages/: - get: - operationId: pages_list - description: Returns pages of all types - summary: List all Wagtail Pages - parameters: - - in: query - name: fields - schema: - type: string - description: Specify fields (e.g. `*`) - - in: query - name: type - schema: - type: string - description: Filter by Wagtail page type - tags: - - pages - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PageList' - description: '' - /api/v2/pages/{id}/: - get: - operationId: pages_retrieve - description: Returns details of a specific Wagtail page by ID - summary: Get Wagtail Page Details - parameters: - - in: path - name: id - schema: - type: integer - description: ID of the Wagtail page - required: true - - in: query - name: revision_id - schema: - type: integer - description: Optional certificate revision ID to retrieve a specific revision - of the certificate page - tags: - - pages - responses: - '200': - content: - application/json: - schema: - oneOf: - - $ref: '#/components/schemas/CoursePageItem' - - $ref: '#/components/schemas/ProgramPageItem' - - $ref: '#/components/schemas/CertificatePage' - - $ref: '#/components/schemas/Page' - description: Returns a page of any known Wagtail page type - /api/v2/pages/?fields=*&type=cms.certificatepage: - get: - operationId: pages_?fields=*&type=cms.certificatepage_retrieve - description: Returns pages of type cms.CertificatePage - summary: List all Certificate Pages - tags: - - pages - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CertificatePageList' - description: '' - /api/v2/pages/?fields=*&type=cms.coursepage: - get: - operationId: pages_?fields=*&type=cms.coursepage_retrieve - description: Returns pages of type cms.CoursePage - summary: List all Course Pages - parameters: - - in: query - name: readable_id - schema: - type: string - description: filter by course readable_id - tags: - - pages - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CoursePageList' - description: '' - /api/v2/pages/?fields=*&type=cms.programpage: - get: - operationId: pages_?fields=*&type=cms.programpage_retrieve - description: Returns pages of type cms.ProgramPage - summary: List all Program Pages - parameters: - - in: query - name: readable_id - schema: - type: string - description: filter by program readable_id - tags: - - pages - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/ProgramPageList' - description: '' - /api/v2/program-collections/: - get: - operationId: program_collections_list - description: Readonly viewset for ProgramCollection objects. - parameters: - - name: page - required: false - in: query - description: A page number within the paginated result set. - schema: - type: integer - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - tags: - - program-collections - security: - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedV2ProgramCollectionList' - description: '' - /api/v2/program-collections/{id}/: - get: - operationId: program_collections_retrieve - description: Readonly viewset for ProgramCollection objects. - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this Program Collection. - required: true - tags: - - program-collections - security: - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V2ProgramCollection' - description: '' - /api/v2/program_certificates/{cert_uuid}/: - get: - operationId: program_certificates_retrieve - description: Get a program certificate by UUID. - parameters: - - in: path - name: cert_uuid - schema: - type: string - format: uuid - required: true - tags: - - program_certificates - security: - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V2ProgramCertificate' - description: '' - /api/v2/program_enrollments/: - get: - operationId: v2_program_enrollments_list - description: |- - Returns a unified set of program and course enrollments for the current - user using v2 serializers. - tags: - - program_enrollments - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/V2UserProgramEnrollmentDetail' - description: '' - /api/v2/program_enrollments/{id}/: - get: - operationId: v2_program_enrollments_retrieve - description: Retrieve a specific program enrollment using v2 serializers. - parameters: - - in: path - name: id - schema: - type: integer - description: Program enrollment ID - required: true - tags: - - program_enrollments - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V2UserProgramEnrollmentDetail' - description: '' - delete: - operationId: v2_program_enrollments_destroy - description: |- - Unenroll the user from this program. This is simpler than the corresponding - function for CourseRunEnrollments; edX doesn't really know what programs - are so there's nothing to process there. - parameters: - - in: path - name: id - schema: - type: integer - description: Program enrollment ID - required: true - tags: - - program_enrollments - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/V2UserProgramEnrollmentDetail' - description: '' - /api/v2/programs/: - get: - operationId: programs_list_v2 - description: List Programs - v2 - parameters: - - in: query - name: contract_id - schema: - type: number - - in: query - name: id - schema: - type: array - items: - type: integer - description: Multiple values may be separated by commas. - explode: false - style: form - - in: query - name: live - schema: - type: boolean - - in: query - name: org_id - schema: - type: number - - name: page - required: false - in: query - description: A page number within the paginated result set. - schema: - type: integer - - in: query - name: page__live - schema: - type: boolean - - name: page_size - required: false - in: query - description: Number of results to return per page. - schema: - type: integer - - in: query - name: readable_id - schema: - type: string - tags: - - programs - security: - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PaginatedV2ProgramList' - description: '' - /api/v2/programs/{id}/: - get: - operationId: programs_retrieve_v2 - description: API view set for Programs - v2 - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this program. - required: true - tags: - - programs - security: - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/V2Program' - description: '' - /api/v2/verifiable_course_credential/{credential_id}/download/: - get: - operationId: verifiable_course_credential_download_list - description: Returns the json for the verifiable credential with the given ID - parameters: - - in: path - name: credential_id - schema: - type: string - format: uuid - required: true - tags: - - verifiable_course_credential - security: - - {} - responses: - '200': - description: No response body - /api/v2/verifiable_program_credential/{credential_id}/download/: - get: - operationId: verifiable_program_credential_download_list - description: Returns the json for the verifiable credential with the given ID - parameters: - - in: path - name: credential_id - schema: - type: string - format: uuid - required: true - tags: - - verifiable_program_credential - security: - - {} - responses: - '200': - description: No response body - /api/v2/verified_program_enrollments/{program_id}/{courserun_id}/: - post: - operationId: verified_program_enrollments_create - description: |- - Create a program-related course enrollment for the learner. - - Some special handling is needed for program-related course run enrollments - when the learner has an enrollment in the program. The learner should get a - course run enrollment that matches their program enrollment at no additional - charge. However, if the learner is enrolling in a course that's an elective, - and they have already enrolled in enough electives to satisfy the program's - requirements, they should then get an audit enrollment. (This won't preclude - them from getting a certificate for the course itself but they'll have to buy - the upgrade separately.) - parameters: - - in: path - name: courserun_id - schema: - type: string - description: Readable ID for the course run to enroll in. - required: true - - in: path - name: program_id - schema: - type: string - description: Readable ID for the program. - required: true - tags: - - verified_program_enrollments - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/CourseRunEnrollmentRequestV2' - description: '' - '204': - description: No response body - '404': - description: No response body - /enrollments/: - post: - operationId: api_enrollments_create - description: View to handle direct POST requests to enroll in a course run. - tags: - - enrollments - responses: - '200': - description: No response body - '302': - description: No response body -components: - schemas: - AvailabilityEnum: - enum: - - anytime - - dated - type: string - description: |- - * `anytime` - anytime - * `dated` - dated - x-enum-descriptions: - - anytime - - dated - BaseCourse: - type: object - description: Basic course model serializer - properties: - id: - type: integer - readOnly: true - title: - type: string - maxLength: 255 - readable_id: - type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - type: - type: string - description: Returns the type of object this is serializing. - readOnly: true - required: - - id - - readable_id - - title - - type - BaseProgram: - type: object - description: Basic program model serializer - properties: - title: - type: string - maxLength: 255 - readable_id: - type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - id: - type: integer - readOnly: true - type: - type: string - readOnly: true - required: - - id - - readable_id - - title - - type - Basket: - type: object - description: Basket model serializer - properties: - id: - type: integer - readOnly: true - user: - type: integer - basket_items: - type: array - items: - $ref: '#/components/schemas/BasketItem' - readOnly: true - required: - - basket_items - - id - - user - BasketDiscountDetail: - type: object - description: BasketDiscount model serializer - properties: - redeemed_discount: - $ref: '#/components/schemas/V0Discount' - redeemed_basket: - $ref: '#/components/schemas/Basket' - required: - - redeemed_basket - - redeemed_discount - BasketItem: - type: object - description: BasketItem model serializer - properties: - basket: - type: integer - product: - type: integer - id: - type: integer - readOnly: true - required: - - basket - - id - - product - BasketWithProduct: - type: object - description: Serializer for Basket model with product details - properties: - id: - type: integer - readOnly: true - user: - type: integer - basket_items: - type: array - items: - type: object - properties: - basket: - type: integer - product: - type: object - properties: - id: - type: integer - price: - type: number - description: - type: string - is_active: - type: boolean - purchasable_object: - type: object - id: - type: integer - readOnly: true - total_price: - type: number - format: double - description: Get total price of all items in basket before discounts - readOnly: true - discounted_price: - type: number - format: double - description: Get total price after any discounts are applied - readOnly: true - discounts: - type: array - items: - $ref: '#/components/schemas/BasketDiscountDetail' - readOnly: true - required: - - basket_items - - discounted_price - - discounts - - id - - total_price - - user - BlankEnum: - enum: - - '' - CertificatePage: - type: object - description: Serializer for certificate pages, including overrides and signatory - items. - properties: - id: - type: integer - meta: - $ref: '#/components/schemas/PageMeta' - title: - type: string - product_name: - type: string - CEUs: - type: string - overrides: - type: array - items: - $ref: '#/components/schemas/Override' - signatory_items: - type: array - items: - $ref: '#/components/schemas/SignatoryItem' - required: - - CEUs - - id - - meta - - overrides - - product_name - - signatory_items - - title - CertificatePageList: - type: object - description: Serializer for a list of certificate pages. - properties: - meta: - $ref: '#/components/schemas/PageListMeta' - items: - type: array - items: - $ref: '#/components/schemas/CertificatePage' - required: - - items - - meta - CertificatePageModel: - type: object - description: Extends the CertificatePageSerializer to work with a model object. - properties: - id: - type: integer - meta: - allOf: - - $ref: '#/components/schemas/PageMetaModel' - readOnly: true - title: - type: string - product_name: - type: string - CEUs: - type: string - overrides: - type: array - items: - $ref: '#/components/schemas/Override' - signatory_items: - type: array - items: - $ref: '#/components/schemas/SignatoryItem' - required: - - CEUs - - id - - meta - - overrides - - product_name - - signatory_items - - title - ChangeEmailRequestCreate: - type: object - description: Serializer for starting a user email change - properties: - new_email: - type: string - format: email - required: - - new_email - ChangeEmailRequestCreateRequest: - type: object - description: Serializer for starting a user email change - properties: - new_email: - type: string - format: email - minLength: 1 - password: - type: string - writeOnly: true - minLength: 1 - required: - - new_email - - password - ChangeEmailRequestUpdate: - type: object - description: Serializer for confirming a user email change - properties: - confirmed: - type: boolean - required: - - confirmed - ChangeEmailRequestUpdateRequest: - type: object - description: Serializer for confirming a user email change - properties: - confirmed: - type: boolean - required: - - confirmed - CheckoutPayload: - type: object - description: Serializes the payload for the checkout data. - properties: - no_checkout: - type: boolean - readOnly: true - default: false - description: Set if the order was automatically completed and no checkout - process is required. - url: - type: string - readOnly: true - default: '' - description: The URL to POST the form to. - method: - type: string - readOnly: true - default: POST - description: The method to use for the checkout form (always POST). - payload: - readOnly: true - default: {} - description: The data for the form. - order_id: - type: integer - readOnly: true - default: 0 - description: If the order was automatically completed, the ID of the new - order. - error: - allOf: - - $ref: '#/components/schemas/ErrorEnum' - readOnly: true - description: |- - Error message for the order, if there is one. - - * `enroll-blocked` - enroll-blocked - * `enroll-duplicated` - enroll-duplicated - * `course-non-upgradable` - course-non-upgradable - * `discount-invalid` - discount-invalid - * `b2b-error-missing-enrollment-code` - b2b-error-missing-enrollment-code - * `b2b-invalid-basket` - b2b-invalid-basket - * `basket-empty` - basket-empty - required: - - error - - method - - no_checkout - - order_id - - payload - - url - CompanySizeEnum: - enum: - - 1 - - 9 - - 99 - - 999 - - 9999 - - 10000 - - 0 - description: |- - * `None` - ---- - * `1` - Small/Start-up (1+ employees) - * `9` - Small/Home office (1-9 employees) - * `99` - Small (10-99 employees) - * `999` - Small to medium-sized (100-999 employees) - * `9999` - Medium-sized (1000-9999 employees) - * `10000` - Large Enterprise (10,000+ employees) - * `0` - Other (N/A or Don't know) - x-enum-descriptions: - - Small/Start-up (1+ employees) - - Small/Home office (1-9 employees) - - Small (10-99 employees) - - Small to medium-sized (100-999 employees) - - Medium-sized (1000-9999 employees) - - Large Enterprise (10,000+ employees) - - Other (N/A or Don't know) - ContractPage: - type: object - description: Serializer for the ContractPage model. - properties: - id: - type: integer - readOnly: true - name: - type: string - readOnly: true - description: The name of the contract. - description: - type: string - readOnly: true - description: Any useful extra information about the contract. - welcome_message: - type: string - readOnly: true - description: A welcome message for learners. - welcome_message_extra: - type: string - readOnly: true - description: Additional welcome message content for learners. - integration_type: - allOf: - - $ref: '#/components/schemas/IntegrationTypeEnum' - readOnly: true - description: |- - The type of integration for this contract. - - * `sso` - SSO - * `non-sso` - Non-SSO - * `managed` - Managed - * `code` - Enrollment Code - * `auto` - Auto Enrollment - membership_type: - type: string - organization: - type: integer - readOnly: true - description: The organization that owns this contract. - contract_start: - type: string - format: date - readOnly: true - nullable: true - description: The start date of the contract. - contract_end: - type: string - format: date - readOnly: true - nullable: true - description: The end date of the contract. - active: - type: boolean - readOnly: true - description: Whether this contract is active or not. Date rules still apply. - slug: - type: string - readOnly: true - description: The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/ - pattern: ^[-\w]+$ - programs: - type: array - items: - type: integer - readOnly: true - required: - - active - - contract_end - - contract_start - - description - - id - - integration_type - - membership_type - - name - - organization - - programs - - slug - - welcome_message - - welcome_message_extra - Country: - type: object - description: Serializer for pycountry countries, with states for US/CA - properties: - code: - type: string - description: Get the country alpha_2 code - readOnly: true - name: - type: string - description: Get the country name (common name preferred if available) - readOnly: true - states: - type: array - items: - type: object - additionalProperties: {} - description: Get a list of states/provinces if USA or Canada - readOnly: true - required: - - code - - name - - states - Course: - type: object - description: Course model serializer - properties: - id: - type: integer - readOnly: true - title: - type: string - maxLength: 255 - readable_id: - type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - next_run_id: - type: integer - nullable: true - description: Get next run id - readOnly: true - departments: - type: array - items: - $ref: '#/components/schemas/Department' - readOnly: true - page: - allOf: - - $ref: '#/components/schemas/CoursePage' - readOnly: true - programs: - allOf: - - $ref: '#/components/schemas/Program' - nullable: true - readOnly: true - required: - - departments - - id - - next_run_id - - page - - programs - - readable_id - - title - CoursePage: - type: object - description: Course page model serializer - properties: - feature_image_src: - type: string - description: Serializes the source of the feature_image - readOnly: true - page_url: - type: string - format: uri - readOnly: true - description: - type: string - description: Get cleaned description text. - readOnly: true - live: - type: boolean - readOnly: true - length: - type: string - description: Get cleaned length text. - readOnly: true - effort: - type: string - nullable: true - description: Get cleaned effort text. - readOnly: true - financial_assistance_form_url: - type: string - format: uri - readOnly: true - current_price: - type: integer - nullable: true - description: Get the current price of the course product. - readOnly: true - instructors: - type: array - items: {} - description: Get instructor information - readOnly: true - required: - - current_price - - description - - effort - - feature_image_src - - financial_assistance_form_url - - instructors - - length - - live - - page_url - CoursePageItem: - type: object - description: Serializer for individual course page items, including all relevant - fields. - properties: - id: - type: integer - readOnly: true - meta: - $ref: '#/components/schemas/PageMeta' - title: - type: string - description: The page title as you'd like it to be seen by the public - maxLength: 255 - description: - type: string - description: The description shown on the home page and product page. - length: - type: string - description: A short description indicating how long it takes to complete - (e.g. '4 weeks'). - maxLength: 50 - effort: - type: string - nullable: true - description: A short description indicating how much effort is required - (e.g. 1-3 hours per week). - maxLength: 100 - min_weekly_hours: - type: string - description: The minimum number of hours per week required to complete the - course. - maxLength: 5 - max_weekly_hours: - type: string - description: The maximum number of hours per week required to complete the - course. - maxLength: 5 - min_weeks: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: The minimum number of weeks required to complete the course/program. - max_weeks: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: The maximum number of weeks required to complete the course/program. - price: - type: array - items: - $ref: '#/components/schemas/PriceItem' - min_price: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: Specify the minimum product price. This is used by MIT Learn. - max_price: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: Specify the maximum product price. This is used by MIT Learn. - prerequisites: - type: string - nullable: true - description: A short description indicating prerequisites of this course/program. - faq_url: - type: string - format: uri - nullable: true - description: URL a relevant FAQ page or entry for the course/program. - maxLength: 200 - about: - type: string - nullable: true - description: Details about this course/program. - what_you_learn: - type: string - nullable: true - description: '*Required for Verifiable Credential generation. What you will - learn from this course.' - feature_image: - $ref: '#/components/schemas/FeatureImage' - video_url: - type: string - format: uri - nullable: true - description: URL to the video to be displayed for this course/program. It - can be an HLS or Youtube video URL. - maxLength: 200 - faculty_section_title: - type: string - nullable: true - description: The title text to display in the faculty cards section of the - product page. - maxLength: 255 - faculty: - type: array - items: - $ref: '#/components/schemas/Faculty' - certificate_page: - allOf: - - $ref: '#/components/schemas/CertificatePage' - nullable: true - course_details: - $ref: '#/components/schemas/V2Course' - topic_list: - type: array - items: - $ref: '#/components/schemas/Topic' - include_in_learn_catalog: - type: boolean - nullable: true - description: If true, Learn should include this in its catalog. - ingest_content_files_for_ai: - type: boolean - nullable: true - description: If true, allow the AI chatbots to ingest the course's content - files. - required: - - about - - certificate_page - - course_details - - description - - effort - - faculty - - faculty_section_title - - faq_url - - feature_image - - id - - include_in_learn_catalog - - ingest_content_files_for_ai - - length - - max_price - - max_weekly_hours - - max_weeks - - meta - - min_price - - min_weekly_hours - - min_weeks - - prerequisites - - price - - title - - topic_list - - video_url - - what_you_learn - CoursePageList: - type: object - description: Serializer for a list of course pages, including metadata and items. - properties: - meta: - $ref: '#/components/schemas/PageListMeta' - items: - type: array - items: - $ref: '#/components/schemas/CoursePageItem' - required: - - items - - meta - CourseRequest: - type: object - description: Course model serializer - properties: - title: - type: string - minLength: 1 - maxLength: 255 - readable_id: - type: string - minLength: 1 - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - required: - - readable_id - - title - CourseRunCertificate: - type: object - description: CourseRunCertificate model serializer - properties: - uuid: - type: string - format: uuid - readOnly: true - link: - type: string - description: |- - Get the link at which this certificate will be served - Format: /certificate// - Example: /certificate/93ebd74e-5f88-4b47-bb09-30a6d575328f/ - readOnly: true - required: - - link - - uuid - CourseRunEnrollment: - type: object - description: CourseRunEnrollment model serializer - properties: - run: - allOf: - - $ref: '#/components/schemas/V1CourseRunWithCourse' - readOnly: true - id: - type: integer - readOnly: true - edx_emails_subscription: - type: boolean - certificate: - allOf: - - $ref: '#/components/schemas/CourseRunCertificate' - nullable: true - readOnly: true - enrollment_mode: - allOf: - - $ref: '#/components/schemas/EnrollmentModeEnum' - readOnly: true - approved_flexible_price_exists: - type: boolean - readOnly: true - grades: - type: array - items: - $ref: '#/components/schemas/CourseRunGrade' - readOnly: true - required: - - approved_flexible_price_exists - - certificate - - enrollment_mode - - grades - - id - - run - CourseRunEnrollmentRequest: - type: object - description: CourseRunEnrollment model serializer - properties: - edx_emails_subscription: - type: boolean - run_id: - type: integer - writeOnly: true - required: - - run_id - CourseRunEnrollmentRequestV2: - type: object - description: CourseRunEnrollment model serializer - properties: - run: - allOf: - - $ref: '#/components/schemas/V2CourseRunWithCourse' - readOnly: true - id: - type: integer - readOnly: true - edx_emails_subscription: - type: boolean - certificate: - allOf: - - $ref: '#/components/schemas/CourseRunCertificate' - nullable: true - readOnly: true - enrollment_mode: - allOf: - - $ref: '#/components/schemas/EnrollmentModeEnum' - readOnly: true - approved_flexible_price_exists: - type: boolean - readOnly: true - grades: - type: array - items: - $ref: '#/components/schemas/CourseRunGrade' - readOnly: true - b2b_organization_id: - type: integer - nullable: true - readOnly: true - b2b_contract_id: - type: integer - nullable: true - readOnly: true - required: - - approved_flexible_price_exists - - b2b_contract_id - - b2b_organization_id - - certificate - - enrollment_mode - - grades - - id - - run - CourseRunEnrollmentRequestV2Request: - type: object - description: CourseRunEnrollment model serializer - properties: - edx_emails_subscription: - type: boolean - run_id: - type: integer - writeOnly: true - required: - - run_id - CourseRunGrade: - type: object - description: CourseRunGrade serializer - properties: - grade: - type: number - format: double - maximum: 1.0 - minimum: 0.0 - letter_grade: - type: string - nullable: true - maxLength: 6 - passed: - type: boolean - set_by_admin: - type: boolean - grade_percent: - type: number - format: double - description: Returns the grade field value as a number out of 100 (or Decimal(0) - if the value is None) - readOnly: true - required: - - grade - - grade_percent - CourseRunV2: - type: object - description: CourseRun model serializer - properties: - title: - type: string - description: The title of the course. This value is synced automatically - with edX studio. - maxLength: 255 - start_date: - type: string - format: date-time - nullable: true - description: The day the course begins. This value is synced automatically - with edX studio. - end_date: - type: string - format: date-time - nullable: true - description: The last day the course is active. This value is synced automatically - with edX studio. - enrollment_start: - type: string - format: date-time - nullable: true - description: The first day students can enroll. This value is synced automatically - with edX studio. - enrollment_end: - type: string - format: date-time - nullable: true - description: The last day students can enroll. This value is synced automatically - with edX studio. - expiration_date: - type: string - format: date-time - nullable: true - description: The date beyond which the learner should not see link to this - course run on their dashboard. - courseware_url: - type: string - nullable: true - description: Get the courseware URL - readOnly: true - courseware_id: - type: string - maxLength: 255 - certificate_available_date: - type: string - format: date-time - nullable: true - description: The day certificates should be available to users. This value - is synced automatically with edX studio. - upgrade_deadline: - type: string - format: date-time - nullable: true - description: The date beyond which the learner can not enroll in paid course - mode. - is_upgradable: - type: boolean - description: Check if the course run is upgradable - readOnly: true - is_enrollable: - type: boolean - description: Check if the course run is enrollable - readOnly: true - is_archived: - type: boolean - description: Check if the course run is archived - readOnly: true - is_self_paced: - type: boolean - run_tag: - type: string - description: 'A string that identifies the set of runs that this run belongs - to (example: ''R2'')' - maxLength: 100 - id: - type: integer - readOnly: true - live: - type: boolean - course_number: - type: string - description: Get the course number - readOnly: true - products: - type: array - items: - allOf: - - $ref: '#/components/schemas/ProductFlexibilePrice' - readOnly: true - approved_flexible_price_exists: - type: boolean - readOnly: true - b2b_contract: - type: integer - nullable: true - required: - - approved_flexible_price_exists - - course_number - - courseware_id - - courseware_url - - id - - is_archived - - is_enrollable - - is_upgradable - - products - - run_tag - - title - CourseWithCourseRunsSerializerV2: - type: object - description: Course model serializer - also serializes child course runs - properties: - id: - type: integer - readOnly: true - title: - type: string - maxLength: 255 - readable_id: - type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - next_run_id: - type: integer - nullable: true - description: Get next run id - readOnly: true - departments: - type: array - items: - $ref: '#/components/schemas/Department' - readOnly: true - page: - allOf: - - $ref: '#/components/schemas/CoursePage' - readOnly: true - programs: - type: array - items: - $ref: '#/components/schemas/BaseProgram' - nullable: true - readOnly: true - topics: - type: array - items: - type: object - additionalProperties: {} - description: List topics of a course - readOnly: true - certificate_type: - type: string - readOnly: true - required_prerequisites: - type: boolean - description: |- - Check if the prerequisites field is populated in the course page CMS. - Returns: - bool: True when the prerequisites field is populated in the course page CMS. False otherwise. - readOnly: true - duration: - type: string - description: Get the duration of the course from the course page CMS. - readOnly: true - min_weeks: - type: integer - nullable: true - description: Get the min weeks of the course from the CMS page. - readOnly: true - max_weeks: - type: integer - nullable: true - description: Get the max weeks of the course from the CMS page. - readOnly: true - min_price: - type: integer - nullable: true - description: Get the min price of the product from the CMS page. - readOnly: true - max_price: - type: integer - nullable: true - description: Get the max price of the product from the CMS page. - readOnly: true - time_commitment: - type: string - nullable: true - description: Get the time commitment of the course from the course page - CMS. - readOnly: true - availability: - type: string - description: Get course availability - readOnly: true - min_weekly_hours: - type: string - nullable: true - description: Get the min weekly hours of the course from the course page - CMS. - readOnly: true - max_weekly_hours: - type: string - nullable: true - description: Get the max weekly hours of the course from the course page - CMS. - readOnly: true - include_in_learn_catalog: - type: boolean - readOnly: true - ingest_content_files_for_ai: - type: boolean - readOnly: true - courseruns: - type: array - items: - $ref: '#/components/schemas/CourseRunV2' - readOnly: true - required: - - availability - - certificate_type - - courseruns - - departments - - duration - - id - - include_in_learn_catalog - - ingest_content_files_for_ai - - max_price - - max_weekly_hours - - max_weeks - - min_price - - min_weekly_hours - - min_weeks - - next_run_id - - page - - programs - - readable_id - - required_prerequisites - - time_commitment - - title - - topics - CreateB2BEnrollment: - type: object - description: |- - Serializer for the result from create_b2b_enrollment. - - There's always a result, and it should be one of the B2B messages that are - defined in main.constants. The other fields appear or not depending on the - result type. - properties: - result: - allOf: - - $ref: '#/components/schemas/ResultEnum' - readOnly: true - order: - type: integer - readOnly: true - price: - type: string - format: decimal - readOnly: true - checkout_result: - $ref: '#/components/schemas/GenerateCheckoutPayload' - required: - - order - - price - - result - CreateBasketWithProductIDRequest: - type: object - description: Defines the schema for a product ID and quantity in the CreateBasketWithProductsSerializer. - properties: - product_id: - type: integer - quantity: - type: integer - minimum: 1 - required: - - product_id - - quantity - CreateBasketWithProductsRequest: - type: object - description: Serializer for creating a basket with products. (For OpenAPI spec.) - properties: - system_slug: - type: string - minLength: 1 - product_ids: - type: array - items: - $ref: '#/components/schemas/CreateBasketWithProductIDRequest' - checkout: - type: boolean - discount_code: - type: string - minLength: 1 - required: - - checkout - - discount_code - - product_ids - - system_slug - Department: - type: object - description: Department model serializer - properties: - name: - type: string - maxLength: 128 - required: - - name - DepartmentRequest: - type: object - description: Department model serializer - properties: - name: - type: string - minLength: 1 - maxLength: 128 - required: - - name - DepartmentWithCount: - type: object - description: CourseRun model serializer that includes the number of courses - and programs associated with each departments - properties: - name: - type: string - maxLength: 128 - courses: - type: integer - programs: - type: integer - required: - - courses - - name - - programs - DepartmentWithCoursesAndPrograms: - type: object - description: Department model serializer that includes the number of courses - and programs associated with each - properties: - id: - type: integer - readOnly: true - name: - type: string - maxLength: 128 - slug: - type: string - maxLength: 128 - pattern: ^[-a-zA-Z0-9_]+$ - course_ids: - type: array - items: - type: integer - readOnly: true - program_ids: - type: array - items: - type: integer - readOnly: true - required: - - course_ids - - id - - name - - program_ids - - slug - Discount: - type: object - properties: - id: - type: integer - readOnly: true - amount: - type: string - format: decimal - pattern: ^-?\d{0,15}(?:\.\d{0,5})?$ - automatic: - type: boolean - discount_type: - $ref: '#/components/schemas/DiscountTypeEnum' - redemption_type: - $ref: '#/components/schemas/RedemptionTypeEnum' - max_redemptions: - type: integer - maximum: 2147483647 - minimum: 0 - nullable: true - discount_code: - type: string - maxLength: 100 - payment_type: - nullable: true - oneOf: - - $ref: '#/components/schemas/PaymentTypeEnum' - - $ref: '#/components/schemas/NullEnum' - is_redeemed: - type: boolean - description: Returns True if the discount has been redeemed - readOnly: true - activation_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable before this - date. - expiration_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable after this - date. - required: - - amount - - discount_code - - discount_type - - id - - is_redeemed - - redemption_type - DiscountProduct: - type: object - properties: - id: - type: integer - readOnly: true - discount: - $ref: '#/components/schemas/V0Discount' - product: - $ref: '#/components/schemas/Product' - required: - - discount - - id - - product - DiscountProductRequest: - type: object - properties: - discount: - $ref: '#/components/schemas/V0DiscountRequest' - product: - $ref: '#/components/schemas/ProductRequest' - required: - - discount - - product - DiscountRedemption: - type: object - description: Serializes a discount redemption. - properties: - id: - type: integer - readOnly: true - redemption_date: - type: string - format: date-time - readOnly: true - redeemed_by: - $ref: '#/components/schemas/User' - redeemed_discount: - $ref: '#/components/schemas/V0Discount' - redeemed_order: - $ref: '#/components/schemas/Order' - required: - - id - - redeemed_by - - redeemed_discount - - redeemed_order - - redemption_date - DiscountRedemptionRequest: - type: object - description: Serializes a discount redemption. - properties: - redeemed_by: - $ref: '#/components/schemas/UserRequest' - redeemed_discount: - $ref: '#/components/schemas/V0DiscountRequest' - redeemed_order: - $ref: '#/components/schemas/OrderRequest' - required: - - redeemed_by - - redeemed_discount - - redeemed_order - DiscountTypeEnum: - enum: - - percent-off - - dollars-off - - fixed-price - type: string - description: |- - * `percent-off` - percent-off - * `dollars-off` - dollars-off - * `fixed-price` - fixed-price - x-enum-descriptions: - - percent-off - - dollars-off - - fixed-price - EnrollmentModeEnum: - enum: - - audit - - verified - type: string - description: |- - * `audit` - audit - * `verified` - verified - x-enum-descriptions: - - audit - - verified - ErrorEnum: - enum: - - enroll-blocked - - enroll-duplicated - - course-non-upgradable - - discount-invalid - - b2b-error-missing-enrollment-code - - b2b-invalid-basket - - basket-empty - type: string - description: |- - * `enroll-blocked` - enroll-blocked - * `enroll-duplicated` - enroll-duplicated - * `course-non-upgradable` - course-non-upgradable - * `discount-invalid` - discount-invalid - * `b2b-error-missing-enrollment-code` - b2b-error-missing-enrollment-code - * `b2b-invalid-basket` - b2b-invalid-basket - * `basket-empty` - basket-empty - x-enum-descriptions: - - enroll-blocked - - enroll-duplicated - - course-non-upgradable - - discount-invalid - - b2b-error-missing-enrollment-code - - b2b-invalid-basket - - basket-empty - ExtendedLegalAddress: - type: object - description: Serializer class that includes email address as part of the legal - address - properties: - country: - type: string - maxLength: 2 - state: - type: string - nullable: true - maxLength: 10 - email: - type: string - description: Get email from the linked user object - readOnly: true - required: - - country - - email - Faculty: - type: object - description: Serializer for faculty details used in course pages. - properties: - id: - type: integer - instructor_name: - type: string - instructor_title: - type: string - instructor_bio_short: - type: string - instructor_bio_long: - type: string - feature_image_src: - type: string - required: - - feature_image_src - - id - - instructor_bio_long - - instructor_bio_short - - instructor_name - - instructor_title - FeatureImage: - type: object - description: Serializer for feature images used in course pages. - properties: - title: - type: string - image_url: - type: string - format: uri - height: - type: integer - width: - type: integer - required: - - height - - image_url - - title - - width - FlexiblePriceTier: - type: object - properties: - id: - type: integer - readOnly: true - courseware_object: - allOf: - - $ref: '#/components/schemas/BaseCourse' - readOnly: true - discount: - type: integer - current: - type: boolean - income_threshold_usd: - type: number - format: double - required: - - courseware_object - - discount - - id - - income_threshold_usd - FlexiblePriceTierRequest: - type: object - properties: - discount: - type: integer - current: - type: boolean - income_threshold_usd: - type: number - format: double - required: - - discount - - income_threshold_usd - GenderEnum: - enum: - - m - - f - - t - - nb - - o - type: string - description: |- - * `m` - Male - * `f` - Female - * `t` - Transgender - * `nb` - Non-binary/non-conforming - * `o` - Other/Prefer Not to Say - x-enum-descriptions: - - Male - - Female - - Transgender - - Non-binary/non-conforming - - Other/Prefer Not to Say - GenerateCheckoutPayload: - type: object - description: |- - Serializer for the result from ecommerce.api.generate_checkout_payload. - - The B2B enrollment API will return the result of the checkout call if the - user needs to pay for the cart because of an error creating the checkout - payload. In that case, we really just need the error states; it will also - include a HttpResponseRedirect that we don't really care about for the API's - purposes. - properties: - country_blocked: - type: boolean - nullable: true - default: false - purchased_same_courserun: - type: boolean - nullable: true - default: false - purchased_non_upgradeable_courserun: - type: boolean - nullable: true - default: false - invalid_discounts: - type: boolean - nullable: true - default: false - no_checkout: - type: boolean - nullable: true - default: false - HighestEducationEnum: - enum: - - Doctorate - - Master's or professional degree - - Bachelor's degree - - Associate degree - - Secondary/high school - - Junior secondary/junior high/middle school - - Elementary/primary school - - No formal education - - Other education - description: |- - * `None` - ---- - * `Doctorate` - Doctorate - * `Master's or professional degree` - Master's or professional degree - * `Bachelor's degree` - Bachelor's degree - * `Associate degree` - Associate degree - * `Secondary/high school` - Secondary/high school - * `Junior secondary/junior high/middle school` - Junior secondary/junior high/middle school - * `Elementary/primary school` - Elementary/primary school - * `No formal education` - No formal education - * `Other education` - Other education - x-enum-descriptions: - - Doctorate - - Master's or professional degree - - Bachelor's degree - - Associate degree - - Secondary/high school - - Junior secondary/junior high/middle school - - Elementary/primary school - - No formal education - - Other education - IntegrationTypeEnum: - enum: - - sso - - non-sso - - managed - - code - - auto - type: string - description: |- - * `sso` - SSO - * `non-sso` - Non-SSO - * `managed` - Managed - * `code` - Enrollment Code - * `auto` - Auto Enrollment - x-enum-descriptions: - - SSO - - Non-SSO - - Managed - - Enrollment Code - - Auto Enrollment - LearnerProgramRecordShare: - type: object - properties: - share_uuid: - type: string - format: uuid - readOnly: true - created_on: - type: string - format: date-time - readOnly: true - updated_on: - type: string - format: date-time - readOnly: true - is_active: - type: boolean - user: - type: integer - program: - type: integer - partner_school: - type: integer - nullable: true - required: - - created_on - - program - - share_uuid - - updated_on - - user - LearnerRecord: - type: object - description: |- - Gathers the various data needed to display the learner's program record. - Pass the program you want the record for and attach the learner via context - object. - properties: - user: - type: object - additionalProperties: - type: string - description: User information including name, email, and username - program: - type: object - additionalProperties: - type: object - additionalProperties: {} - description: Program details including title, readable_id, courses, and - requirements - sharing: - type: array - items: - $ref: '#/components/schemas/LearnerProgramRecordShare' - description: Active program record shares for this user - partner_schools: - type: array - items: - $ref: '#/components/schemas/PartnerSchool' - description: List of partner schools - required: - - partner_schools - - program - - sharing - - user - LegalAddress: - type: object - description: Serializer for legal address - properties: - country: - type: string - maxLength: 2 - state: - type: string - nullable: true - maxLength: 10 - required: - - country - LegalAddressRequest: - type: object - description: Serializer for legal address - properties: - country: - type: string - minLength: 1 - maxLength: 2 - state: - type: string - nullable: true - maxLength: 10 - required: - - country - Line: - type: object - description: Serializes order lines. - properties: - quantity: - type: integer - item_description: - type: string - unit_price: - type: string - format: decimal - pattern: ^-?\d{0,7}(?:\.\d{0,2})?$ - total_price: - type: string - format: decimal - pattern: ^-?\d{0,7}(?:\.\d{0,2})?$ - id: - type: integer - product: - allOf: - - $ref: '#/components/schemas/Product' - readOnly: true - required: - - id - - item_description - - product - - quantity - - total_price - - unit_price - Nested: - type: object - properties: - id: - type: integer - readOnly: true - created_on: - type: string - format: date-time - readOnly: true - updated_on: - type: string - format: date-time - readOnly: true - amount: - type: string - format: decimal - pattern: ^-?\d{0,15}(?:\.\d{0,5})?$ - automatic: - type: boolean - discount_type: - $ref: '#/components/schemas/DiscountTypeEnum' - redemption_type: - $ref: '#/components/schemas/RedemptionTypeEnum' - payment_type: - nullable: true - oneOf: - - $ref: '#/components/schemas/PaymentTypeEnum' - - $ref: '#/components/schemas/NullEnum' - max_redemptions: - type: integer - maximum: 2147483647 - minimum: 0 - nullable: true - discount_code: - type: string - maxLength: 100 - activation_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable before this - date. - expiration_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable after this - date. - is_bulk: - type: boolean - is_program_discount: - type: boolean - nullable: true - description: Discount is only for creating verified course run enrollments - for a program. - required: - - amount - - created_on - - discount_code - - discount_type - - id - - redemption_type - - updated_on - NodeTypeEnum: - enum: - - operator - - course - - program - type: string - description: |- - * `operator` - operator - * `course` - course - * `program` - program - x-enum-descriptions: - - operator - - course - - program - NullEnum: - enum: - - null - Order: - type: object - properties: - id: - type: integer - readOnly: true - state: - $ref: '#/components/schemas/StateEnum' - purchaser: - type: array - items: - $ref: '#/components/schemas/ExtendedLegalAddress' - readOnly: true - total_price_paid: - type: string - format: decimal - pattern: ^-?\d{0,15}(?:\.\d{0,5})?$ - lines: - type: array - items: - $ref: '#/components/schemas/TransactionLine' - readOnly: true - discounts: - type: array - items: - $ref: '#/components/schemas/RedeemedDiscount' - readOnly: true - refunds: - type: array - items: - type: object - properties: - amount: - type: number - date: - type: string - format: date-time - readOnly: true - reference_number: - type: string - nullable: true - maxLength: 255 - created_on: - type: string - format: date-time - readOnly: true - transactions: - type: object - properties: - card_number: - type: string - card_type: - type: string - name: - type: string - bill_to_email: - type: string - payment_method: - type: string - readOnly: true - street_address: - type: object - properties: - line: - type: array - items: - type: string - postal_code: - type: string - state: - type: string - city: - type: string - country: - type: string - readOnly: true - required: - - created_on - - discounts - - id - - lines - - purchaser - - refunds - - state - - street_address - - total_price_paid - - transactions - OrderHistory: - type: object - properties: - id: - type: integer - readOnly: true - state: - $ref: '#/components/schemas/StateEnum' - reference_number: - type: string - nullable: true - maxLength: 255 - purchaser: - $ref: '#/components/schemas/PublicUser' - total_price_paid: - type: string - format: decimal - pattern: ^-?\d{0,15}(?:\.\d{0,5})?$ - lines: - type: array - items: - $ref: '#/components/schemas/Line' - created_on: - type: string - format: date-time - readOnly: true - titles: - type: array - items: {} - readOnly: true - updated_on: - type: string - format: date-time - readOnly: true - required: - - created_on - - id - - lines - - purchaser - - state - - titles - - total_price_paid - - updated_on - OrderRequest: - type: object - properties: - state: - $ref: '#/components/schemas/StateEnum' - total_price_paid: - type: string - format: decimal - pattern: ^-?\d{0,15}(?:\.\d{0,5})?$ - reference_number: - type: string - nullable: true - maxLength: 255 - required: - - state - - total_price_paid - OrganizationPage: - type: object - description: Serializer for the OrganizationPage model. - properties: - id: - type: integer - readOnly: true - name: - type: string - readOnly: true - description: The name of the organization - description: - type: string - readOnly: true - description: Any useful extra information about the organization - logo: - type: string - format: uri - readOnly: true - description: The organization's logo. Will be displayed in the app in various - places. - slug: - type: string - readOnly: true - description: The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/ - pattern: ^[-\w]+$ - contracts: - type: array - items: - $ref: '#/components/schemas/ContractPage' - readOnly: true - required: - - contracts - - description - - id - - logo - - name - - slug - Override: - type: object - description: Serializer for overrides used in certificate pages. - properties: - type: - type: string - value: - $ref: '#/components/schemas/OverrideValue' - id: - type: string - required: - - id - - type - - value - OverrideValue: - type: object - description: Serializer for override values used in certificate pages. - properties: - readable_id: - type: string - CEUs: - type: string - format: decimal - pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ - required: - - CEUs - - readable_id - Page: - type: object - description: Serializer for individual Wagtail pages. - properties: - id: - type: integer - title: - type: string - meta: - $ref: '#/components/schemas/PageMeta' - required: - - id - - meta - - title - PageList: - type: object - description: Serializer for a list of Wagtail pages. - properties: - meta: - $ref: '#/components/schemas/PageListMeta' - items: - type: array - items: - $ref: '#/components/schemas/Page' - required: - - items - - meta - PageListMeta: - type: object - description: Serializer for metadata of a list of Wagtail pages. - properties: - total_count: - type: integer - required: - - total_count - PageMeta: - type: object - description: Serializer for page metadata used in various Wagtail pages. - properties: - type: - type: string - detail_url: - type: string - format: uri - html_url: - type: string - format: uri - slug: - type: string - show_in_menus: - type: boolean - seo_title: - type: string - search_description: - type: string - first_published_at: - type: string - format: date-time - nullable: true - alias_of: - type: string - nullable: true - locale: - type: string - live: - type: boolean - last_published_at: - type: string - format: date-time - nullable: true - required: - - alias_of - - detail_url - - first_published_at - - html_url - - last_published_at - - live - - locale - - search_description - - seo_title - - show_in_menus - - slug - - type - PageMetaModel: - type: object - description: Extends the PageMetaSerializer to work with a Page object - properties: - type: - type: string - description: |- - Get the page type, in a more simple manner than Wagtail. - - The Wagtail version of this is PageTypeField, and it tries to modify the - context, which we neither need nor is in the correct format for it. - readOnly: true - detail_url: - type: string - description: |- - Get the detail URL, which should be the API call for this page. - - The Wagtail version of this is DetailUrlField and it also tries to make - changes to the context that we don't need. - readOnly: true - html_url: - type: string - description: Return PageHtmlUrlField. This is wrapped for OpenAPI schema - generation. - readOnly: true - slug: - type: string - show_in_menus: - type: boolean - seo_title: - type: string - search_description: - type: string - first_published_at: - type: string - format: date-time - nullable: true - alias_of: - type: string - nullable: true - locale: - type: string - description: Return PageLocaleField. This is wrapped for OpenAPI schema - generation. - readOnly: true - live: - type: boolean - last_published_at: - type: string - format: date-time - nullable: true - required: - - alias_of - - detail_url - - first_published_at - - html_url - - last_published_at - - live - - locale - - search_description - - seo_title - - show_in_menus - - slug - - type - PaginatedCourseWithCourseRunsSerializerV2List: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=4 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=2 - results: - type: array - items: - $ref: '#/components/schemas/CourseWithCourseRunsSerializerV2' - PaginatedDiscountProductList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 - results: - type: array - items: - $ref: '#/components/schemas/DiscountProduct' - PaginatedDiscountRedemptionList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 - results: - type: array - items: - $ref: '#/components/schemas/DiscountRedemption' - PaginatedFlexiblePriceTierList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 - results: - type: array - items: - $ref: '#/components/schemas/FlexiblePriceTier' - PaginatedOrderHistoryList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 - results: - type: array - items: - $ref: '#/components/schemas/OrderHistory' - PaginatedProductList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 - results: - type: array - items: - $ref: '#/components/schemas/Product' - PaginatedStaffDashboardUserList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?o=400&l=100 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?o=200&l=100 - results: - type: array - items: - $ref: '#/components/schemas/StaffDashboardUser' - PaginatedUserDiscountMetaList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 - results: - type: array - items: - $ref: '#/components/schemas/UserDiscountMeta' - PaginatedV0DiscountList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=400&limit=100 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?offset=200&limit=100 - results: - type: array - items: - $ref: '#/components/schemas/V0Discount' - PaginatedV1CourseWithCourseRunsList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=4 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=2 - results: - type: array - items: - $ref: '#/components/schemas/V1CourseWithCourseRuns' - PaginatedV1ProgramList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=4 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=2 - results: - type: array - items: - $ref: '#/components/schemas/V1Program' - PaginatedV2ProgramCollectionList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=4 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=2 - results: - type: array - items: - $ref: '#/components/schemas/V2ProgramCollection' - PaginatedV2ProgramList: - type: object - required: - - count - - results - properties: - count: - type: integer - example: 123 - next: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=4 - previous: - type: string - nullable: true - format: uri - example: http://api.example.org/accounts/?page=2 - results: - type: array - items: - $ref: '#/components/schemas/V2Program' - PartnerSchool: - type: object - properties: - id: - type: integer - readOnly: true - created_on: - type: string - format: date-time - readOnly: true - updated_on: - type: string - format: date-time - readOnly: true - name: - type: string - maxLength: 255 - email: - type: string - required: - - created_on - - email - - id - - name - - updated_on - PartnerSchoolRequest: - type: object - properties: - name: - type: string - minLength: 1 - maxLength: 255 - email: - type: string - minLength: 1 - required: - - email - - name - PatchedChangeEmailRequestUpdateRequest: - type: object - description: Serializer for confirming a user email change - properties: - confirmed: - type: boolean - PatchedDiscountProductRequest: - type: object - properties: - discount: - $ref: '#/components/schemas/V0DiscountRequest' - product: - $ref: '#/components/schemas/ProductRequest' - PatchedDiscountRedemptionRequest: - type: object - description: Serializes a discount redemption. - properties: - redeemed_by: - $ref: '#/components/schemas/UserRequest' - redeemed_discount: - $ref: '#/components/schemas/V0DiscountRequest' - redeemed_order: - $ref: '#/components/schemas/OrderRequest' - PatchedFlexiblePriceTierRequest: - type: object - properties: - discount: - type: integer - current: - type: boolean - income_threshold_usd: - type: number - format: double - PatchedProductRequest: - type: object - description: Serializes a product, including the purchasable object. - properties: - price: - type: string - format: decimal - pattern: ^-?\d{0,5}(?:\.\d{0,2})?$ - description: - type: string - minLength: 1 - is_active: - type: boolean - description: Controls visibility of the product in the app. - PatchedUpdateCourseRunEnrollmentRequest: - type: object - properties: - receive_emails: - type: boolean - description: Whether to receive course emails - PatchedUserDiscountMetaRequest: - type: object - description: Serializes UserDiscount but only allows depth = 1 - properties: - discount: - $ref: '#/components/schemas/V0DiscountRequest' - user: - $ref: '#/components/schemas/UserRequest' - PatchedUserRequest: - type: object - description: Serializer for users - properties: - username: - type: string - nullable: true - minLength: 1 - maxLength: 30 - name: - type: string - maxLength: 255 - email: - type: string - format: email - nullable: true - minLength: 1 - password: - type: string - writeOnly: true - minLength: 1 - legal_address: - allOf: - - $ref: '#/components/schemas/LegalAddressRequest' - nullable: true - user_profile: - allOf: - - $ref: '#/components/schemas/UserProfileRequest' - nullable: true - is_active: - type: boolean - default: true - PatchedV0DiscountRequest: - type: object - description: Serializes a discount. - properties: - amount: - type: string - format: decimal - pattern: ^-?\d{0,15}(?:\.\d{0,5})?$ - automatic: - type: boolean - discount_type: - $ref: '#/components/schemas/DiscountTypeEnum' - redemption_type: - $ref: '#/components/schemas/RedemptionTypeEnum' - max_redemptions: - type: integer - maximum: 2147483647 - minimum: 0 - nullable: true - discount_code: - type: string - minLength: 1 - maxLength: 100 - payment_type: - nullable: true - oneOf: - - $ref: '#/components/schemas/PaymentTypeEnum' - - $ref: '#/components/schemas/NullEnum' - activation_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable before this - date. - expiration_date: - type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable after this - date. - PaymentTypeEnum: - enum: - - marketing - - sales - - financial-assistance - - customer-support - - staff - - legacy - type: string - description: |- - * `marketing` - marketing - * `sales` - sales - * `financial-assistance` - financial-assistance - * `customer-support` - customer-support - * `staff` - staff - * `legacy` - legacy - x-enum-descriptions: - - marketing - - sales - - financial-assistance - - customer-support - - staff - - legacy - PriceItem: - type: object - description: Serializer for price items used in course pages. - properties: - type: - type: string - value: - type: object - additionalProperties: {} - id: - type: string - format: uuid - required: - - id - - type - - value - Product: - type: object - description: Serializes a product, including the purchasable object. - properties: - id: - type: integer - readOnly: true - price: - type: string - format: decimal - pattern: ^-?\d{0,5}(?:\.\d{0,2})?$ - description: - type: string - is_active: - type: boolean - description: Controls visibility of the product in the app. - purchasable_object: - oneOf: - - type: object - properties: - id: - type: integer - run_tag: - type: string - start_date: - type: string - format: date-time - end_date: - type: string - format: date-time - - type: object - properties: - id: - type: integer - title: - type: string - run_tag: - type: string - start_date: - type: string - format: date-time - end_date: - type: string - format: date-time - course: - type: object - properties: - id: - type: integer - title: - type: string - page: - type: object - readable_id: - type: string - enrollment_start: - type: string - format: date-time - enrollment_end: - type: string - format: date-time - course_number: - type: string - readOnly: true - required: - - description - - id - - price - - purchasable_object - ProductFlexibilePrice: - type: object - description: Simple serializer for Product without related purchasable objects - properties: - id: - type: integer - readOnly: true - price: - type: string - format: decimal - pattern: ^-?\d{0,5}(?:\.\d{0,2})?$ - description: - type: string - is_active: - type: boolean - description: Controls visibility of the product in the app. - product_flexible_price: - allOf: - - $ref: '#/components/schemas/Discount' - nullable: true - readOnly: true - required: - - description - - id - - price - - product_flexible_price - ProductFlexibilePriceRequest: - type: object - description: Simple serializer for Product without related purchasable objects - properties: - price: - type: string - format: decimal - pattern: ^-?\d{0,5}(?:\.\d{0,2})?$ - description: - type: string - minLength: 1 - is_active: - type: boolean - description: Controls visibility of the product in the app. - required: - - description - - price - ProductFlexiblePrice: - type: object - description: Simple serializer for Product without related purchasable objects - properties: - id: - type: integer - readOnly: true - price: - type: string - format: decimal - pattern: ^-?\d{0,5}(?:\.\d{0,2})?$ - description: - type: string - is_active: - type: boolean - description: Controls visibility of the product in the app. - product_flexible_price: - allOf: - - $ref: '#/components/schemas/V0Discount' - nullable: true - readOnly: true - required: - - description - - id - - price - - product_flexible_price - ProductRequest: - type: object - description: Serializes a product, including the purchasable object. - properties: - price: - type: string - format: decimal - pattern: ^-?\d{0,5}(?:\.\d{0,2})?$ - description: - type: string - minLength: 1 - is_active: - type: boolean - description: Controls visibility of the product in the app. - required: - - description - - price - Program: - type: object - properties: - id: - type: integer - title: - type: string - readable_id: - type: string - required: - - id - - readable_id - - title - ProgramCertificate: - type: object - description: ProgramCertificate model serializer - properties: - uuid: - type: string - format: uuid - readOnly: true - link: - type: string - description: |- - Get the link at which this certificate will be served - Format: /certificate/program// - Example: /certificate/program/93ebd74e-5f88-4b47-bb09-30a6d575328f/ - readOnly: true - required: - - link - - uuid - ProgramPage: - type: object - description: Program page model serializer - properties: - feature_image_src: - type: string - description: Serializes the source of the feature_image - readOnly: true - page_url: - type: string - format: uri - readOnly: true - financial_assistance_form_url: - type: string - format: uri - readOnly: true - description: - type: string - description: The description shown on the home page and product page. - readOnly: true - live: - type: boolean - readOnly: true - length: - type: string - description: A short description indicating how long it takes to complete - (e.g. '4 weeks'). - maxLength: 50 - effort: - type: string - nullable: true - description: A short description indicating how much effort is required - (e.g. 1-3 hours per week). - maxLength: 100 - price: - type: string - description: Get the price text from the program page. - readOnly: true - required: - - description - - feature_image_src - - financial_assistance_form_url - - live - - page_url - - price - ProgramPageItem: +components: + schemas: + AvailabilityEnum: + enum: + - anytime + - dated + type: string + description: |- + * `anytime` - anytime + * `dated` - dated + x-enum-descriptions: + - anytime + - dated + BaseProgram: type: object - description: Serializer for individual program page items, including all relevant - fields. + description: Basic program model serializer properties: - id: - type: integer - readOnly: true - meta: - $ref: '#/components/schemas/PageMeta' title: type: string - description: The page title as you'd like it to be seen by the public maxLength: 255 - description: - type: string - description: The description shown on the home page and product page. - readOnly: true - length: - type: string - description: A short description indicating how long it takes to complete - (e.g. '4 weeks'). - maxLength: 50 - effort: - type: string - nullable: true - description: A short description indicating how much effort is required - (e.g. 1-3 hours per week). - maxLength: 100 - min_weekly_hours: - type: string - description: The minimum number of hours per week required to complete the - course. - maxLength: 5 - max_weekly_hours: - type: string - description: The maximum number of hours per week required to complete the - course. - maxLength: 5 - min_weeks: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: The minimum number of weeks required to complete the course/program. - max_weeks: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: The maximum number of weeks required to complete the course/program. - price: - type: array - items: - $ref: '#/components/schemas/PriceItem' - min_price: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: Specify the minimum product price. This is used by MIT Learn. - max_price: - type: integer - maximum: 32767 - minimum: -32768 - nullable: true - description: Specify the maximum product price. This is used by MIT Learn. - prerequisites: - type: string - nullable: true - description: A short description indicating prerequisites of this course/program. - faq_url: - type: string - format: uri - nullable: true - description: URL a relevant FAQ page or entry for the course/program. - maxLength: 200 - about: - type: string - nullable: true - description: Details about this course/program. - what_you_learn: - type: string - nullable: true - description: '*Required for Verifiable Credential generation. What you will - learn from this course.' - feature_image: - $ref: '#/components/schemas/FeatureImage' - video_url: - type: string - format: uri - nullable: true - description: URL to the video to be displayed for this course/program. It - can be an HLS or Youtube video URL. - maxLength: 200 - faculty_section_title: + readable_id: type: string - nullable: true - description: The title text to display in the faculty cards section of the - product page. + pattern: ^[\w\-+:\.]+$ maxLength: 255 - faculty: - type: array - items: - $ref: '#/components/schemas/Faculty' - certificate_page: - $ref: '#/components/schemas/CertificatePage' - program_details: - $ref: '#/components/schemas/V2Program' - required: - - about - - certificate_page - - description - - effort - - faculty - - faculty_section_title - - faq_url - - feature_image - - id - - length - - max_price - - max_weekly_hours - - max_weeks - - meta - - min_price - - min_weekly_hours - - min_weeks - - prerequisites - - price - - program_details - - title - - video_url - - what_you_learn - ProgramPageList: - type: object - description: Serializer for a list of program pages, including metadata and - items. - properties: - meta: - $ref: '#/components/schemas/PageListMeta' - items: - type: array - items: - $ref: '#/components/schemas/ProgramPageItem' - required: - - items - - meta - PublicUser: - type: object - description: Serializer for public user data - properties: id: type: integer readOnly: true - username: - type: string - nullable: true - maxLength: 30 - name: - type: string - maxLength: 255 - created_on: - type: string - format: date-time - readOnly: true - updated_on: + type: type: string - format: date-time readOnly: true required: - - created_on - id - - updated_on - RedeemedDiscount: - type: object - description: DiscountRedemption model serializer - properties: - redeemed_discount: - allOf: - - $ref: '#/components/schemas/Nested' - readOnly: true - required: - - redeemed_discount - RedemptionTypeEnum: - enum: - - one-time - - one-time-per-user - - unlimited - type: string - description: |- - * `one-time` - one-time - * `one-time-per-user` - one-time-per-user - * `unlimited` - unlimited - x-enum-descriptions: - - one-time - - one-time-per-user - - unlimited - ResultEnum: - enum: - - b2b-disallowed - - b2b-error-no-contract - - b2b-error-no-product - - b2b-error-missing-enrollment-code - - b2b-error-invalid-enrollment-code - - b2b-error-requires-checkout - - b2b-enroll-success - type: string - description: |- - * `b2b-disallowed` - b2b-disallowed - * `b2b-error-no-contract` - b2b-error-no-contract - * `b2b-error-no-product` - b2b-error-no-product - * `b2b-error-missing-enrollment-code` - b2b-error-missing-enrollment-code - * `b2b-error-invalid-enrollment-code` - b2b-error-invalid-enrollment-code - * `b2b-error-requires-checkout` - b2b-error-requires-checkout - * `b2b-enroll-success` - b2b-enroll-success - x-enum-descriptions: - - b2b-disallowed - - b2b-error-no-contract - - b2b-error-no-product - - b2b-error-missing-enrollment-code - - b2b-error-invalid-enrollment-code - - b2b-error-requires-checkout - - b2b-enroll-success - SignatoryItem: - type: object - description: Serializer for signatory items used in certificate pages. - properties: - name: - type: string - title_1: - type: string - title_2: - type: string - title_3: - type: string - organization: - type: string - signature_image: - type: string - required: - - name - - organization - - signature_image - - title_1 - - title_2 - - title_3 - StaffDashboardUser: + - readable_id + - title + - type + CertificatePage: type: object - description: Serializer for data we care about in the staff dashboard + description: Serializer for certificate pages, including overrides and signatory + items. properties: id: type: integer - readOnly: true - username: - type: string - maxLength: 500 - name: - type: string - maxLength: 255 - email: - type: string - format: email - maxLength: 254 - legal_address: - allOf: - - $ref: '#/components/schemas/LegalAddress' - nullable: true - is_staff: - type: boolean - description: The user can access the admin site - is_superuser: - type: boolean - title: Superuser status - description: Designates that this user has all permissions without explicitly - assigning them. - required: - - email - - id - - legal_address - - username - StateEnum: - enum: - - pending - - fulfilled - - canceled - - declined - - errored - - refunded - - review - - partially_refunded - type: string - description: |- - * `pending` - Pending - * `fulfilled` - Fulfilled - * `canceled` - Canceled - * `declined` - Declined - * `errored` - Errored - * `refunded` - Refunded - * `review` - Review - * `partially_refunded` - Partially Refunded - x-enum-descriptions: - - Pending - - Fulfilled - - Canceled - - Declined - - Errored - - Refunded - - Review - - Partially Refunded - Topic: - type: object - description: Serializer for topics used in course pages. - properties: - name: - type: string - parent: - type: string - required: - - name - TransactionLine: - type: object - description: Serializes a line item from a transaction. - properties: - quantity: - type: integer - CEUs: - type: string - content_title: - type: string - readable_id: - type: string - start_date: - type: string - format: date-time - end_date: - type: string - format: date-time - total_paid: + meta: + $ref: '#/components/schemas/PageMeta' + title: type: string - discount: + product_name: type: string - price: + CEUs: type: string + overrides: + type: array + items: + $ref: '#/components/schemas/Override' + signatory_items: + type: array + items: + $ref: '#/components/schemas/SignatoryItem' required: - CEUs - - content_title - - discount - - end_date - - price - - quantity - - readable_id - - start_date - - total_paid - User: + - id + - meta + - overrides + - product_name + - signatory_items + - title + CertificatePageList: type: object - description: Serializer for users + description: Serializer for a list of certificate pages. properties: - id: - type: integer - readOnly: true - username: - type: string - nullable: true - maxLength: 30 - name: - type: string - maxLength: 255 - email: + meta: + $ref: '#/components/schemas/PageListMeta' + items: + type: array + items: + $ref: '#/components/schemas/CertificatePage' + required: + - items + - meta + CoursePage: + type: object + description: Course page model serializer + properties: + feature_image_src: type: string - format: email - nullable: true - legal_address: - allOf: - - $ref: '#/components/schemas/LegalAddress' - nullable: true - user_profile: - allOf: - - $ref: '#/components/schemas/UserProfile' - nullable: true - is_anonymous: - type: boolean + description: Serializes the source of the feature_image readOnly: true - is_authenticated: - type: boolean + page_url: + type: string + format: uri readOnly: true - is_editor: - type: boolean - description: Returns True if the user has editor permissions for the CMS + description: + type: string + description: Get cleaned description text. readOnly: true - is_staff: + live: type: boolean readOnly: true - description: The user can access the admin site - is_superuser: - type: boolean + length: + type: string + description: Get cleaned length text. readOnly: true - title: Superuser status - description: Designates that this user has all permissions without explicitly - assigning them. - created_on: + effort: type: string - format: date-time + nullable: true + description: Get cleaned effort text. readOnly: true - updated_on: + financial_assistance_form_url: type: string - format: date-time + format: uri readOnly: true - grants: - type: array - items: - type: string + current_price: + type: integer + nullable: true + description: Get the current price of the course product. readOnly: true - is_active: - type: boolean - default: true - b2b_organizations: + instructors: type: array - items: - $ref: '#/components/schemas/OrganizationPage' - readOnly: true - global_id: - type: string + items: {} + description: Get instructor information readOnly: true - nullable: true - description: The SSO ID (usually a Keycloak UUID) for the user. required: - - b2b_organizations - - created_on - - global_id - - grants - - id - - is_anonymous - - is_authenticated - - is_editor - - is_staff - - is_superuser - - legal_address - - updated_on - UserDiscountMeta: + - current_price + - description + - effort + - feature_image_src + - financial_assistance_form_url + - instructors + - length + - live + - page_url + CoursePageItem: type: object - description: Serializes UserDiscount but only allows depth = 1 + description: Serializer for individual course page items, including all relevant + fields. properties: id: type: integer readOnly: true - discount: - $ref: '#/components/schemas/V0Discount' - user: - $ref: '#/components/schemas/User' - required: - - discount - - id - - user - UserDiscountMetaRequest: - type: object - description: Serializes UserDiscount but only allows depth = 1 - properties: - discount: - $ref: '#/components/schemas/V0DiscountRequest' - user: - $ref: '#/components/schemas/UserRequest' - required: - - discount - - user - UserProfile: - type: object - description: Serializer for profile - properties: - gender: - nullable: true - oneOf: - - $ref: '#/components/schemas/GenderEnum' - - $ref: '#/components/schemas/BlankEnum' - - $ref: '#/components/schemas/NullEnum' - year_of_birth: - type: integer - maximum: 2147483647 - minimum: -2147483648 - nullable: true - addl_field_flag: - type: boolean - description: Flags if we've asked the user for additional information - company: + meta: + $ref: '#/components/schemas/PageMeta' + title: type: string - nullable: true - maxLength: 128 - job_title: + description: The page title as you'd like it to be seen by the public + maxLength: 255 + description: type: string - nullable: true - maxLength: 128 - industry: + description: The description shown on the home page and product page. + length: type: string - nullable: true - maxLength: 60 - job_function: + description: A short description indicating how long it takes to complete + (e.g. '4 weeks'). + maxLength: 50 + effort: type: string nullable: true - maxLength: 60 - company_size: - nullable: true - oneOf: - - $ref: '#/components/schemas/CompanySizeEnum' - - $ref: '#/components/schemas/NullEnum' - years_experience: - nullable: true - oneOf: - - $ref: '#/components/schemas/YearsExperienceEnum' - - $ref: '#/components/schemas/NullEnum' - leadership_level: + description: A short description indicating how much effort is required + (e.g. 1-3 hours per week). + maxLength: 100 + min_weekly_hours: type: string + description: The minimum number of hours per week required to complete the + course. + maxLength: 5 + max_weekly_hours: + type: string + description: The maximum number of hours per week required to complete the + course. + maxLength: 5 + min_weeks: + type: integer + maximum: 32767 + minimum: -32768 nullable: true - maxLength: 60 - highest_education: - nullable: true - oneOf: - - $ref: '#/components/schemas/HighestEducationEnum' - - $ref: '#/components/schemas/BlankEnum' - - $ref: '#/components/schemas/NullEnum' - type_is_student: - type: boolean - nullable: true - description: The learner identifies as type Student - type_is_professional: - type: boolean - nullable: true - description: The learner identifies as type Professional - type_is_educator: - type: boolean - nullable: true - description: The learner identifies as type Educator - type_is_other: - type: boolean + description: The minimum number of weeks required to complete the course/program. + max_weeks: + type: integer + maximum: 32767 + minimum: -32768 nullable: true - description: The learner identifies as type Other (not professional, student, - or educator) - UserProfileRequest: - type: object - description: Serializer for profile - properties: - gender: + description: The maximum number of weeks required to complete the course/program. + price: + type: array + items: + $ref: '#/components/schemas/PriceItem' + min_price: + type: integer + maximum: 32767 + minimum: -32768 nullable: true - oneOf: - - $ref: '#/components/schemas/GenderEnum' - - $ref: '#/components/schemas/BlankEnum' - - $ref: '#/components/schemas/NullEnum' - year_of_birth: + description: Specify the minimum product price. This is used by MIT Learn. + max_price: type: integer - maximum: 2147483647 - minimum: -2147483648 + maximum: 32767 + minimum: -32768 nullable: true - addl_field_flag: - type: boolean - description: Flags if we've asked the user for additional information - company: + description: Specify the maximum product price. This is used by MIT Learn. + prerequisites: type: string nullable: true - maxLength: 128 - job_title: + description: A short description indicating prerequisites of this course/program. + faq_url: type: string + format: uri nullable: true - maxLength: 128 - industry: + description: URL a relevant FAQ page or entry for the course/program. + maxLength: 200 + about: type: string nullable: true - maxLength: 60 - job_function: + description: Details about this course/program. + what_you_learn: type: string nullable: true - maxLength: 60 - company_size: - nullable: true - oneOf: - - $ref: '#/components/schemas/CompanySizeEnum' - - $ref: '#/components/schemas/NullEnum' - years_experience: - nullable: true - oneOf: - - $ref: '#/components/schemas/YearsExperienceEnum' - - $ref: '#/components/schemas/NullEnum' - leadership_level: + description: '*Required for Verifiable Credential generation. What you will + learn from this course.' + feature_image: + $ref: '#/components/schemas/FeatureImage' + video_url: type: string + format: uri nullable: true - maxLength: 60 - highest_education: - nullable: true - oneOf: - - $ref: '#/components/schemas/HighestEducationEnum' - - $ref: '#/components/schemas/BlankEnum' - - $ref: '#/components/schemas/NullEnum' - type_is_student: - type: boolean + description: URL to the video to be displayed for this course/program. It + can be an HLS or Youtube video URL. + maxLength: 200 + faculty_section_title: + type: string nullable: true - description: The learner identifies as type Student - type_is_professional: - type: boolean + description: The title text to display in the faculty cards section of the + product page. + maxLength: 255 + faculty: + type: array + items: + $ref: '#/components/schemas/Faculty' + certificate_page: + allOf: + - $ref: '#/components/schemas/CertificatePage' nullable: true - description: The learner identifies as type Professional - type_is_educator: + course_details: + $ref: '#/components/schemas/V2Course' + topic_list: + type: array + items: + $ref: '#/components/schemas/Topic' + include_in_learn_catalog: type: boolean nullable: true - description: The learner identifies as type Educator - type_is_other: + description: If true, Learn should include this in its catalog. + ingest_content_files_for_ai: type: boolean nullable: true - description: The learner identifies as type Other (not professional, student, - or educator) - UserProgramEnrollmentDetail: + description: If true, allow the AI chatbots to ingest the course's content + files. + required: + - about + - certificate_page + - course_details + - description + - effort + - faculty + - faculty_section_title + - faq_url + - feature_image + - id + - include_in_learn_catalog + - ingest_content_files_for_ai + - length + - max_price + - max_weekly_hours + - max_weeks + - meta + - min_price + - min_weekly_hours + - min_weeks + - prerequisites + - price + - title + - topic_list + - video_url + - what_you_learn + CoursePageList: type: object + description: Serializer for a list of course pages, including metadata and items. properties: - program: - $ref: '#/components/schemas/V1Program' - enrollments: + meta: + $ref: '#/components/schemas/PageListMeta' + items: type: array items: - $ref: '#/components/schemas/CourseRunEnrollment' - certificate: - allOf: - - $ref: '#/components/schemas/V1ProgramCertificate' - nullable: true - readOnly: true + $ref: '#/components/schemas/CoursePageItem' required: - - certificate - - enrollments - - program - UserRequest: + - items + - meta + Department: type: object - description: Serializer for users + description: Department model serializer properties: - username: - type: string - nullable: true - minLength: 1 - maxLength: 30 name: type: string - maxLength: 255 - email: - type: string - format: email - nullable: true - minLength: 1 - password: - type: string - writeOnly: true - minLength: 1 - legal_address: - allOf: - - $ref: '#/components/schemas/LegalAddressRequest' - nullable: true - user_profile: - allOf: - - $ref: '#/components/schemas/UserProfileRequest' - nullable: true - is_active: - type: boolean - default: true + maxLength: 128 required: - - legal_address - V0Discount: + - name + Faculty: type: object - description: Serializes a discount. + description: Serializer for faculty details used in course pages. properties: id: type: integer - readOnly: true - amount: + instructor_name: type: string - format: decimal - pattern: ^-?\d{0,15}(?:\.\d{0,5})?$ - automatic: - type: boolean - discount_type: - $ref: '#/components/schemas/DiscountTypeEnum' - redemption_type: - $ref: '#/components/schemas/RedemptionTypeEnum' - max_redemptions: - type: integer - maximum: 2147483647 - minimum: 0 - nullable: true - discount_code: + instructor_title: type: string - maxLength: 100 - payment_type: - nullable: true - oneOf: - - $ref: '#/components/schemas/PaymentTypeEnum' - - $ref: '#/components/schemas/NullEnum' - is_redeemed: - type: boolean - description: Returns True if the discount has been redeemed - readOnly: true - activation_date: + instructor_bio_short: type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable before this - date. - expiration_date: + instructor_bio_long: + type: string + feature_image_src: type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable after this - date. required: - - amount - - discount_code - - discount_type + - feature_image_src - id - - is_redeemed - - redemption_type - V0DiscountRequest: + - instructor_bio_long + - instructor_bio_short + - instructor_name + - instructor_title + FeatureImage: type: object - description: Serializes a discount. + description: Serializer for feature images used in course pages. properties: - amount: - type: string - format: decimal - pattern: ^-?\d{0,15}(?:\.\d{0,5})?$ - automatic: - type: boolean - discount_type: - $ref: '#/components/schemas/DiscountTypeEnum' - redemption_type: - $ref: '#/components/schemas/RedemptionTypeEnum' - max_redemptions: - type: integer - maximum: 2147483647 - minimum: 0 - nullable: true - discount_code: - type: string - minLength: 1 - maxLength: 100 - payment_type: - nullable: true - oneOf: - - $ref: '#/components/schemas/PaymentTypeEnum' - - $ref: '#/components/schemas/NullEnum' - activation_date: + title: type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable before this - date. - expiration_date: + image_url: type: string - format: date-time - nullable: true - description: If set, this discount code will not be redeemable after this - date. + format: uri + height: + type: integer + width: + type: integer required: - - amount - - discount_code - - discount_type - - redemption_type - V1BaseCourseRun: + - height + - image_url + - title + - width + NodeTypeEnum: + enum: + - course + - program + - operator + type: string + description: |- + * `course` - course + * `program` - program + * `operator` - operator + x-enum-descriptions: + - course + - program + - operator + Override: type: object - description: CourseRun model serializer + description: Serializer for overrides used in certificate pages. properties: - title: - type: string - description: The title of the course. This value is synced automatically - with edX studio. - maxLength: 255 - start_date: - type: string - format: date-time - nullable: true - description: The day the course begins. This value is synced automatically - with edX studio. - end_date: - type: string - format: date-time - nullable: true - description: The last day the course is active. This value is synced automatically - with edX studio. - enrollment_start: - type: string - format: date-time - nullable: true - description: The first day students can enroll. This value is synced automatically - with edX studio. - enrollment_end: - type: string - format: date-time - nullable: true - description: The last day students can enroll. This value is synced automatically - with edX studio. - expiration_date: - type: string - format: date-time - nullable: true - description: The date beyond which the learner should not see link to this - course run on their dashboard. - courseware_url: - type: string - nullable: true - description: Get the courseware URL - readOnly: true - courseware_id: + type: type: string - maxLength: 255 - certificate_available_date: + value: + $ref: '#/components/schemas/OverrideValue' + id: type: string - format: date-time - nullable: true - description: The day certificates should be available to users. This value - is synced automatically with edX studio. - upgrade_deadline: + required: + - id + - type + - value + OverrideValue: + type: object + description: Serializer for override values used in certificate pages. + properties: + readable_id: type: string - format: date-time - nullable: true - description: The date beyond which the learner can not enroll in paid course - mode. - is_upgradable: - type: boolean - description: Check if the course run is upgradable - readOnly: true - is_enrollable: - type: boolean - description: Check if the course run is enrollable - readOnly: true - is_archived: - type: boolean - description: Check if the course run is archived - readOnly: true - is_self_paced: - type: boolean - run_tag: + CEUs: type: string - description: 'A string that identifies the set of runs that this run belongs - to (example: ''R2'')' - maxLength: 100 + format: decimal + pattern: ^-?\d{0,3}(?:\.\d{0,2})?$ + required: + - CEUs + - readable_id + Page: + type: object + description: Serializer for individual Wagtail pages. + properties: id: type: integer - readOnly: true - live: - type: boolean - course_number: + title: type: string - description: Get the course number - readOnly: true - products: - type: array - items: - allOf: - - $ref: '#/components/schemas/ProductFlexibilePrice' - readOnly: true - approved_flexible_price_exists: - type: boolean - readOnly: true + meta: + $ref: '#/components/schemas/PageMeta' required: - - approved_flexible_price_exists - - course_number - - courseware_id - - courseware_url - id - - is_archived - - is_enrollable - - is_upgradable - - products - - run_tag + - meta - title - V1CourseRunWithCourse: + PageList: type: object - description: CourseRun model serializer - also serializes the parent Course. + description: Serializer for a list of Wagtail pages. properties: - title: + meta: + $ref: '#/components/schemas/PageListMeta' + items: + type: array + items: + $ref: '#/components/schemas/Page' + required: + - items + - meta + PageListMeta: + type: object + description: Serializer for metadata of a list of Wagtail pages. + properties: + total_count: + type: integer + required: + - total_count + PageMeta: + type: object + description: Serializer for page metadata used in various Wagtail pages. + properties: + type: type: string - description: The title of the course. This value is synced automatically - with edX studio. - maxLength: 255 - start_date: + detail_url: type: string - format: date-time - nullable: true - description: The day the course begins. This value is synced automatically - with edX studio. - end_date: + format: uri + html_url: type: string - format: date-time - nullable: true - description: The last day the course is active. This value is synced automatically - with edX studio. - enrollment_start: + format: uri + slug: type: string - format: date-time - nullable: true - description: The first day students can enroll. This value is synced automatically - with edX studio. - enrollment_end: + show_in_menus: + type: boolean + seo_title: type: string - format: date-time - nullable: true - description: The last day students can enroll. This value is synced automatically - with edX studio. - expiration_date: + search_description: + type: string + first_published_at: type: string format: date-time nullable: true - description: The date beyond which the learner should not see link to this - course run on their dashboard. - courseware_url: + alias_of: type: string nullable: true - description: Get the courseware URL - readOnly: true - courseware_id: + locale: type: string - maxLength: 255 - certificate_available_date: + live: + type: boolean + last_published_at: type: string format: date-time nullable: true - description: The day certificates should be available to users. This value - is synced automatically with edX studio. - upgrade_deadline: + required: + - alias_of + - detail_url + - first_published_at + - html_url + - last_published_at + - live + - locale + - search_description + - seo_title + - show_in_menus + - slug + - type + PriceItem: + type: object + description: Serializer for price items used in course pages. + properties: + type: type: string - format: date-time - nullable: true - description: The date beyond which the learner can not enroll in paid course - mode. - is_upgradable: - type: boolean - description: Check if the course run is upgradable - readOnly: true - is_enrollable: - type: boolean - description: Check if the course run is enrollable - readOnly: true - is_archived: - type: boolean - description: Check if the course run is archived + value: + type: object + additionalProperties: {} + id: + type: string + format: uuid + required: + - id + - type + - value + ProgramPage: + type: object + description: Program page model serializer + properties: + feature_image_src: + type: string + description: Serializes the source of the feature_image readOnly: true - is_self_paced: - type: boolean - run_tag: + page_url: type: string - description: 'A string that identifies the set of runs that this run belongs - to (example: ''R2'')' - maxLength: 100 - id: - type: integer + format: uri readOnly: true - live: - type: boolean - course_number: + financial_assistance_form_url: type: string - description: Get the course number + format: uri readOnly: true - products: - type: array - items: - allOf: - - $ref: '#/components/schemas/ProductFlexibilePrice' + description: + type: string + description: The description shown on the home page and product page. readOnly: true - description: List of products associated with this course run - approved_flexible_price_exists: + live: type: boolean readOnly: true - course: - allOf: - - $ref: '#/components/schemas/Course' + length: + type: string + description: A short description indicating how long it takes to complete + (e.g. '4 weeks'). + maxLength: 50 + effort: + type: string + nullable: true + description: A short description indicating how much effort is required + (e.g. 1-3 hours per week). + maxLength: 100 + price: + type: string + description: Get the price text from the program page. readOnly: true required: - - approved_flexible_price_exists - - course - - course_number - - courseware_id - - courseware_url - - id - - is_archived - - is_enrollable - - is_upgradable - - products - - run_tag - - title - V1CourseRunWithCourseRequest: + - description + - feature_image_src + - financial_assistance_form_url + - live + - page_url + - price + ProgramPageItem: type: object - description: CourseRun model serializer - also serializes the parent Course. + description: Serializer for individual program page items, including all relevant + fields. properties: + id: + type: integer + readOnly: true + meta: + $ref: '#/components/schemas/PageMeta' title: type: string - minLength: 1 - description: The title of the course. This value is synced automatically - with edX studio. + description: The page title as you'd like it to be seen by the public maxLength: 255 - start_date: + description: type: string - format: date-time - nullable: true - description: The day the course begins. This value is synced automatically - with edX studio. - end_date: + description: The description shown on the home page and product page. + readOnly: true + length: type: string - format: date-time - nullable: true - description: The last day the course is active. This value is synced automatically - with edX studio. - enrollment_start: + description: A short description indicating how long it takes to complete + (e.g. '4 weeks'). + maxLength: 50 + effort: type: string - format: date-time nullable: true - description: The first day students can enroll. This value is synced automatically - with edX studio. - enrollment_end: + description: A short description indicating how much effort is required + (e.g. 1-3 hours per week). + maxLength: 100 + min_weekly_hours: type: string - format: date-time - nullable: true - description: The last day students can enroll. This value is synced automatically - with edX studio. - expiration_date: + description: The minimum number of hours per week required to complete the + course. + maxLength: 5 + max_weekly_hours: type: string - format: date-time + description: The maximum number of hours per week required to complete the + course. + maxLength: 5 + min_weeks: + type: integer + maximum: 32767 + minimum: -32768 nullable: true - description: The date beyond which the learner should not see link to this - course run on their dashboard. - courseware_id: - type: string - minLength: 1 - maxLength: 255 - certificate_available_date: - type: string - format: date-time + description: The minimum number of weeks required to complete the course/program. + max_weeks: + type: integer + maximum: 32767 + minimum: -32768 nullable: true - description: The day certificates should be available to users. This value - is synced automatically with edX studio. - upgrade_deadline: - type: string - format: date-time + description: The maximum number of weeks required to complete the course/program. + price: + type: array + items: + $ref: '#/components/schemas/PriceItem' + min_price: + type: integer + maximum: 32767 + minimum: -32768 nullable: true - description: The date beyond which the learner can not enroll in paid course - mode. - is_self_paced: - type: boolean - run_tag: - type: string - minLength: 1 - description: 'A string that identifies the set of runs that this run belongs - to (example: ''R2'')' - maxLength: 100 - live: - type: boolean - required: - - courseware_id - - run_tag - - title - V1CourseWithCourseRuns: - type: object - description: Course model serializer - also serializes child course runs - properties: - id: + description: Specify the minimum product price. This is used by MIT Learn. + max_price: type: integer - readOnly: true - title: + maximum: 32767 + minimum: -32768 + nullable: true + description: Specify the maximum product price. This is used by MIT Learn. + prerequisites: type: string - maxLength: 255 - readable_id: + nullable: true + description: A short description indicating prerequisites of this course/program. + faq_url: type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - next_run_id: - type: integer + format: uri nullable: true - description: Get next run id - readOnly: true - departments: - type: array - items: - $ref: '#/components/schemas/Department' - readOnly: true - page: - allOf: - - $ref: '#/components/schemas/CoursePage' - readOnly: true - programs: - allOf: - - $ref: '#/components/schemas/Program' + description: URL a relevant FAQ page or entry for the course/program. + maxLength: 200 + about: + type: string nullable: true - readOnly: true - courseruns: - type: array - items: - $ref: '#/components/schemas/V1BaseCourseRun' - readOnly: true - required: - - courseruns - - departments - - id - - next_run_id - - page - - programs - - readable_id - - title - V1Program: - type: object - description: Program model serializer - properties: - title: + description: Details about this course/program. + what_you_learn: type: string - maxLength: 255 - readable_id: + nullable: true + description: '*Required for Verifiable Credential generation. What you will + learn from this course.' + feature_image: + $ref: '#/components/schemas/FeatureImage' + video_url: type: string - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - id: - type: integer - readOnly: true - courses: - allOf: - - $ref: '#/components/schemas/V1CourseWithCourseRuns' - readOnly: true - requirements: - type: object - properties: - required: - type: array - items: - oneOf: - - type: integer - description: List of required course IDs - electives: - type: array - items: - oneOf: - - type: integer - description: List of elective course IDs - readOnly: true - req_tree: - type: array - items: - $ref: '#/components/schemas/V1ProgramRequirement' - readOnly: true - page: - allOf: - - $ref: '#/components/schemas/ProgramPage' - readOnly: true - program_type: + format: uri + nullable: true + description: URL to the video to be displayed for this course/program. It + can be an HLS or Youtube video URL. + maxLength: 200 + faculty_section_title: type: string nullable: true + description: The title text to display in the faculty cards section of the + product page. maxLength: 255 - departments: + faculty: type: array items: - $ref: '#/components/schemas/Department' - readOnly: true - live: - type: boolean + $ref: '#/components/schemas/Faculty' + certificate_page: + $ref: '#/components/schemas/CertificatePage' + program_details: + $ref: '#/components/schemas/V2Program' required: - - courses - - departments + - about + - certificate_page + - description + - effort + - faculty + - faculty_section_title + - faq_url + - feature_image - id - - page - - readable_id - - req_tree - - requirements + - length + - max_price + - max_weekly_hours + - max_weeks + - meta + - min_price + - min_weekly_hours + - min_weeks + - prerequisites + - price + - program_details - title - V1ProgramCertificate: - type: object - description: ProgramCertificate model serializer - properties: - uuid: - type: string - format: uuid - readOnly: true - link: - type: string - description: |- - Get the link at which this certificate will be served - Format: /certificate/program// - Example: /certificate/program/93ebd74e-5f88-4b47-bb09-30a6d575328f/ - readOnly: true - required: - - link - - uuid - V1ProgramRequirement: + - video_url + - what_you_learn + ProgramPageList: type: object - description: Serializer for a ProgramRequirement + description: Serializer for a list of program pages, including metadata and + items. properties: - id: - type: integer - nullable: true - data: - $ref: '#/components/schemas/V1ProgramRequirementData' - children: + meta: + $ref: '#/components/schemas/PageListMeta' + items: type: array items: - $ref: '#/components/schemas/V1ProgramRequirement' - default: [] + $ref: '#/components/schemas/ProgramPageItem' required: - - data - V1ProgramRequirementData: + - items + - meta + SignatoryItem: type: object - description: Serializer for ProgramRequirement data + description: Serializer for signatory items used in certificate pages. properties: - node_type: - $ref: '#/components/schemas/NodeTypeEnum' - course: + name: type: string - nullable: true - required_program: + title_1: type: string - nullable: true - program: + title_2: type: string - title: + title_3: type: string - nullable: true - operator: + organization: type: string - nullable: true - operator_value: + signature_image: type: string - nullable: true - elective_flag: - type: boolean - nullable: true - default: false required: - - node_type + - name + - organization + - signature_image + - title_1 + - title_2 + - title_3 + Topic: + type: object + description: Serializer for topics used in course pages. + properties: + name: + type: string + parent: + type: string + required: + - name V2Course: type: object description: Course model serializer @@ -7336,246 +948,6 @@ components: - time_commitment - title - topics - V2CourseRequest: - type: object - description: Course model serializer - properties: - title: - type: string - minLength: 1 - maxLength: 255 - readable_id: - type: string - minLength: 1 - pattern: ^[\w\-+:\.]+$ - maxLength: 255 - required: - - readable_id - - title - V2CourseRunCertificate: - type: object - description: Serializer for course certificates. - properties: - user: - $ref: '#/components/schemas/PublicUser' - uuid: - type: string - format: uuid - readOnly: true - is_revoked: - type: boolean - readOnly: true - title: Revoked - description: Indicates whether or not the certificate is revoked - certificate_page: - allOf: - - $ref: '#/components/schemas/CertificatePageModel' - readOnly: true - verifiable_credential_json: - readOnly: true - course_run: - $ref: '#/components/schemas/V2CourseRunWithCourse' - certificate_page_revision: - type: integer - readOnly: true - nullable: true - required: - - certificate_page - - certificate_page_revision - - course_run - - is_revoked - - user - - uuid - - verifiable_credential_json - V2CourseRunWithCourse: - type: object - description: CourseRun model serializer - also serializes the parent Course. - properties: - title: - type: string - description: The title of the course. This value is synced automatically - with edX studio. - maxLength: 255 - start_date: - type: string - format: date-time - nullable: true - description: The day the course begins. This value is synced automatically - with edX studio. - end_date: - type: string - format: date-time - nullable: true - description: The last day the course is active. This value is synced automatically - with edX studio. - enrollment_start: - type: string - format: date-time - nullable: true - description: The first day students can enroll. This value is synced automatically - with edX studio. - enrollment_end: - type: string - format: date-time - nullable: true - description: The last day students can enroll. This value is synced automatically - with edX studio. - expiration_date: - type: string - format: date-time - nullable: true - description: The date beyond which the learner should not see link to this - course run on their dashboard. - courseware_url: - type: string - nullable: true - description: Get the courseware URL - readOnly: true - courseware_id: - type: string - maxLength: 255 - certificate_available_date: - type: string - format: date-time - nullable: true - description: The day certificates should be available to users. This value - is synced automatically with edX studio. - upgrade_deadline: - type: string - format: date-time - nullable: true - description: The date beyond which the learner can not enroll in paid course - mode. - is_upgradable: - type: boolean - description: Check if the course run is upgradable - readOnly: true - is_enrollable: - type: boolean - description: Check if the course run is enrollable - readOnly: true - is_archived: - type: boolean - description: Check if the course run is archived - readOnly: true - is_self_paced: - type: boolean - run_tag: - type: string - description: 'A string that identifies the set of runs that this run belongs - to (example: ''R2'')' - maxLength: 100 - id: - type: integer - readOnly: true - live: - type: boolean - course_number: - type: string - description: Get the course number - readOnly: true - products: - type: array - items: - allOf: - - $ref: '#/components/schemas/ProductFlexibilePrice' - readOnly: true - approved_flexible_price_exists: - type: boolean - readOnly: true - b2b_contract: - type: integer - nullable: true - course: - allOf: - - $ref: '#/components/schemas/V2Course' - readOnly: true - required: - - approved_flexible_price_exists - - course - - course_number - - courseware_id - - courseware_url - - id - - is_archived - - is_enrollable - - is_upgradable - - products - - run_tag - - title - V2CourseRunWithCourseRequest: - type: object - description: CourseRun model serializer - also serializes the parent Course. - properties: - title: - type: string - minLength: 1 - description: The title of the course. This value is synced automatically - with edX studio. - maxLength: 255 - start_date: - type: string - format: date-time - nullable: true - description: The day the course begins. This value is synced automatically - with edX studio. - end_date: - type: string - format: date-time - nullable: true - description: The last day the course is active. This value is synced automatically - with edX studio. - enrollment_start: - type: string - format: date-time - nullable: true - description: The first day students can enroll. This value is synced automatically - with edX studio. - enrollment_end: - type: string - format: date-time - nullable: true - description: The last day students can enroll. This value is synced automatically - with edX studio. - expiration_date: - type: string - format: date-time - nullable: true - description: The date beyond which the learner should not see link to this - course run on their dashboard. - courseware_id: - type: string - minLength: 1 - maxLength: 255 - certificate_available_date: - type: string - format: date-time - nullable: true - description: The day certificates should be available to users. This value - is synced automatically with edX studio. - upgrade_deadline: - type: string - format: date-time - nullable: true - description: The date beyond which the learner can not enroll in paid course - mode. - is_self_paced: - type: boolean - run_tag: - type: string - minLength: 1 - description: 'A string that identifies the set of runs that this run belongs - to (example: ''R2'')' - maxLength: 100 - live: - type: boolean - b2b_contract: - type: integer - nullable: true - required: - - courseware_id - - run_tag - - title V2Program: type: object description: Program Model Serializer v2 @@ -7771,79 +1143,6 @@ components: - time_commitment - title - topics - V2ProgramCertificate: - type: object - description: Serializer for course certificates. - properties: - user: - $ref: '#/components/schemas/PublicUser' - uuid: - type: string - format: uuid - readOnly: true - is_revoked: - type: boolean - readOnly: true - title: Revoked - description: Indicates whether or not the certificate is revoked - certificate_page: - allOf: - - $ref: '#/components/schemas/CertificatePageModel' - readOnly: true - verifiable_credential_json: - readOnly: true - program: - $ref: '#/components/schemas/V2Program' - certificate_page_revision: - type: integer - readOnly: true - nullable: true - required: - - certificate_page - - certificate_page_revision - - is_revoked - - program - - user - - uuid - - verifiable_credential_json - V2ProgramCollection: - type: object - description: Serializer for ProgramCollection - properties: - id: - type: integer - readOnly: true - title: - type: string - description: - type: string - programs: - type: array - items: - type: object - properties: - id: - type: integer - title: - type: string - order: - type: integer - readOnly: true - created_on: - type: string - format: date-time - readOnly: true - updated_on: - type: string - format: date-time - readOnly: true - required: - - created_on - - description - - id - - programs - - title - - updated_on V2ProgramRequirement: type: object description: Serializer for a ProgramRequirement @@ -7890,52 +1189,3 @@ components: default: false required: - node_type - V2UserProgramEnrollmentDetail: - type: object - description: |- - Serializer for user program enrollments with associated course enrollments. - - This aggregates a program, its course enrollments for the user, and any - program certificate that has been earned. - properties: - program: - $ref: '#/components/schemas/V2Program' - enrollments: - type: array - items: - $ref: '#/components/schemas/CourseRunEnrollmentRequestV2' - certificate: - allOf: - - $ref: '#/components/schemas/ProgramCertificate' - nullable: true - readOnly: true - required: - - certificate - - enrollments - - program - YearsExperienceEnum: - enum: - - 2 - - 5 - - 10 - - 15 - - 20 - - 21 - - 0 - description: |- - * `None` - ---- - * `2` - Less than 2 years - * `5` - 2-5 years - * `10` - 6 - 10 years - * `15` - 11 - 15 years - * `20` - 16 - 20 years - * `21` - More than 20 years - * `0` - Prefer not to say - x-enum-descriptions: - - Less than 2 years - - 2-5 years - - 6 - 10 years - - 11 - 15 years - - 16 - 20 years - - More than 20 years - - Prefer not to say diff --git a/poetry.lock b/poetry.lock index 5b46d40dba..37e4914808 100644 --- a/poetry.lock +++ b/poetry.lock @@ -5346,6 +5346,21 @@ files = [ {file = "toolz-1.0.0.tar.gz", hash = "sha256:2c86e3d9a04798ac556793bced838816296a2f085017664e4995cb40a1047a02"}, ] +[[package]] +name = "traceback-with-variables" +version = "2.2.1" +description = "Adds variables to python traceback. Simple, lightweight, controllable. Debug reasons of exceptions by logging or pretty printing colorful variable contexts for each frame in a stacktrace, showing every value. Dump locals environments after errors to console, files, and loggers. Works with Jupyter and IPython." +optional = false +python-versions = ">=3.7" +groups = ["main"] +files = [ + {file = "traceback_with_variables-2.2.1-py3-none-any.whl", hash = "sha256:ab6d75c72d26d61217962d11db44c98c62dccd2fedb2d4fb0ae4f9faf9db23c2"}, + {file = "traceback_with_variables-2.2.1.tar.gz", hash = "sha256:ea7c695f9b401762f68f75df0439d661112b8dbd58bcd6910e402cff925ad7e0"}, +] + +[package.extras] +test = ["flake8", "ipython", "notebook (==6.2.0)", "pytest-cov"] + [[package]] name = "traitlets" version = "5.14.3" @@ -6001,4 +6016,4 @@ cffi = ["cffi (>=1.17,<2.0) ; platform_python_implementation != \"PyPy\" and pyt [metadata] lock-version = "2.1" python-versions = "^3.11" -content-hash = "9ece6691009b45425eee807581bfad05397e18aad9a09ab857595ecffc30a127" +content-hash = "41eafe3cc6336f9cefe007ba1af58569ab378f7c4a0b856615327f50bb872c81" diff --git a/pyproject.toml b/pyproject.toml index 29dc7133bb..2123caca2a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -91,6 +91,7 @@ authlib = "^1.6.3" trino = "^0.336.0" granian = "^2.5.4" mitol-django-olposthog = "^2025.8.1" +traceback-with-variables = "^2.2.1" [tool.poetry.group.dev.dependencies]