Skip to main content

Shopify

1. Introduction

Shopify is an e-commerce platform that lets merchants worldwide to build and customize online stores to sell theor products. Integrating Shopify with Yellow.ai enables seamless access to Shopify data within our platform. This integration facilitates data utilization for effective campaigns, event management, and enhanced customer support.

Here are some key benefits of leveraging this integration:

  • Unified customer data & customer self-serve: Gain a 360-degree view of your customers by integrating their Shopify data with other touchpoints. You can enable customers to access their data and order details conveniently through bot conversations.
  • Personalized campaigns and automated workflows: Leverage customer data to create targeted marketing campaigns, boost sales and create automated workflows.
  • Better support with multi-channel: Provide better customer support by accessing order history and customer details directly from Shopify and interact across various channels, including chat, email, Whatsapp and more.
  • Time and Cost Savings: Reduce manual data entry, streamline processes, and save time and resources by automating tasks.

2.Integrate Shopify with Yellow.ai

Step 1: Create Shopify store app

  1. Login to your Shopify account.

  2. Choose the store you want to create the app for.

  3. Click Apps on the left sidebar and click App and sales channel settings.

  4. Click Develop apps for your app store.

  5. Click Create app.

  6. Provide a name for your app and click Create app.

  7. In the Admin API integration section, select the actions you want the Yellow.ai platform to perform. For a detailed help doc, see Custom apps section of the Shopify documentation.

    drawing
  1. In Shopify admin, choose both Read and Write access to following scopes.

    ScopeDescription
    CustomersAccess and manage customers, including their addresses, order history, and segments.
    OrdersRetrieve and manage orders, transactions, fulfillments, and abandoned checkouts.
    ProductsView and manage products, variants, and collections.
    ReturnsView and manage return orders.
    Script tagsView and manage javascript tags for store front and order status pages.

Step 2: Get Admin API access credentials

  • Go to API credentials section and copy the Admin API access token and API secret key.

Step 3: Connect the Shopify Store App with Yellow.ai

You need to use the API token to establish integration with Yellow.ai as explained below:

  1. Go to the [yellow.ai platform].

  2. Go to the bot and navigate to Integrations.

    drawing
  3. Type shopify in the Search box, and select Shopify Shop from the list.

  4. Scroll down to Add account and fill in the required details.

    OptionDescription
    Give accout nameProvide a name to Shopify account to be connected.
    Shop NameName of your shop in Shopify. The shop name should be taken from the Shopify store URL, for example if the merchant store URL is yellowxyz.myshopify.com,the shop name would be yellowxyz.
    Admin API Access TokenCopy and paste this from your Shopify store (refer step 8). Please only enter the Admin API access token that is displayed during the app creation process on Shopify.
    API Secret KeyCopy and paste this from your Shopify store (refer step 8)
    Domain nameDomain name refers to the URL or web address that directs customers to your online store. Enter the domain name to enable Yellow to ingest the script on the store and capture user-related events for User 360. For example, yellowxyz.myshopify.com.
  1. Click Connect.

    If the integration is successful, You can see the Shopify Shop app on the Integrations page. With this, the connection has been established between the integration app and your Shopify account.

note
  • Please ensure that you enter your store name exactly as it appears in your Shopify account.
  • For the initial user backfilling of the recent 10k user data, please reach out to the team to initiate the process.

3. Shopify user data syncing in User 360/Engage

This integration automates the creation of user records in User 360 using Shopify event data. By default, it is configured to capture userIds, emails, and phone numbers. Additionally, the integration enables the automatic synchronization of the following event data with User 360. This empowers User 360 as a valuable resource for personalized and effective user engagement strategies.

note

Shopify events will be generated only from the store channel and passed to User 360. If event tracking is enabled in the bot, these events will also be sent to the bot. Events originating from other channels, such as orders created through a bot or WhatsApp, will generally not be relayed unless the user profile exists in User 360.

Supported standard user properties from Shopify events

The following standard user properties are automatically added or updated in User 360 directly from Shopify events.

  • userId
  • email
  • firstName
  • phone
  • city
  • country

