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

# Get refund

> Use to inspect a single refund: its destination, settled amount and failure reason.



## OpenAPI

````yaml /api-reference/openapi.json get /refunds/{id}
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/{id}:
    get:
      tags:
        - Refunds
      summary: Get refund
      description: >-
        Use to inspect a single refund: its destination, settled amount and
        failure reason.
      operationId: getRefund
      parameters:
        - name: id
          in: path
          description: Refund ID
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
        '404':
          description: Resource not found
          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\"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.GetRefund(ctx, \"<id>\")\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.RefundResponse != 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.get_refund(id="<id>")

                # 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.getRefund("<id>");

              console.log(result);
            }

            run();
components:
  schemas:
    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
    errors.ErrorResponse:
      type: object
      properties:
        code:
          $ref: '#/components/schemas/errors.ErrorCode'
        http_status_code:
          type: integer
        message:
          type: string
      x-speakeasy-name-override: ErrorResponse
    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
    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
  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.