# Integrations

> Connect Waflow with your favorite tools including Shopify, CRMs, and custom webhooks

Source: https://edesy.in/docs/waflow/settings/integrations

Waflow integrates with popular business tools to streamline your WhatsApp marketing workflow. Connect your e-commerce platforms, CRMs, and custom applications to automate messaging and sync data seamlessly.

## Integration Overview

Integrations allow Waflow to communicate with external systems:

- **Import Data**: Sync contacts, orders, and events from other platforms
- **Export Data**: Send Waflow data to external systems
- **Trigger Automations**: Start workflows based on external events
- **Enrich Profiles**: Add data from other sources to contact profiles

### Integration Types

| Type | Description | Examples |
|------|-------------|----------|
| **Native** | Built-in, one-click setup | Shopify, WooCommerce |
| **OAuth** | Secure authorization | HubSpot, Salesforce |
| **API Key** | Simple authentication | Custom apps |
| **Webhook** | Event-based communication | Any system |

## E-Commerce Integrations

Connect your online store for automated order messaging.

### Shopify

Waflow's Shopify integration enables:

- Automatic order confirmation messages
- Shipping and delivery updates
- Abandoned cart recovery
- Customer sync

**Setup Steps:**

1. Navigate to **Settings** > **Integrations** > **Shopify**
2. Click **Connect Shopify**
3. Enter your Shopify store URL
4. Authorize Waflow in Shopify
5. Configure sync settings

**Available Events:**

| Event | Description | Use Case |
|-------|-------------|----------|
| Order Created | New order placed | Order confirmation |
| Order Fulfilled | Order shipped | Shipping notification |
| Order Delivered | Delivery confirmed | Delivery update |
| Checkout Abandoned | Cart left incomplete | Recovery message |
| Customer Created | New customer registered | Welcome message |
| Refund Issued | Payment refunded | Refund confirmation |

**Data Synced:**

- Customer information (name, email, phone)
- Order history
- Product details
- Tags and segments

> **Tip:** Enable two-way sync to update Shopify customer tags based on WhatsApp engagement.

### WooCommerce

Connect your WordPress WooCommerce store:

1. Go to **Settings** > **Integrations** > **WooCommerce**
2. Click **Connect**
3. Enter your store URL
4. Install the Waflow plugin in WordPress
5. Enter the API keys provided
6. Configure sync options

**Features:**

- Order status updates
- Product back-in-stock notifications
- Review requests after delivery
- Customer birthday messages

### Other E-Commerce Platforms

| Platform | Integration Type | Status |
|----------|-----------------|--------|
| Magento | API | Available |
| BigCommerce | Native | Available |
| PrestaShop | Webhook | Available |
| Custom Store | API/Webhook | Available |

## CRM Integrations

Sync customer data with your CRM.

### HubSpot

Connect HubSpot for contact and deal sync:

1. Navigate to **Settings** > **Integrations** > **HubSpot**
2. Click **Connect HubSpot**
3. Log in to your HubSpot account
4. Grant requested permissions
5. Configure field mappings

**Sync Options:**

| Data | Direction | Description |
|------|-----------|-------------|
| Contacts | Bi-directional | Sync contact properties |
| Deals | HubSpot → Waflow | Trigger by deal stage |
| Activities | Waflow → HubSpot | Log WhatsApp conversations |
| Lists | HubSpot → Waflow | Import contact lists |

**Field Mapping:**

Map HubSpot properties to Waflow fields:

```
HubSpot: firstname → Waflow: first_name
HubSpot: email → Waflow: email
HubSpot: lifecyclestage → Waflow: lifecycle_stage (custom)
HubSpot: hs_lead_status → Waflow: lead_status (tag)
```

### Salesforce

Enterprise CRM integration:

1. Go to **Settings** > **Integrations** > **Salesforce**
2. Click **Connect Salesforce**
3. Authorize via OAuth
4. Select Salesforce objects to sync
5. Configure field mappings

**Available Objects:**

- Leads
- Contacts
- Accounts
- Opportunities
- Cases

**Features:**

- Bi-directional contact sync
- Opportunity-triggered campaigns
- Case creation from WhatsApp
- Activity logging

