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

# Create Subscription Route



## OpenAPI

````yaml https://api.somya.ai/openapi.json post /v1/subscriptions
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers: []
security: []
paths:
  /v1/subscriptions:
    post:
      tags:
        - subscriptions
      summary: Create Subscription Route
      operationId: create_subscription_route_v1_subscriptions_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSubscriptionRequest'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSubscriptionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CreateSubscriptionRequest:
      properties:
        plan_id:
          type: string
          maxLength: 100
          minLength: 1
          title: Plan Id
      type: object
      required:
        - plan_id
      title: CreateSubscriptionRequest
    CreateSubscriptionResponse:
      properties:
        success:
          type: boolean
          title: Success
          default: true
        data:
          $ref: '#/components/schemas/CreateSubscriptionData'
      type: object
      required:
        - data
      title: CreateSubscriptionResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CreateSubscriptionData:
      properties:
        razorpay_order_id:
          type: string
          title: Razorpay Order Id
        amount:
          type: integer
          title: Amount
        currency:
          type: string
          title: Currency
        key_id:
          type: string
          title: Key Id
      type: object
      required:
        - razorpay_order_id
        - amount
        - currency
        - key_id
      title: CreateSubscriptionData
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````