2017 © Pedro Peláez
 

library shopify-client

A client to communicate to the Shopify api.

image

edwin-luijten/shopify-client

A client to communicate to the Shopify api.

  • Friday, November 3, 2017
  • by Edwin-Luijten
  • Repository
  • 1 Watchers
  • 0 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Shopify API Client

Latest Version Software License Build Status Code Coverage Quality Score Total Downloads, (*1)

This package provides a client to communicate with the Shopify api., (*2)

Install

Via Composer, (*3)

``` bash $ composer require edwin-luijten/shopify-client, (*4)


## Usage ### Creating a Shopify application Read the following documentation: https://help.shopify.com/api/getting-started ### Using the Client ``` php $client = new \ShopifyClient\Client(new \ShopifyClient\Config($domain, $key, $secret)); $client->orders->get(1); $client->orders->all(); $client->orders->all([ 'page' => 2, ]); $client->orders->metafields->all($orderId);

Throttle request to prevent bucket overflow:, (*5)

``` php $totalProducts = $client->products->count(); $perPage = 50; $pages = $totalProducts <= 50 ? 1: round($totalProducts / $perPage);, (*6)

for($i = 0; $i <= $pages; $i++) { $products = \ShopifyClient\Request::throttle(function($client, $i) { return $client->products->all([ 'page' => $i, ]); }); }, (*7)


### Add your own resources Check https://github.com/Edwin-Luijten/shopify-client/tree/develop/src/Resource for how to create your own resource. ``` php $config = new \ShopifyClient\Config($domain, $key, $secret, [ 'helloWorld' => \HelloWorldClass::class, ]; $client = new \ShopifyClient\Client($config);

Implemented resources

  • [x] Abandoned checkouts
  • [x] Article (Accessible trough blogs)
  • [x] Blog
  • [ ] CarrierService
  • [ ] Checkout
  • [ ] Collect
  • [ ] CollectionListing
  • [ ] Comment
  • [x] Country
  • [ ] CustomCollection
  • [x] Customer
  • [x] CustomerAddress (Accessible trough customers)
  • [ ] CustomerSavedSearch
  • [x] DiscountCode (Accessible trough priceRules)
  • [ ] DraftOrder
  • [ ] Event
  • [x] Fulfillment
  • [x] FulfillmentEvent
  • [x] FulfillmentService
  • [ ] Gift Card (Shopify Plus)
  • [ ] Location
  • [ ] Marketing Event
  • [x] Metafield (products, variants, orders, blogs, articles)
  • [ ] Multipass (Shopify Plus)
  • [x] Order
  • [x] Order Risks (Accessible trough orders)
  • [ ] Page
  • [ ] Policy
  • [x] PriceRule
  • [x] Product
  • [x] Product Image (Accessible trough products)
  • [x] Product Variant (Accessible trough products)
  • [ ] ProductListing
  • [x] Province (Accessible trough countries)
  • [ ] RecurringApplicationCharge
  • [ ] Redirect
  • [ ] Refund
  • [ ] Report
  • [ ] ResourceFeedback
  • [ ] ScriptTag
  • [ ] Shipping Zone
  • [x] Shop
  • [ ] SmartCollection
  • [ ] Storefront Access Token
  • [ ] Theme
  • [ ] Transaction
  • [ ] UsageCharge
  • [x] User (Shopify Plus)
  • [x] Webhook
  • [ ] ShopifyQL

Testing

Set some environment variables first:
- SHOPIFY_DOMAIN
- SHOPIFY_KEY
- SHOPIFY_SECRET
- SHOPIFY_RATE_LIMIT
- SHOPIFY_PRODUCT_VARIANT_ID, (*8)

bash $ ./vendor/bin/phpunit, (*9)

Contributing

Please see CONTRIBUTING for details., (*10)

Security

If you discover any security related issues, please email :author_email instead of using the issue tracker., (*11)

Credits

License

The MIT License (MIT). Please see License File for more information., (*12)

The Versions

03/11 2017

dev-master

9999999-dev

A client to communicate to the Shopify api.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Edwin Luijten

03/11 2017

v0.0.2

0.0.2.0

A client to communicate to the Shopify api.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Edwin Luijten

03/11 2017

dev-develop

dev-develop

A client to communicate to the Shopify api.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Edwin Luijten

31/10 2017

v0.0.1

0.0.1.0

A client to communicate to the Shopify api.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Edwin Luijten

11/10 2017

dev-rewrite

dev-rewrite

A client to communicate to the Shopify api.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Edwin Luijten