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

# Refund (and Cancel)

> Issues a refund for a specific transaction triggered by a chargeback alert. In the case of RDR, the refund has already occured so it will only be recorded in Paysight. This function also cancels the user subscription, even if the refund is unsuccessful or has been refunded previously.



## OpenAPI

````yaml /api-reference/mitigation-api/paysight_mitigation_api.yaml post /api/mitigation/refund
openapi: 3.0.0
info:
  title: Paysight Mitigation API
  version: 1.0.0
  description: >-
    API for handling mitigation-related customer service operations such as
    search and refund
servers:
  - url: https://test.paysight.io
    description: Test Server
security:
  - ApiKeyAuth: []
paths:
  /api/mitigation/refund:
    post:
      tags:
        - API for Chargeback Mitigation Providers
      summary: Refund (and Cancel)
      description: >-
        Issues a refund for a specific transaction triggered by a chargeback
        alert. In the case of RDR, the refund has already occured so it will
        only be recorded in Paysight. This function also cancels the user
        subscription, even if the refund is unsuccessful or has been refunded
        previously.
      parameters:
        - $ref: '#/components/parameters/ClientId'
        - $ref: '#/components/parameters/UserEmail'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefundRequest'
      responses:
        '200':
          description: Refund result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundResponse'
        '400':
          description: Invalid input
        '500':
          description: Internal server error
components:
  parameters:
    ClientId:
      name: ClientId
      in: header
      required: true
      description: >-
        Your Paysight Tenant/Client Id. This is the id of the parent company
        listed in https://app.paysight.io/management/companies. Alternatively,
        this will be provided by Paysight
      schema:
        type: string
    UserEmail:
      name: UserEmail
      in: header
      required: true
      description: The email address of the party or group making the request
      schema:
        type: string
  schemas:
    RefundRequest:
      type: object
      required:
        - transactionId
      description: Request payload for issuing a refund
      properties:
        transactionId:
          type: string
          description: Unique ID of the transaction to refund
          example: c0ffeec0-ffee-c0ff-eec0-ffeec0ffhec0
        amount:
          type: number
          description: Amount to refund
          example: 20
        refundItems:
          type: array
          description: >-
            List of items included in the refund - this is only required for
            partial refunds on ecom transactions. Otherwise omit.
          items:
            type: object
            properties:
              itemId:
                type: string
                description: Unique identifier of the item
                example: item123
              quantity:
                type: integer
                description: Quantity to refund
                example: 1
        sendUserCommunication:
          type: boolean
          description: Whether to send an email notification to the customer
          example: true
        alertSource:
          type: string
          description: Source of the alert triggering the refund
          enum:
            - Chargebacks911
            - AltoGlobal
            - ChargebacksHero
            - GoatMaverick
            - DisputeDotCom
            - Kount
            - ChargebackHelp
            - Disputifier
            - RCVR
          example: ChargebackHelp
        alertType:
          type: string
          description: Type of alert
          enum:
            - Ethoca
            - CDRN
            - RDR
          example: RDR
    RefundResponse:
      type: object
      description: >-
        Response payload returned after processing a refund. Note in the case of
        RDR, the refund will only be recorded as it is already completed.
      properties:
        success:
          type: boolean
          description: Indicates if the refund was successful
        message:
          type: string
          description: Message describing the result of the refund
        refundId:
          type: string
          description: Unique identifier for the processed refund
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Your Paysight API key

````