# 🚀 Upgrade to WooCommerce External API Integration PRO

## Why Upgrade?

The **FREE version** is great for basic integrations, but **PRO** unlocks powerful features for complex use cases:

### ✅ What's Included in FREE
- ✅ **25+ Variables**: Basic customer, order, and product data
- ✅ **Basic Date Functions**: `{{date:+1month}}`, `{{today:}}`, `{{now:}}`
- ✅ **Per-Product Configuration**: Different APIs for different products
- ✅ **Authentication**: Bearer, API Key, Basic Auth
- ✅ **Test Mode**: Test your API connections before going live
- ✅ **Logging**: Debug and track all API calls

---

## 🔒 PRO-Only Features

### 1. **"Send ONLY Custom Fields" Mode**
For strict APIs that reject extra parameters:
```json
{
  "identifier": "{{email}}",
  "expiry": "{{date:+1year}}"
}
```
✅ Only these 2 fields sent (no extra WooCommerce data)  
❌ FREE sends 15+ default fields + your custom fields

**Use Cases:**
- PostgreSQL stored procedures (strict parameter matching)
- Microservices with defined schemas
- Third-party APIs with strict validation

---

### 2. **Math Calculations**
Perform calculations on order values:
```json
{
  "price_with_tax": "{{math:{{total}}*1.18}}",
  "rounded_total": "{{math:round({{total}})}}",
  "half_quantity": "{{math:{{quantity}}/2}}"
}
```

**Supported Functions:**
- Basic: `+`, `-`, `*`, `/`, `()`
- `round()`, `ceil()`, `floor()`
- `abs()`, `sqrt()`, `pow()`

**Use Cases:**
- Send price including tax
- Calculate credits based on order total
- Prorate values based on formulas

---

### 3. **Random Value Generators**
Generate unique IDs and values:
```json
{
  "transaction_id": "{{uuid:}}",
  "verification_code": "{{random:100000-999999}}",
  "api_key": "{{random_string:32-hex}}"
}
```

**Functions:**
- `{{uuid:}}` - UUID v4 (e.g., `a3f4b2c1-...`)
- `{{random:1-100}}` - Random number in range
- `{{random_string:16}}` - 16 character random string
- `{{random_string:8-alpha}}` - Letters only
- `{{random_string:12-hex}}` - Hex characters

**Use Cases:**
- Generate unique transaction IDs
- Create temporary passwords
- Generate API keys or tokens

---

### 4. **Advanced Date/Time Functions**
More date formats and precision:
```json
{
  "unix_timestamp": "{{timestamp:+30days}}",
  "iso_datetime": "{{datetime:+1year}}",
  "us_format": "{{date_us:}}",
  "custom_format": "{{date_custom:d M Y|+6months}}"
}
```

**Additional Formats:**
- `{{timestamp:}}` - Unix timestamp
- `{{timestamp_ms:}}` - Milliseconds timestamp
- `{{datetime:}}` - ISO 8601 with timezone
- `{{date_us:}}`, `{{date_eu:}}` - Regional formats
- `{{date_custom:FORMAT|modifier}}` - Any PHP date format

**Use Cases:**
- APIs requiring Unix timestamps
- Integrate with systems expecting specific date formats
- Calculate exact expiry dates

---

### 5. **25+ Additional Variables**
Full billing/shipping address and more:
```json
{
  "billing_address": "{{billing_address_1}}",
  "billing_city": "{{billing_city}}",
  "billing_postcode": "{{billing_postcode}}",
  "billing_country": "{{billing_country}}",
  "shipping_address": "{{shipping_address_1}}",
  "order_tax": "{{order_tax}}",
  "order_shipping": "{{order_shipping}}"
}
```

---

## 💰 Pricing

### FREE Version
- **Price:** $0
- **Support:** Community forums
- **Updates:** Basic updates
- **Use:** Unlimited sites (GPL license)

