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

# Receive Razorpay Webhook

> Receive Razorpay events for one environment. The request body must be the raw Razorpay JSON body and must include the Razorpay signature header.



## OpenAPI

````yaml https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/payments.yaml post /api/webhooks/razorpay/{environment}
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/webhooks/razorpay/{environment}:
    post:
      tags:
        - Payment Webhooks
      summary: Receive Razorpay Webhook
      description: >-
        Receive Razorpay events for one environment. The request body must be
        the raw Razorpay JSON body and must include the Razorpay signature
        header.
      parameters:
        - $ref: '#/components/parameters/EnvironmentPath'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: true
      responses:
        '200':
          description: Webhook received
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RazorpayWebhookResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - razorpaySignature: []
components:
  parameters:
    EnvironmentPath:
      name: environment
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/PaymentEnvironment'
      description: Payment provider environment.
  schemas:
    RazorpayWebhookResponse:
      type: object
      required:
        - received
        - handled
      properties:
        received:
          type: boolean
        handled:
          type: boolean
    PaymentEnvironment:
      type: string
      enum:
        - test
        - live
    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
  responses:
    BadRequest:
      description: Invalid request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    razorpaySignature:
      type: apiKey
      in: header
      name: x-razorpay-signature

````