> ## 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.

# Verify Razorpay Subscription Authorization

> Verify the Razorpay Checkout signature for the subscription authorization payment before recording the authorization payment ID locally.



## OpenAPI

````yaml https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/payments.yaml post /api/payments/razorpay/{environment}/subscriptions/verify
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}/subscriptions/verify:
    post:
      tags:
        - Razorpay Payments
      summary: Verify Razorpay Subscription Authorization
      description: >-
        Verify the Razorpay Checkout signature for the subscription
        authorization payment before recording the authorization payment ID
        locally.
      parameters:
        - $ref: '#/components/parameters/EnvironmentPath'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VerifyRazorpaySubscriptionBody'
            example:
              subscriptionId: sub_123
              paymentId: pay_123
              signature: razorpay_signature
      responses:
        '200':
          description: Razorpay subscription authorization verified
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VerifyRazorpaySubscriptionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - bearerAuth: []
components:
  parameters:
    EnvironmentPath:
      name: environment
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/PaymentEnvironment'
      description: Payment provider environment.
  schemas:
    VerifyRazorpaySubscriptionBody:
      type: object
      required:
        - subscriptionId
        - paymentId
        - signature
      additionalProperties: false
      properties:
        subscriptionId:
          type: string
          minLength: 1
          example: sub_123
        paymentId:
          type: string
          minLength: 1
          example: pay_123
        signature:
          type: string
          minLength: 1
    VerifyRazorpaySubscriptionResponse:
      type: object
      required:
        - verified
        - subscription
      properties:
        verified:
          type: boolean
        subscription:
          $ref: '#/components/schemas/RazorpaySubscription'
    PaymentEnvironment:
      type: string
      enum:
        - test
        - live
    RazorpaySubscription:
      type: object
      required:
        - environment
        - subscriptionId
        - planId
        - customerId
        - subjectType
        - subjectId
        - status
        - currentStart
        - currentEnd
        - endedAt
        - quantity
        - chargeAt
        - startAt
        - endAt
        - totalCount
        - authAttempts
        - paidCount
        - remainingCount
        - shortUrl
        - hasScheduledChanges
        - changeScheduledAt
        - offerId
        - authorizationPaymentId
        - authorizationVerifiedAt
        - notes
        - providerCreatedAt
        - syncedAt
        - createdAt
        - updatedAt
      properties:
        environment:
          $ref: '#/components/schemas/RazorpayEnvironment'
        subscriptionId:
          type: string
          example: sub_123
        planId:
          type: string
          example: plan_123
        customerId:
          type: string
          nullable: true
          example: cust_123
        subjectType:
          type: string
          nullable: true
        subjectId:
          type: string
          nullable: true
        status:
          $ref: '#/components/schemas/RazorpaySubscriptionStatus'
        currentStart:
          type: string
          format: date-time
          nullable: true
        currentEnd:
          type: string
          format: date-time
          nullable: true
        endedAt:
          type: string
          format: date-time
          nullable: true
        quantity:
          type: integer
          nullable: true
        chargeAt:
          type: string
          format: date-time
          nullable: true
        startAt:
          type: string
          format: date-time
          nullable: true
        endAt:
          type: string
          format: date-time
          nullable: true
        totalCount:
          type: integer
          nullable: true
        authAttempts:
          type: integer
          nullable: true
        paidCount:
          type: integer
          nullable: true
        remainingCount:
          type: integer
          nullable: true
        shortUrl:
          type: string
          nullable: true
        hasScheduledChanges:
          type: boolean
        changeScheduledAt:
          type: string
          format: date-time
          nullable: true
        offerId:
          type: string
          nullable: true
        authorizationPaymentId:
          type: string
          nullable: true
          example: pay_123
        authorizationVerifiedAt:
          type: string
          format: date-time
          nullable: true
        notes:
          $ref: '#/components/schemas/Metadata'
        providerCreatedAt:
          type: string
          format: date-time
          nullable: true
        syncedAt:
          type: string
          format: date-time
        createdAt:
          type: string
          format: date-time
        updatedAt:
          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'
    RazorpaySubscriptionStatus:
      type: string
      enum:
        - created
        - authenticated
        - active
        - pending
        - halted
        - cancelled
        - completed
        - expired
        - paused
    Metadata:
      type: object
      additionalProperties:
        type: string
  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'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````