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

# Subscribe to product plan

> Subscribe to a product plan



## OpenAPI

````yaml post /api/v2/product/subscribe
openapi: 3.0.0
info:
  version: 2.0.0
  title: Vida API
  description: Vida API Documentation
servers:
  - url: https://api.vida.dev
    description: Vida Production
    variables:
      baseUrl:
        default: api.vida.dev
        description: Production API Root
security: []
paths:
  /api/v2/product/subscribe:
    post:
      tags:
        - Billing
      summary: Subscribe to product plan
      description: Subscribe to a product plan
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - productPlanId
                - term
              properties:
                productPlanId:
                  description: Product Plan Id to enable subscription
                  type: string
                  example: pplan-vida-business-basic
                term:
                  description: Subscription length of month or year
                  type: string
                  example: month
                cancelUrl:
                  description: >-
                    If using external payment processor (eg Stripe) what url to
                    redirect if payment canceled
                  type: string
                  example: https://yoursite.io/cancel
                successUrl:
                  description: >-
                    If using external payment processor (eg Stripe) what url to
                    redirect if payment successful
                  type: string
                  example: https://yoursite.io/success
                checkoutType:
                  description: >-
                    Which checkout session you would like to start. Embedded
                    session or external redirect url
                  type: string
                  example: embedded
      responses:
        '200':
          description: Successfully subscribed
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Success
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
      security:
        - apiKeyAuth: []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: query
      name: token
      description: Vida API Token

````