=== FutureFeathers Order API === Contributors: futurefeathers Tags: api, integration, webhook, rest api, automation Requires at least: 5.8 Tested up to: 6.9 Requires PHP: 7.4 Stable tag: 1.0.0 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html Send order data to external APIs automatically. Ideal for WooCommerce, SaaS, LMS, and CRM. Includes 25+ variables. == Description == **FutureFeathers Order API** allows you to automatically send order data to external APIs when orders are completed. Works ideally with WooCommerce stores. Ideal for: * **SaaS License Management** - Activate licenses when orders complete * **LMS/Academy Systems** - Update user limits and subscriptions * **CRM Integration** - Sync customer data automatically * **Inventory Management** - Update external inventory systems * **Custom Workflows** - Trigger any external system = Key Features = * **Per-Product Configuration** - Different API for each product * **25+ Dynamic Variables** - Include customer, order, and product data * **Date Functions** - Calculate expiry dates automatically (`{{date:+1month}}`) * **Multiple HTTP Methods** - POST, PUT, PATCH support * **Authentication** - Bearer Token, API Key, Basic Auth * **Test Mode** - Test API connections before going live * **Detailed Logging** - Debug and track all API calls * **Custom Headers** - Add any HTTP headers needed * **Custom JSON Payload** - Full control over what data is sent * **WooCommerce HPOS** - Compatible with High-Performance Order Storage = Available Variables = Include dynamic data in your API requests: **Customer Data:** * `{{email}}` - Customer email * `{{customer_first_name}}` - First name * `{{customer_last_name}}` - Last name * `{{customer_full_name}}` - Full name * `{{customer_phone}}` - Phone number **Order Data:** * `{{order_id}}` - Order ID * `{{total}}` - Order total * `{{currency}}` - Currency code * `{{purchase_date}}` - Purchase date/time * `{{order_status}}` - Order status **Product Data:** * `{{product_id}}` - Product ID * `{{product_name}}` - Product name * `{{product_sku}}` - Product SKU * `{{quantity}}` - Quantity purchased **Date Functions:** * `{{date:+1month}}` - Date plus 1 month * `{{date:+1year}}` - Date plus 1 year * `{{today:}}` - Today's date * `{{now:}}` - Current date/time * `{{year:}}`, `{{month:}}`, `{{day:}}` - Date parts = Pro Features = Upgrade to **PRO** for advanced features: * **"Send ONLY Custom Fields" Mode** - For strict APIs that reject extra parameters * **Math Calculations** - `{{math:{{total}}*1.18}}` for taxes, calculations * **UUID Generator** - `{{uuid:}}` for unique IDs * **Random Generators** - `{{random:1-100}}`, `{{random_string:16}}` * **Advanced Timestamps** - Unix timestamps, milliseconds * **Custom Date Formats** - Any PHP date format * **50+ Variables** - Full billing/shipping address, advanced order data * **Priority Support** - Email support with 24-hour response [Upgrade to PRO](https://futurefeathers.com/futurefeathers-order-api-pro) = Example Use Cases = **SaaS License Management:** Send license activation to your API when customer purchases: ``` { "email": "{{email}}", "product": "{{product_name}}", "license_key": "MANUAL_KEY_HERE", "expires": "{{date:+1year}}" } ``` **LMS Academy Limits:** Update student limits in your learning management system: ``` { "user_email": "{{email}}", "validity_date": "{{date:+1month}}", "max_students": "100" } ``` **CRM Contact Sync:** Add customer to your CRM automatically: ``` { "email": "{{email}}", "first_name": "{{customer_first_name}}", "last_name": "{{customer_last_name}}", "order_total": "{{total}}", "purchase_date": "{{purchase_date}}" } ``` == Installation == 1. Upload the plugin files to `/wp-content/plugins/futurefeathers-order-api/` 2. Activate the plugin through the 'Plugins' menu in WordPress 3. Edit any product in WooCommerce 4. Scroll to "External API Integration" meta box 5. Configure your API settings: * Enable API integration * Enter API endpoint URL * Select HTTP method (POST/PUT/PATCH) * Add authentication if needed * Customize JSON payload with variables 6. Click "Test API Connection" to verify 7. Save the product == Frequently Asked Questions == = How do I configure the API for a product? = 1. Edit the product in WooCommerce 2. Find "External API Integration" meta box (below product data) 3. Check "Enable API Integration for this product" 4. Enter your API endpoint URL 5. Configure authentication and custom fields 6. Use the "Test API" button to verify = What triggers the API call? = The API is called when: * Order status changes to "Completed" * Payment is completed (WooCommerce payment_complete hook) * Subscription becomes active (if WooCommerce Subscriptions installed) = How do I use variables in my JSON? = Variables must be in quotes: ``` { "email": "{{email}}", "amount": "{{total}}" } ``` NOT like this (will cause JSON error): ``` { "email": {{email}} } ``` = Can I send different data for different products? = Yes! Each product has its own API configuration. You can send completely different data for each product. = How do I debug if the API isn't working? = 1. Enable logging in Settings → WooCommerce External API 2. Test using the "Test API Connection" button 3. Check the Logs tab to see exactly what was sent 4. Verify the API response = What's the difference between FREE and PRO? = **FREE includes:** * 25+ variables * Basic date functions * Per-product config * Test mode * Logging **PRO adds:** * "Send ONLY custom fields" mode * Math calculations * UUID/random generators * Advanced timestamps * 50+ variables * Priority support [Compare features](https://futurefeathers.com/futurefeathers-order-api-pro) = Is it compatible with WooCommerce Subscriptions? = Yes! The plugin automatically detects subscriptions and includes subscription data in the API payload. = Is it compatible with HPOS (High-Performance Order Storage)? = Yes! The plugin is fully compatible with WooCommerce HPOS. = My API rejects requests with extra fields. What can I do? = Upgrade to the **PRO version** which includes "Send ONLY custom fields" mode. This sends only your custom JSON fields without the default WooCommerce data. = Can I use this with Zapier alternatives? = Yes! This plugin is a cost-effective alternative to Zapier, Make, or n8n. One-time payment vs monthly subscription. == Screenshots == 1. Product meta box - Configure API for each product individually 2. API settings - URL, method, authentication, custom payload 3. Test API button - Test your integration before going live 4. Variable helper - See all available variables 5. Logs page - Debug and track all API calls 6. Global settings - Enable logging, set timeout, retry attempts == Changelog == = 1.0.0 = * Initial release * Per-product API configuration * 25+ dynamic variables * Date calculation functions * Multiple authentication methods * Test mode * Detailed logging * WooCommerce HPOS compatibility * WooCommerce Subscriptions support == Upgrade Notice == = 1.0.0 = Initial release of WooCommerce External API Integration. == Support == For support questions, please use the WordPress.org support forum. For PRO version support, email: support@futurefeathers.com == Pro Version == Get advanced features with the PRO version: * "Send ONLY custom fields" mode for strict APIs * Math calculations: `{{math:10+5}}` * UUID generation: `{{uuid:}}` * Random generators: `{{random:1-100}}` * Advanced timestamps and custom date formats * 50+ variables including full address data * Priority email support [Upgrade to PRO - $49](https://futurefeathers.com/futurefeathers-order-api-pro)