PHP code example of hiboutik / hiboutikapi

1. Go to this page and download the library: Download hiboutik/hiboutikapi library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

hiboutik / hiboutikapi example snippets







$hiboutik = new \Hiboutik\HiboutikAPI(YOUR_HIBOUTIK_ACCOUNT, USER, KEY);


$hiboutik = new \Hiboutik\HiboutikAPI(YOUR_HIBOUTIK_ACCOUNT);
$hiboutik->oauth(ACCESS_TOKEN);


$result = $hiboutik->get("/products/");
if ($hiboutik->request_ok) {
  print_r($result);
} else {
  if (isset($result['details']['error_description'])) {
    print $result['details']['error_description'];
  } else {
    print $result['error_description'];
  }
}


$result = $hiboutik->post("products", [
  "product_model" => "My product",
  "product_barcode" => "",
  "product_brand" => "2",
  "product_supplier" => "2",
  "product_price" => "99.90",
  "product_discount_price" => "89.90",
  "product_category" => 5,
  "product_size_type" => 0,
  "product_stock_management" => 0,
  "product_supplier_reference" => "",
  "product_vat" => 0
]);

if ($hiboutik->request_ok) {
  print 'Product created!';
} else {
  if (isset($result['details']['error_description'])) {
    print $result['details']['error_description'];
  } else {
    print $result['error_description'];
  }
}


$pagination = $hiboutik->pagination();


$hiboutik = new \Hiboutik\HiboutikAPI(YOUR_HIBOUTIK_ACCOUNT, USER, KEY, '1');