{"id":13546441,"url":"https://github.com/bold-commerce/bold-shopify-toolkit","last_synced_at":"2025-04-12T15:37:48.673Z","repository":{"id":22766693,"uuid":"97263194","full_name":"bold-commerce/bold-shopify-toolkit","owner":"bold-commerce","description":"A Symfony Based Shopify api wrapper","archived":false,"fork":false,"pushed_at":"2024-12-26T14:56:51.000Z","size":439,"stargazers_count":26,"open_issues_count":6,"forks_count":48,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-03-27T14:14:40.050Z","etag":null,"topics":["laravel","php","shopify","shopify-api","snyk-scan","symfony"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bold-commerce.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-14T18:42:00.000Z","updated_at":"2024-12-05T18:46:16.000Z","dependencies_parsed_at":"2024-02-21T18:46:06.737Z","dependency_job_id":"00f39136-a6e5-4f72-a8b0-2d187e33c8d3","html_url":"https://github.com/bold-commerce/bold-shopify-toolkit","commit_stats":{"total_commits":151,"total_committers":56,"mean_commits":"2.6964285714285716","dds":0.9271523178807947,"last_synced_commit":"2197630d0405bee45c8e6542983e89d2ddb6138a"},"previous_names":[],"tags_count":140,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bold-commerce%2Fbold-shopify-toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bold-commerce%2Fbold-shopify-toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bold-commerce%2Fbold-shopify-toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bold-commerce%2Fbold-shopify-toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bold-commerce","download_url":"https://codeload.github.com/bold-commerce/bold-shopify-toolkit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247024151,"owners_count":20870940,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","php","shopify","shopify-api","snyk-scan","symfony"],"created_at":"2024-08-01T12:00:37.757Z","updated_at":"2025-04-03T15:11:31.805Z","avatar_url":"https://github.com/bold-commerce.png","language":"PHP","funding_links":[],"categories":["Libraries","库"],"sub_categories":["PHP"],"readme":"# Bold Shopify Toolkit\n\n[![CircleCI](https://circleci.com/gh/bold-commerce/bold-shopify-toolkit/tree/master.svg?style=svg)](https://circleci.com/gh/bold-commerce/bold-shopify-toolkit/tree/master)\n\n## Purpose\nBold Shopify Toolkit is a [Symfony](https://symfony.com/)-based [Shopify](https://shopify.com) wrapper that makes it easy to interact with Shopify. The intention is to integrate with the [API offered by Shopify](https://help.shopify.com/api/reference) and maintain consistent data structures for the models and services that access these endpoints.\n\n## Getting Started\nThis package works best with a Dependency Injection Container since there are many dependencies that need to be resolved.\n\n### Prerequisites\nTo use this package, you will need to bind Models to the following interfaces.\n\n- [ShopAccessInfo](src/Contracts/ShopAccessInfo.php)\n- [ShopBaseInfo](src/Contracts/ShopBaseInfo.php)\n- [ApplicationInfo](src/Contracts/ApplicationInfo.php)\n- [ApiSleeper](src/Contracts/ApiSleeper.php)\n\nAn example API Sleeper has been included in this package.\n\n**Laravel:** (see `AppServiceProvider.php`)\n\n```php\n    $this-\u003eapp-\u003ebind(\\BoldApps\\ShopifyToolkit\\Contracts\\ApiSleeper::class,\n            \\BoldApps\\ShopifyToolkit\\Support\\ShopifyApiHandler::class);\n\n```\n\n### Installing\n\nAdd to `composer.json`\n\n```sh\n$ composer require bold-commerce/bold-shopify-toolkit\n```\n\nBind the appropriate models during your request lifecycle.\n\n```php\n    $this-\u003eapp-\u003ebind(\\BoldApps\\ShopifyToolkit\\Contracts\\ApiSleeper::class,\n            \\BoldApps\\ShopifyToolkit\\Support\\ShopifyApiHandler::class);\n\n    ...\n```\nOr for apps that use container system this will look like below \n```php\n        $shopifyApiHandler = new ShopifyApiHandler();\n        $this-\u003egetContainer()-\u003eaddShared(RequestHookInterface::class, $shopifyApiHandler);\n        $this-\u003egetContainer()-\u003eaddShared(ApiSleeper::class, $shopifyApiHandler);\n```\nabove code can be part of a service provider class\n\nBind the shop that will be using the toolkit before making calls to its services and/or models.\n```php\n// $shop - Eloquent model containing at least the myshopify_domain (\"example.myshopify.com\")\napp()-\u003einstance(BoldApps\\ShopifyToolkit\\Contracts\\ShopBaseInfo::class, $shop);\n \n// $accessToken - Contains the access token string created when the shop installed the app\napp()-\u003einstance(BoldApps\\ShopifyToolkit\\Contracts\\ShopAccessInfo::class, $accessToken);\n```\n\n## Running the tests\n\n```sh\n$ vendor/bin/phpunit tests\n```\n\nThere is a dockerfile provided for running the tests the same way it\nwill run on Circle\n\n```sh\n$ ./runtests.sh\n```\n\n## Examples\n\nCreate the service representing the API you would like to use:\n```php\n$variantService = new BoldApps\\ShopifyToolkit\\Services\\Variant();\n//OR\n$variantService = app()-\u003emake(BoldApps\\ShopifyToolkit\\Services\\Variant::class);\n```\n\nGet a single variant model:\n```php\n/** @var BoldApps\\ShopifyToolkit\\Models\\Variant $variant */\n$variant = $variantService-\u003egetById(2641814487051);\n \n$variant-\u003egetPrice(); //99.0\n```\n\nGet a collection of variant models and filter it so that we only get their titles, using the product ID:\n```php\n/** @var Illuminate\\Support\\Collection $variants */\n$variants = $variantService-\u003egetAllByProductId(327661486091, [\"fields\" =\u003e \"title\"]);\n \n/** @var BoldApps\\ShopifyToolkit\\Models\\Variant $variant */\nforeach ($variants as $variant) {\n    $title = $variant-\u003egetTitle(); //\"Default title\"\n}\n```\n\nUpdate a variant:\n```php\n$variant-\u003esetOption1(\"Not pink\");\n \n$updatedVariant = $variantService-\u003eupdate($variant);\n \n$updatedVariant-\u003egetOption1(); //\"Not pink\"\n```\n\nSee `tests/VariantTest.php` for an example of how to serialize and deserialize a model.\n\n\n## TODO\n\n* Add more tests\n* Add example of advance usage of ShopifyApiHandler\n\n## Contributing\n\nPull requests and ideas are welcome! Open an issue and lets talk.\n\n## Versioning\n\nWe use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/bold-commerce/bold-shopify-toolkit/tags).\n\n## License\n\nThis project is licensed under the Apache 2 License - see the [LICENSE.md](LICENSE.md) file for details\n\n## Acknowledgments\n\n* Thanks to Shopify for making the best Developer Network!\n* Thanks to Bold Commerce Developers for making this amazing package\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbold-commerce%2Fbold-shopify-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbold-commerce%2Fbold-shopify-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbold-commerce%2Fbold-shopify-toolkit/lists"}