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

# Create Razorpay Plan

> Create a Razorpay Plan with its amount-bearing item definition, then mirror it locally after Razorpay succeeds.



## OpenAPI

````yaml https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/payments.yaml post /api/payments/razorpay/{environment}/catalog/plans
openapi: 3.0.3
info:
  title: Insforge Payments API
  version: 1.0.0
  description: >-
    Provider-specific Stripe and Razorpay payment setup, runtime flows, catalog
    management, sync, and webhook projections
servers: []
security: []
tags:
  - name: Stripe Payments
    description: >-
      Stripe Checkout, Billing Portal, catalog, sync, customer, subscription,
      and transaction routes
  - name: Razorpay Payments
    description: >-
      Razorpay Orders, Subscriptions, catalog, manual webhook setup, sync,
      customer, and transaction routes
  - name: Payment Webhooks
    description: Provider webhook ingestion routes
paths:
  /api/payments/razorpay/{environment}/catalog/plans:
    post:
      tags:
        - Razorpay Payments
      summary: Create Razorpay Plan
      description: >-
        Create a Razorpay Plan with its amount-bearing item definition, then
        mirror it locally after Razorpay succeeds.
      parameters:
        - $ref: '#/components/parameters/EnvironmentPath'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRazorpayPlanBody'
            example:
              period: monthly
              interval: 1
              item:
                name: Pro monthly
                amount: 199900
                currency: INR
      responses:
        '201':
          description: Razorpay plan created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MutateRazorpayPlanResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
      security:
        - bearerAuth: []
        - apiKey: []
components:
  parameters:
    EnvironmentPath:
      name: environment
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/PaymentEnvironment'
      description: Payment provider environment.
  schemas:
    CreateRazorpayPlanBody:
      type: object
      required:
        - period
        - interval
        - item
      additionalProperties: false
      description: Notes keys starting with insforge_ are reserved and rejected.
      properties:
        period:
          type: string
          enum:
            - daily
            - weekly
            - monthly
            - yearly
        interval:
          type: integer
          minimum: 1
        item:
          type: object
          required:
            - name
            - amount
            - currency
          additionalProperties: false
          properties:
            name:
              type: string
              minLength: 1
              maxLength: 255
            description:
              type: string
              nullable: true
              maxLength: 2048
            amount:
              type: integer
              minimum: 1
            currency:
              type: string
              minLength: 3
              maxLength: 3
              example: INR
        notes:
          $ref: '#/components/schemas/Metadata'
    MutateRazorpayPlanResponse:
      type: object
      required:
        - plan
      properties:
        plan:
          $ref: '#/components/schemas/RazorpayPlan'
    PaymentEnvironment:
      type: string
      enum:
        - test
        - live
    Metadata:
      type: object
      additionalProperties:
        type: string
    RazorpayPlan:
      type: object
      required:
        - environment
        - planId
        - itemId
        - period
        - interval
        - amount
        - unitAmount
        - currency
        - active
        - notes
        - providerCreatedAt
        - syncedAt
      properties:
        environment:
          $ref: '#/components/schemas/RazorpayEnvironment'
        planId:
          type: string
          example: plan_123
        itemId:
          type: string
          example: item_123
        period:
          type: string
          enum:
            - daily
            - weekly
            - monthly
            - yearly
          example: monthly
        interval:
          type: integer
          example: 1
        amount:
          type: integer
          nullable: true
          example: 290000
        unitAmount:
          type: integer
          nullable: true
          description: Razorpay nested item per-unit amount mirror. Usually equals amount.
          example: 290000
        currency:
          type: string
          example: inr
        active:
          type: boolean
        notes:
          $ref: '#/components/schemas/Metadata'
        providerCreatedAt:
          type: string
          format: date-time
          nullable: true
        syncedAt:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      required:
        - error
        - message
        - statusCode
      properties:
        error:
          type: string
          example: INVALID_INPUT
        message:
          type: string
          example: 'environment: Invalid enum value'
        statusCode:
          type: integer
          example: 400
        nextActions:
          type: string
          nullable: true
    RazorpayEnvironment:
      $ref: '#/components/schemas/PaymentEnvironment'
  responses:
    BadRequest:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````