=== WITHMIA for WooCommerce ===
Contributors: appwithmia
Tags: woocommerce, whatsapp, chatbot, abandoned cart, ai
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Connect your WooCommerce store to WITHMIA: your AI sales assistant for WhatsApp, Instagram and web chat.

== Description ==

**WITHMIA for WooCommerce** connects your store to the [WITHMIA](https://withmia.com) platform, so your AI assistant can sell your products, build ready-to-pay carts, track orders and recover abandoned carts — from WhatsApp, Instagram, Messenger and your web chat.

### What does this plugin do?

**AI sales assistant**
Your WITHMIA assistant reads your catalog in real time. It can recommend products and answer questions about stock, prices and promotions right there in the chat.

**Carts built for the customer**
The assistant creates pre-filled cart links: the customer opens one and only has to pay. Works with simple and variable products.

**Order tracking**
Customers ask about their order on WhatsApp. WITHMIA is notified of every status change automatically.

**Real-time notifications**
Get alerts about new orders, status changes, low stock, new customers and refunds in your WITHMIA dashboard.

**Abandoned cart recovery**
The plugin spots abandoned carts and tells WITHMIA, which can send an automatic WhatsApp message to win the sale back.

**Sales metrics**
Conversion, cart recovery rate and more, from your WITHMIA dashboard.

### Main features

* **Simplified API**: REST endpoints shaped for AI queries
* **Dedicated authentication**: its own API key, no WooCommerce credentials needed
* **Cart by URL**: build a link with several products and quantities
* **Abandonment detection**: a cart with no activity for 30 minutes
* **Configurable webhooks**: choose which events reach WITHMIA
* **Admin panel**: everything under WooCommerce → WITHMIA
* **Translated**: Spanish, Portuguese, French, German and Japanese included
* **Light**: it does not slow your store down

### Supported channels

* WhatsApp (official Cloud API from Meta, and QR)
* Instagram Direct
* Facebook Messenger
* Web chat on your site
* Email

### How it works

1. Install and activate the plugin
2. Copy the API key from WooCommerce → WITHMIA
3. Paste it into your WITHMIA dashboard (app.withmia.com → Integrations → WooCommerce)
4. Copy the webhook URL WITHMIA gives you and paste it into the plugin settings
5. That is it — your AI assistant can sell your products

== External services ==

This plugin connects your store to the WITHMIA platform, a third-party service operated by MIA Marketing & Intelligence Artificial SpA. The connection is what makes the integration work:

* **What it connects to:** the webhook URL you configure in the plugin settings (your WITHMIA account, e.g. `https://app.withmia.com/api/woocommerce/webhook`). The plugin sends the events you enable to that URL, and WITHMIA reads your catalog back through the REST endpoints this plugin registers, authenticating with the API key shown on the settings page.
* **What data is sent:** only the events you enable. Depending on that choice it can include order data (products, quantities, totals, status), stock changes, new customer registrations, refunds, and abandoned cart contents together with the contact details the customer entered at checkout (name, email, phone). Passwords and payment card data are never sent.
* **When:** when the corresponding event happens in your store, and when WITHMIA queries your catalog to answer a customer.
* **Test requests:** pressing "Test connection" on the settings page sends one request with your store URL and store name, and nothing else.

Service provider: WITHMIA — [Terms of Service](https://withmia.com/terminos) · [Privacy Policy](https://withmia.com/privacidad)

== Installation ==

### Automatic installation

1. Go to **Plugins → Add New** in your WordPress dashboard
2. Search for "WITHMIA for WooCommerce"
3. Click **Install** and then **Activate**
4. Go to **WooCommerce → WITHMIA**

### Manual installation

1. Download the plugin ZIP file
2. Go to **Plugins → Add New → Upload Plugin**
3. Select the ZIP file and click **Install Now**
4. Activate the plugin

### Setup

1. Go to **WooCommerce → WITHMIA**
2. Copy the **API key**
3. In [app.withmia.com](https://app.withmia.com), go to **Integrations → WooCommerce** and paste it there along with your store URL
4. Copy the **webhook URL** WITHMIA gives you and paste it into the plugin
5. Copy the **webhook secret** and set it as `WOOCOMMERCE_WEBHOOK_SECRET` in WITHMIA
6. Choose which events to send and click **Save changes**
7. Press **Test connection** to confirm both ends are talking

== Frequently Asked Questions ==

= Do I need a WITHMIA account? =

Yes. This plugin is the connector between your WooCommerce store and the WITHMIA platform. You can start at [withmia.com](https://withmia.com) — new accounts include a 14-day free trial, no credit card required.

= Does the plugin slow down my store? =

No. Webhook notifications are sent without blocking the page, and the API endpoints only answer when they are queried.

= Does it work with variable products? =

Yes. Simple, variable (with variations), grouped and external products are supported. Pre-filled carts also work with specific variations.

= What data is sent to WITHMIA? =

Only what you enable under Events: order information, stock changes, and abandoned cart data. Passwords and payment card data are never sent. The External services section above has the detail.

= Do I need the WooCommerce REST API enabled? =

Yes, and it is enabled by default. The plugin registers its own endpoints inside the WooCommerce REST API namespace.

= Can I use the API without the WITHMIA platform? =

Yes. The REST endpoints (`/wc/v3/withmia-products` and the rest) can be used by any application holding the API key. The AI and chat features do need the WITHMIA platform.

= Does it work on multilingual stores? =

Yes. Products come back in the language your store is set to. It works with WPML and Polylang.

= How does abandoned cart recovery work? =

The plugin follows cart activity per session. If a cart sees no activity for 30 minutes it is marked as abandoned and WITHMIA is notified. Your AI assistant can then send a WhatsApp message with a recovery link.

= In which languages is the plugin available? =

The admin panel ships translated into Spanish, Portuguese, French, German and Japanese, and follows your WordPress language.

== Screenshots ==

1. Settings panel under WooCommerce → WITHMIA
2. API key and connection status
3. Webhook event settings
4. Available API endpoints

== Changelog ==

= 1.0.0 =
* Initial release
* Simplified REST API for products, categories and stock
* Pre-filled cart links
* Abandoned cart tracking with webhook notification
* Admin panel under WooCommerce
* Webhooks for orders, stock, customers and refunds
* Variable product support
* Dedicated API key authentication
* Admin panel translated into Spanish, Portuguese, French, German and Japanese

== Upgrade Notice ==

= 1.0.0 =
First release. Install it to connect your store with WITHMIA.
