> For the complete documentation index, see [llms.txt](https://docs.sfox.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sfox.com/rest-api/post-trade-settlement-pts/create-transfer.md).

# Create Transfer

<mark style="color:blue;">**`POST`**</mark> `https://api.sfox.com/v1/account/transfer`

Transfer funds between your account's trading and collateral wallets.

{% hint style="info" %}
**Hedge long positions:** Transfer funds to your collateral wallet so you can open a short position on the same currency in your trading wallet.
{% endhint %}

{% hint style="warning" %}
Transfers from your collateral wallet to your trading wallet will automatically settle unsettled positions, if applicable, first. The remainder, if any, will be applied to your trading wallet.
{% endhint %}

### Body Parameters

<table><thead><tr><th width="244">Name</th><th width="95">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>currency</code></strong> <mark style="color:red;">required</mark></td><td>String</td><td>Currency to be transferred</td></tr><tr><td><strong><code>quantity</code></strong> <mark style="color:red;">required</mark></td><td>String</td><td>Quantity to be transferred</td></tr><tr><td><strong><code>from_wallet</code></strong> <mark style="color:red;">required</mark></td><td>String</td><td>Wallet being transferred from. Possible values:<br><code>trading</code>: your account's trading wallet<br><code>collateral</code>: your account's collateral wallet</td></tr><tr><td><strong><code>to_wallet</code></strong> <mark style="color:red;">required</mark></td><td>String</td><td>Wallet being transferred to. Possible values:<br><code>trading</code>: your account's trading wallet<br><code>collateral</code>: your account's collateral wallet</td></tr></tbody></table>

### Response Body

<table><thead><tr><th width="254">Key</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>from_transaction_id</code></strong></td><td>sFOX generated ID of the transaction debiting the source wallet of the transfer</td></tr><tr><td><strong><code>to_transaction_id</code></strong></td><td>sFOX generated ID of the transaction crediting the destination wallet of the transfer</td></tr><tr><td><strong><code>currency</code></strong></td><td>Currency that was transferred</td></tr><tr><td><strong><code>quantity</code></strong></td><td>Quantity of the currency that was transferred</td></tr><tr><td><strong><code>from_wallet</code></strong></td><td>Name of the source wallet (<code>trading</code> or <code>collateral</code>)</td></tr><tr><td><strong><code>to_wallet</code></strong></td><td>Name of the destination wallet (<code>trading</code> or <code>collateral</code>)</td></tr></tbody></table>

### Responses

<details>

<summary><mark style="color:green;">200</mark></summary>

```json
{
    "from_transaction_id": 5467771,
    "to_transaction_id": 5467772,
    "currency": "btc",
    "quantity": 1,
    "from_wallet": "trading",
    "to_wallet": "collateral"
}
```

</details>

### Example Requests

{% tabs %}
{% tab title="Shell" %}

```bash
curl -H 'Authorization: Bearer <API_TOKEN>' \
-H 'Content-Type: application/json' \
-X POST \
--data '{"currency": "btc", "quantity": "1", "from_wallet": "trading", "to_wallet": "collateral"}' \
https://api.sfox.com/v1/account/transfer
```

{% endtab %}

{% tab title="NodeJS" %}

```javascript
const axios = require('axios');

axios({
  method: 'post',
  url: 'https://api.sfox.com/v1/account/transfer',
  headers: {
    'Authorization': 'Bearer <API_KEY>'
  },
  data: { 
    currency: 'btc',
    quantity: 1,
    from_wallet: 'trading',
    to_wallet: 'collateral'
  }
}).then(response => {
  console.log(response)
}).catch(err => {
  console.error(err)
});
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

data = requests.post(
  "https://api.sfox.com/v1/account/transfer",
  headers={
    "Authorization": "Bearer <API_KEY>",
  },
  data={
    "currency": "btc",
    "quantity": 1,
    "from_wallet": "trading",
    "to_wallet": "collateral"
  }
)
print(data)
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sfox.com/rest-api/post-trade-settlement-pts/create-transfer.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