Supported Shopify events syncing in User 360

The integration enables the automatic synchronization of the following event data with User 360. This empowers User 360 as a valuable resource for personalized and effective user engagement strategies.

The following table provides a comprehensive list of Shopify events along with their descriptions and sample use cases.

EventDescriptionSample use cases
shopifyNewOrderA new order is created in the Shopify store.Trigger order confirmation email or update inventory when a new order is created in your Shopify store.
shopifyNewProductA new product has been added to the Shopify store.Update product catalog, create product listings, or send a WhatsApp notification when a new product is added to your Shopify store.
shopifyOrderCancelledAn order is cancelled.Handle order cancellation: Update inventory levels, refund payments, or notify customers when their orders are canceled.
shopifyOrderFulfilledAn order was fulfilled or completed.Update shipping information, send shipping notifications to the customer, or update order status when an order is fulfilled or completed.
shopifyOrderPaidPayment made for an order.Send payment receipt, or update financial record when a payment is made for an order.
shopifyRefundCreatedA refund was created for an order.Update financial records, notify customers about their refund, or adjust inventory levels when a refund is issued for an order.
shopifyReturnRequestA return request is initiated.Helpful for handling return-related processes, such as notifying customers and managing inventory.
shopifyNewCustomerA new customer is registered.Add the customer to User 360, send welcome email, or track customer acquisition when a new customer registers in your Shopify store.
shopifyCustomerUpdateA customer’s profile details have been updated.Keep your customer database up to date or send profile change notification when a customer's profile details are updated.
shopifyCheckoutCreatedOrder checkout is initiated in Shopify.Track order progress when an order checkout is initiated in your Shopify store.
shopifyOrdersUpdatedShopify order is updated.Monitor order changes, adjust inventory, or notify the customer on order updates to handle order updates in Shopify store.
shopifyCartCreateA cart is created in Shopify.Track shopping cart activity, gather data on abandoned carts, or initiate cart-related marketing efforts when a cart is created in Shopify store.
note

To know how to run campaigns based on Shopify events, see here.

Payload samples of Shopify events in User 360

The following are the event schemas associated with various Shopify events. These event schemas define the structure and data that get sent to the CDP when specific events occur in your Shopify store.

From SDK

{
"token": "c1-830e691d16f1093cfcde75960320d9cd",
"note": "",
"attributes": {},
"original_total_price": 3000,
"total_price": 3000,
"total_discount": 0,
"total_weight": 0,
"item_count": 1,
"items": [
{
"id": 43453026762901,
"properties": {},
"quantity": 1,
"variant_id": 43453026762901,
"key": "43453026762901:159c30471db14672fe636da24f9346f2",
"title": "Adania Pant - Black",
"price": 3000,
"original_price": 3000,
"discounted_price": 3000,
"line_price": 3000,
"original_line_price": 3000,
"total_discount": 0,
"discounts": [],
"sku": "",
"grams": 0,
"vendor": "twewr",
"taxable": true,
"product_id": 7907558064277,
"product_has_only_default_variant": false,
"gift_card": false,
"final_price": 3000,
"final_line_price": 3000,
"url": "/products/adania-pant?variant=43453026762901",
"featured_image": {
"aspect_ratio": 0.714,
"alt": "Adania Pant",
"height": 2048,
"url": "https://cdn.shopify.com/s/files/1/0458/0252/0725/files/2015-03-30_Jake_Look_16_20656_16533.jpg?v=1684943817",
"width": 1462
},
"image": "https://cdn.shopify.com/s/files/1/0458/0252/0725/files/2015-03-30_Jake_Look_16_20656_16533.jpg?v=1684943817",
"handle": "adania-pant",
"requires_shipping": true,
"product_type": "",
"product_title": "Adania Pant",
"product_description": "\\nThis is a demonstration store. You can purchase products like this from Baby & Company\\nSuper stretch Adaina Pant offers the classic skinny with all the fun bits. Zip closure at back with concealed zip openings at ankles. By Malene Birger. Color Blue. 90% Polyamide, 10% Elastane. Made in China. Ashley is wearing a European 36. ",
"variant_title": "Black",
"variant_options": [
"Black"
],
"options_with_values": [
{
"name": "Color",
"value": "Black"
}
],
"line_level_discount_allocations": [],
"line_level_total_discount": 0,
"quantity_rule": {
"min": 1,
"max": null,
"increment": 1
},
"has_components": false
}
],
"requires_shipping": true,
"currency": "INR",
"items_subtotal_price": 3000,
"cart_level_discount_applications": [],
"userId": "x1660667398488_WIv23Iv-fr-McW_SZme-l"
}


