webweave / magento2-sdk
合适的 Magento 2 REST API SDK
v0.2
2017-12-18 11:40 UTC
Requires
- guzzlehttp/guzzle: ~6.0
This package is auto-updated.
Last update: 2024-09-22 01:23:32 UTC
README
适合 Magento 2 REST API 的 SDK
警告
此软件不提供任何类型的保修,使用风险自负。
暂时完成
- 客户组
- 客户
需求
php-curl 需要安装。
使用方法
安装
最佳方式是使用 composer
$ composer require webweave/magento2-sdk
基本代码示例
<?php 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);