Have questions? Leave your message here or Schedule a quick call with our manager now
Categories API methods allow you to manage categories in the store. It is possible to:
Run category.add method, to add customers to the store, and provide all necessary parameters.
public function apiAdd($params)
{
$params = array(
'name' => 'Shoes'
);
return $api->request('category.add', $params);
}
If you want to update the category, call category.list method to get category id.
public function apiList($params)
{
$params = array(
'start' => 2,
'count' => 2,
);
return $api->request('category.list', $params);
}
When you get your category id, you are able to perform category.update method.
public function apiUpdate($params)
{
$params = array(
'id' => 20,
'avail' => 'false',
'meta_title' => 'meta title for category'
);
return $api->request('category.update', $params);
}
If you want to assign your product to some category, simply call product.list method and category.list method to get product id and category id.
After that, run category.assign method.
public function apiAssign($params)
{
$params = array(
'product_id' => 69,
'category_id' => 20,
);
return $api->request('category.assign', $params);
}
For more methods jump into documentation.
Posted in: Getting Started
Discover how API2Cart can ease your eCommerce integrations with a personalized demo. See how seamlessly our solution can connect your software with over 40 eCommerce platforms.
Don't miss out! This is an exclusive one-time offer. Secure your additional trial period by booking your demo now.