Shopify API

Component ID

2469089

Component name

Shopify API

Component type

module

Maintenance status

Development status

Component security advisory coverage

covered

Downloads

4970

Component created

Component changed

Component body

Simple integration with the Shopify API. Shopify is a leading eCommerce solution. Using this module requires a Shopify store of your own.

Drupal 7

Dependencies

  • Libraries API
  • Shopify API library (see installation instructions)

Installation

  1. Download the Shopify API library from https://github.com/cmcdonaldca/ohShopify.php. Add it to your libraries directory (ie, sites/all/libraries/shopify).
  2. Download and install this module.
  3. Navigate to the admin settings page at admin/config/services/shopify.
  4. Follow the help instructions to connect Drupal to your Shopify store.

Usage

$client = shopify_api_client();
$products = $client->call('GET', '/admin/products.json', array('limit' => 100, 'page' => 2));

Drupal 8

Dependencies

  • Use composer to download the required Shopify PHP SDK library. Run in your Drupal root:

    composer require donutdan4114/shopify:dev-master
    You should now have a new directory in /vendor/donutdan4114/shopify

Installation

  1. Download this module.
  2. Run composer require donutdan4114/shopify:dev-master in the root directory.
  3. Navigate to the admin settings page at admin/config/system/shopify_api.
  4. Follow the help instructions to connect Drupal to your Shopify store.

Usage

Shopify PHP SDK documentation.

$client = shopify_api_client();
$products = $client->getProducts(['query' => ['limit' => 100, 'page' => 2']]);
$shop = $client->getShopInfo();

Notes

This module provides no user interface other than the admin configuration form. It is intended for developers.

For a full Shopify integration, check out the Shopify module, which uses this module.