<?php $key="YOUR-ACCOUNT-KEY"; $receiver_key="SUB-ACCOUNT-KEY"; $quantity="AMOUNT-OF-UNITS-TO-TRANSFER";$response = httpPost("https://api.textng.xyz/transfer-units-sub/" ,array("key"=>"$key","receiver_key"=>"$receiver_key","quantity"=>"$quantity"));function httpPost($url, $data){ $curl =curl_init ($url);curl_setopt ($curl, CURLOPT_POST, true);curl_setopt ($curl, CURLOPT_POSTFIELDS, http_build_query($data));curl_setopt ($curl, CURLOPT_RETURNTRANSFER, true);$response = curl_exec($curl); curl_close($curl);echo $response; } ?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js" ></script> <script>var key="YOUR-ACCOUNT-KEY" ;var receiver_key="SUB-ACCOUNT-KEY" ;var quantity="AMOUNT-OF-UNITS-TO-TRANSFER" ;var url ="https://api.textng.xyz/transfer-units-sub/" ; $.post(url, { key: key, receiver_key: receiver_key, quantity: quantity },function (res) {var data = JSON.parse(res);if (data.status ==="SUCCESS" ) {// Do Success Work! } else {// Do Error Work! } }); </script>
Parameter | Example | Description |
---|---|---|
Key |
XXXXX-XXXX-XXXXX | This can be found in the Developers page of your dashboard. The key authorizes the transaction. |
receiver_key |
XXX-XXXX-XXXXX | The api-key of the receiving sub-account. |
quantity |
The amount of units to transfer to the sub-account. |
{'status': 'SUCCESS ', 'response': 'Transaction Successful'}
{'status': 'ERROR ', 'response': 'ERROR Invalid Key'}
{'status': 'ERROR ', 'response': 'ERROR Incomplete Parameters'}
// If quantity is not a digit {'status': 'ERROR ', 'response': 'ERROR Invalid Quantity'}
{'status': 'ERROR ', 'response': 'ERROR Invalid Receiver Key'}
{'status': 'ERROR ', 'response': 'ERROR Insufficient Wallet Balance'}
{'status': 'ERROR ', 'response': 'ERROR Could not complete transaction'}