> ## 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 Order Payment

> Verify the Razorpay Checkout signature for an order payment before recording the verified payment ID locally.



## OpenAPI

````yaml https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/payments.yaml post /api/payments/razorpay/{environment}/orders/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}/orders/verify:
    post:
      tags:
        - Razorpay Payments
      summary: Verify Razorpay Order Payment
      description: >-
        Verify the Razorpay Checkout signature for an order payment before
        recording the verified payment ID locally.
      parameters:
        - $ref: '#/components/parameters/EnvironmentPath'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VerifyRazorpayOrderBody'
            example:
              orderId: order_123
              paymentId: pay_123
              signature: razorpay_signature
      responses:
        '200':
          description: Razorpay order payment verified
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VerifyRazorpayOrderResponse'
        '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:
    VerifyRazorpayOrderBody:
      type: object
      required:
        - orderId
        - paymentId
        - signature
      additionalProperties: false
      properties:
        orderId:
          type: string
          minLength: 1
          example: order_123
        paymentId:
          type: string
          minLength: 1
          example: pay_123
        signature:
          type: string
          minLength: 1
    VerifyRazorpayOrderResponse:
      type: object
      required:
        - verified
        - order
      properties:
        verified:
          type: boolean
        order:
          $ref: '#/components/schemas/RazorpayOrder'
    PaymentEnvironment:
      type: string
      enum:
        - test
        - live
    RazorpayOrder:
      type: object
      required:
        - id
        - environment
        - status
        - subjectType
        - subjectId
        - customerName
        - customerEmail
        - customerContact
        - orderId
        - receipt
        - amount
        - amountPaid
        - amountDue
        - currency
        - attempts
        - verifiedPaymentId
        - verifiedAt
        - notes
        - lastError
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
          format: uuid
        environment:
          $ref: '#/components/schemas/RazorpayEnvironment'
        status:
          $ref: '#/components/schemas/RazorpayOrderStatus'
        subjectType:
          type: string
          nullable: true
        subjectId:
          type: string
          nullable: true
        customerName:
          type: string
          nullable: true
        customerEmail:
          type: string
          format: email
          nullable: true
        customerContact:
          type: string
          nullable: true
        orderId:
          type: string
          nullable: true
          example: order_123
        receipt:
          type: string
          nullable: true
        amount:
          type: integer
          example: 50000
        amountPaid:
          type: integer
          nullable: true
        amountDue:
          type: integer
          nullable: true
        currency:
          type: string
          example: inr
        attempts:
          type: integer
          nullable: true
        verifiedPaymentId:
          type: string
          nullable: true
          example: pay_123
        verifiedAt:
          type: string
          format: date-time
          nullable: true
        notes:
          $ref: '#/components/schemas/Metadata'
        lastError:
          type: string
          nullable: true
        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'
    RazorpayOrderStatus:
      type: string
      enum:
        - initialized
        - created
        - attempted
        - paid
        - failed
    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

````