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

# Create Subscription Refund

> Use this API to create a refund for the payment of a Subscription. Only one of paymentId or merchantTxnId should be passed. If both are passed then the request will be rejected.



## OpenAPI

````yaml post /api/v2/subscriptions/create-refund
openapi: 3.0.0
info:
  title: Cashfree Subscription API
  description: >-
    Create and manage subscriptions and collect recurring payments from
    customers easily with Cashfree Subscriptions.
  version: v2
servers:
  - url: https://sandbox.cashfree.com
    description: Sandbox server
  - url: https://api.cashfree.com
    description: Production server
security: []
externalDocs:
  url: https://docs.cashfree.com/reference/postman-collection-1
  description: This url will have the information of all the APIs.
paths:
  /api/v2/subscriptions/create-refund:
    post:
      tags:
        - Subscription Refund
      summary: Create Subscription Refund
      description: >-
        Use this API to create a refund for the payment of a Subscription. Only
        one of paymentId or merchantTxnId should be passed. If both are passed
        then the request will be rejected.
      operationId: createSubscriptionRefund
      parameters:
        - name: X-Client-Id
          in: header
          required: true
          schema:
            type: string
            description: Client ID provided by Cashfree.
            example: asdf1234
        - name: X-Client-Secret
          in: header
          required: true
          schema:
            type: string
            description: Client Secret provided by Cashfree.
            example: qwer9876
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                paymentId:
                  type: string
                  description: Payment ID for which the refund is to be created.
                  example: '1223'
                refundAmount:
                  type: number
                  description: Amount to be refunded.
                  example: 100
                refundNote:
                  type: string
                  description: Note associated with the refund.
                  example: Charge refund
                merchantRefundId:
                  type: string
                  description: Unique ID for the merchant's refund request.
                  example: test-refund
                requestedSpeed:
                  type: string
                  description: >-
                    The requested speed for processing the refund (e.g.,
                    STANDARD).
                  example: STANDARD
            examples:
              Create Refund Request:
                value:
                  paymentId: '1223'
                  refundAmount: 100
                  refundNote: Charge refund
                  merchantRefundId: test-refund
                  requestedSpeed: STANDARD
      responses:
        '200':
          description: Successful creation of the refund.
          content:
            application/json:
              examples:
                Create Refund:
                  value:
                    subRefundId: SUB_76d688d5-cbcc-49ea-960b-21b11433b641
                    merchantRefundId: test-refund
                    paymentId: 1223
                    subReferenceId: 191645
                    refundAmount: 100
                    refundStatus: INITIALIZED
        '400':
          description: Bad request due to invalid parameters or other issues.
          content:
            application/json:
              examples:
                Create Refund Error:
                  value:
                    subRefundId: SUB_76d688d5-cbcc-49ea-960b-21b11433b641
                    merchantRefundId: test-refund
                    paymentId: 1223
                    subReferenceId: 191645
                    refundAmount: 100
                    refundStatus: INITIALIZED
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: Status of the API call.
                    example: ERROR
                  message:
                    type: string
                    description: Error message.
                    example: Server encountered an unexpected condition.

````