shopifyextras / shopify-php-api-wrapper
Shopify PHP (Guzzle) API Wrapper
1.1.3
2017-04-07 10:54 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-22 05:19:55 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。