> ## 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.

# Subaccount Spot Transfer

> This endpoint allows users to transfer spot assets between a main account and its subaccounts

Please refer to the [Python SDK](https://github.com/pacifica-fi/python-sdk) for a comprehensive guide on subaccount spot transfer via API

```http theme={null}
POST /api/v1/account/subaccount/spot_asset/transfer
```

#### 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 (sender)</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>"to\_account"</code></td><td>string</td><td>required</td><td>Destination account address</td><td><code>69trU9A5...</code></td></tr><tr><td><code>"symbol"</code></td><td>string</td><td>required</td><td>Spot asset symbol (e.g. SOL)</td><td><code>SOL</code></td></tr><tr><td><code>"amount"</code></td><td>decimal string</td><td>required</td><td>Amount to transfer</td><td><code>1.50000000</code></td></tr><tr><td><code>"idempotency\_key"</code></td><td>string</td><td>optional</td><td>Full UUID. Prevents duplicate transfers</td><td><code>f47ac10b-58cc-4372-a567-0e02b2c3d479</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>

The signature must be generated using the operation type `"transfer_spot_asset"`.

```json theme={null}
{
  "account": "42trU9A5...",
  "signature": "5j1Vy9Uq...",
  "timestamp": 1716200000000,
  "to_account": "69trU9A5...",
  "symbol": "SOL",
  "amount": "1.50000000",
  "idempotency_key": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "agent_wallet": "69trU9A5...",
  "expiry_window": 30000
}
```

The destination account must be a subaccount of the sender, or the sender must be a subaccount transferring to its parent.

#### Response

* Status 200: Transfer completed successfully

```json theme={null}
Status Code: 200
{
  "success": true,
  "data": {
    "success": true,
    "error": null
  },
  "error": null,
  "code": null
}
```

* 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,
    "to_account": "69trU9A5...",
    "symbol": "SOL",
    "amount": "1.50000000",
    "idempotency_key": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
    "agent_wallet": "69trU9A5...",
    "expiry_window": 30000,
}

response = requests.post(
    "/api/v1/account/subaccount/spot_asset/transfer",
    headers={"Accept": "*/*", "Content-Type": "application/json"},
    json=payload,
)

data = response.json()
```
