jeppos / shopify-php-sdk
An easy to use Shopify PHP SDK.
Installs: 247
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/jeppos/shopify-php-sdk
Requires
- php: ^7.1
- consistence/consistence-jms-serializer: ^1.0
- doctrine/common: ^2.7
- guzzlehttp/guzzle: ^6.2
- jms/serializer: ^1.6
Requires (Dev)
- codacy/coverage: ^1.1
- phpmd/phpmd: ^2.6
- phpunit/phpunit: ^6.1
- squizlabs/php_codesniffer: ^3.0
This package is auto-updated.
Last update: 2025-09-27 23:42:07 UTC
README
An easy to use Shopify PHP SDK.
Installation
Composer
composer require jeppos/shopify-php-sdk
Usage
Configure
Create a private app using the instructions found on Shopify's own documentation, to generate the required credentials.
<?php include __DIR__ . '/vendor/autoload.php'; \Doctrine\Common\Annotations\AnnotationRegistry::registerLoader('class_exists'); $shopifySDK = new \Jeppos\ShopifySDK\ShopifySDK('your-store-name.myshopify.com', 'api-key', 'api-secret');
Properties
The ShopifySDK class has the following properties,
- products - Returns an instance of ProductService
- collects - Returns an instance of CollectService
- customCollections - Returns an instance of CustomCollectionService
- productImages - Returns an instance of ProductImageService
- productVariants - Returns an instance of ProductVariantService
Examples
Fetch single product
// Get a Product class $product = $shopifySDK->products->getOne(123); // Display the product title echo $product->getTitle();
Fetch a list of custom collections
// Get an array of CustomCollection classes $customCollections = $shopifySDK->customCollections->getList(); // Display the title of each custom collection on a new line foreach ($customCollections as $customCollection) { echo $customCollection->getTitle() . PHP_EOL; }
Create a product
$product = new Product(); $product->setTitle('My new product'); $shopifySDK->products->createOne($product);