PHPackages                             bold-commerce/bold-shopify-toolkit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. bold-commerce/bold-shopify-toolkit

ActiveLibrary[API Development](/categories/api)

bold-commerce/bold-shopify-toolkit
==================================

7.1.0(10mo ago)28101.0k46[9 PRs](https://github.com/bold-commerce/bold-shopify-toolkit/pulls)Apache-2.0PHPCI passing

Since Jul 14Pushed 1mo ago20 watchersCompare

[ Source](https://github.com/bold-commerce/bold-shopify-toolkit)[ Packagist](https://packagist.org/packages/bold-commerce/bold-shopify-toolkit)[ RSS](/packages/bold-commerce-bold-shopify-toolkit/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (169)Used By (0)

Bold Shopify Toolkit
====================

[](#bold-shopify-toolkit)

[![CircleCI](https://camo.githubusercontent.com/03149555223286cfa8cda4681e88ce74c25ae992de00be443c8810fda1bda045/68747470733a2f2f636972636c6563692e636f6d2f67682f626f6c642d636f6d6d657263652f626f6c642d73686f706966792d746f6f6c6b69742f747265652f6d61737465722e7376673f7374796c653d737667)](https://circleci.com/gh/bold-commerce/bold-shopify-toolkit/tree/master)

Purpose
-------

[](#purpose)

Bold 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.

Getting Started
---------------

[](#getting-started)

This package works best with a Dependency Injection Container since there are many dependencies that need to be resolved.

### Prerequisites

[](#prerequisites)

To use this package, you will need to bind Models to the following interfaces.

- [ShopAccessInfo](src/Contracts/ShopAccessInfo.php)
- [ShopBaseInfo](src/Contracts/ShopBaseInfo.php)
- [ApplicationInfo](src/Contracts/ApplicationInfo.php)
- [ApiSleeper](src/Contracts/ApiSleeper.php)

An example API Sleeper has been included in this package.

**Laravel:** (see `AppServiceProvider.php`)

```
    $this->app->bind(\BoldApps\ShopifyToolkit\Contracts\ApiSleeper::class,
            \BoldApps\ShopifyToolkit\Support\ShopifyApiHandler::class);
```

### Installing

[](#installing)

Add to `composer.json`

```
$ composer require bold-commerce/bold-shopify-toolkit
```

Bind the appropriate models during your request lifecycle.

```
    $this->app->bind(\BoldApps\ShopifyToolkit\Contracts\ApiSleeper::class,
            \BoldApps\ShopifyToolkit\Support\ShopifyApiHandler::class);

    ...
```

Or for apps that use container system this will look like below

```
        $shopifyApiHandler = new ShopifyApiHandler();
        $this->getContainer()->addShared(RequestHookInterface::class, $shopifyApiHandler);
        $this->getContainer()->addShared(ApiSleeper::class, $shopifyApiHandler);
```

above code can be part of a service provider class

Bind the shop that will be using the toolkit before making calls to its services and/or models.

```
// $shop - Eloquent model containing at least the myshopify_domain ("example.myshopify.com")
app()->instance(BoldApps\ShopifyToolkit\Contracts\ShopBaseInfo::class, $shop);

// $accessToken - Contains the access token string created when the shop installed the app
app()->instance(BoldApps\ShopifyToolkit\Contracts\ShopAccessInfo::class, $accessToken);
```

Running the tests
-----------------

[](#running-the-tests)

```
$ vendor/bin/phpunit tests
```

There is a dockerfile provided for running the tests the same way it will run on Circle

```
$ ./runtests.sh
```

Examples
--------

[](#examples)

Create the service representing the API you would like to use:

```
$variantService = new BoldApps\ShopifyToolkit\Services\Variant();
//OR
$variantService = app()->make(BoldApps\ShopifyToolkit\Services\Variant::class);
```

Get a single variant model:

```
/** @var BoldApps\ShopifyToolkit\Models\Variant $variant */
$variant = $variantService->getById(2641814487051);

$variant->getPrice(); //99.0
```

Get a collection of variant models and filter it so that we only get their titles, using the product ID:

```
/** @var Illuminate\Support\Collection $variants */
$variants = $variantService->getAllByProductId(327661486091, ["fields" => "title"]);

/** @var BoldApps\ShopifyToolkit\Models\Variant $variant */
foreach ($variants as $variant) {
    $title = $variant->getTitle(); //"Default title"
}
```

Update a variant:

```
$variant->setOption1("Not pink");

$updatedVariant = $variantService->update($variant);

$updatedVariant->getOption1(); //"Not pink"
```

See `tests/VariantTest.php` for an example of how to serialize and deserialize a model.

TODO
----

[](#todo)

- Add more tests
- Add example of advance usage of ShopifyApiHandler

Contributing
------------

[](#contributing)

Pull requests and ideas are welcome! Open an issue and lets talk.

Versioning
----------

[](#versioning)

We 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).

License
-------

[](#license)

This project is licensed under the Apache 2 License - see the [LICENSE.md](LICENSE.md) file for details

Acknowledgments
---------------

[](#acknowledgments)

- Thanks to Shopify for making the best Developer Network!
- Thanks to Bold Commerce Developers for making this amazing package

###  Health Score

62

—

FairBetter than 99% of packages

Maintenance79

Regular maintenance activity

Popularity41

Moderate usage in the ecosystem

Community34

Small or concentrated contributor base

Maturity82

Battle-tested with a long release history

 Bus Factor7

7 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~21 days

Recently: every ~73 days

Total

146

Last Release

50d ago

Major Versions

4.0.2 → v5.0.02023-04-25

4.1.0 → 5.5.42024-02-21

4.x-dev → 6.0.02024-02-26

v6.3.0 → v7.0.02025-05-29

7.1.0 → 8.0.0-beta.12025-08-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/44ab83c961dc564c082ce259a5337e2085170c1ac2b731f9d63183e6bbe7d0ea?d=identicon)[bold.it](/maintainers/bold.it)

![](https://www.gravatar.com/avatar/430bbed371eba1fa86795e2ff900700d24436012e785a2a87fbec7c1184a912a?d=identicon)[erkswerks](/maintainers/erkswerks)

![](https://www.gravatar.com/avatar/bc89d977f5cf67b6dc7c5b104ba0de0df528551c9ab5d743744919cd6f07bbe1?d=identicon)[CalinBold](/maintainers/CalinBold)

![](https://www.gravatar.com/avatar/01718c0c89915fbdccabf4261b703029c8b5b72edd1aa462fec8c5323f5e9a77?d=identicon)[bold-github-ci](/maintainers/bold-github-ci)

---

Top Contributors

[![deepsidhu1313](https://avatars.githubusercontent.com/u/7684338?v=4)](https://github.com/deepsidhu1313 "deepsidhu1313 (14 commits)")[![walrusk](https://avatars.githubusercontent.com/u/487708?v=4)](https://github.com/walrusk "walrusk (13 commits)")[![jerairrest](https://avatars.githubusercontent.com/u/1588969?v=4)](https://github.com/jerairrest "jerairrest (13 commits)")[![grandelc](https://avatars.githubusercontent.com/u/5347427?v=4)](https://github.com/grandelc "grandelc (12 commits)")[![Pawandeepalw](https://avatars.githubusercontent.com/u/3940076?v=4)](https://github.com/Pawandeepalw "Pawandeepalw (11 commits)")[![digiexchris](https://avatars.githubusercontent.com/u/5871642?v=4)](https://github.com/digiexchris "digiexchris (9 commits)")[![bmansell](https://avatars.githubusercontent.com/u/12076625?v=4)](https://github.com/bmansell "bmansell (8 commits)")[![Wryte](https://avatars.githubusercontent.com/u/1534358?v=4)](https://github.com/Wryte "Wryte (7 commits)")[![rickywiens](https://avatars.githubusercontent.com/u/675907?v=4)](https://github.com/rickywiens "rickywiens (6 commits)")[![JasonTToews](https://avatars.githubusercontent.com/u/41793397?v=4)](https://github.com/JasonTToews "JasonTToews (6 commits)")[![theRTC204](https://avatars.githubusercontent.com/u/6956413?v=4)](https://github.com/theRTC204 "theRTC204 (5 commits)")[![jim-boldcommerce](https://avatars.githubusercontent.com/u/85518614?v=4)](https://github.com/jim-boldcommerce "jim-boldcommerce (4 commits)")[![James300](https://avatars.githubusercontent.com/u/9325039?v=4)](https://github.com/James300 "James300 (4 commits)")[![mCassy](https://avatars.githubusercontent.com/u/9416864?v=4)](https://github.com/mCassy "mCassy (4 commits)")[![kfalkowski11](https://avatars.githubusercontent.com/u/45801249?v=4)](https://github.com/kfalkowski11 "kfalkowski11 (3 commits)")[![jdart-bold](https://avatars.githubusercontent.com/u/140189863?v=4)](https://github.com/jdart-bold "jdart-bold (3 commits)")[![markstgodard](https://avatars.githubusercontent.com/u/405082?v=4)](https://github.com/markstgodard "markstgodard (3 commits)")[![lizkenyon](https://avatars.githubusercontent.com/u/23265671?v=4)](https://github.com/lizkenyon "lizkenyon (2 commits)")[![JoshuaKlassen](https://avatars.githubusercontent.com/u/12076483?v=4)](https://github.com/JoshuaKlassen "JoshuaKlassen (2 commits)")[![mitchell-engen](https://avatars.githubusercontent.com/u/35231085?v=4)](https://github.com/mitchell-engen "mitchell-engen (2 commits)")

---

Tags

laravelphpshopifyshopify-apisnyk-scansymfony

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/bold-commerce-bold-shopify-toolkit/health.svg)

```
[![Health](https://phpackages.com/badges/bold-commerce-bold-shopify-toolkit/health.svg)](https://phpackages.com/packages/bold-commerce-bold-shopify-toolkit)
```

###  Alternatives

[skagarwal/google-places-api

Google Places Api

1913.0M8](/packages/skagarwal-google-places-api)[dcblogdev/laravel-microsoft-graph

A Laravel Microsoft Graph API (Office365) package

168285.5k1](/packages/dcblogdev-laravel-microsoft-graph)[vluzrmos/slack-api

Wrapper for Slack.com WEB API.

102589.1k3](/packages/vluzrmos-slack-api)[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1344.8k1](/packages/jasara-php-amzn-selling-partner-api)[grantholle/powerschool-api

A Laravel package to make interacting with PowerSchool less painful.

1715.6k1](/packages/grantholle-powerschool-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
