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

# Refund a failed deposit

> Transfer the funds from a failed deposit back to a user-provided address on the same chain.



## OpenAPI

````yaml https://raw.githubusercontent.com/rhinestonewtf/openapi/refs/heads/main/deposit-service.json post /deposits/refund
openapi: 3.1.0
info:
  title: Deposit Service API
  version: 1.0.0
  description: >-
    Cross-chain deposit processing service with automatic token bridging and gas
    sponsorship
servers:
  - url: https://v1.orchestrator.rhinestone.dev/deposit-processor
security: []
paths:
  /deposits/refund:
    post:
      tags:
        - Processing
      summary: Refund a failed deposit
      description: >-
        Transfer the funds from a failed deposit back to a user-provided address
        on the same chain.
      parameters:
        - schema:
            type: string
            description: API key for authentication
            example: your-api-key
          required: true
          description: API key for authentication
          name: x-api-key
          in: header
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefundDepositRequestBody'
      responses:
        '200':
          description: Deposit refunded successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundDepositResponse'
        '400':
          description: Invalid request, deposit not found, or not eligible for refund
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Unauthorized - API key does not own the account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Refund transfer failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    RefundDepositRequestBody:
      type: object
      properties:
        chain:
          type: string
          pattern: ^[a-z0-9]+:[a-zA-Z0-9]+$
          description: CAIP-2 chain identifier of the deposit (e.g. "eip155:8453")
          example: eip155:8453
        txHash:
          type: string
          minLength: 1
          description: Source transaction hash of the stuck deposit
          example: 0xabc123...
        account:
          type: string
          minLength: 1
          description: >-
            Managed account address that received the deposit (EVM address or
            Solana public key)
          example: '0xde0fdf9c06b404cc5e20543cb84cac9067102f19'
        token:
          type: string
          minLength: 1
          description: >-
            Source token address. Use the zero address (0x000…000) for native
            transfers.
          example: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48'
        recipient:
          type: string
          minLength: 1
          description: >-
            Address to receive the refunded tokens (EVM address or Solana public
            key)
          example: '0x742d35Cc6634C0532925a3b844Bc9e7595f5bE91'
      required:
        - chain
        - txHash
        - account
        - token
        - recipient
    RefundDepositResponse:
      type: object
      properties:
        message:
          type: string
        transactionHash:
          type: string
        amount:
          type: string
      required:
        - message
        - transactionHash
        - amount
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        details:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
              path:
                type: array
                items:
                  anyOf:
                    - type: string
                    - type: number
              code:
                type: string
            required:
              - message
      required:
        - error

````