> **Note:** Salesforce integration requires Professional edition or higher.

### Zoho CRM

Connect Zoho CRM:

1. Navigate to **Settings** > **Integrations** > **Zoho CRM**
2. Click **Connect**
3. Authorize with Zoho account
4. Map fields between systems
5. Enable sync

### Other CRMs

| CRM | Integration Type | Features |
|-----|-----------------|----------|
| Pipedrive | Native | Contacts, deals |
| Freshsales | Native | Contacts, activities |
| Monday.com | Native | Items, updates |
| Notion | Webhook | Custom sync |

## Webhook Integration

Webhooks enable real-time communication with any system.

### Incoming Webhooks

Receive data from external systems:

1. Go to **Settings** > **Integrations** > **Webhooks** > **Incoming**
2. Click **Create Webhook**
3. Configure:
   - Name and description
   - Authentication (API key, signature)
   - Data mapping
4. Copy the webhook URL
5. Configure the external system to send data

**Webhook URL Format:**
```
https://api.waflow.com/webhooks/incoming/{webhook_id}
```

**Example Payload:**
```json
{
  "event": "order_shipped",
  "timestamp": "2025-01-15T10:30:00Z",
  "data": {
    "customer_phone": "+919876543210",
    "order_id": "ORD-12345",
    "tracking_number": "TRK789456",
    "carrier": "FedEx"
  }
}
```

**Mapping to Waflow:**
```
data.customer_phone → Contact identifier
data.order_id → Variable {{order_id}}
data.tracking_number → Variable {{tracking}}
```

### Outgoing Webhooks

Send Waflow events to external systems:

1. Navigate to **Settings** > **Integrations** > **Webhooks** > **Outgoing**
2. Click **Create Webhook**
3. Configure:
   - Destination URL
   - Events to send
   - Authentication headers
   - Retry policy
4. Test the webhook
5. Activate

**Available Events:**

| Event | Description |
|-------|-------------|
| `message.sent` | Message dispatched |
| `message.delivered` | Message delivered |
| `message.read` | Message read |
| `message.replied` | Contact replied |
| `contact.created` | New contact added |
| `contact.updated` | Contact modified |
| `campaign.completed` | Campaign finished |

**Outgoing Payload Example:**
```json
{
  "event": "message.delivered",
  "timestamp": "2025-01-15T10:30:00Z",
  "workspace_id": "ws_abc123",
  "data": {
    "message_id": "msg_xyz789",
    "contact_phone": "+919876543210",
    "template_name": "order_confirmation",
    "delivered_at": "2025-01-15T10:30:00Z"
  }
}
```

### Webhook Security

Secure your webhook endpoints:

**API Key Authentication:**
- Include API key in header
- Waflow sends: `X-Waflow-API-Key: your_key`

**Signature Verification:**
- HMAC-SHA256 signature
- Header: `X-Waflow-Signature`
- Verify using shared secret

**Verification Code (Python):**
```python
import hmac
import hashlib

def verify_signature(payload, signature, secret):
    expected = hmac.new(
        secret.encode(),
        payload.encode(),
        hashlib.sha256
    ).hexdigest()
    return hmac.compare_digest(expected, signature)
```

## API Access

Build custom integrations using the Waflow API.

### Getting API Keys

1. Navigate to **Settings** > **API**
2. Click **Create API Key**
3. Configure:
   - Key name (for identification)
   - Permissions (scopes)
   - Expiration (optional)
4. Copy the API key (shown only once)

> **Warning:** Store API keys securely. Never expose them in client-side code or public repositories.

### API Permissions

| Scope | Access |
|-------|--------|
| `contacts:read` | Read contact data |
| `contacts:write` | Create/update contacts |
| `messages:send` | Send messages |
| `messages:read` | Read message history |
| `campaigns:read` | View campaigns |
| `campaigns:write` | Create/manage campaigns |
| `analytics:read` | Access analytics data |

### API Documentation

Access full API documentation:

- **Base URL**: `https://api.waflow.com/v1`
- **Authentication**: Bearer token in header
- **Format**: JSON

