Shopify

libs.shopify.get()

Requires the Shopify integration to be set up

Returns an instance of Shopify-api-node library, with the credentials already set up. You can then call Shopify APIs directly, like the following.

const shopify = libs.shopify.get();
const { tags } = awai

const shopify = libs.shopify.get();
const query = `{
    order(id: "gid://shopify/Order/${orderID}") {
      id
      tags
      lineItems (first: 100) {
        edges {
          node {
            id
            product {
              id
              tags
            }
          }
        }
      }
    }
  }`;
  const { order } = await shopify.graphql(query);

// if you have added multiple shopify integration to the same app,
// you can access them like this:

const shopOne = libs.shopify.get('shopOne.myshopify.com');
const shopTwo = libs.shopify.get('shopTwo.myshopify.com');

...

Last updated