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

# List refunds

> Use to see where refunded money actually went and whether it has settled. Filter by invoice_ids to get every settlement row for one invoice.



## OpenAPI

````yaml /api-reference/openapi.json get /refunds
openapi: 3.0.1
info:
  title: Tirdad API
  description: Tirdad API Service
  contact:
    name: API Support
  version: '1.0'
servers:
  - url: https://api.tirdad.ai/v1
    description: Tirdad API
security: []
paths:
  /refunds:
    get:
      tags:
        - Refunds
      summary: List refunds
      description: >-
        Use to see where refunded money actually went and whether it has
        settled. Filter by invoice_ids to get every settlement row for one
        invoice.
      operationId: listRefunds
      parameters:
        - name: invoice_ids
          in: query
          description: Filter by invoice IDs
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
        - name: payment_ids
          in: query
          description: Filter by payment IDs
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
        - name: credit_note_ids
          in: query
          description: Filter by credit note IDs
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
        - name: refund_statuses
          in: query
          description: Filter by refund status
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
        - name: refund_destinations
          in: query
          description: Filter by refund destination
          style: form
          explode: false
          schema:
            type: array
            items:
              type: string
        - name: gateway
          in: query
          description: Filter by payment gateway
          schema:
            type: string
        - name: only_settled
          in: query
          description: Only refunds that have settled
          schema:
            type: boolean
        - name: limit
          in: query
          description: Limit
          schema:
            type: integer
        - name: offset
          in: query
          description: Offset
          schema:
            type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListRefundsResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: go
          label: Go
          source: "package main\n\nimport(\n\t\"context\"\n\ttirdad \"github.com/tirdad-billing/go-sdk/v2\"\n\t\"github.com/tirdad-billing/go-sdk/v2/models/dtos\"\n\t\"log\"\n)\n\nfunc main() {\n    ctx := context.Background()\n\n    s := tirdad.New(\n        tirdad.WithSecurity(\"<YOUR_API_KEY_HERE>\"),\n    )\n\n    res, err := s.Refunds.ListRefunds(ctx, dtos.ListRefundsRequest{})\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.ListRefundsResponse != nil {\n        // handle response\n    }\n}"
        - lang: python
          label: Python
          source: |-
            from tirdad_sdk import Tirdad


            with Tirdad(
                api_key_auth="<YOUR_API_KEY_HERE>",
            ) as f_client:

                res = f_client.refunds.list_refunds()

                # Handle response
                print(res)
        - lang: typescript
          label: TypeScript
          source: |-
            import { Tirdad } from "@tirdad/sdk";

            const tirdad = new Tirdad({
              apiKeyAuth: "<YOUR_API_KEY_HERE>",
            });

            async function run() {
              const result = await tirdad.refunds.listRefunds();

              console.log(result);
            }

            run();
components:
  schemas:
    ListRefundsResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/RefundResponse'
        pagination:
          $ref: '#/components/schemas/types.PaginationResponse'
    errors.ErrorResponse:
      type: object
      properties:
        code:
          $ref: '#/components/schemas/errors.ErrorCode'
        http_status_code:
          type: integer
        message:
          type: string
      x-speakeasy-name-override: ErrorResponse
    RefundResponse:
      type: object
      properties:
        amount:
          type: string
        attempt:
          type: integer
        cancelled_at:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
        created_by:
          type: string
        credit_note_id:
          type: string
        currency:
          type: string
        environment_id:
          type: string
        failed_at:
          type: string
          format: date-time
        failure_reason:
          type: string
        gateway_idempotency_token:
          type: string
        gateway_metadata:
          type: object
          additionalProperties: true
        gateway_refund_id:
          type: string
        gateway_tracking_id:
          type: string
        id:
          type: string
        idempotency_key:
          type: string
        initiated_at:
          type: string
          format: date-time
        invoice_id:
          type: string
        metadata:
          $ref: '#/components/schemas/types.Metadata'
        payment_gateway:
          type: string
        payment_id:
          type: string
        refund_destination:
          $ref: '#/components/schemas/types.RefundDestination'
        refund_destination_id:
          type: string
        refund_reason:
          $ref: '#/components/schemas/types.RefundReason'
        refund_status:
          $ref: '#/components/schemas/types.RefundStatus'
        settled_amount:
          type: string
        status:
          $ref: '#/components/schemas/types.Status'
        succeeded_at:
          type: string
          format: date-time
        tenant_id:
          type: string
        updated_at:
          type: string
          format: date-time
        updated_by:
          type: string
    types.PaginationResponse:
      type: object
      properties:
        limit:
          type: integer
        offset:
          type: integer
        total:
          type: integer
      x-speakeasy-name-override: PaginationResponse
    errors.ErrorCode:
      type: string
      enum:
        - http_client_error
        - system_error
        - internal_error
        - not_found
        - already_exists
        - version_conflict
        - validation_error
        - invalid_operation
        - permission_denied
        - database_error
        - service_unavailable
        - too_many_requests
        - not_implemented
      x-enum-varnames:
        - ErrCodeHTTPClient
        - ErrCodeSystemError
        - ErrCodeInternalError
        - ErrCodeNotFound
        - ErrCodeAlreadyExists
        - ErrCodeVersionConflict
        - ErrCodeValidation
        - ErrCodeInvalidOperation
        - ErrCodePermissionDenied
        - ErrCodeDatabase
        - ErrCodeServiceUnavailable
        - ErrCodeTooManyRequests
        - ErrCodeNotImplemented
      x-speakeasy-name-override: ErrorCode
    types.Metadata:
      type: object
      additionalProperties:
        type: string
      x-speakeasy-name-override: Metadata
    types.RefundDestination:
      type: string
      enum:
        - GATEWAY
        - WALLET
        - OUT_OF_BAND
      x-enum-varnames:
        - RefundDestinationGateway
        - RefundDestinationWallet
        - RefundDestinationOutOfBand
      x-speakeasy-name-override: RefundDestination
    types.RefundReason:
      type: string
      enum:
        - DUPLICATE
        - FRAUDULENT
        - REQUESTED_BY_CUSTOMER
        - ORDER_CHANGE
        - SERVICE_ISSUE
        - OTHER
      x-enum-varnames:
        - RefundReasonDuplicate
        - RefundReasonFraudulent
        - RefundReasonRequestedByCustomer
        - RefundReasonOrderChange
        - RefundReasonServiceIssue
        - RefundReasonOther
      x-speakeasy-name-override: RefundReason
    types.RefundStatus:
      type: string
      enum:
        - PENDING
        - PROCESSING
        - SUCCEEDED
        - FAILED
        - CANCELLED
      x-enum-varnames:
        - RefundStatusPending
        - RefundStatusProcessing
        - RefundStatusSucceeded
        - RefundStatusFailed
        - RefundStatusCancelled
      x-speakeasy-name-override: RefundStatus
    types.Status:
      type: string
      enum:
        - published
        - deleted
        - archived
      x-enum-varnames:
        - StatusPublished
        - StatusDeleted
        - StatusArchived
      x-speakeasy-name-override: Status
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      description: Enter your API key in the format *x-api-key &lt;api-key&gt;**
      name: x-api-key
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.