**Example Request:**
```bash
curl -X GET "https://api.waflow.com/v1/contacts" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"
```

### Rate Limits

| Plan | Requests/Minute | Requests/Day |
|------|----------------|--------------|
| Starter | 60 | 10,000 |
| Growth | 300 | 50,000 |
| Business | 1,000 | 200,000 |
| Enterprise | Custom | Custom |

## Zapier Integration

Connect Waflow with 5,000+ apps via Zapier.

### Setting Up Zapier

1. Go to Zapier and search for "Waflow"
2. Connect your Waflow account
3. Create a Zap:
   - Choose trigger app/event
   - Choose Waflow action
   - Map data fields
   - Test and activate

### Popular Zaps

| Trigger | Action | Use Case |
|---------|--------|----------|
| Google Sheets row added | Send WhatsApp | Bulk messaging from sheet |
| Typeform submission | Add contact | Lead capture |
| Stripe payment | Send message | Payment confirmation |
| Calendly booking | Send reminder | Appointment confirmation |
| Gmail email | Create contact | Lead import |

### Available Triggers

- New contact added
- Contact tag applied
- Message received
- Campaign completed

### Available Actions

- Send WhatsApp message
- Create/update contact
- Add tag to contact
- Start automation

## Platform-Specific Integrations

### Google Sheets

Sync contacts with Google Sheets:

1. Navigate to **Settings** > **Integrations** > **Google Sheets**
2. Connect your Google account
3. Select spreadsheet
4. Map columns to Waflow fields
5. Choose sync direction:
   - One-time import
   - Continuous sync
   - Export only

### Mailchimp

Sync email lists with WhatsApp:

1. Go to **Settings** > **Integrations** > **Mailchimp**
2. Connect Mailchimp account
3. Select audiences to sync
4. Map fields
5. Enable sync

**Features:**
- Import email subscribers to WhatsApp
- Sync engagement data
- Unified audience management

### Calendly

Appointment reminders:

1. Connect Calendly integration
2. Select event types
3. Configure reminder templates:
   - Confirmation (immediate)
   - Reminder (24 hours before)
   - Reminder (1 hour before)

## Managing Integrations

### Integration Health

Monitor integration status:

1. Go to **Settings** > **Integrations**
2. View status indicators:
   - Green: Connected and healthy
   - Yellow: Warning (needs attention)
   - Red: Disconnected or error

### Troubleshooting

Common integration issues:

| Issue | Cause | Solution |
|-------|-------|----------|
| Sync stopped | Token expired | Reconnect integration |
| Missing data | Field mapping issue | Review mappings |
| Duplicate contacts | Identifier mismatch | Check phone format |
| Webhook failures | Endpoint unavailable | Check destination URL |

### Integration Logs

View integration activity:

1. Select an integration
2. Click **Logs**
3. Filter by:
   - Date range
   - Event type
   - Status
4. View details for troubleshooting

### Disconnecting Integrations

Remove an integration:

1. Go to **Settings** > **Integrations**
2. Select the integration
3. Click **Disconnect**
4. Confirm removal
5. Historical data remains in Waflow

> **Note:** Disconnecting an integration does not delete synced contacts or message history.

## Best Practices

### Integration Setup

1. **Start with one integration**: Get it working before adding more
2. **Test thoroughly**: Use test data before production
3. **Document mappings**: Keep records of field mappings
4. **Set up alerts**: Monitor for failures

### Data Quality

1. **Consistent phone formats**: Use E.164 format (+country code)
2. **Required fields**: Ensure all integrations provide required data
3. **Deduplication**: Configure how to handle duplicates
4. **Regular audits**: Check data quality periodically

### Security

1. **Rotate API keys**: Change keys regularly
2. **Minimal permissions**: Grant only necessary access
3. **Secure webhooks**: Always use authentication
4. **Audit access**: Review integration permissions

## Next Steps

- [Automations](https://edesy.in/docs/waflow/automations) - Trigger automations from integrations
- [Analytics](https://edesy.in/docs/waflow/analytics) - Track integration performance
- [API Documentation](https://api.waflow.com/docs) - Build custom integrations
