=== OpenCartCity Connector for QuickBooks Online ===
Contributors: opencartcity
Tags: woocommerce, quickbooks, qbo, accounting, sync
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automate your accounting by seamlessly synchronizing WooCommerce orders, customers, and products directly to QuickBooks Online.

== Description ==

Eliminate manual data entry and keep your books perfectly balanced. The **OpenCartCity Connector for QuickBooks Online** bridges the gap between your storefront and QuickBooks Online (QBO). 

Whenever an order is processed, modified, or completed, this module dynamically handles dependency logic to ensure customers, items, and transactions map perfectly without creating duplicates.

### Key Features
* **Smart Dependency Queuing:** Automatically detects if a product or customer already exists in QBO before uploading a transaction.
* **Flexible Order Mapping:** Sync transactions dynamically as either **Invoices** (with linked payments) or **Sales Receipts** based on your workflow.
* **HPOS & Custom Data Store Compliant:** Built specifically to support modern High-Performance Order Storage (HPOS) and standard WordPress environments without memory race conditions.
* **Inventory Control Protection:** Safely skips frontend checkout stock triggers to prevent duplicate queue bloat.

== External Services ==

This plugin connects directly to QuickBooks Online (via the Intuit API) to synchronize e-commerce and accounting data between your WooCommerce store and QuickBooks.

* **Service:** QuickBooks Online (provided by Intuit Inc.)
* **Purpose:** To authorize your store account via OAuth 2.0 and synchronize customers, products, sales receipts, and invoices to your QuickBooks Online account.
* **Data Sent & When:** 
  - During OAuth connection: Authorization codes and refresh tokens are transmitted via `https://oauth.platform.intuit.com` to establish and maintain account authorization.
  - During order product or customer sync: Customer details (names, email, billing/shipping addresses, etc), product data (names, SKUs, prices etc), and order data(customer, product, address, totals etc) are transmitted via `https://quickbooks.api.intuit.com` (or `https://sandbox-quickbooks.api.intuit.com` in sandbox mode) when orders, products or customers are created/updated in WooCommerce.
* **Terms of Service:** https://www.intuit.com/legal/terms/
* **Privacy Policy:** https://www.intuit.com/privacy/statement/

== Installation ==

1. Upload the entire `opencartcity-connector-for-quickbooks-online` folder to the `/wp-content/plugins/` directory, or upload the `.zip` file directly via **Plugins > Add New > Upload**.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Navigate to **WooCommerce > Settings > QuickBooks Sync** to configure your API Credentials.
4. Authenticate your store with your Intuit Developer App via OAuth 2.0.

== Frequently Asked Questions ==

= What happens on order edits? =
If an order's total or configuration changes, the plugin handles linked transaction checks—safely modifying the invoice and managing payment rewrites without disrupting past bank reconciliations.

= Does it support guest checkouts? =
Yes, if a customer checks out as a guest, the plugin automatically maps the transaction payload to your configured global fallback customer asset.

== Screenshots ==

1. QuickBooks Online API Connection Settings and Authorization.
2. Sync Configuration for Products, Customers, and Orders.
3. Account Mapping Settings for Income, Expense, and Asset accounts.
4. Detailed Sync Activity Logs for troubleshooting API requests and responses.
5. QBO Sync Queue Management for monitoring pending and failed sync jobs.
6. WordPress Users / Customers List Table showing linked QBO Customer IDs.
7. WooCommerce Products List Table showing QBO Sync Status badges and Force Re-sync buttons.
8. WooCommerce Orders List Table with real-time QBO Sync Status indicators.

== Changelog ==

= 1.0.0 =
* Initial stable production launch.
* Added support for WooCommerce HPOS data structures.
* Implemented strict anti-duplicate guards for linked invoices and payments.