# Withdraw from a Product

> Coming soon, upon request — this feature is turned on for your tenant by the Aurea team. [Contact us](https://www.aureahub.com/contact)

Withdraws an amount, or the whole position, to the wallet the position is held by.

## Overview

- `amount` in the asset's smallest unit, or `"max"` for the whole position (the operation then has `withdrawAll: true` and `amount: null`). The position must hold it (`400` `EARN_INSUFFICIENT_POSITION`).
- A product your tenant switched off, or one that is paused, still pays out. A withdrawal never waits for a disclosure.
- A product that pays withdrawals later answers the operation `completed` once the request is made, with a `redemption` that follows it until it is paid ([Withdrawals and Redemptions](https://docs.aureahub.com/docs/guide-earn.md)); `secondary_market` sells the shares at once.
- Who signs, the answer and the retries are as for a [Deposit](https://docs.aureahub.com/docs/earn-deposit.md).

## Endpoint

### `POST /v1/earn/withdrawals`

Authentication: bearer token required.

Withdraws an amount, or the whole position, to the wallet the position is held by.

**Headers**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | string | no | Optional. Up to 255 letters, digits, - or _; see [Retries](https://docs.aureahub.com/docs/guide-earn.md) |

**Request body**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `productId` | string | yes | The product's identifier |
| `amount` | string | yes | In the asset's smallest unit, or `max` |
| `isTestnet` | boolean | yes | `true` testnet, `false` mainnet |
| `walletId` | string | no | The wallet holding the position; without it, the first one somebody can sign for |
| `route` | string | no | `direct`, `bridge` or `secondary_market` |
| `chainId` | integer | no | The chain to operate on; without it, the one the wallet is on |

**Responses**

`201` Completed (custodial)

```json
{
  "operationId": "8b2d…",
  "productId": "lumen",
  "kind": "withdrawal",
  "route": "direct",
  "signer": "server",
  "state": "completed",
  "isTestnet": false,
  "walletId": "5a90…",
  "walletAddress": "0x9C1d…",
  "chain": "gnosis",
  "chainId": 100,
  "assetAddress": "0xcB44…C56E",
  "amount": null,
  "withdrawAll": true,
  "quote": {
    "apy": 2.41,
    "apyBasisPoints": 241,
    "rateSource": "onchain",
    "observedAt": "2026-10-05T11:00:05.000Z",
    "expectedAmount": "50012000000000000000",
    "fee": "0",
    "assetDecimals": 18
  },
  "txHashes": ["0x…"],
  "failureCode": null,
  "signing": null,
  "createdAt": "2026-10-05T11:00:10.000Z",
  "updatedAt": "2026-10-05T11:00:22.000Z",
  "broadcastAt": "2026-10-05T11:00:12.000Z",
  "completedAt": "2026-10-05T11:00:22.000Z",
  "failedAt": null
}
```

---

Web version: https://docs.aureahub.com/#earn-withdraw
