# Transfer

Transferring from one wallet to another is super easy, here is how to it, Chief  😉

<mark style="color:green;">`POST`</mark> `https://live.chimoney.io/api/v0.1/wallets/transfer`

Transfer from one wallet to another. Wallet can be a team wallet or a user wallet.

#### Headers

| Name                                        | Type                        | Description |
| ------------------------------------------- | --------------------------- | ----------- |
| X-API-Key<mark style="color:red;">\*</mark> | API\_KEY\_FROM\_DEV\_PORTAL |             |

#### Request Body

| Name                                       | Type                                                | Description |
| ------------------------------------------ | --------------------------------------------------- | ----------- |
| receiver<mark style="color:red;">\*</mark> | Account or Team ID to transfer to                   |             |
| amount<mark style="color:red;">\*</mark>   | 1                                                   |             |
| wallet<mark style="color:red;">\*</mark>   | Wallet type: chi, airtime, momo. Will befault to ch |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // transaction detail
}
```

{% endtab %}
{% endtabs %}

### <mark style="color:purple;">**#Javascript FETCH**</mark>

```javascript
var myHeaders = new Headers();
myHeaders.append("X-API-Key", "API_KEY_FROM_DEV_PORTAL");

var raw = "{\n    \"receiver\": \"Account or Team ID to transfer to\",\n    \"amount\": 1,\n    \"wallet\": \"Wallet type: chi, airtime, momo. Will befault to chi\"\n}";

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://live.chimoney.io/api/v0.1/wallets/transfer", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

### <mark style="color:purple;">**#Python REQUESTS**</mark>

```python
import requests

url = "https://live.chimoney.io/api/v0.1/wallets/transfer"

payload = "{\n    \"receiver\": \"Account or Team ID to transfer to\",\n    \"amount\": 1,\n    \"wallet\": \"Wallet type: chi, airtime, momo. Will befault to chi\"\n}"
headers = {
  'X-API-Key': 'API_KEY_FROM_DEV_PORTAL'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
```

### <mark style="color:purple;">**#PHP cURL**</mark>

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://live.chimoney.io/api/v0.1/wallets/transfer',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "receiver": "Account or Team ID to transfer to",
    "amount": 1,
    "wallet": "Wallet type: chi, airtime, momo. Will befault to chi"
}',
  CURLOPT_HTTPHEADER => array(
    'X-API-Key: API_KEY_FROM_DEV_PORTAL'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% hint style="success" %}
Yay! It's done.
{% endhint %}