Run campaigns based on Shopify events

You can initiate Flow campaigns based on Shopify events that you have enabled in Yellow.ai.

In Flow campaigns, choose Condition as Has done event check and in Campaign triggers when user, choose the event that you want to use to trigger campaigns.

Here are some examples:

In an online store on Shopify, you notice that some customers abandon their shopping carts during the checkout process. To recover those potential sales, set up a Flow campaign to automatically send reminders to users who have abandoned their shopping carts on your Shopify store.

Entry trigger: shopifyCartCreate event

Exception to trigger notification: ShopifyCheckoutCreated event

Flow configuration:

  1. Trigger the flow: Initiate the campaign when a user adds items to their cart, identify it using the shopifyCartCreate event.

  2. Wait condition: Check if the user has completed the purchase by waiting for the ShopifyCheckoutCreated event. Set time delay, say 10 min. If no ShopifyCheckoutCreated event is detected within 10 min, proceed to the next step.

  3. Send abandonment reminder: If the user has not completed the purchase within the specified time, send a WhatsApp notification. Here is a sample message:

    • Sample Notification Message: "Hello [User's Name], we noticed you left some wonderful items in your cart. 🛒 Don't miss out on these great finds! Tap here to complete your purchase: [Checkout Link]. Thank you for choosing our store!"
note

You will see only events that you have enabled for the bot. For more details, see how to activate events.

To know more about Flow campaigns, click here.


4. Access Shopify data in bot conversations

Once the integration is set up, Shopify events start flowing to Yellow.ai. These events serve as triggers for bot flows, enabling the creation of personalized conversations, running effective campaigns, storing customer data in User360,personalized responses, data enrichment, and the creation of efficient workflows.

Supported Shopify events you can use in Automation

The following table provides a comprehensive list of Shopify events along with their descriptions and sample use cases.

EventDescriptionSample use cases
shopifyNewOrderA new order is created in the Shopify store.- Trigger order confirmation emails
- Update inventory when a new order is created in your Shopify store.
shopifyNewProductA new product has been added to the Shopify store.- Update the product catalog
- Create product listings
- Send WhatsApp notifications when a new product is added to your Shopify store.
shopifyOrderCancelledAn order is cancelled.- Handle order cancellations
- Update inventory levels
- Refund payments
- Notify customers when their orders are canceled.
shopifyOrderFulfilledAn order was fulfilled or completed.Update shipping information
- Send shipping notifications to customers
- Update order status when an order is fulfilled or completed.
shopifyOrderPaidPayment made for an order.- Send payment receipts
- Update financial records when a payment is made for an order.
shopifyRefundCreatedA refund was created for an order.- Update financial records
- Notify customers about their refunds
- Adjust inventory levels when a refund is issued for an order.
shopifyNewCustomerA new customer is registered.- Add the customer to User 360
- Send welcome emails
- Track customer acquisition when a new customer registers in your Shopify store.
shopifyCustomerUpdateA customer’s profile details have been updated.- Keep your customer database up to date
- Send profile change notifications when a customer's profile details are updated.
shopifyCheckoutCreatedOrder checkout is initiated in Shopify.- Track order progress when an order checkout is initiated in your Shopify store.
shopifyOrdersUpdatedShopify order is updated.- Monitor order changes
- Adjust inventory
- Notify the customer about order updates to handle order updates in the Shopify store.

Events enabled by default in Studio

