Skip to content

How I Created a Deal in HubSpot with Line Items Automatically Associated after Customer Purchase

Hello, I’m Ryan Schweighart, founder of Whole Hart Impact, where I help organizations grow without the growing pains with HubSpot and Zapier. Today, I’ll demonstrate how to automatically add line items to a deal in HubSpot using Zapier, inspired by a question from the HubSpot community.



This tutorial will show you how to automatically associate multiple line items with a single Zap in Zapier. By the end of this demo, you will know how to:

  1. Set up a trigger for your e-commerce platform.
  2. Create a deal in HubSpot.
  3. Loop through line items.
  4. Create and associate line items with the deal.
  5. Update the deal amount in HubSpot.

Step-by-Step Guide

1. Setting Up the Trigger

For this demo, I’m using Google Sheets as the trigger, but you can use your e-commerce platform like Shopify or Squarespace. The trigger step captures order information and initiates the Zap.

2. Creating the Deal in HubSpot

After setting up the trigger, create a deal in HubSpot using the “Create Deal” event in Zapier. Name the deal dynamically using data from the trigger step and assign it to the appropriate pipeline and stage.

3. Looping Through Line Items

To handle multiple line items, use the “Looping by Zapier” step. Create a loop from text, typically with a comma delimiter. This allows Zapier to process each line item individually.

4. Finding and Creating Line Items

Inside the loop:

  • Find Product in HubSpot: Use the product name or ID from the e-commerce platform to find the corresponding product in HubSpot.
  • Create Line Item: Once the product is found, create a line item using the “Create Line Item” event in Zapier, mapping necessary details like product ID and quantity.

5. Associating Line Items with the Deal

Use the “Create Associations” event to link the line item to the deal created earlier. This step ensures that each line item is properly associated with the deal for accurate tracking and reporting.

6. Updating the Deal Amount

The final step is to update the deal amount. This ensures that the total deal value reflects all associated line items. Use a condition to check if it's the last loop iteration, then update the deal amount in HubSpot.


By following these steps, you can automate the process of adding line items to deals in HubSpot using Zapier. This not only saves time but also ensures accuracy in tracking customer purchase patterns. If you have any questions or need further assistance, feel free to reach out.

Thank you for following along. Bye for now!