rothrauff-consulting / shopify
A PHP wrapper for the Shopify API.
Requires
- php: ^7.1
Requires (Dev)
- phpunit/phpunit: ^7.0
This package is auto-updated.
Last update: 2023-05-12 00:04:15 UTC
README
Currently supports version 2019-10, 2020-01, and 2020-04 of the REST Admin API, and will support all released versions.
Installation
You can install the package via composer:
composer require rothrauff-consulting/shopify
Usage
use RothrauffConsulting\Shopify\Shopify; $shopify = new Shopify('store_url', 'app_api_key', 'app_password');
or to specify an api version:
use RothrauffConsulting\Shopify\Shopify; $shopify = new Shopify('store_url', 'app_api_key', 'app_password', 'api_version');
Examples:
$shopify->get('products'); $shopify->get('products', ['fields' => 'id,title']); $shopify->post('products', [ 'product' => [ //new product ] ]); $shopify->put('products/{id}', [ 'product' => [ //update product ] ]); $shopify->delete('products/{id}');
Some delete requests require parameters, e.g., themes:
$shopify->delete('themes/{theme_id}/assets', ['asset[key]' => 'asset_key']);
There is a retry mechanism that allows you to set how many retries, and how long to wait before retrying. Set these environment variables:
SHOPIFY_RETRY_COUNT=
SHOPIFY_TIMEOUT_SECONDS=
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email developers@rothrauffconsulting.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
PHP Package Boilerplate
This package was generated using the PHP Package Boilerplate.