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

# refund.failed

> Fired when a refund fails. A gateway refund that fails is retried into the customer's wallet. Doc-only for parsing.



## OpenAPI

````yaml /api-reference/openapi.json post /webhook-events/refund.failed
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:
  /webhook-events/refund.failed:
    post:
      tags:
        - Webhook Events
      summary: refund.failed
      description: >-
        Fired when a refund fails. A gateway refund that fails is retried into
        the customer's wallet. Doc-only for parsing.
      responses:
        '200':
          description: Webhook payload
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/webhookDto.RefundWebhookPayload'
      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.WebhookEvents.PostWebhookEventsRefundFailed(ctx)\n    if err != nil {\n        log.Fatal(err)\n    }\n    if res.WebhookDtoRefundWebhookPayload != 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.webhook_events.post_webhook_events_refund_failed()

                # 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.webhookEvents.postWebhookEventsRefundFailed();

              console.log(result);
            }

            run();
components:
  schemas:
    webhookDto.RefundWebhookPayload:
      type: object
      properties:
        event_type:
          $ref: '#/components/schemas/types.WebhookEventName'
        refund:
          $ref: '#/components/schemas/webhookDto.Refund'
    types.WebhookEventName:
      type: string
      enum:
        - subscription.created
        - subscription.draft.created
        - subscription.activated
        - subscription.updated
        - subscription.paused
        - subscription.cancelled
        - subscription.resumed
        - subscription.plan_changed
        - subscription.phase.created
        - subscription.phase.updated
        - subscription.phase.deleted
        - feature.created
        - feature.updated
        - feature.deleted
        - feature.wallet_balance.alert
        - entitlement.created
        - entitlement.updated
        - entitlement.deleted
        - wallet.created
        - wallet.updated
        - wallet.terminated
        - wallet.transaction.created
        - wallet.transaction.updated
        - payment.created
        - payment.updated
        - payment.failed
        - payment.success
        - payment.pending
        - refund.created
        - refund.succeeded
        - refund.failed
        - customer.created
        - customer.updated
        - customer.deleted
        - invoice.update.finalized
        - invoice.update.payment
        - invoice.update.voided
        - invoice.update
        - invoice.payment.overdue
        - invoice.sync.success
        - invoice.sync.failed
        - wallet.credit_balance.dropped
        - wallet.credit_balance.recovered
        - wallet.ongoing_balance.dropped
        - wallet.ongoing_balance.recovered
        - wallet.ongoing_balance.updated
        - subscription.spend.threshold_reached
        - subscription.spend.threshold_recovered
        - subscription.line_item_spend.threshold_reached
        - subscription.line_item_spend.threshold_recovered
        - subscription.group_spend.threshold_reached
        - subscription.group_spend.threshold_recovered
        - entitlement.grant.exhausted
        - subscription.renewal.due
        - invoice.communication.triggered
        - credit_note.created
        - credit_note.updated
        - checkout.session.initiated
        - checkout.session.completed
        - checkout.session.failed
        - checkout.session.expired
        - event.rejected
      x-enum-varnames:
        - WebhookEventSubscriptionCreated
        - WebhookEventSubscriptionDraftCreated
        - WebhookEventSubscriptionActivated
        - WebhookEventSubscriptionUpdated
        - WebhookEventSubscriptionPaused
        - WebhookEventSubscriptionCancelled
        - WebhookEventSubscriptionResumed
        - WebhookEventSubscriptionPlanChanged
        - WebhookEventSubscriptionPhaseCreated
        - WebhookEventSubscriptionPhaseUpdated
        - WebhookEventSubscriptionPhaseDeleted
        - WebhookEventFeatureCreated
        - WebhookEventFeatureUpdated
        - WebhookEventFeatureDeleted
        - WebhookEventFeatureWalletBalanceAlert
        - WebhookEventEntitlementCreated
        - WebhookEventEntitlementUpdated
        - WebhookEventEntitlementDeleted
        - WebhookEventWalletCreated
        - WebhookEventWalletUpdated
        - WebhookEventWalletTerminated
        - WebhookEventWalletTransactionCreated
        - WebhookEventWalletTransactionUpdated
        - WebhookEventPaymentCreated
        - WebhookEventPaymentUpdated
        - WebhookEventPaymentFailed
        - WebhookEventPaymentSuccess
        - WebhookEventPaymentPending
        - WebhookEventRefundCreated
        - WebhookEventRefundSucceeded
        - WebhookEventRefundFailed
        - WebhookEventCustomerCreated
        - WebhookEventCustomerUpdated
        - WebhookEventCustomerDeleted
        - WebhookEventInvoiceUpdateFinalized
        - WebhookEventInvoiceUpdatePayment
        - WebhookEventInvoiceUpdateVoided
        - WebhookEventInvoiceUpdate
        - WebhookEventInvoicePaymentOverdue
        - WebhookEventInvoiceSyncSuccess
        - WebhookEventInvoiceSyncFailed
        - WebhookEventWalletCreditBalanceDropped
        - WebhookEventWalletCreditBalanceRecovered
        - WebhookEventWalletOngoingBalanceDropped
        - WebhookEventWalletOngoingBalanceRecovered
        - WebhookEventWalletOngoingBalanceUpdated
        - WebhookEventSubscriptionSpendThresholdReached
        - WebhookEventSubscriptionSpendThresholdRecovered
        - WebhookEventSubscriptionLineItemSpendThresholdReached
        - WebhookEventSubscriptionLineItemSpendThresholdRecovered
        - WebhookEventSubscriptionGroupSpendThresholdReached
        - WebhookEventSubscriptionGroupSpendThresholdRecovered
        - WebhookEventEntitlementGrantExhausted
        - WebhookEventSubscriptionRenewalDue
        - WebhookEventInvoiceCommunicationTriggered
        - WebhookEventCreditNoteCreated
        - WebhookEventCreditNoteUpdated
        - WebhookEventCheckoutSessionInitiated
        - WebhookEventCheckoutSessionCompleted
        - WebhookEventCheckoutSessionFailed
        - WebhookEventCheckoutSessionExpired
        - WebhookEventEventRejected
      x-speakeasy-name-override: WebhookEventName
    webhookDto.Refund:
      type: object
      properties:
        amount:
          type: string
        attempt:
          type: integer
        credit_note_id:
          type: string
        currency:
          type: string
        failed_at:
          type: string
          format: date-time
        failure_reason:
          type: string
        gateway_refund_id:
          type: string
        id:
          type: string
        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
        succeeded_at:
          type: string
          format: date-time
    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

````

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