Transfer an account

/account/transfer

Want to transfer an account ?, here is how to do it Chief 😉

POST https://live.chimoney.io/api/v0.1/account/transfer

Transfer account to sub account id

Headers

NameTypeDescription

X-API-Key*

API_KEY_FROM_DEV_PORTAL

Request Body

NameTypeDescription

receiver*

SUB_ACCOUNT_USER_ID

amount

1

wallet

airtime

{
    // success
}

#Javascript FETCH

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

var raw = "{\n    \"receiver\": \"SUB_ACCOUNT_USER_ID\",\n    \"amount\": 1,\n    \"wallet\": \"airtime\"\n}";

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

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

#Python REQUESTS

import requests

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

payload = "{\n    \"receiver\": \"SUB_ACCOUNT_USER_ID\",\n    \"amount\": 1,\n    \"wallet\": \"airtime\"\n}"
headers = {
  'X-API-Key': 'API_KEY_FROM_DEV_PORTAL'
}

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

print(response.text)

#PHP cURL

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://live.chimoney.io/api/v0.1/account/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": "SUB_ACCOUNT_USER_ID",
    "amount": 1,
    "wallet": "airtime"
}',
  CURLOPT_HTTPHEADER => array(
    'X-API-Key: API_KEY_FROM_DEV_PORTAL'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

Yay! It's done.

Last updated