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

> Refund a customer



## OpenAPI

````yaml /api-reference/customer-service-api/paysight_customer_service_api.yaml post /refund
openapi: 3.0.0
info:
  title: Paysight Customer Service API
  description: Customer Service API for searching transations, refunding etc
  version: 1.0.0
  contact:
    email: tech@paysight.io
servers:
  - description: Paysight Cards API
    url: https://test.paysight.io/customerapi/
security:
  - ApiKeyAuth: []
paths:
  /refund:
    post:
      summary: Refund
      description: Refund a customer
      parameters:
        - $ref: '#/components/parameters/ClientId'
        - $ref: '#/components/parameters/UserEmail'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefundRequest'
        description: Payload
      responses:
        '200':
          description: Valid Request. More detailed info will be in the JSON body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundResponse'
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:
        - parentCompanyId
        - userEmail
        - messageId
        - sendUserCommunication
      properties:
        parentCompanyId:
          type: integer
          example: 1
          description: Your Paysight tenant id. This will be provided by Paysight.
        userEmail:
          type: string
          format: email
          description: An email associated with the party/agent making the request
          example: care@yourdomain.com
        messageId:
          type: string
          format: uuid
          example: fd6562a1-e0e7-4b8b-b0d4-f20359482dd1
          description: The unique Paysight transaction id
        amount:
          type: number
          description: >-
            The amount to refund in the original transaction currency. 0 will
            result in a full refund. Any amount greater than the transaction
            amount will be rejected. Any partial refund amount for an eCom order
            must be accompanied by a complete list of refundItems.
          example: 12.99
        refundItems:
          type: array
          description: To be defined (applicable only to ecom transactions)
          example: []
          items:
            type: integer
        sendUserCommunication:
          type: boolean
          description: >-
            If true, then Paysight will send a confirmation to the user's email
            address (if mail settings are set up)
          example: false
    RefundResponse:
      type: object
      required:
        - success
      properties:
        success:
          type: boolean
          description: Indicates if refund transaction was successful
          example: true
        message:
          type: string
          example: ''
          description: Debug information
        refundId:
          type: string
          format: uuid
          example: da6562a1-e0e7-4b8b-c0d4-g20359482dd1
          description: The unique Paysight transaction id for the refund
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Your Paysight API key. You can find it in your Paysight account at
        https://app.paysight.io/settings/account

````