# Zapier Integration Connect Powerlily to 6,000+ apps with Zapier. Automatically sync quotes and leads to your CRM, send notifications, update spreadsheets, and more—all without writing code. ## What is Zapier? Zapier is an automation platform that connects different apps together. When something happens in one app (a "trigger"), Zapier automatically performs an action in another app. **Popular Use Cases:** - **CRM Sync** - New quote → Create deal in Salesforce, HubSpot, or Pipedrive - **Team Notifications** - New lead → Send Slack message or SMS - **Spreadsheet Tracking** - Quote updated → Add row to Google Sheets - **Email Automation** - Quote signed → Send email via Mailchimp or SendGrid - **Project Management** - Quote won → Create project in Asana or Monday.com ## Prerequisites Before you start, you'll need: 1. **Zapier Account** - Free plan available at [zapier.com](https://zapier.com) 2. **Powerlily API Key** - See [[settings/API Settings|API Settings]] for setup 3. **Target App Account** - The app you want to connect to (Salesforce, Slack, etc.) --- ## Setting Up Zapier with Powerlily Powerlily doesn't have a native Zapier app (yet!), but you can use **Webhooks by Zapier** to connect using the Powerlily API. ### Step 1: Get Your API Key 1. Log into Powerlily 2. Go to **Company Settings** > **API Settings** 3. Click **Generate New API Key** 4. Copy and save your API key securely > **Important:** You'll need this API key for every Zap you create. ### Step 2: Create a New Zap 1. Log into your Zapier account 2. Click **Create Zap** (or **+ Create** button) 3. Give your Zap a descriptive name (e.g., "New Powerlily Quote to Salesforce") --- ## Common Zap Workflows ### Workflow 1: New Quotes to Google Sheets Track all new quotes in a spreadsheet automatically. #### Setup Instructions **1. Configure the Trigger (Schedule)** Since Powerlily doesn't send webhooks, we'll poll for new quotes: - **App:** Schedule by Zapier - **Trigger:** Every Hour (or desired frequency) - Click **Continue** **2. Get New Quotes** - **App:** Webhooks by Zapier - **Action:** GET Request - Click **Continue** **Configure the GET Request:** - **URL:** `https://yourcompany.powerlily.io/api/v1/quotes?per_page=10` - Replace `yourcompany` with your subdomain or custom domain - **Headers:** - Key: `X-Api-Key` - Value: Your 64-character API key (paste it here) - Click **Continue** and **Test** to verify connection **3. Parse the Response** The API returns JSON with a `data` array. You'll need to loop through quotes: - **App:** Code by Zapier (optional for advanced users) - **Or:** Use Zapier's **Looping** feature (available on paid plans) **For simple setups without looping:** - Use **Formatter by Zapier** > **Utilities** > **Line-item to Text** to extract the first quote **4. Add to Google Sheets** - **App:** Google Sheets - **Action:** Create Spreadsheet Row - Click **Continue** and connect your Google account **Map the Fields:** - **Spreadsheet:** Select your tracking spreadsheet - **Worksheet:** Select the sheet (e.g., "Quotes") - **Map Fields:** - Column A: `name` (customer name) - Column B: `email` - Column C: `address` - Column D: `total_cost` - Column E: `project_status` - Column F: `stage_name` - Column G: `created_at` **5. Add a Filter (Important!)** To avoid duplicates, add a filter step: - **App:** Filter by Zapier - **Condition:** Only continue if quote `created_at` is within the last hour - This prevents re-adding old quotes on every poll **6. Test and Turn On** - Click **Test** to verify it works - Click **Publish** to activate your Zap --- ### Workflow 2: New Leads to Slack Get instant Slack notifications when someone fills out your lead form. #### Setup Instructions **1. Configure the Trigger (Schedule)** - **App:** Schedule by Zapier - **Trigger:** Every 15 Minutes (more frequent for leads) - Click **Continue** **2. Get Recent Leads** - **App:** Webhooks by Zapier - **Action:** GET Request - Click **Continue** **Configure the GET Request:** - **URL:** `https://yourcompany.powerlily.io/api/v1/leads?per_page=5` - **Headers:** - Key: `X-Api-Key` - Value: Your API key - Click **Test** **3. Filter for New Leads** - **App:** Filter by Zapier - **Condition:** `created_at` is within the last 15 minutes - This ensures you only get notified about brand new leads **4. Send Slack Message** - **App:** Slack - **Action:** Send Channel Message - Click **Continue** and connect your Slack workspace **Configure Message:** - **Channel:** #sales (or your preferred channel) - **Message Text:** ``` 🌟 New Solar Lead! **Name:** {{name}} **Email:** {{email}} **Phone:** {{phone}} **Address:** {{address}} **Monthly Bill:** ${{power_bill}} View in Powerlily: https://yourcompany.powerlily.io/leads ``` **5. Test and Turn On** - Send a test message to verify formatting - Publish your Zap --- ### Workflow 3: Signed Quotes to Salesforce Automatically create a Salesforce opportunity when a quote is signed. #### Setup Instructions **1. Configure the Trigger (Schedule)** - **App:** Schedule by Zapier - **Trigger:** Every 30 Minutes - Click **Continue** **2. Get Recent Quotes** - **App:** Webhooks by Zapier - **Action:** GET Request **Configure:** - **URL:** `https://yourcompany.powerlily.io/api/v1/quotes?per_page=20` - **Headers:** - Key: `X-Api-Key` - Value: Your API key **3. Filter for Signed Quotes** - **App:** Filter by Zapier - **Conditions:** - `signed` equals `true` - AND `updated_at` is within the last 30 minutes - This catches newly signed quotes only **4. Get Quote Details** Get full quote details including equipment: - **App:** Webhooks by Zapier - **Action:** GET Request **Configure:** - **URL:** `https://yourcompany.powerlily.io/api/v1/quotes/{{id}}` - Use the `id` from the previous step - **Headers:** - Key: `X-Api-Key` - Value: Your API key **5. Create Salesforce Opportunity** - **App:** Salesforce - **Action:** Create Opportunity - Click **Continue** and connect Salesforce **Map Fields:** - **Opportunity Name:** `{{name}} - Solar Installation` - **Account Name:** `{{name}}` - **Stage:** "Proposal Accepted" (or your equivalent) - **Amount:** `{{total_cost}}` - **Close Date:** 30 days from now - **Description:** ``` System: {{total_system_capacity_kw}} kW Annual Production: {{total_ac_annual_kwh}} kWh Address: {{address}} Customer Email: {{email}} Customer Phone: {{phone}} ``` **6. Test and Turn On** --- ### Workflow 4: Won Projects to Monday.com Create project boards automatically when you win a deal. #### Setup Instructions **1. Trigger on Schedule** - **App:** Schedule by Zapier - **Trigger:** Every Hour **2. Get Quotes with "Won" Status** - **App:** Webhooks by Zapier - **Action:** GET Request - **URL:** `https://yourcompany.powerlily.io/api/v1/quotes?per_page=10` - **Headers:** `X-Api-Key: YOUR_KEY` **3. Filter for Won Projects** - **App:** Filter by Zapier - **Conditions:** - `project_status` equals `won` - `updated_at` within last hour **4. Get Full Quote Details** - **App:** Webhooks by Zapier - **Action:** GET Request - **URL:** `https://yourcompany.powerlily.io/api/v1/quotes/{{id}}` **5. Create Monday.com Item** - **App:** Monday.com - **Action:** Create Item - **Board:** Your installation projects board - **Map Fields:** - Name: `{{name}} - {{address}}` - Status: "Design Complete" - System Size: `{{total_system_capacity_kw}} kW` - Customer Email: `{{email}}` - Customer Phone: `{{phone}}` - Install Address: `{{address}}` --- ### Workflow 5: Lead Notifications via SMS Get text messages for high-value leads. #### Setup Instructions **1. Schedule Trigger** - **App:** Schedule by Zapier - **Trigger:** Every 10 Minutes **2. Get Recent Leads** - **App:** Webhooks by Zapier - **Action:** GET Request - **URL:** `https://yourcompany.powerlily.io/api/v1/leads?per_page=5` - **Headers:** `X-Api-Key: YOUR_KEY` **3. Filter for High-Value Leads** - **App:** Filter by Zapier - **Conditions:** - `power_bill` is greater than 200 - AND `created_at` within last 10 minutes **4. Send SMS** - **App:** SMS by Zapier (or Twilio) - **Action:** Send SMS - **To:** Your phone number - **Message:** ``` 🔥 High-Value Lead! {{name}} Monthly Bill: ${{power_bill}} Phone: {{phone}} Address: {{address}} Check Powerlily now! ``` --- ## Advanced Tips & Tricks ### Using Zapier Storage Store the last processed quote/lead ID to avoid duplicates: 1. Add **Storage by Zapier** to your Zap 2. Before processing, check if the quote ID exists in storage 3. If not in storage, process it and save the ID 4. This prevents duplicate processing across Zap runs ### Multi-Step Workflows Chain multiple actions together: **Example:** New signed quote → 1. Create Salesforce opportunity 2. Send Slack notification to team 3. Add customer to Mailchimp list 4. Create project in Asana 5. Send SMS to project manager ### Using Paths Zapier Paths let you create conditional workflows: **Example:** New quote → - **Path A** (if `total_cost` > $30,000): Notify senior sales rep - **Path B** (if `total_cost` < $30,000): Notify junior sales rep ### Formatting Dates Use **Formatter by Zapier** to format timestamps: - **Input:** `2025-01-15T10:00:00-04:00` - **Output:** `January 15, 2025 at 10:00 AM` ### Parsing Equipment Data For detailed quotes with equipment arrays, use **Code by Zapier** (Python or JavaScript) to parse complex JSON structures. --- ## Polling Intervals Guide Since we're polling the API (not using webhooks), choose appropriate intervals: | Data Type | Recommended Interval | Reason | |---|---|---| | **Leads** | Every 5-15 minutes | Time-sensitive, respond quickly | | **Signed Quotes** | Every 15-30 minutes | Important but less urgent | | **All Quotes** | Every 1-2 hours | General syncing, not urgent | | **Quote Updates** | Every 1 hour | Track changes over time | **Important:** More frequent polling uses more Zapier tasks. Free plans have limits (100 tasks/month). --- ## Zapier Plan Considerations ### Free Plan - **100 tasks per month** - **5 Zaps** - **Single-step Zaps** - **15-minute polling intervals** **Good for:** Testing, small teams, low-volume workflows ### Starter Plan ($19.99/mo) - **750 tasks per month** - **20 Zaps** - **Multi-step Zaps** - **15-minute polling** **Good for:** Small businesses, moderate automation ### Professional Plan ($49/mo+) - **2,000+ tasks** - **Unlimited Zaps** - **Paths, filters, and formatting** - **Custom polling (as fast as every 1 minute)** - **Premium apps** **Good for:** Growing businesses with complex workflows --- ## Troubleshooting ### Zap Isn't Running **Check:** - Is the Zap turned on? (Check the toggle) - Have you exceeded your task limit? - Is your Zapier account active? ### API Authentication Errors **Solutions:** - Verify your API key is correct (64 characters) - Ensure no extra spaces in the header value - Check that the header name is exactly `X-Api-Key` - Verify your API key hasn't been regenerated ### Duplicate Records **Solutions:** - Add a **Filter by Zapier** step to check timestamps - Use **Storage by Zapier** to track processed IDs - Adjust your polling interval to match your filter window - Add a **Dedupe** step (available on paid plans) ### Getting Old Data **Problem:** Getting historical quotes instead of just new ones **Solution:** - Add timestamp filter: `created_at` or `updated_at` within the polling interval - Use `per_page=5` to limit results - Check your filter conditions are correct ### Rate Limits If you hit Powerlily's rate limits (100 requests/minute): **Solutions:** - Reduce polling frequency - Use larger `per_page` values (max 100) - Stagger multiple Zaps by a few minutes - Contact Powerlily support if you need higher limits ### Empty Arrays **Problem:** `pv_arrays`, `panels`, or `inverters` are empty **Solution:** - Use the detail endpoint: `GET /api/v1/quotes/:id` - Check that the quote has been fully designed - Some quotes may not have equipment data yet --- ## Common Error Messages ### "Invalid API key" **Cause:** API key is wrong or missing **Fix:** - Double-check your API key in API Settings - Ensure the `X-Api-Key` header is set correctly - No spaces before or after the key ### "Resource not found" **Cause:** The quote or lead ID doesn't exist **Fix:** - Verify the ID is being passed correctly - Check that the resource hasn't been deleted - Use the list endpoint first to get valid IDs ### "Too many requests" **Cause:** Exceeded rate limit (100 requests/minute) **Fix:** - Reduce polling frequency - Wait 60 seconds before retrying - Batch requests more efficiently --- ## Best Practices ### 1. Start Simple Begin with one basic Zap and expand from there: - Test with a simple Google Sheets integration first - Once working, add more complex actions - Build confidence before creating multi-step Zaps ### 2. Use Descriptive Names Name your Zaps clearly: - ✅ "New Powerlily Lead → Slack #sales" - ✅ "Signed Quote → Salesforce Opportunity" - ❌ "My Zap 1" ### 3. Test Thoroughly Before turning on a Zap: - Run multiple tests with real data - Check target app to verify data appears correctly - Test edge cases (missing fields, null values) ### 4. Monitor Your Zaps Check Zap history regularly: - Review the **Task History** in Zapier - Watch for errors or failed runs - Adjust filters if getting too many/few results ### 5. Document Your Workflows Keep a list of: - Which Zaps are running - What they do - Who owns them - When they were created ### 6. Secure Your API Key - Store it in Zapier only (don't share it) - Regenerate if you suspect it's compromised - Don't use the same key in multiple services - Consider different keys for production vs. testing --- ## Example Zapier Templates ### Template: Daily Quote Summary Email **What it does:** Sends you a daily email summarizing all quotes created yesterday **Setup:** 1. **Trigger:** Schedule - Every Day at 8:00 AM 2. **Action:** Webhooks - GET all quotes 3. **Filter:** `created_at` is yesterday 4. **Action:** Gmail - Send Email with quote summary ### Template: Lead Distribution **What it does:** Assigns leads to sales reps round-robin style **Setup:** 1. **Trigger:** Schedule - Every 10 minutes 2. **Action:** Get new leads from API 3. **Filter:** New leads only 4. **Action:** Storage - Get current rep counter 5. **Action:** Format - Determine next rep 6. **Action:** Gmail/Slack - Notify assigned rep 7. **Action:** Storage - Increment counter ### Template: Won Deal Celebration **What it does:** Posts celebration message when you win a deal **Setup:** 1. **Trigger:** Schedule - Every hour 2. **Action:** Get quotes with `project_status = won` 3. **Filter:** Just changed to won (check timestamp) 4. **Action:** Slack - Post to #wins channel with 🎉 5. **Action:** Email - Notify team --- ## Getting Help ### Zapier Resources - **Zapier Help:** [help.zapier.com](https://help.zapier.com) - **Zapier Community:** [community.zapier.com](https://community.zapier.com) - **Tutorials:** [zapier.com/learn](https://zapier.com/learn) ### Powerlily Support - **Email:** [email protected] - **Subject Line:** Include "Zapier Integration Help" - **Include:** Screenshots of your Zap setup and error messages ### Testing Tools - **Request Bin:** [requestbin.com](https://requestbin.com) - Test webhooks - **JSON Formatter:** [jsonformatter.org](https://jsonformatter.org) - Validate API responses - **cURL:** Test API calls directly from command line --- ## Related Documentation - [[settings/API Settings|API Settings]] - Complete API reference and authentication - [[settings/Domain Settings|Domain Settings]] - Configure your API base URL - [[CRM/Workflows|Workflows]] - Understand workflow stages for filtering - [[Leads/Overview|Leads Management]] - Learn about lead data structure --- ## Future: Native Zapier App We're working on a native Powerlily Zapier app that will include: - **Real-time triggers** - No more polling, instant notifications - **Actions** - Create and update quotes directly from Zapier - **Pre-built templates** - One-click setup for common workflows - **Better field mapping** - User-friendly interface for all quote fields **Want early access?** Email [email protected] with "Zapier Beta" in the subject. --- *Last updated: December 2025*