=== Humasana ===
Contributors: humasana  
Tags: woocommerce, marketplace, sync, orders, inventory  
Requires at least: 6.0  
Tested up to: 6.7  
Stable tag: 0.1.2
Requires PHP: 7.2  
WC requires at least: 8.0  
License: GPL-3.0-or-later  
License URI: https://www.gnu.org/licenses/gpl-3.0.html  

The Humasana Connect is a powerful extension that enables seamless integration between your WooCommerce store and the Humasana Marketplace. 

== Description ==
Humasana Connect syncs products, inventory, and orders between WooCommerce and Humasana Marketplace.  
When a customer places an order on Humasana, it appears in WooCommerce as a native order.  
Stock updates are also synchronized automatically, preventing overselling.  

In order to use this plugin, all your product MUST HAVE the gain/ups/EAN number filled in the inventory section.

= Use of External Service: Humasana API =
This plugin relies on the Humasana API to synchronize data between your WooCommerce store and the [Humasana Marketplace](https://www.humasana.com/). 

= Key Features =
* Product Sync: Automatically sync WooCommerce products with the Humasana Marketplace.
* Order Management: Create and update orders from Humasana within WooCommerce.
* Order Tracking Sync: Synchronize order tracking information between both platforms.
* View Reports: View detailed reports on total synced products, orders, and errors.
* Automated Updates: Ensure accurate data without manual intervention.


= Data Processing and Privacy =
All data is transmitted securely between your WooCommerce site and the Humasana API. By using this plugin, you agree to Humasana's [Terms of Service](https://www.humasana.com/static/kowloon/files/humasana-cgu-fr.pdf).

= Support =
For any issues, feature requests, or assistance, please contact our support team at care@humasana.com or visit our [FAQ page](https://www.humasana.com/fr/faq).

== Installation ==

= Manual Installation =
1. Upload the plugin files to the `/wp-content/plugins/humasana` directory.  
2. Activate the plugin through the ‘Plugins’ screen in WordPress.  
3. Configure your Humasana account in the plugin settings.  

= Requirements =
-   WordPress with WooCommerce installed and configured.
-   Active account on Humasana Marketplace

== Frequently Asked Questions ==

= How does the order synchronization work? =
Orders placed on Humasana appear in WooCommerce as native orders for easy fulfillment.  

= What the service is and what it is used for? =
The Humasana API is an external service provided by Humasana Marketplace that allows merchants to: 
- Synchronize their WooCommerce products with Humasana.
- Automatically create and update orders received from Humasana.
- Sync order status, order tracking data between WooCommerce and Humasana.
- View a sync report dashboard.

= What data is sent/received and when? = 
The plugin communicates with the Humasana API to perform the following operations:
1. Product Sync: 
    - Data Sent: Product name, description, status, images, price, discount, stock quantity, and attributes.	
    - When It Is Sent: When a product is created, updated, or deleted in WooCommerce.
2. Order status sync: 
    - Data Sent: Order status	
    - When It Is Sent: When an order is updated in WooCommerce
3. Order tracking sync: 
    - Data Sent: Tracking number, shipping carrier details
    - When It Is Sent: When an order's tracking information is updated in WooCommerce
4. Order Webhook: 
    - Data Received: Order details (products, customer shipping address, payment method), for the purpose of creating a new native order in Woocommerce for easy fulfillment. 
    - When It Is received: When an order is placed or updated on Humasana.
5. Show Report:
    - Data Received: Total products synced, total orders synced, total sync errors. 
    - When It Is received: When go to the Humasana settings page.

= Summary Table API endpoint =
1. `GET` `/api/report/stats` 
Fetch sync reports (products, orders, errors).
2. `POST` `/api/products` 
Create a single product on Humasana.
3. `POST` `/api/product/sync` 
Sync multiple products in batch.
4. `POST` `/api/product/link` 
Link variations to a parent product.
5. `PUT` `/api/product/update` 
Update product details (price, stock, etc.).
6. `POST` `/api/product/remove` 
Remove a product from Humasana.
7. `PUT` `/api/order/{orderID}` 
Update the status of an order.
8. `POST` `/api/order/{orderID}/tracking` 
Update order tracking information.
9. `POST` `/api/auth/store` 
Authenticate WooCommerce store with Humasana.

= Source Files Location =
The `build/` directory contains the compiled JavaScript files used by the plugin, while the `src/` directory contains the original source code.

== Changelog ==
= 0.1.2 =
* Display stats on synced products.  
= 0.1.0 =
* Initial release.  

== Upgrade Notice ==
= 0.1.0 =
First version of the plugin.  