### PRO Version
- **Price:** $49 (one-time payment)
- **Support:** Priority email support
- **Updates:** Lifetime updates
- **Use:** Unlimited sites
- **Guarantee:** 30-day money-back

---

## 🔄 Upgrade Process

### Step 1: Purchase PRO
Visit: [https://futurefeathers.com/futurefeathers-order-api-pro](https://futurefeathers.com/futurefeathers-order-api-pro)

### Step 2: Download PRO Plugin
Download `woocommerce-external-api-integration-pro.zip`

### Step 3: Install PRO
1. Go to **Plugins → Add New → Upload Plugin**
2. Upload the PRO zip file
3. Click **Install Now** → **Activate**

### Step 4: Deactivate FREE
1. Go to **Plugins**
2. Find "WooCommerce External API Integration" (FREE)
3. Click **Deactivate**
4. (Optional) Delete FREE version

### ✅ Your Settings Are Preserved!
All your product configurations, API URLs, custom fields, and settings automatically carry over. Nothing needs to be reconfigured!

---

## 📊 Feature Comparison Table

| Feature | FREE | PRO |
|---------|------|-----|
| **Variables** | 25+ basic | 50+ advanced |
| **Date Functions** | Basic (date, today, now) | Advanced (timestamp, datetime, custom) |
| **Math Calculations** | ❌ | ✅ |
| **Random Generators** | ❌ | ✅ (UUID, numbers, strings) |
| **"Only Custom Fields" Mode** | ❌ | ✅ |
| **Full Address Data** | ❌ | ✅ |
| **Custom Date Formats** | ❌ | ✅ |
| **Test API Button** | ✅ | ✅ |
| **Logging** | ✅ | ✅ |
| **Authentication** | ✅ | ✅ |
| **Per-Product Config** | ✅ | ✅ |
| **Updates** | Basic | Lifetime |
| **Support** | Community | Priority |

---

## 🎯 Real-World PRO Use Cases

### Use Case 1: SaaS License Management
```json
{
  "email": "{{email}}",
  "license_key": "{{uuid:}}",
  "max_users": "{{math:{{quantity}}*10}}",
  "expires": "{{timestamp:+1year}}"
}
```
✅ Only these fields sent (no extra parameters)  
✅ Auto-generate unique license keys  
✅ Calculate user limits based on quantity  
✅ Set exact expiry timestamp

### Use Case 2: LMS Academy Limits (Your Use Case!)
```json
{
  "p_identifier_value": "{{email}}",
  "p_is_uniqueid": "FALSE",
  "p_new_validity": "{{date:+1month}}",
  "p_new_maxclients": "{{math:{{quantity}}*50}}",
  "p_new_maxstaff": "{{math:{{quantity}}*5}}"
}
```
✅ Strict parameter matching (Supabase RPC)  
✅ Calculate limits based on purchased quantity  
✅ Auto-calculate dates

### Use Case 3: CRM Integration
```json
{
  "contact_id": "{{uuid:}}",
  "email": "{{email}}",
  "name": "{{customer_full_name}}",
  "address": "{{billing_address_1}}, {{billing_city}}",
  "lifetime_value": "{{math:round({{total}})}}",
  "verification_code": "{{random:100000-999999}}"
}
```

---

## 🆘 Questions?

### Can I try PRO before buying?
All PRO features are demonstrated in our [video walkthrough](https://futurefeathers.com/demo). We also offer a **30-day money-back guarantee**.

### Will my FREE settings work in PRO?
Yes! PRO is 100% backward compatible. All your configurations transfer automatically.

### How many sites can I use PRO on?
Unlimited! There are no site restrictions.

### Do I need to pay annually?
No! It's a **one-time payment** with lifetime updates.

### What if I need help?
PRO includes **priority email support**. We typically respond within 24 hours.

---

## 🔗 Get PRO Now

**Ready to unlock advanced features?**

👉 [**Upgrade to PRO - $49**](https://futurefeathers.com/futurefeathers-order-api-pro)

---

**Thank you for using WooCommerce External API Integration!** 🙏

