> ## Documentation Index
> Fetch the complete documentation index at: https://altostrat.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Check trial eligibility

> Checks if a workspace is eligible for a 14-day free trial. A workspace is eligible if it has only one billing account and no existing subscriptions.



## OpenAPI

````yaml /api/en/workspaces.yaml get /workspaces/{workspaceId}/billing-accounts/{billingAccountId}/trial-eligibility
openapi: 3.0.3
info:
  title: Altostrat Workspaces API
  version: 1.0.0
  description: >-
    The Altostrat Workspaces API is the microservice responsible for tenancy,
    billing, user identity, and organizational hierarchy.

    It serves as the foundational layer for all multi-tenancy and subscription
    logic within the Altostrat SDX platform, enabling the secure separation of
    customer data and resources for SD-WAN, network automation, and agentic AI
    features.

    This API allows you to programmatically manage:

    - **Workspaces:** The top-level containers for all tenant resources, users,
    and billing configurations.

    - **Organizations:** Hierarchical entities used to model customer tenants or
    business units, track resource usage, and apply limits.

    - **Billing & Subscriptions:** The financial accounts and Stripe-powered
    subscriptions that govern access to Altostrat SDX features and resources.

    - **Members & Access:** The users and their specific roles (Owner, Admin,
    Viewer) within a workspace.

    Developers use this API to build the structural foundation and manage the
    billing lifecycle upon which all other Altostrat SDX automation and AI
    features operate.
servers:
  - url: https://v1.api.altostrat.io
    description: Production API Server
security:
  - bearerAuth: []
tags:
  - name: Workspaces
    description: Manage workspaces, the top-level containers for all resources.
  - name: Workspace Members
    description: Manage user access and roles within a workspace.
  - name: Organizations
    description: Manage hierarchical organizations for tenancy and resource segmentation.
  - name: Billing Accounts
    description: Manage financial accounts linked to Stripe for billing and subscriptions.
  - name: Subscriptions
    description: Manage product subscriptions powered by Stripe.
  - name: Invoices
    description: Retrieve invoice history and preview upcoming billing changes.
  - name: Payment Methods
    description: Manage customer payment methods for subscriptions.
  - name: Public
    description: Unauthenticated endpoints for retrieving public organization information.
paths:
  /workspaces/{workspaceId}/billing-accounts/{billingAccountId}/trial-eligibility:
    get:
      tags:
        - Subscriptions
      summary: Check trial eligibility
      description: >-
        Checks if a workspace is eligible for a 14-day free trial. A workspace
        is eligible if it has only one billing account and no existing
        subscriptions.
      parameters:
        - $ref: '#/components/parameters/WorkspaceId'
        - $ref: '#/components/parameters/BillingAccountId'
      responses:
        '200':
          description: Trial eligibility status.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrialEligibilityResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    WorkspaceId:
      name: workspaceId
      in: path
      required: true
      description: The ID of the workspace.
      schema:
        type: string
        example: ws_a1b2c3d4e5f6g7h8
    BillingAccountId:
      name: billingAccountId
      in: path
      required: true
      description: >-
        The ID of the billing account, which corresponds to a Stripe Customer ID
        (`cus_...`).
      schema:
        type: string
        example: cus_a1b2c3d4e5f6g7h8
  schemas:
    TrialEligibilityResponse:
      type: object
      properties:
        trial_eligible:
          type: boolean
          description: Whether the workspace qualifies for a new trial subscription.
          example: true
        has_payment_method:
          type: boolean
          description: Whether the billing account has a default payment method on file.
          example: false
        can_create_subscription:
          type: boolean
          description: >-
            A convenient flag indicating if a new subscription can be created
            (either trial eligible or has a payment method).
          example: true
        trial_info:
          type: object
          properties:
            trial_days:
              type: integer
              description: The length of the trial period in days, if eligible.
              example: 14
            message:
              type: string
              example: >-
                This workspace qualifies for a 14-day free trial because it has
                only one billing account with no existing subscriptions.
        requirements:
          type: object
          description: >-
            An object detailing what is needed to create a subscription if
            `can_create_subscription` is false.
          example:
            add_payment_method: >-
              A default payment method must be added before creating
              subscriptions.
  responses:
    Unauthorized:
      description: >-
        Unauthorized - The request was not authenticated. Ensure you have
        provided a valid Bearer token in the Authorization header.
    Forbidden:
      description: >-
        Forbidden - The authenticated user does not have permission to perform
        this action.
    NotFound:
      description: Not Found - The requested resource could not be found.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Enter your JWT in the format: Bearer {token}'

````