Shopistuff icon

Shopistuff

Consume Shopify API

Overview

The Shopistuff node for n8n enables you to interact with Shopify's API, specifically focusing here on the Customer resource and the Find Many operation. This operation allows you to search and retrieve multiple customer records from your Shopify store based on a variety of filter criteria.

Common scenarios:

  • Fetching a list of customers for marketing campaigns.
  • Filtering customers by attributes such as email, order history, or subscription status.
  • Exporting customer data for analysis or reporting.

Practical example:
You could use this node to pull all customers who have made a purchase in the last month and have opted into marketing emails, then send them a newsletter via another n8n node.


Properties

Name Type Meaning
Limit Number Max number of results to return. Controls how many customer records are fetched (default: 50).
Order Options Order of results. Choose between ascending or descending by last order date.
Query Fixed Collection Query parameters for filtering the results. Allows specifying one or more filters on customer fields. See below for available filters.

Query sub-properties (filters):

Each filter is optional and can be used individually or in combination:

  • Accepts Marketing (Boolean): Filter by whether the customer accepts marketing.
  • Activation Date (DateTime): Filter by activation date.
  • Address 1/2 (String): Filter by address fields.
  • City (String): Filter by city.
  • Company (String): Filter by company name.
  • Country (String): Filter by country.
  • Customer Date (DateTime): Filter by customer creation date.
  • Customer First Name (String): Filter by first name.
  • Customer ID (Number): Filter by unique customer ID.
  • Customer Last Name (String): Filter by last name.
  • Customer Tag (String): Filter by tag.
  • Email (String): Filter by email address.
  • Email Marketing State (Options: Subscribed/Unsubscribed): Filter by email marketing subscription state.
  • First Name (String): Filter by first name.
  • First Order Date (DateTime): Filter by date of first order.
  • ID (Number): Filter by internal ID.
  • Last Abandoned Order Date (DateTime): Filter by last abandoned order date.
  • Last Name (String): Filter by last name.
  • Multipass Identifier (String): Filter by multipass identifier.
  • Orders Count (Number): Filter by number of orders.
  • Order Date (DateTime): Filter by order date.
  • Phone (String): Filter by phone number.
  • Province (String): Filter by province/state.
  • Shop ID (Number): Filter by shop ID.
  • State (String): Filter by state.
  • Tag (String): Filter by tag.
  • Total Spent (Number): Filter by total amount spent.
  • Updated At (DateTime): Filter by last update timestamp.
  • Verified Email (Boolean): Filter by verified email status.
  • Product Subscriber Status (Options: Subscribed/Unsubscribed): Filter by product subscription status.

Output

The output will be an array of JSON objects, each representing a customer record matching the specified filters.

Example output structure:

[
  {
    "id": 123456,
    "email": "[email protected]",
    "first_name": "John",
    "last_name": "Doe",
    "orders_count": 5,
    "total_spent": "150.00",
    "accepts_marketing": true,
    "created_at": "2023-01-15T12:34:56Z",
    "updated_at": "2023-06-10T09:21:45Z",
    // ...other customer fields
  },
  ...
]
  • Each object contains standard Shopify customer fields such as id, email, first_name, last_name, orders_count, etc.
  • The exact fields returned may depend on your query and Shopify API version.

Dependencies

  • External Service: Requires access to a Shopify store and its API.
  • API Key: You must configure valid Shopify API credentials in n8n under the credential type shopistuffApi.
  • n8n Configuration: No additional configuration required beyond setting up credentials.

Troubleshooting

Common issues:

  • Invalid Credentials: If your API key or password is incorrect, you'll receive authentication errors. Double-check your credentials in n8n.
  • Insufficient Permissions: Ensure your Shopify API user has permission to read customer data.
  • Too Many Results: If you request too many records without proper limits, you may hit Shopify API rate limits.
  • Filter Mismatch: Using filters that do not match any customers will result in an empty array.

Error messages:

  • "At least one line item has to be added" – Not relevant for this operation, but may appear if using other operations incorrectly.
  • "error": "<message>" – Any error encountered during execution will be included in the output if "Continue On Fail" is enabled.

Links and References

Discussion