Overview
Rootfi’s WooCommerce integration enables you to seamlessly fetch and synchronize e-commerce data from WooCommerce stores. This integration provides access to orders, products, customers, inventory, and other critical business data.How it works
The WooCommerce integration connects to your WooCommerce store using the WooCommerce REST API. Once authenticated, Rootfi can fetch data from your store and keep it synchronized in real-time through webhooks.Architecture
- Authentication: Secure connection using WooCommerce API keys
- Data fetching: Periodic synchronization of store data via REST API
- Real-time updates: Webhook notifications for immediate data changes
- Data normalization: Standardized data format across all integrations
Authentication
Prerequisites
- WooCommerce store with REST API enabled
- Admin access to generate API credentials
- HTTPS enabled on your store (required for API access)
Connection process
- Navigate to your WooCommerce admin dashboard
- Go to WooCommerce > Settings > Advanced > REST API
- Click Add key to generate new API credentials
- Set the following:
- Description: Rootfi Integration
- User: Select an admin user
- Permissions: Read/Write
- Copy the generated Consumer Key and Consumer Secret
- In Rootfi, provide:
- Store URL
- Consumer Key
- Consumer Secret
- Test the connection to verify access
Security considerations
- API keys should be stored securely and never exposed in client-side code
- Use HTTPS for all API communications
- Regularly rotate API credentials
- Monitor API access logs for suspicious activity
Data entities
Rootfi fetches the following data entities from WooCommerce:Orders
Complete order information including line items, customer details, and fulfillment status. Key fields:id- Unique order identifierorder_number- Human-readable order numberstatus- Order status (pending, processing, completed, etc.)date_created- Order creation timestampdate_modified- Last modification timestamptotal- Order total amountsubtotal- Subtotal before taxes and shippingtotal_tax- Total tax amountshipping_total- Shipping costdiscount_total- Total discount amountcurrency- Order currency codecustomer_id- Associated customer IDbilling- Billing address objectshipping- Shipping address objectpayment_method- Payment method usedpayment_method_title- Payment method display nameline_items- Array of ordered productsshipping_lines- Shipping method detailstax_lines- Tax breakdownfee_lines- Additional feescoupon_lines- Applied couponsrefunds- Refund information
Products
Product catalog including variations, pricing, and inventory. Key fields:id- Unique product identifiername- Product nameslug- URL-friendly product identifiertype- Product type (simple, variable, grouped, external)status- Publication status (publish, draft, pending)sku- Stock keeping unitprice- Current priceregular_price- Regular price before discountssale_price- Sale price if on saledate_on_sale_from- Sale start datedate_on_sale_to- Sale end datestock_quantity- Available stock countstock_status- Stock status (instock, outofstock, onbackorder)manage_stock- Whether stock is managedcategories- Product categoriestags- Product tagsimages- Product images arrayattributes- Product attributesvariations- Product variations (for variable products)weight- Product weightdimensions- Product dimensions (length, width, height)description- Full product descriptionshort_description- Short product description
Customers
Customer profiles and contact information. Key fields:id- Unique customer identifieremail- Customer email addressfirst_name- Customer first namelast_name- Customer last nameusername- Customer usernamedate_created- Account creation datedate_modified- Last modification datebilling- Billing address objectfirst_namelast_namecompanyaddress_1address_2citystatepostcodecountryemailphone
shipping- Shipping address objectfirst_namelast_namecompanyaddress_1address_2citystatepostcodecountry
orders_count- Total number of orderstotal_spent- Total amount spentavatar_url- Customer avatar URL
Inventory
Stock levels and inventory management data. Key fields:product_id- Associated product IDvariation_id- Variation ID (if applicable)sku- Stock keeping unitstock_quantity- Current stock levelstock_status- Stock availability statusmanage_stock- Whether stock management is enabledbackorders- Backorder settings (no, notify, yes)low_stock_amount- Low stock threshold
Categories
Product categorization and taxonomy. Key fields:id- Unique category identifiername- Category nameslug- URL-friendly identifierparent- Parent category IDdescription- Category descriptiondisplay- Display typeimage- Category imagecount- Number of products in category
Coupons
Discount codes and promotional offers. Key fields:id- Unique coupon identifiercode- Coupon codeamount- Discount amountdiscount_type- Type of discount (percent, fixed_cart, fixed_product)description- Coupon descriptiondate_expires- Expiration dateusage_count- Number of times usedusage_limit- Maximum usage limitusage_limit_per_user- Per-user usage limitindividual_use- Whether coupon can be used with other couponsproduct_ids- Applicable product IDsexcluded_product_ids- Excluded product IDsminimum_amount- Minimum order amountmaximum_amount- Maximum order amount
Refunds
Order refund information. Key fields:id- Unique refund identifierorder_id- Associated order IDdate_created- Refund creation dateamount- Refund amountreason- Refund reasonrefunded_by- User who processed refundline_items- Refunded line items
Tax rates
Tax configuration and rates. Key fields:id- Unique tax rate identifiercountry- Country codestate- State codepostcode- Postal codecity- City namerate- Tax rate percentagename- Tax rate namepriority- Tax prioritycompound- Whether tax is compoundshipping- Whether tax applies to shippingclass- Tax class
API endpoints
Rootfi uses the following WooCommerce REST API endpoints:Orders
GET /wp-json/wc/v3/orders- List all ordersGET /wp-json/wc/v3/orders/{id}- Get single orderPOST /wp-json/wc/v3/orders- Create orderPUT /wp-json/wc/v3/orders/{id}- Update order
Products
GET /wp-json/wc/v3/products- List all productsGET /wp-json/wc/v3/products/{id}- Get single productPOST /wp-json/wc/v3/products- Create productPUT /wp-json/wc/v3/products/{id}- Update product
Customers
GET /wp-json/wc/v3/customers- List all customersGET /wp-json/wc/v3/customers/{id}- Get single customerPOST /wp-json/wc/v3/customers- Create customerPUT /wp-json/wc/v3/customers/{id}- Update customer
Product variations
GET /wp-json/wc/v3/products/{product_id}/variations- List variationsGET /wp-json/wc/v3/products/{product_id}/variations/{id}- Get variation
Categories
GET /wp-json/wc/v3/products/categories- List categoriesGET /wp-json/wc/v3/products/categories/{id}- Get category
Coupons
GET /wp-json/wc/v3/coupons- List couponsGET /wp-json/wc/v3/coupons/{id}- Get coupon
Refunds
GET /wp-json/wc/v3/orders/{order_id}/refunds- List refundsGET /wp-json/wc/v3/orders/{order_id}/refunds/{id}- Get refund
Tax rates
GET /wp-json/wc/v3/taxes- List tax ratesGET /wp-json/wc/v3/taxes/{id}- Get tax rate
Webhooks
Rootfi configures webhooks to receive real-time updates from WooCommerce.Supported webhook events
Orders:order.created- New order createdorder.updated- Order updatedorder.deleted- Order deleted
product.created- New product createdproduct.updated- Product updatedproduct.deleted- Product deleted
customer.created- New customer registeredcustomer.updated- Customer profile updatedcustomer.deleted- Customer deleted
product.updated- Stock level changed (via product update)
Webhook configuration
Webhooks are automatically configured during the integration setup:- Rootfi creates webhook subscriptions via the WooCommerce API
- Webhook endpoint:
https://api.rootfi.com/webhooks/woocommerce/{integration_id} - Webhook secret is generated for signature verification
- Events are delivered in real-time as they occur
Webhook payload
Each webhook includes:event- Event typecreated_at- Event timestampresource- Resource type (order, product, customer)data- Complete resource data
Webhook security
- All webhooks are signed with HMAC-SHA256
- Signatures are verified before processing
- Invalid signatures are rejected
- Webhook endpoints use HTTPS only
Data synchronization
Initial sync
When you first connect a WooCommerce store:- Rootfi fetches all historical data
- Data is processed in batches to avoid rate limits
- Sync progress is tracked and resumable
- Typical sync time: 5-30 minutes depending on store size
Incremental sync
After initial sync:- Webhooks provide real-time updates
- Periodic polling ensures data consistency
- Modified records are detected and updated
- Deleted records are marked as inactive
Rate limits
WooCommerce API rate limits:- Default: 25 requests per 10 seconds
- Configurable per store
- Rootfi automatically handles rate limiting with exponential backoff
Troubleshooting
Common issues
Authentication failed:- Verify API credentials are correct
- Ensure REST API is enabled in WooCommerce settings
- Check that HTTPS is enabled on your store
- Confirm the API user has admin permissions
- Check that the API user has appropriate permissions
- Verify the data exists in WooCommerce
- Review API rate limits and sync status
- Check webhook delivery logs
- Verify webhook is active in WooCommerce settings
- Check webhook delivery logs in WooCommerce
- Ensure firewall allows outbound connections
- Verify webhook URL is accessible
- Large product catalogs may take longer to sync
- Consider increasing API rate limits
- Check for API errors in logs
- Monitor server resources
Support
For additional help:- Check Rootfi integration logs
- Review WooCommerce system status
- Contact Rootfi support with integration ID
- Provide relevant error messages and timestamps
Best practices
- Regular monitoring: Check sync status and webhook delivery regularly
- API key rotation: Rotate API credentials periodically for security
- Test environment: Test integration changes in staging before production
- Data validation: Verify critical data after initial sync
- Error handling: Monitor error logs and set up alerts for failures
- Performance optimization: Use webhooks for real-time updates instead of frequent polling
- Backup: Maintain regular backups of your WooCommerce data
Limitations
- Historical data retention depends on WooCommerce configuration
- Some custom fields may require additional mapping
- Third-party plugin data may not be included by default
- API rate limits may affect sync speed for large stores
- Webhook delivery is not guaranteed (use polling as backup)