/* generated using openapi-typescript-codegen -- do not edit */ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ import type { AppleSubscriptionStatusRequest } from '../models/AppleSubscriptionStatusRequest'; import type { AppleSubscriptionStatusView } from '../models/AppleSubscriptionStatusView'; import type { AppleVerifyTransactionId } from '../models/AppleVerifyTransactionId'; import type { AssociateAccountResponse } from '../models/AssociateAccountResponse'; import type { AssociateAppleAccount } from '../models/AssociateAppleAccount'; import type { AWSTenantLaunchRequest } from '../models/AWSTenantLaunchRequest'; import type { BaseResponse } from '../models/BaseResponse'; import type { GCPTenantLaunchRequest } from '../models/GCPTenantLaunchRequest'; import type { GooglePayAccountResponse } from '../models/GooglePayAccountResponse'; import type { GooglePayVerifyToken } from '../models/GooglePayVerifyToken'; import type { StripeCheckoutSessionRequest } from '../models/StripeCheckoutSessionRequest'; import type { StripeCheckoutSessionResponse } from '../models/StripeCheckoutSessionResponse'; import type { StripeConnectDashboardLink } from '../models/StripeConnectDashboardLink'; import type { StripeConnectOnboard } from '../models/StripeConnectOnboard'; import type { StripeConnectOnboardResponse } from '../models/StripeConnectOnboardResponse'; import type { StripeConnectStatus } from '../models/StripeConnectStatus'; import type { StripeContext } from '../models/StripeContext'; import type { StripeCustomerPortalRequest } from '../models/StripeCustomerPortalRequest'; import type { StripeCustomerPortalResponse } from '../models/StripeCustomerPortalResponse'; import type { StripeLocalProduct } from '../models/StripeLocalProduct'; import type { StripeNewUserTenantLaunchRequest } from '../models/StripeNewUserTenantLaunchRequest'; import type { StripePricingPageSessionResponse } from '../models/StripePricingPageSessionResponse'; import type { StripeSubscriptionRenewalRequest } from '../models/StripeSubscriptionRenewalRequest'; import type { StripeSubscriptionRenewalResponse } from '../models/StripeSubscriptionRenewalResponse'; import type { TenantLaunchRequest } from '../models/TenantLaunchRequest'; import type { TenantLaunchResponse } from '../models/TenantLaunchResponse'; import type { VerifyGCPMarketPlaceRequest } from '../models/VerifyGCPMarketPlaceRequest'; import type { VerifyGCPMarketPlaceResponse } from '../models/VerifyGCPMarketPlaceResponse'; import type { CancelablePromise } from '../core/CancelablePromise'; import { OpenAPI } from '../core/OpenAPI'; import { request as __request } from '../core/request'; export class CommerceService { /** * Handle callbacks from Stripe after successful checkout. * * Updates: * - Platform launch state * - Association configuration status * @returns any * @throws ApiError */ public static providerAssociationStripeCallbackRetrieve({ launchId, }: { launchId: string, }): CancelablePromise<{ message?: string; }> { return __request(OpenAPI, { method: 'GET', url: '/api/provider-association/stripe/callback/{launch_id}/', path: { 'launch_id': launchId, }, }); } /** * Associate an Apple account with a user known user * @returns AssociateAccountResponse * @throws ApiError */ public static providersAppleAssociateAccountCreate({ requestBody, }: { requestBody: AssociateAppleAccount, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/providers/apple/associate-account/', body: requestBody, mediaType: 'application/json', }); } /** * View to handle apple webhooks * @returns any No response body * @throws ApiError */ public static providersAppleHookCreate(): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/providers/apple/hook/', }); } /** * Returns information about a user subscription status * @returns AppleSubscriptionStatusView * @throws ApiError */ public static providersAppleSubscriptionStatusCreate({ requestBody, }: { requestBody?: AppleSubscriptionStatusRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/providers/apple/subscription-status/', body: requestBody, mediaType: 'application/json', }); } /** * Checks if a provided transaction_id is valid * @returns BaseResponse * @throws ApiError */ public static providersAppleValidateTransactionIdCreate({ requestBody, }: { requestBody: AppleVerifyTransactionId, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/providers/apple/validate-transaction-id/', body: requestBody, mediaType: 'application/json', }); } /** * Serves a view that redirects to the AWS marketplace create organization page * * Set CREATE_ORGANIZATION_URL in GlobalConfigurationFetcher to the * URL of the AWS marketplace create organization page * @returns any No response body * @throws ApiError */ public static providersAwsCreateOrganizationCreate(): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/providers/aws/create-organization/', }); } /** * API endpoint to get domain setup status * @returns any No response body * @throws ApiError */ public static providersAwsDomainStatusRetrieve(): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/providers/aws/domain-status/', }); } /** * Proxy to the Platform launch API * * We cannot expose launching a tenant to an authorized user hence the need for the API * * The API validates the x_amzn_marketplace_token and then proxies the request to the Platform Launch API * @returns TenantLaunchResponse * @throws ApiError */ public static providersAwsLaunchTenantCreate({ requestBody, }: { requestBody: AWSTenantLaunchRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/providers/aws/launch-tenant/', body: requestBody, mediaType: 'application/json', }); } /** * API endpoint to get/update CNAME records for domain setup * @returns any No response body * @throws ApiError */ public static providersAwsSyncDomainRecordsRetrieve(): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/providers/aws/sync-domain-records/', }); } /** * API endpoint to get/update CNAME records for domain setup * @returns any No response body * @throws ApiError */ public static providersAwsSyncDomainRecordsCreate(): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/providers/aws/sync-domain-records/', }); } /** * Serves a view that redirects to the GCP marketplace create organization page * * Set CREATE_ORGANIZATION_URL in GlobalConfigurationFetcher to the URL of the GCP marketplace create organization * page * @returns any No response body * @throws ApiError */ public static providersGcpCreateOrganizationCreate(): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/providers/gcp/create-organization/', }); } /** * Serves a view that redirects to the GCP marketplace create organization page * * Set CREATE_ORGANIZATION_URL in GlobalConfigurationFetcher to the URL of the GCP marketplace create organization * page * @returns any No response body * @throws ApiError */ public static providersGcpCreateOrganizationCreate2({ productId, }: { productId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/providers/gcp/create-organization/{product_id}/', path: { 'product_id': productId, }, }); } /** * @returns any No response body * @throws ApiError */ public static providersGcpHookCreate(): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/providers/gcp/hook/', }); } /** * Proxy to the Platform launch API * * We cannot expose launching a tenant to an authorized user hence the need for the API * * The API validates the x_gcp_marketplace_token and then proxies the request to the Platform Launc API * @returns TenantLaunchResponse * @throws ApiError */ public static providersGcpLaunchTenantCreate({ requestBody, }: { requestBody: GCPTenantLaunchRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/providers/gcp/launch-tenant/', body: requestBody, mediaType: 'application/json', }); } /** * @returns VerifyGCPMarketPlaceResponse * @throws ApiError */ public static providersGcpValidateSignupTokenCreate({ requestBody, }: { requestBody: VerifyGCPMarketPlaceRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/providers/gcp/validate-signup-token/', body: requestBody, mediaType: 'application/json', }); } /** * Google Allows us to pass an obfuscated account id to be sent to during a subscription purchase * @returns GooglePayAccountResponse * @throws ApiError */ public static providersGooglePayGetAccountRetrieve({ bundleId, }: { bundleId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/providers/google-pay/get-account/{bundle_id}', path: { 'bundle_id': bundleId, }, }); } /** * View to handle Google Pay webhooks * @returns any No response body * @throws ApiError */ public static providersGooglePayHookCreate(): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/providers/google-pay/hook/', }); } /** * Associate a Google Pay account with a known user * @returns BaseResponse * @throws ApiError */ public static providersGooglePayValidateTransactionIdCreate({ requestBody, }: { requestBody: GooglePayVerifyToken, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/providers/google-pay/validate-transaction-id/', body: requestBody, mediaType: 'application/json', }); } /** * Proxy to the Platform launch API * * We cannot expose launching a tenant to an unauthorized user hence the need for the API * * The API validates the stripe_checkout_id and then proxies the request to the Platform Launch API * @returns TenantLaunchResponse * @throws ApiError */ public static providersStripeCreateOrganizationCreate({ requestBody, }: { requestBody: StripeNewUserTenantLaunchRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/providers/stripe/create-organization/', body: requestBody, mediaType: 'application/json', }); } /** * POST * Update platform provisioning config * * request body: * {"config_name": "demo_config} * @returns any No response body * @throws ApiError */ public static provisionCreate({ configName, }: { configName: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/provision/{config_name}/', path: { 'config_name': configName, }, }); } /** * User/tenant creation API * * To create using any payment provider, ensure you use the StudentToken Authentication Mechanism * and also include the correct `provider_key` in the request body: * * ``` * apple_transaction_id: str * stripe_checkout_id: str * x_gcp_marketplace_token: str * aws_transaction_id: str * google_pay_transaction_id: str * ``` * * To create a tenant without a payment provider, call the API without ny of the above provider keys in the request body * @returns TenantLaunchResponse * @throws ApiError */ public static serviceLaunchTenantCreate({ requestBody, }: { requestBody: TenantLaunchRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/service/launch/tenant/', body: requestBody, mediaType: 'application/json', }); } /** * User creation flow * @returns any No response body * @throws ApiError */ public static serviceManageUserCreate(): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/service/manage/user/', }); } /** * Make user tenant admin * @returns any No response body * @throws ApiError */ public static serviceManageUserRoleCreate(): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/service/manage/user/role/', }); } /** * Stripe checkout session API View for user upgrade * * Request the following fields: * * - tenant * - sku * - mode * - success_url * - cancel_url * * Response: * { * "redirect_to": "https://checkout.stripe.com/xxx/xxxx/xxxx", * } * @returns StripeCheckoutSessionResponse * @throws ApiError */ public static serviceOrgsUsersStripeCheckoutSessionCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: StripeCheckoutSessionRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/service/orgs/{org}/users/{user_id}/stripe/checkout-session/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns StripeCustomerPortalResponse * @throws ApiError */ public static serviceOrgsUsersStripeCustomerPortalCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: StripeCustomerPortalRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/service/orgs/{org}/users/{user_id}/stripe/customer-portal/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns StripeLocalProduct * @throws ApiError */ public static serviceOrgsUsersStripeProductsRetrieve({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/service/orgs/{org}/users/{user_id}/stripe/products/', path: { 'org': org, 'user_id': userId, }, }); } /** * Mixin that includes the StudentTokenAuthentication and IsPlatformAdmin * @returns any No response body * @throws ApiError */ public static serviceOrgsUsersStripeProductsManageCreate({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/service/orgs/{org}/users/{user_id}/stripe/products/manage/', path: { 'org': org, 'user_id': userId, }, }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns StripeSubscriptionRenewalResponse * @throws ApiError */ public static serviceOrgsUsersStripeSubscriptionRenewalCreate({ org, userId, requestBody, }: { org: string, userId: string, requestBody: StripeSubscriptionRenewalRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/service/orgs/{org}/users/{user_id}/stripe/subscription-renewal/', path: { 'org': org, 'user_id': userId, }, body: requestBody, mediaType: 'application/json', }); } /** * Mixin that includes the StudentTokenAuthentication and IsAdminUserOrStudent * @returns any No response body * @throws ApiError */ public static serviceOrgsUsersStripeSubscriptionsRetrieve({ org, userId, }: { org: string, userId: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/service/orgs/{org}/users/{user_id}/stripe/subscriptions/', path: { 'org': org, 'user_id': userId, }, }); } /** * Handle course payment callback after successful Stripe checkout. * Enrolls the user in the purchased course. * * URL Parameters: * - stripe_checkout_id: The local Checkout Session UUID * * Response: * - Redirect: Successfully processed course enrollment * - 404: Checkout session not found * - 400: Invalid checkout session or product * - 500: Server error during processing * @returns any No response body * @throws ApiError */ public static serviceOrgsStripeCoursePaymentCallbackRetrieve({ platformKey, }: { platformKey: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/service/orgs/{platform_key}/stripe/course-payment-callback/', path: { 'platform_key': platformKey, }, }); } /** * Disconnect Stripe Connect account * @returns any * @throws ApiError */ public static servicePlatformsStripeConnectDestroy({ platformKey, }: { platformKey: string, }): CancelablePromise> { return __request(OpenAPI, { method: 'DELETE', url: '/api/service/platforms/{platform_key}/stripe/connect/', path: { 'platform_key': platformKey, }, }); } /** * Get Express Dashboard login link * @returns StripeConnectDashboardLink * @throws ApiError */ public static servicePlatformsStripeConnectDashboardRetrieve({ platformKey, }: { platformKey: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/service/platforms/{platform_key}/stripe/connect/dashboard/', path: { 'platform_key': platformKey, }, }); } /** * Start Stripe Connect onboarding for platform admin * @returns StripeConnectOnboardResponse * @throws ApiError */ public static servicePlatformsStripeConnectOnboardCreate({ platformKey, requestBody, }: { platformKey: string, requestBody: StripeConnectOnboard, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/service/platforms/{platform_key}/stripe/connect/onboard/', path: { 'platform_key': platformKey, }, body: requestBody, mediaType: 'application/json', }); } /** * Start Stripe Connect onboarding for platform admin * @returns StripeConnectOnboardResponse * @throws ApiError */ public static servicePlatformsStripeConnectOnboardRefreshCreate({ platformKey, requestBody, }: { platformKey: string, requestBody: StripeConnectOnboard, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/service/platforms/{platform_key}/stripe/connect/onboard/refresh/', path: { 'platform_key': platformKey, }, body: requestBody, mediaType: 'application/json', }); } /** * Get Connect account status * @returns StripeConnectStatus * @throws ApiError */ public static servicePlatformsStripeConnectStatusRetrieve({ platformKey, }: { platformKey: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/service/platforms/{platform_key}/stripe/connect/status/', path: { 'platform_key': platformKey, }, }); } /** * Create a uuid to help us track internally user initiated checkout * @returns StripeContext * @throws ApiError */ public static servicePlatformsStripeContextRetrieve({ platformKey, }: { platformKey: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/service/platforms/{platform_key}/stripe/context/', path: { 'platform_key': platformKey, }, }); } /** * Unified callback after successful Stripe checkout. * * Handles both subscription (pricing page) and credit-topup (payment mode) * checkouts. The checkout type is determined from the Stripe session automatically. * * URL Parameters: * - checkout_session_id: The Stripe Checkout Session ID (optional in URL, * can also be passed as ?stripe_checkout_id query param) * * Response: * - Redirect: Successfully validated and sending to next page * - 404: Checkout session not found * - 400: Invalid checkout session or product * @returns any No response body * @throws ApiError */ public static servicePlatformsStripeCreditTopupCallbackRetrieve({ checkoutSessionId, platformKey, }: { checkoutSessionId: string, platformKey: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/service/platforms/{platform_key}/stripe/credit-topup-callback/{checkout_session_id}/', path: { 'checkout_session_id': checkoutSessionId, 'platform_key': platformKey, }, }); } /** * Unified callback after successful Stripe checkout. * * Handles both subscription (pricing page) and credit-topup (payment mode) * checkouts. The checkout type is determined from the Stripe session automatically. * * URL Parameters: * - checkout_session_id: The Stripe Checkout Session ID (optional in URL, * can also be passed as ?stripe_checkout_id query param) * * Response: * - Redirect: Successfully validated and sending to next page * - 404: Checkout session not found * - 400: Invalid checkout session or product * @returns any No response body * @throws ApiError */ public static servicePlatformsStripePricingPageCallbackRetrieve({ platformKey, }: { platformKey: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/service/platforms/{platform_key}/stripe/pricing-page-callback/', path: { 'platform_key': platformKey, }, }); } /** * Unified callback after successful Stripe checkout. * * Handles both subscription (pricing page) and credit-topup (payment mode) * checkouts. The checkout type is determined from the Stripe session automatically. * * URL Parameters: * - checkout_session_id: The Stripe Checkout Session ID (optional in URL, * can also be passed as ?stripe_checkout_id query param) * * Response: * - Redirect: Successfully validated and sending to next page * - 404: Checkout session not found * - 400: Invalid checkout session or product * @returns any No response body * @throws ApiError */ public static servicePlatformsStripePricingPageCallbackRetrieve2({ checkoutSessionId, platformKey, }: { checkoutSessionId: string, platformKey: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/service/platforms/{platform_key}/stripe/pricing-page-callback/{checkout_session_id}/', path: { 'checkout_session_id': checkoutSessionId, 'platform_key': platformKey, }, }); } /** * Create a uuid to track user-initiated pricing page checkouts. * * Works for both authenticated and unauthenticated (guest) users. * Accepts optional `redirect_url` and `source_platform_key` query params. * @returns StripePricingPageSessionResponse * @throws ApiError */ public static servicePlatformsStripePricingPageSessionRetrieve({ platformKey, }: { platformKey: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/service/platforms/{platform_key}/stripe/pricing-page-session/', path: { 'platform_key': platformKey, }, }); } /** * @returns any No response body * @throws ApiError */ public static serviceStripeCheckoutRetrieve({ checkoutUuid, }: { checkoutUuid: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/service/stripe/checkout/{checkout_uuid}/', path: { 'checkout_uuid': checkoutUuid, }, }); } /** * Stripe free trial checkout session. No user auth * * Request the following fields: * * - success_url * - cancel_url * - product * * Response: * { * "redirect_to": "https://checkout.stripe.com/xxx/xxxx/xxxx", * } * @returns StripeCheckoutSessionResponse * @throws ApiError */ public static serviceStripeCheckoutFreeTrialCreate({ requestBody, }: { requestBody: StripeCheckoutSessionResponse, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/service/stripe/checkout/free-trial/', body: requestBody, mediaType: 'application/json', }); } /** * Public GET endpoint that creates a Stripe checkout session and redirects to Stripe. * After checkout, routes through pricing-page-callback for tenant provisioning. * * URL: /api/service/stripe/checkout/redirect// * Query params: * - redirect_url (optional): Final destination after successful checkout + provisioning. * When omitted, the pricing-page-callback uses its default redirect. * - cancel_url (optional): Where to redirect if checkout is cancelled. * Defaults to the mentor AI portal. * @returns any No response body * @throws ApiError */ public static serviceStripeCheckoutRedirectRetrieve({ sku, }: { sku: string, }): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/service/stripe/checkout/redirect/{sku}/', path: { 'sku': sku, }, }); } /** * Stripe checkout session API View for new users (first-time subscription) * * Request the following fields: * * - user_id, username, or email (user identifier) * - tenant (tenant type to create after successful checkout) * - sku * - mode (choices: "subscription", "payment", "setup") * - success_url * - cancel_url * - period (optional): Billing period - "weekly", "monthly", or "yearly" (defaults to "monthly") * - skip_card (optional): Skip card collection for free plans * - is_free_trial (optional): Enable free trial mode * * Response: * { * "redirect_to": "https://checkout.stripe.com/xxx/xxxx/xxxx", * } * @returns StripeCheckoutSessionResponse * @throws ApiError */ public static serviceStripeNewUserCheckoutCreate({ requestBody, }: { requestBody: StripeCheckoutSessionRequest, }): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/service/stripe/new-user-checkout/', body: requestBody, mediaType: 'application/json', }); } /** * Check if a tenant with a given key, org, or name exists. * * At least one non-empty filter parameter (key, org, or name) is required. * @returns any No response body * @throws ApiError */ public static serviceTenantValidationCreate(): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/service/tenant/validation/', }); } /** * GET * Gets site hash_key from * or * Gets site_id form hash_key * @returns any No response body * @throws ApiError */ public static serviceTokenRetrieve(): CancelablePromise { return __request(OpenAPI, { method: 'GET', url: '/api/service/token/', }); } /** * Check if tenant exists or not * @returns any No response body * @throws ApiError */ public static serviceUserValidationCreate(): CancelablePromise { return __request(OpenAPI, { method: 'POST', url: '/api/service/user/validation/', }); } }