> ## Documentation Index
> Fetch the complete documentation index at: https://razorpay-60c89f9a-mintlify-audit-missing-sections-1778528421.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Refund

> Initiates a refund against a captured payment. If `amount` is not specified, the full payment amount is refunded. You can issue multiple partial refunds as long as the total does not exceed the captured amount.



## OpenAPI

````yaml /openapi/core.json post /payments/{id}/refund
openapi: 3.1.0
info:
  title: Razorpay Core Resources API
  description: >-
    The Razorpay Core Resources API provides endpoints for managing Orders,
    Payments, Refunds, and Settlements. Use HTTP Basic Auth with your Key ID as
    the username and Key Secret as the password.
  version: 1.0.0
  contact:
    name: Razorpay Support
    url: https://razorpay.com/support
servers:
  - url: https://api.razorpay.com/v1
    description: Razorpay Production API
security:
  - basicAuth: []
tags:
  - name: Orders
    description: >-
      Orders represent payment intents. Create an order before accepting a
      payment from a customer.
  - name: Payments
    description: >-
      Payments represent individual payment transactions. Fetch, list, and
      capture payments.
  - name: Refunds
    description: >-
      Refunds represent the reversal of a payment back to the customer. Initiate
      full or partial refunds against captured payments.
  - name: Settlements
    description: >-
      Settlements represent the transfer of funds collected from payments to
      your registered bank account.
paths:
  /payments/{id}/refund:
    post:
      tags:
        - Refunds
      summary: Create a Refund
      description: >-
        Initiates a refund against a captured payment. If `amount` is not
        specified, the full payment amount is refunded. You can issue multiple
        partial refunds as long as the total does not exceed the captured
        amount.
      operationId: createRefund
      parameters:
        - name: id
          in: path
          required: true
          description: The unique identifier of the captured payment to refund.
          schema:
            type: string
            example: pay_DJkTfWoJ5ZFPce
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefundCreateRequest'
            example:
              amount: 50000
              speed: normal
              notes:
                reason: Customer request
              receipt: receipt_refund_1001
      responses:
        '200':
          description: The refund was successfully initiated. Returns the refund object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Refund'
              example:
                id: rfnd_FP8QHiV938haTz
                entity: refund
                amount: 50000
                currency: INR
                payment_id: pay_DJkTfWoJ5ZFPce
                status: processed
                speed_processed: normal
                receipt: receipt_refund_1001
                notes:
                  reason: Customer request
                created_at: 1595491208
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
components:
  schemas:
    RefundCreateRequest:
      type: object
      description: >-
        Request body for creating a refund against a payment. If `amount` is
        omitted, a full refund is initiated.
      properties:
        amount:
          type: integer
          description: >-
            The amount to refund, in the smallest currency sub-unit. If not
            provided, the full payment amount is refunded. Must not exceed the
            captured payment amount.
          example: 50000
        speed:
          type: string
          description: >-
            The processing speed for the refund. `normal` takes 5-7 business
            days; `optimum` processes instantly where supported, falling back to
            `normal` otherwise.
          enum:
            - normal
            - optimum
          example: normal
        notes:
          type: object
          description: A key-value store of custom metadata to attach to the refund.
          additionalProperties:
            type: string
          example:
            reason: Customer request
        receipt:
          type: string
          description: A unique receipt number for the refund, for your internal reference.
          example: receipt_refund_1001
    Refund:
      type: object
      description: A Razorpay Refund object representing a refund transaction.
      properties:
        id:
          type: string
          description: Unique identifier for the refund.
          example: rfnd_FP8QHiV938haTz
        entity:
          type: string
          description: Entity type, always `refund` for refund objects.
          example: refund
        amount:
          type: integer
          description: >-
            The refund amount in the smallest currency sub-unit (e.g., paise for
            INR).
          example: 50000
        currency:
          type: string
          description: The ISO 4217 currency code for the refund.
          example: INR
        payment_id:
          type: string
          description: >-
            The unique identifier of the payment against which the refund was
            initiated.
          example: pay_DJkTfWoJ5ZFPce
        status:
          type: string
          description: The current status of the refund.
          enum:
            - pending
            - processed
            - failed
          example: processed
        speed_processed:
          type: string
          description: >-
            The processing speed at which the refund was processed. `normal`
            refunds are processed within 5-7 business days; `optimum` refunds
            are processed instantly where supported.
          example: normal
        receipt:
          type: string
          description: A unique receipt number for the refund, for your internal reference.
          example: receipt_refund_1001
        notes:
          type: object
          description: A key-value store of custom metadata attached to the refund.
          additionalProperties:
            type: string
          example:
            reason: Customer request
        created_at:
          type: integer
          description: Unix timestamp (in seconds) at which the refund was created.
          example: 1595491208
    ErrorResponse:
      type: object
      description: An error response returned by the API.
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: A machine-readable error code.
              example: BAD_REQUEST_ERROR
            description:
              type: string
              description: A human-readable description of the error.
              example: The amount must be at least 100 paise.
            source:
              type: string
              description: The source of the error (e.g., `business` or `customer`).
              example: business
            step:
              type: string
              description: The step at which the error occurred.
              example: payment_initiation
            reason:
              type: string
              description: A brief reason for the error.
              example: input_validation_failed
            metadata:
              type: object
              description: Additional metadata about the error.
              additionalProperties: true
  responses:
    BadRequestError:
      description: The request was invalid or contained incorrect parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    UnauthorizedError:
      description: Authentication credentials are missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFoundError:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: Use your Razorpay Key ID as the username and Key Secret as the password.

````