API:bulkSetPrices - Bulk update TLD prices
Update prices of your TLD portfolio in bulk.
Required parameters
- category_id
- Orderpage category id to change prices for
- products[n][name]
- Name of product / TLD to change
Optional parameters
- products[n][periods][k][register]
- For tlds, set register price for {k} years for amount passed trough this argument
- products[n][periods][k][transfer]
- For tlds, set transfer price for {k} years for amount passed trough this argument
- products[n][periods][k][renew]
- For tlds, set renew price for {k} years for amount passed trough this argument
- products[n][updatedomains]
- Set to 1 to update (increase/decrease) pricing of existing domains with this TLD. Note: This is slow feature due to number of related operations, if enabled, please consider splitting update price call for multiple tlds into multiple subsequent calls
Request
GET http://url_to_your_hostbill.com/admin/api.php?token=:TOKEN&call=bulkSetPrices&category_id=:CATEGORY_ID&products[n][name]=:PRODUCTS[N][NAME]
<?php
include 'class.hbwrapper.php';
$hbw = HBWrapper::singleton();
$hbw->setAPIUrl('http://url_to_hb.com/admin/api.php');
if($hbw->logIn("adminlogin","password")) {
$return = $hbw->bulkSetPrices(array('category_id'=>:CATEGORY_ID,
'products[n][name]'=>:PRODUCTS[N][NAME]));
print_r($return);
}
?>
<?php
//Use this method to access HostBill api from HostBill modules
$api = new ApiWrapper();
$return = $api->bulkSetPrices(array('category_id'=>:CATEGORY_ID,
'products[n][name]'=>:PRODUCTS[N][NAME]));
print_r($return);
?>
Response
{
"success": false,
"call": "bulkSetPrices",
"server_time": 1478712115,
"info": [
"Product updated"
]
}