WooCommerce Connector
WooCommerce Connector
Connect your WooCommerce store to Brevo through Tajo for complete e-commerce data synchronization. Leverage the WooCommerce REST API to sync customers, orders, products, and coupon data for targeted marketing campaigns and automated workflows.
Overview
| Property | Value |
|---|---|
| Platform | WooCommerce (WordPress) |
| Category | E-commerce |
| Setup Complexity | Medium |
| Official Integration | No |
| Data Synced | Customers, Orders, Products, Coupons |
| Available Skills | 10 |
Features
- Customer sync - Real-time customer data synchronization to Brevo contacts
- Order tracking - Full order lifecycle event tracking for post-purchase flows
- Product catalog sync - Sync products and variations for email recommendations
- Coupon management - Sync coupon codes for promotional campaigns
- Webhook support - Real-time updates via WooCommerce webhooks
- Cart abandonment - Track and recover abandoned carts
- Multi-site support - Connect WordPress multisite WooCommerce installations
- Custom meta fields - Map WooCommerce custom meta to Brevo attributes
Prerequisites
Before you begin, ensure you have:
- A WordPress site with WooCommerce plugin installed and activated
- WooCommerce REST API enabled (Settings > Advanced > REST API)
- API Consumer Key and Consumer Secret generated
- Your site must use HTTPS for API authentication
- A Brevo account with API access
- A Tajo account with API credentials
Authentication
REST API Keys
WooCommerce uses Consumer Key and Consumer Secret pairs for authentication. Generate these in WooCommerce > Settings > Advanced > REST API.
OAuth 1.0a (HTTPS sites)
curl https://yourstore.com/wp-json/wc/v3/orders \ -u "consumer_key:consumer_secret"Query String Authentication (HTTPS)
curl "https://yourstore.com/wp-json/wc/v3/orders?consumer_key=ck_xxx&consumer_secret=cs_xxx"Permission Levels
| Permission | Access |
|---|---|
| Read | View resources only |
| Write | Create and edit resources |
| Read/Write | Full CRUD access |
Configuration
Basic Setup
connectors: woocommerce: enabled: true store_url: "https://yourstore.com" consumer_key: "ck_your_consumer_key" consumer_secret: "cs_your_consumer_secret" api_version: "wc/v3" verify_ssl: true
# Data sync options sync: customers: true orders: true products: true coupons: true
# Brevo list assignment lists: all_customers: 50 buyers: 51 abandoned_cart: 52Customer Field Mapping
Map WooCommerce customer fields to Brevo attributes:
customer_mapping: email: email first_name: FIRSTNAME last_name: LASTNAME billing.phone: SMS billing.company: COMPANY billing.city: CITY billing.state: STATE billing.country: COUNTRY billing.postcode: ZIP
# E-commerce metrics (computed) orders_count: ORDER_COUNT total_spent: TOTAL_SPENT date_created: SIGNUP_DATE
# Meta fields meta_data.loyalty_points: LOYALTY_POINTS meta_data.preferred_category: PREF_CATEGORYWebhook Configuration
Register webhooks in WooCommerce > Settings > Advanced > Webhooks:
webhooks: - topic: "customer.created" event: "customer_created" - topic: "customer.updated" event: "customer_updated" - topic: "order.created" event: "order_placed" - topic: "order.updated" event: "order_updated" - topic: "order.completed" event: "order_fulfilled" - topic: "order.refunded" event: "order_refunded" - topic: "coupon.created" event: "coupon_created" - topic: "product.created" event: "product_added" - topic: "product.updated" event: "product_updated"API Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /wc/v3/customers | List customers |
POST | /wc/v3/customers | Create a customer |
GET | /wc/v3/customers/{id} | Get a customer |
PUT | /wc/v3/customers/{id} | Update a customer |
GET | /wc/v3/orders | List orders |
POST | /wc/v3/orders | Create an order |
GET | /wc/v3/orders/{id} | Get an order |
GET | /wc/v3/products | List products |
GET | /wc/v3/products/{id} | Get a product |
GET | /wc/v3/products/{id}/variations | List product variations |
GET | /wc/v3/coupons | List coupons |
GET | /wc/v3/reports/sales | Get sales reports |
GET | /wc/v3/reports/top_sellers | Get top sellers |
POST | /wc/v3/webhooks | Create a webhook |
Code Examples
Initialize WooCommerce Connector
import { TajoClient } from '@tajo/sdk';
const tajo = new TajoClient({ apiKey: process.env.TAJO_API_KEY, brevoApiKey: process.env.BREVO_API_KEY});
// Connect WooCommerce storeawait tajo.connectors.connect('woocommerce', { storeUrl: 'https://yourstore.com', consumerKey: process.env.WC_CONSUMER_KEY, consumerSecret: process.env.WC_CONSUMER_SECRET});Fetch and Sync Customers
// Fetch customers using WooCommerce REST APIconst WooCommerce = require('@woocommerce/woocommerce-rest-api').default;
const api = new WooCommerce({ url: 'https://yourstore.com', consumerKey: process.env.WC_CONSUMER_KEY, consumerSecret: process.env.WC_CONSUMER_SECRET, version: 'wc/v3'});
// List customers with paginationconst response = await api.get('customers', { per_page: 100, page: 1, orderby: 'registered_date', order: 'desc'});
const customers = response.data;// [{ id, email, first_name, last_name, billing, shipping, ... }]
// Pagination info from headersconst totalPages = response.headers['x-wp-totalpages'];const totalItems = response.headers['x-wp-total'];Handle Webhook Events
// WooCommerce webhook handlerapp.post('/webhooks/woocommerce', async (req, res) => { const topic = req.headers['x-wc-webhook-topic']; const signature = req.headers['x-wc-webhook-signature'];
// Verify webhook signature const expectedSignature = crypto .createHmac('sha256', WEBHOOK_SECRET) .update(JSON.stringify(req.body)) .digest('base64');
if (signature !== expectedSignature) { return res.status(401).send('Invalid signature'); }
// Forward to Tajo await tajo.connectors.handleWebhook('woocommerce', { topic, payload: req.body });
res.status(200).send('OK');});Batch Operations
// Batch create, update, and delete productsconst batchResponse = await api.post('products/batch', { create: [ { name: 'New Product', type: 'simple', regular_price: '19.99' } ], update: [ { id: 123, regular_price: '24.99' } ], delete: [456]});Rate Limits
WooCommerce itself does not enforce API rate limits, but the underlying WordPress server and hosting provider may impose limits:
| Factor | Typical Limit | Details |
|---|---|---|
| Shared hosting | 50-100 req/min | Varies by host |
| Managed WP hosting | 200-500 req/min | WP Engine, Kinsta, etc. |
| Self-hosted | No hard limit | Limited by server resources |
| Per page | 100 records max | Default is 10 |
| Batch operations | 100 items/batch | Create, update, or delete |
Server Performance
Large WooCommerce stores may experience slow API responses. Use pagination, limit fields with _fields parameter, and schedule bulk syncs during off-peak hours.
Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
401 Unauthorized | Invalid API keys | Regenerate Consumer Key/Secret in WooCommerce settings |
403 Forbidden | Insufficient permissions | Set API key to Read/Write access |
| SSL certificate errors | Invalid SSL on site | Ensure valid SSL certificate; set verify_ssl: false for testing only |
| Webhooks not firing | WordPress cron disabled | Enable WP-Cron or configure server-level cron |
| Slow API responses | Large database | Optimize WordPress database, use _fields parameter |
| Missing custom fields | Meta data not exposed | Use meta_data field to access custom meta |
| Pagination issues | Default page size | Explicitly set per_page parameter (max 100) |
Best Practices
- Use webhooks for real-time sync - Configure WooCommerce webhooks rather than polling the API
- Verify webhook signatures - Always validate the
X-WC-Webhook-Signatureheader - Paginate all list requests - Use
pageandper_pageparameters; checkX-WP-TotalPagesheader - Use the
_fieldsparameter - Request only needed fields to reduce response size and improve performance - Batch operations - Use batch endpoints for bulk create/update/delete operations (up to 100 items)
- Schedule large syncs - Run initial full syncs during off-peak hours to avoid server strain
- Enable HTTPS - WooCommerce API requires HTTPS for OAuth authentication
Security
- OAuth 1.0a - Secure authentication via Consumer Key/Secret pairs
- HMAC webhook signatures - SHA-256 signature verification for incoming webhooks
- HTTPS required - API requires TLS encryption for authentication
- Permission scoping - API keys can be set to Read, Write, or Read/Write
- WordPress security - Benefits from WordPress core security updates
- PCI considerations - Payment data handled by WooCommerce payment gateways, not exposed via API