Shopify

This component lets you build integrations that extend and enhance the Shopify admin.

Follow these instructions to learn how to integrate the Shopify store with your Digital Experience Platform applications: https://docs.squiz.net/matrix/version/latest/tutorials/integrations/use-shopify-to-sell-products-through-your-site.html.

This component was tested using API version 2021-04. You can find more information about API versioning at Shopify here or read more about the Shopify Admin API here.

Prerequisites

Credentials

Credentials
ShopName

The name of your shop. For example, example.myshopify.com.

API Key

The API key you generated in the Shopify admin area.

Password

The API password that you generated.

Type

An authorization type. This is needed only for the Webhook subscription trigger. The following authorization types support it:

No Auth

Use this method to work with any open REST API.

Basic Auth

Use this method to provide sign-in credentials like username and password.

API Key Auth

Use this method to provide API Key to access the resource.

HMAC verification shared secret

Use this to verify through a shared secret. The x-eio-signature header should be specified.

  • The component calls a list products endpoint under the hood to verify credentials. To succeed, you need to grant at least Read permissions to the app in the Apps  App development  YOUR APP NAME  ADMIN API PERMISSIONS  Products set to 'Read access' (or 'Read and write')

    Permissions
  • Due to current platform limitations, keep the Type field populated with the No auth option to ensure correct component behavior.

    Shopify Webhook HMAC Secret

    This field is required only for the Webhook subscription trigger. When Shopify sends data through Webhooks, it signs the request with an HMAC header. To find the secret, you need to navigate to Settings  Notifications  Webhooks and copy the secret.

  • Shopify’s instructions on generating credentials are available here.

Metafields

Metafields for an object can be written when upserting/creating an object that supports metafields. When polling for objects, looking up, or searching for objects, a checkbox can be selected to fetch the corresponding metafields. Selecting this checkbox will cause more API calls to be consumed (an additional API call is made for each object read.)

When reading metafields, data will be returned in this format. When writing metafield data, the following format is also expected for the metafields object.

{
  "metafieldNamespaceOne": {
    "metafieldKeyOne": "Metafield Value for metafieldNamespaceOne.metafieldKeyOne",
    "metafieldKeyTwo": "Metafield Value for metafieldNamespaceOne.metafieldKeyTwo"
  },
  "metafieldNamespaceTwo": {
    "metafieldKeyThree": "Metafield Value for metafieldNamespaceTwo.metafieldKeyThree"
  }
}

Shopify metafields support the following three types:

  • integer metafields will be created whenever the value provided for a metafield is a JSON number that is an integer. When reading Shopify integer metafields, they will result in JSON numbers.

  • string metafields will be created whenever the value provided for a metafield is a JSON string or a JSON number that is not an integer. When reading any Shopify string metafields, they will result in JSON strings regardless of whether or not they could be parsed as numbers.

  • json_string metafields will be created whenever the value provided for a metafield is a JSON object, array, or boolean. The incoming value will be converted to a JSON string and stored. When reading Shopify metafields, they will be converted back to their JSON forms. Setting a metafield with the value of JSON null will result in that metafield being deleted.

Not setting a value for a metafield will result in that metafield being unchanged.

Triggers

The Shopify component has the following Shopify triggers

Polling trigger

Polls Shopify API for new and updated objects.

Webhook subscription trigger

Creates webhook subscriptions on the Shopify side and receives events to the flow.

Actions

Shopify component has the following Shopify actions:

Lookup Object action

Finds object by ID.

Lookup Objects action

Retrieves object by ID.

Create Object action

Action to create a new object instance. This can only be used for an object that can’t be updated.

Upsert Object action

Upsert Object action is helpful if it isn’t known if there is already an object in the system. Action determines if the data needs to be matched to an existing object or added to a new one. This can only be used for objects that can be created and updated.

Delete Object action

Delete Object By Unique Criteria.

Make Raw Request

Allows you to construct individual requests to be sent to the API manually.