PHP code example of webweave / magento2-sdk

1. Go to this page and download the library: Download webweave/magento2-sdk 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/ */

    

webweave / magento2-sdk example snippets




use WebWeave\Magento2SDK\ApiClient;
use WebWeave\Magento2SDK\CustomerGroups;

//Initialize client
$apiClient = new ApiClient('https://magento2.shop/', 'AdminUserName', "AdminPassword");

//Get and set Bearer token in the client
$apiClient->getToken();

//Create a customer group
$customerGroup = new CustomerGroups($apiClient);

$data = array("group" => array(
	"code" => "I am made by the magento2-sdk :D"
));

$customerGroup->createCustomerGroup($data);