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

# Create Refund

> Initiate a refund for a transaction



## OpenAPI

````yaml POST /transactions/refund/{originalTxId}
openapi: 3.0.3
info:
  title: OraFi Merchant API
  description: Seamless crypto payments API for merchants
  version: 1.0.0
  contact:
    name: OraFi Support
    email: support@orafi.app
servers:
  - url: https://api.orafi.app/v1
    description: Production server
  - url: http://localhost:3000/v1
    description: Local development server
security: []
tags:
  - name: Paylinks
    description: Paylink management endpoints
  - name: Payments
    description: Payment creation and verification endpoints
  - name: Customers
    description: Customer management endpoints
  - name: Transactions
    description: Transaction retrieval and payout endpoints
  - name: Refunds
    description: Refund management endpoints
  - name: Webhooks
    description: Webhook registration and management
  - name: Profile
    description: Business profile settings
  - name: Settlements
    description: Settlement account management
  - name: Fiat
    description: Fiat-related endpoints
  - name: Business
    description: Business mode and settings
  - name: Notifications
    description: Notification preferences
  - name: Subscriptions
    description: Subscription plans and customer subscriptions
paths:
  /transactions/refund/{originalTxId}:
    post:
      tags:
        - Refunds
      summary: Create refund
      description: Initiate a refund for a transaction
      parameters:
        - name: originalTxId
          in: path
          description: ID of the original transaction to refund
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                to:
                  description: Recipient wallet address or account
                  type: string
                  example: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
                reason:
                  description: Reason for the refund
                  type: string
                  example: Customer requested cancellation
              required:
                - to
      responses:
        '201':
          description: Refund created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Refund initiated successfully
                  data:
                    $ref: '#/components/schemas/Refund'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
        - apiKey: []
components:
  schemas:
    Refund:
      type: object
      properties:
        id:
          description: Refund unique identifier
          type: string
          example: refund_abc123
        amount:
          description: Refunded amount
          type: number
          example: 100
        status:
          description: Refund status
          type: string
          example: CONFIRMED
        transactionId:
          description: Original transaction ID
          type: string
        toAddress:
          description: Refund destination address
          type: string
        reason:
          description: Refund reason
          type: string
        txDigest:
          description: Refund transaction digest
          type: string
        createdAt:
          description: Creation timestamp
          type: string
          format: date-time
  responses:
    BadRequest:
      description: Bad request - Invalid input or validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              message:
                type: string
                example: Validation error message
    Unauthorized:
      description: Unauthorized - Missing or invalid API key
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              message:
                type: string
                example: Unauthorized access
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for merchant authentication required for most endpoints

````