# Pipedrive integration via Zapier

Removes the "ConstructConnect plugs into Pipedrive natively" objection.
Same architecture as the HubSpot Zap; different mapping.

> Setup: 8 minutes. Recurring cost: $0 on Zapier free tier.

## End-to-end Zap

### Step 1 — Trigger
- **Webhooks by Zapier** → **Catch Hook**
- Paste the webhook URL into Shovel Radar dashboard → Account → Webhook URL

### Step 2 — Filter (optional)
- Filter: `delivery.row_count > 0`

### Step 3 — Loop over permits
- **Looping by Zapier** → loop input `delivery.permits`

### Step 4 — Find or create Pipedrive Organization
- App: **Pipedrive** → Event: **Find Organization**
- Lookup: by `name` (use `applicant` or `contractor`)
- If not found → branch to **Create Organization**

### Step 5 — Find or create Pipedrive Person
- App: **Pipedrive** → Event: **Find Person**
- Lookup: by `email` or `phone`
- If not found → branch to **Create Person**
- Map fields:
  | Pipedrive  | Permit field |
  |---|---|
  | Name       | (parse from applicant) |
  | Email      | (if present)            |
  | Phone      | phone                   |
  | Organization | from Step 4           |

### Step 6 — Create Pipedrive Deal
- App: **Pipedrive** → Event: **Create Deal**
- Map fields:
  | Pipedrive Deal | Permit field |
  |---|---|
  | Title          | `{applicant} — {scope_short}` |
  | Value          | cost                          |
  | Currency       | CAD                           |
  | Stage          | (your first stage ID)         |
  | Person         | from Step 5                   |
  | Organization   | from Step 4                   |
  | Visible To     | Owner's group                 |
  | Add Time       | now                           |
- Add Custom Fields:
  - `permit_id`         (text)
  - `permit_address`    (text)
  - `permit_scope`      (long text)
  - `permit_applied_date` (date)
  - `permit_source`     (`shovel-radar`)

### Step 7 — Add a Note to the Deal
- App: **Pipedrive** → Event: **Create Note**
- Content:
  ```
  From Shovel Radar weekly delivery on {run_date}.

  Permit: {permit_id}
  Address: {address}
  Scope: {description}
  Cost: ${cost}
  Filing date: {applied}

  Source URL: {download_url}
  ```

## Done. Sanity check

After your first real delivery fires the Zap:

1. Open Pipedrive → Deals → filter by `Source = shovel-radar`
2. Confirm count matches `delivery.row_count` from the webhook
3. Click into one — Notes should have the permit details
4. Confirm Custom Field `permit_id` populated

## Common gotchas

- **Pipedrive currency** — set CAD on the company level, not per-deal,
  or your reporting will mix currencies.
- **Lead vs Deal** — by default we create a Deal; if you prefer Leads
  (Pipedrive's pre-deal stage), change Step 6 event to **Create Lead**.
- **Duplicate prevention** — Pipedrive doesn't auto-dedupe Deals.
  Add a Filter step after Step 4 that checks "Deal with this permit_id
  already exists?" via **Pipedrive → Find Deal** before creating.
- **Free tier limits** — Pipedrive Essential supports 1 pipeline,
  Advanced+ supports multiple. If you want a dedicated "Shovel Radar
  Leads" pipeline you're on Advanced ($28/user/mo).

## Cost

| Tier | Cost | Sufficient for |
|---|---|---|
| Zapier Free | $0 | 100 tasks/mo |
| Zapier Starter | $20 USD | 750 tasks/mo |
| Pipedrive Essential | $14 USD/user/mo | 1 pipeline, 3k deals |
| Pipedrive Advanced | $28 USD/user/mo | unlimited pipelines |

**Net for the typical case:** $0 if you stay on Zapier free; $14
USD/mo for Pipedrive itself (you'd be paying that anyway).
