elabuwa/shopifyapi

A set of APIs to retrieve data from Shopify

3.0.1 2020-10-05 01:12 UTC

This package is auto-updated.

Last update: 2024-05-05 09:16:57 UTC


README

This is a simple wrapper for Shopify's APIs. This will initially focus on GET requests on the customer and product APIs and move to build on other endpoints as well. PRs are most welcome.

Installation

A simple composer install is all you need to get things running.

$ composer require elabuwa/shopifyapi

Development

The response is a Guzzle Response object

$credentials = [
    'userName' => env('SHOPIFY_USERNAME', ''),
    'password' => env('SHOPIFY_PASSWORD', ''),
    'apiVersion' => env('SHOPIFY_API_VERSION', ''),
    'storeShopifyUrl' => env('SHOPIFY_URL', '')
];
$customerObj = new shopifyCustomers($credentials);
$response = $customerObj->customerInfo('customerID');
var_dump($response['customer']);

Plugins

Guzzle is the only plugin used at the moment. Guzzle by default has an option to throw exceptions on http error codes. However, this has been disabled to allow you to handle errors the way you see fit. If you wish to enable this, simply set $http_errors = true.

Todos

  • Add extra endpoints
  • Write Tests

License

MIT