<?php $key="YOUR-ACCOUNT-KEY"; $c_name="SUB-BUSINESS-NAME"; $adminphone="PHONE-NUMBER"; $c_category="SUB-BUSINESS-CATEGORY"; $adminname="ACCOUNT-MANAGER"; $response = httpPost("https://api.textng.xyz/create-sub-account/" ,array("key"=>"$key","company_name"=>"$c_name","company_category"=>"$c_category","admin_name"=>"$adminname","admin_phone"=>"$adminphone"));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 c_name="SUB-BUSINESS-NAME" ;var adminphone="PHONE-NUMBER" ;var c_category="SUB-BUSINESS-CATEGORY" ;var adminname="ACCOUNT-MANAGER" ;var url ="https://api.textng.xyz/create-sub-account/" ; $.post(url, { key: key, company_name: c_name, admin_phone: adminphone, adminname: adminname, company_category: c_category },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. |
company_name |
XXX-XXX | The name of the sub-business for which you are creating the sub-account. |
admin_phone |
070001000 | The phone for number of the sub-account's contact person. |
admin_name |
John Doe | The name of the sub-account's contact person. |
company_category |
The business category the new sub-account falls under. Use the corresponding number to represent the category Category List |
{'status': 'SUCCESS ', 'response': 'Sub-Account Created', 'api-key' => 'XXXX-XXXX-XXXXX'}
{'status': 'ERROR ', 'response': 'ERROR Invalid Key'}
{'status': 'ERROR ', 'response': 'ERROR Incomplete Parameters'}
{'status': 'ERROR ', 'response': 'ERROR Cannot Create Sub-Account Under Sub-Account'}
{'status': 'ERROR ', 'response': 'ERROR Invalid Category, Refer To Documentation'}
{'status': 'ERROR ', 'response': 'ERROR Could Not Create Sub-Account'}