Once your integration is set up, the following events are sent to bot directly are available by default with this integration.

  • shopifyRefundCreated
  • shopifyNewProduct
  • shopifyOrderPaid
note

The availability of events within the integration depends on the scopes you have enabled when generating the API token.

Activate Shopify events you wish to use in Automation

Apart from the events mentioned in the previous section, you can enable other events that you want to make use in Automation. For a list of events supported in Automation, see here.

To enable events:

  1. Go to Automation > Event > Integrations. You will see all the events related to Shopify with the prefix shopify<eventName>.

  2. Navigate to the event that you want to enable and click on the more options icon > Activate.

  1. Once you enable required shopify events, you can use these Shopify events to:
note

Error: Webhook is failing:

  • Ensure you have activated the respective event as mentioned above. If your webhook fails more than twice, it will be removed and your application will not receive any notifications.

Fetch Shopify data in bot conversations

To make use of Shopify events in bot flows:

  1. Go to your bot in Automation and navigate to the flow where you want to use a Shopify event.
  1. Navigate to the Integration node - Node > Integration > Shopify Shop.

    drawing
  1. Choose your Account name

  2. Select the respective Action that you need to perform. For details of each schema, see Schema details for different Shopify actions.

  3. In Var pass the parameter variable that contains the required information in the format variables.objVariableName.key.

    drawing
  4. Use Show sample response to see all the details (in the JSON format) that the function can retrieve.

  5. To store the response, use Store the response in a variable.

    drawing
  6. You can decide which info to display to the user. Use the Function node to customise that information in the Code tab. For example, in the previous screenshot, order details are stored in the variable order_details. You can access this data using order_details.order.name.

Shopify action nodes with Sample payloads

You can see all the Shopify action nodes in Integration > Shopify node (Refer to the previous section for more details).

The following are some limitations with these action nodes:

  1. Data Fetch Limitation: You can retrieve a maximum of 50 records (products/orders/collections etc.) in a single query or request.

  2. Object Size Restriction: The response object size is limited to 90KB. The data you send or receive should not exceed this limit.

  3. Product Display Limitation: When displaying product details, you can showcase up to 8 carousel images. This limitation is due to the inability to use a "Next" option to view additional products in subsequent lists.

These points highlight the specific constraints and limitations that users or developers should be aware of when working with this system or application.

This function retrieves order details using the provided order ID.

ParameterDatatypeExample
order_idNumber632910392

Here is a sample response schema:


{
"order": {
"id": 450789469,
"cancel_reason": null,
"cancelled_at": null,
"confirmed": true,
"email": "[email protected]",
"financial_status": "partially_refunded",
"fulfillment_status": null,
"name": "#1001"
}
}

Map shopify data to user properties

You can add/update user properties with Shopify data through bot conversations by mapping them to user properties. This enables you to create highly personalized and engaging interactions with your users.

For detailed instructions, see Add user variables that come from user events into user properties.

You can create personalized conversations using stored properties, know how.



5. Import Shopify bot from Marketplace template

Importing a Shopify bot template into your Yellow.ai account is a straightforward process that streamlines the integration of Yellow.ai with your Shopify store. This template provides pre-configured floes and actions designed to enhance your e-commerce operations. This includes flows such as Browse products, Get order details, authenticate user via OTP, show customer details, connect to support, and raise ticket.

To import the Shopify shop template in your bot:

  1. Navigate to the Marketplace and search for Shopify. You will see Shopify E-commerce with Shopify integration.

  2. Select the template and click +Use Template.

    The template will start importing. Wait until the import is complete.

  3. Open the Flows dropdown to see the new flows added to the bot.


6. Troubleshooting

Error: Your webhook is failing

Ensure you have enabled Shopify's event in Event Hub. If your webhook fails more than twice, it will be removed and your application will not receive any notifications.


7. Disconnect Shopify integration

To remove this integration from your bot:

  1. On the bot configuration page, go to Integrations.
  2. Search for Shopify shop > Disconnect.

Important References

  1. Shopify Custom Apps
  2. Configuring Storefront data for getAllCollections integration node