---
title: "Refund a failed deposit"
method: POST
path: "/deposits/refund"
tags: ["Processing"]
---

# Refund a failed deposit

`POST /deposits/refund`

Transfer the funds from a failed deposit back to a user-provided address on the same chain. Authenticate with an `x-api-key` (write scope) or a Bearer platform token; the credential must belong to the client that registered the account. On a supported chain the deposit must already be `failed` or `rejected`; if no such deposit exists the call returns 400 (a deposit still being processed is not refundable). On a chain this service does not take deposits from (`deposit: false` on `/chains`), where no deposit record can ever be created, the deposit is instead reconstructed from the on-chain transaction receipt — the receipt must show that `txHash` credited `account` with `token`, or the same 400 is returned.

## Headers

- `x-api-key` string — API key for authentication (omit when sending Authorization)
- `authorization` string — Bearer platform token (e.g. forwarded by user-service). Takes precedence over `x-api-key` when both are present.

## Request body

- RefundDepositRequestBody
  - `chain` string, required — CAIP-2 chain identifier of the deposit (e.g. "eip155:8453")
  - `txHash` string, required — Source transaction hash of the stuck deposit
  - `account` string, required — Managed account address that received the deposit (EVM address or Solana public key)
  - `token` string, required — Source token address. Use the zero address (0x000…000) for native transfers.
  - `recipient` string, required — Address to receive the refunded tokens (EVM address or Solana public key)

## Response `200`

Deposit refunded successfully

- RefundDepositResponse
  - `message` string, required
  - `transactionHash` string, required
  - `amount` string, required

## Other responses

- `400` — Invalid request, deposit not found, or not eligible for refund
- `401` — Authentication required or invalid
- `403` — Unauthorized - credential does not belong to the client that registered the account, or API key lacks write scope
- `500` — Refund transfer failed

---

[API](https://skmtc.net/rhinestonewtf/apis/deposit-service-api.md) · [All operations](https://skmtc.net/rhinestonewtf/apis/deposit-service-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/rhinestonewtf/deposit-service-api/revisions/ce4e0abfe33a/schema)
