# API: Store eCheck/ACH
# editClientACH
Add eCheck/ACH to client profile
# Required parameters
Parameter | Description |
---|---|
id | Client ID |
ach[type] | Type (checkings, savings, business_checking) |
ach[account] | Account Number |
ach[routing] | Routing Number |
# Request
GET /admin/api.php?api_id=API_ID&api_key=API_KEY&call=editClientACH&id=ID&ach%5Btype%5D=ACH%5BTYPE%5D&ach%5Baccount%5D=ACH%5BACCOUNT%5D&ach%5Brouting%5D=ACH%5BROUTING%5D
# PHP Samples
$url = 'http://url_to_hb.com/admin/api.php';
$post = [
'call' => 'editClientACH',
'api_id' => $API_ID,
'api_key' => $API_KEY,
'id' => $ID,
'ach[type]' => $ACH[TYPE],
'ach[account]' => $ACH[ACCOUNT],
'ach[routing]' => $ACH[ROUTING],
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$data = curl_exec($ch);
curl_close($ch);
$return = json_decode($data, true);
print_r($return);
include 'class.hbwrapper.php';
HBWrapper::setAPI('http://url_to_hb.com/admin/api.php','API ID','API Key');
$params = [
'id' => $ID,
'ach[type]' => $ACH[TYPE],
'ach[account]' => $ACH[ACCOUNT],
'ach[routing]' => $ACH[ROUTING],
];
$return = HBWrapper::singleton()->editClientACH($params);
print_r($return);
/* Use this method to access HostBill api from HostBill modules */
$api = new ApiWrapper();
$params = [
'id' => $ID,
'ach[type]' => $ACH[TYPE],
'ach[account]' => $ACH[ACCOUNT],
'ach[routing]' => $ACH[ROUTING],
];
$return = $api->editClientACH($params);
print_r($return);
# Response
{
"success": true,
"call": "editClientACH",
"server_time": 1317726229
}