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

# Request Withdrawal

> This endpoint allows users to request withdrawal.

```http theme={null}
POST /api/v1/account/withdraw
```

#### Request Body

<table><thead><tr><th width="176">Field</th><th width="98">Type</th><th width="95">Need</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><code>"account"</code></td><td>string</td><td>required</td><td>User's wallet address</td><td><code>42trU9A5...</code></td></tr><tr><td><code>"signature"</code></td><td>string</td><td>required</td><td>Cryptographic signature</td><td><code>5j1Vy9Uq...</code></td></tr><tr><td><code>"timestamp"</code></td><td>integer</td><td>required</td><td>Current timestamp in milliseconds</td><td><code>1716200000000</code></td></tr><tr><td><code>"amount"</code></td><td>string</td><td>required</td><td>Amount to withdraw in USDC</td><td><code>100.50</code></td></tr><tr><td><code>"idempotency\_key"</code></td><td>string</td><td>optional</td><td>Full UUID string. Prevents duplicate withdrawals</td><td><code>550e8400-e29b-41d4-a716-446655440000</code></td></tr><tr><td><code>"agent\_wallet"</code></td><td>string</td><td>optional</td><td>Agent wallet address</td><td><code>69trU9A5...</code></td></tr><tr><td><code>"expiry\_window"</code></td><td>integer</td><td>optional</td><td>Signature expiry in milliseconds</td><td><code>30000</code></td></tr></tbody></table>

```json theme={null}
{
  "account": "42trU9A5...",
  "signature": "5j1Vy9Uq...",
  "timestamp": 1716200000000,
  "amount": "100.50",
  "agent_wallet": "69trU9A5...",
  "expiry_window": 30000,
}
```

#### Response

* Status 200: Success

```json theme={null}
{
  "success": true,
  "data": {
    "batch_nonce": 42,
    "requested_amount": "100.500000",
    "fee_amount": "1.000000"
  }
}
```

| Field                | Type           | Description                      |
| -------------------- | -------------- | -------------------------------- |
| `'batch_nonce'`      | integer        | Nonce of the withdrawal batch    |
| `'requested_amount'` | decimal string | Amount requested for withdrawal  |
| `'fee_amount'`       | decimal string | Fee deducted from the withdrawal |

* Status 400: Invalid request parameters
* Status 409: Duplicate idempotency key
* Status 500: Internal server error

#### Code Example (Python)

```python theme={null}
import requests

payload = {
    "account": "42trU9A5...",
    "signature": "5j1Vy9Uq...",
    "timestamp": 1716200000000,
    "amount": "100.50"
}

response = requests.post(
    "/api/v1/account/withdraw",
    json=payload,
    headers={"Content-Type": "application/json"}
)

data = response.json()
```
