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

# Refund Transaction

> Processes a refund for a transaction based on the provided data.



## OpenAPI

````yaml https://app.dimepayments.com/openapi.yaml post /api/transaction/refund
openapi: 3.0.3
info:
  title: Dime Payments API Documentation
  description: >-
    A simple, basic API for managing Merchants through Dime Payments. JSON based
    REST API
  version: 1.0.0
servers:
  - url: https://app.dimepayments.com
security:
  - default: []
tags:
  - name: Merchant management
    description: ''
  - name: Transaction management
    description: >-

      APIs for managing transactions.  Depending on API KEY permissions, one
      should be able to

      charge credit cards, ACH, Google/Apple Pay wallets along with other
      functions.
  - name: Addresses
    description: |-

      APIs for managing customer addresses
  - name: Customer management
    description: >-

      APIs for managing customers.  Depending on API KEY permissions, one should
      be able to

      list, create, update, and delete customers along with several other
      customer specific requests.
  - name: Deposit management
    description: ''
  - name: Invoice management
    description: >-

      APIs for managing invoices. Depending on API KEY permissions, one should
      be

      able to list, create, update, delete, and send invoices, manage their line

      items, and manage recurring-invoice schedules. Every request is scoped to
      a

      single Merchant via the required `data.sid`.
  - name: Payment Method management
    description: >-

      APIs for managing payment methods associated with customers.  Depending on
      API KEY permissions, one should be able to

      list, show, create, update, and delete payment methods.
  - name: Recurring Payments management
    description: >-

      APIs for managing recurring payments.  Depending on API KEY permissions,
      one should be able to

      create, edit, pause, cancel along with other functions.
  - name: Zapier
    description: >-

      APIs for use through Zapier.  Depending on API KEY permissions, one should
      be able to

      see customers and transactions data.
paths:
  /api/transaction/refund:
    post:
      tags:
        - Transaction management
      summary: Refund Transaction
      description: Processes a refund for a transaction based on the provided data.
      operationId: refundTransaction
      parameters: []
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  type: object
                  description: ''
                  example: []
                  properties:
                    sid:
                      type: number
                      description: The ID of merchant that processed the transaction.
                      example: 1234567
                    amount:
                      type: number
                      description: >-
                        The amount to be refunded. Must be greater than 0 and
                        less than the total amount of transaction.
                      example: 100.5
                    transaction_info_id:
                      type: number
                      description: >-
                        The transaction info id which is unique only against the
                        SID of the merchant, and ties across all other reporting
                        objects such as transactions.
                      example: 6789131231
                    transaction_type:
                      type: string
                      description: >-
                        Only required if not passing transaction_info_id. The
                        transaction type which should be either CC or ACH.
                      example: CC
                    transaction_id:
                      type: number
                      description: >-
                        Only required if not passing transaction_info_id. For
                        credit card transactions this is the gateway transaction
                        id, and for ach transactions this is the att number.
                      example: 6789131231
                  required:
                    - sid
                    - amount
                    - transaction_info_id
                    - transaction_type
                    - transaction_id
      responses:
        '200':
          description: Successful Refund
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    message: refund
                properties:
                  data:
                    type: object
                    properties:
                      message:
                        type: string
                        example: refund
                        description: 'The message returned from the refund. Example: refund'
        '400':
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  - description: ''
                    type: object
                    example:
                      errors:
                        data.sid:
                          - The sid field is required.
                        data.transaction_info_id:
                          - The selected transaction_info_id is invalid.
                    properties:
                      errors:
                        type: object
                        properties:
                          data.sid:
                            type: array
                            example:
                              - The sid field is required.
                            items:
                              type: string
                          data.transaction_info_id:
                            type: array
                            example:
                              - The selected transaction_info_id is invalid.
                            items:
                              type: string
                  - description: ''
                    type: object
                    example:
                      data:
                        message: No such Merchant
                    properties:
                      data:
                        type: object
                        properties:
                          message:
                            type: string
                            example: No such Merchant
                            description: >-
                              The message returned from the refund. Example:
                              refund
                  - description: ''
                    type: object
                    example:
                      data:
                        message: Error processing refund
                    properties:
                      data:
                        type: object
                        properties:
                          message:
                            type: string
                            example: Error processing refund
                            description: >-
                              The message returned from the refund. Example:
                              refund
                  - description: ''
                    type: object
                    example:
                      data:
                        message: Unsupported processor.
                    properties:
                      data:
                        type: object
                        properties:
                          message:
                            type: string
                            example: Unsupported processor.
                            description: >-
                              The message returned from the refund. Example:
                              refund
        '401':
          description: Bad API Key Permission
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    message: Permission Denied.
                properties:
                  data:
                    type: object
                    properties:
                      message:
                        type: string
                        example: Permission Denied.
                        description: 'The message returned from the refund. Example: refund'
components:
  securitySchemes:
    default:
      type: http
      scheme: bearer
      description: >-
        You can retrieve your token by visiting your dashboard and clicking
        <b>Generate API token under your profile in top right</b>.

````