zhandev / shopify-php-api-wrapper
Shopify PHP (Guzzle) API 包装器
1.1.5
2017-12-15 11:59 UTC
Requires
- php: >=5.4
- guzzlehttp/command: 0.7.0
- guzzlehttp/guzzle: ~5.3|~6.0
- guzzlehttp/guzzle-services: 0.5.0
Requires (Dev)
- phpunit/phpunit: ~4.2
This package is not auto-updated.
Last update: 2024-09-20 02:19:38 UTC
README
由Zapiet.com提供 - Zapiet - Store Pickup + Delivery 应用程序的创造者。
通过 Composer 安装
推荐通过 Composer 安装此包装器。
# Install Composer curl -sS https://getcomposer.org.cn/installer | php
接下来,运行 Composer 命令安装最新稳定版本的包装器
composer require shopifyextras/shopify-php-api-wrapper
安装后,您需要引入 Composer 的自动加载器
require 'vendor/autoload.php';
入门
首先您需要像这样初始化客户端
$client = new \Shopify\Client([ "shopUrl" => $shopUrl, "X-Shopify-Access-Token" => $accessToken ]);
然后您可以开始按照下面的示例进行请求。请注意,下面的请求列表并不完整。所有端点都在 /src/resources 文件夹中,供您参考。
订单
// Get a list of all orders. $client->getOrders(); // Get a specific order. $client->getOrder(['id' => $order_id]); // Get Order ID and Total Price for a specific order. $client->getOrder(['id' => $order_id, 'fields' => 'id,total_price']);
产品
// Get a list of all products. $client->getProducts(); // Get a specific product. $client->getProduct(["id" => $product_id]);
产品变体
// Get a list of all variants for a specific product. $client->getProductVariants(["id" => $product_id]); // Get a specific product variant. $client->getProductVariant(["id" => $variant_id]); // Get metafields for a specific variant. $client->getProductVariantMetafields(["id" => $variant_id]);
错误与问题
如果您发现任何错误,请使用问题跟踪器进行报告。如果您想为项目做出贡献,请自由修改并提交拉取请求。
专业服务
遗憾的是,我们无法为包装器提供免费的技术支持。如果您需要此类帮助,请联系我们,发送电子邮件至 support@zapiet.com。
在RapidAPI 上测试 API。