=== RAU Mirakl Order Sync for WooCommerce ===
Contributors: rajaamanullah
Plugin URI: https://rajaamanullah.com/product/mirakl-order-sync-for-woocommerce/
Tags: mirakl, marketplace, order sync, marketplace integration, woocommerce
Requires at least: 5.6
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Connect Mirakl marketplace shops to WooCommerce: import orders automatically, accept them, and sync tracking and shipping status back.

== Description ==

[RAU Mirakl Order Sync for WooCommerce](https://rajaamanullah.com/product/mirakl-order-sync-for-woocommerce/) lets marketplace sellers manage all their Mirakl orders inside WooCommerce.

If you sell on a marketplace built on the Mirakl platform, your orders normally live in the marketplace's own seller portal. That means a second dashboard to watch, manual copying of addresses and SKUs into WooCommerce, and tracking numbers that have to be pasted back by hand once a parcel ships. Miss an acceptance deadline and the order can be cancelled automatically.

This plugin closes that gap. It connects to your Mirakl shop over the marketplace's own API, pulls new orders into WooCommerce on a schedule you set, and creates them as ordinary WooCommerce orders with the customer, shipping address, line items and shipping costs already filled in. From there your normal fulfilment workflow applies. When you complete the order in WooCommerce, the tracking number and carrier go back to Mirakl and the order is marked as shipped, so the marketplace and your store stay in step without anyone retyping anything.

It is built for sellers running more than one shop. Each Mirakl shop is configured separately with its own API URL, key and shop ID, and its own import behaviour, so a store selling on two or three marketplaces can keep different order statuses, pricing rules and carriers for each one.

= What it does =

* Connect unlimited Mirakl shops — each with its own API URL, API key and shop ID
* Automatic scheduled imports (every 5 minutes up to daily)
* Manual import by date range, or by specific Mirakl order IDs
* Auto-accept orders waiting for acceptance (per shop)
* Import real prices and shipping costs, or zero-price fulfilment orders (per shop)
* Choose the WooCommerce status for imported orders (per shop)
* Download Mirakl delivery bills (PDF) and attach them to orders
* Send tracking numbers to Mirakl and mark orders SHIPPED
* Match products by SKU, with optional placeholder products for unknown SKUs
* Country fallback/force options for marketplaces that send localized country names
* Connection tester for each shop
* Full logging via WooCommerce → Status → Logs
* Compatible with WooCommerce High-Performance Order Storage (HPOS)

= Works with marketplaces built on Mirakl =

Mirakl powers the marketplace platform behind many large European retailers, including Carrefour, Decathlon, Leroy Merlin, Auchan, Fnac Darty, Galeries Lafayette, Conforama, La Redoute, Boulanger, Maisons du Monde, El Corte Inglés, PC Componentes, Worten and MediaMarktSaturn.

The plugin is not written against any single marketplace. If your marketplace runs on Mirakl and your seller account gives you an API URL ending in /api plus a shop API key, this plugin can connect to it. All marketplace and company names above are trademarks of their respective owners and are listed only to describe compatibility.

This plugin is an independent integration developed by a marketplace seller. It is not affiliated with, endorsed by, or sponsored by Mirakl.

= Documentation and support =

Documentation, setup guides and support are available on the developer's website: [rajaamanullah.com](https://rajaamanullah.com/). For questions about this plugin, visit the [plugin page](https://rajaamanullah.com/product/mirakl-order-sync-for-woocommerce/) or use the wordpress.org support forum.

== External services ==

This plugin connects to the Mirakl marketplace API to do its job. It talks only to the API URL you enter for each shop (your marketplace's own Mirakl instance, e.g. https://yourmarketplace.mirakl.net/api) — there is no other external service, no telemetry, and nothing is sent anywhere else.

What is sent, and when:

* Your shop API key (as the authorization header) with every request, so Mirakl can authenticate the shop you configured.
* Order queries (date ranges, order ids) when importing orders — manually, or on the schedule you configure.
* Order acceptance, tracking numbers, carrier details and shipment confirmations for your Mirakl orders, when you enable those features or complete an order.
* Document download requests for delivery bills, when document download is enabled.

The data received (orders, customer addresses, documents) is stored in your own WooCommerce store. This service is provided by the Mirakl instance of the marketplace you sell on, under that marketplace's own terms of service; Mirakl's privacy policy is at https://www.mirakl.com/privacy-policy.

== Installation ==

1. Upload the plugin and activate it.
2. Go to WooCommerce → RAU Mirakl Sync → Shops → Add Shop.
3. Enter your Mirakl API URL (e.g. https://yourmarketplace.mirakl.net/api) and your shop API key.
4. Use "Test connection" to verify, then configure the import behaviour per shop.

== Frequently Asked Questions ==

= Which marketplaces does this work with? =

Any marketplace running on the Mirakl platform that gives sellers API access. That includes retailers such as Carrefour, Decathlon, Leroy Merlin, Auchan, Fnac Darty, El Corte Inglés and MediaMarktSaturn, among many others. The plugin talks to the standard Mirakl seller API rather than to one specific marketplace, so if your seller account provides an API URL and a shop API key, it should connect.

= Do I need a Mirakl API key, and where do I find it? =

Yes. The key comes from your seller account on the marketplace, usually under Settings → API in the Mirakl back office. It authenticates your shop, so treat it like a password. If you cannot see an API section, ask the marketplace's seller support to enable API access for your account.

= Can I connect more than one Mirakl shop? =

Yes, there is no limit. Each shop is added separately with its own API URL, key and Mirakl shop ID, and each has its own settings for scheduled imports, auto-accept, order status, pricing, carrier and country handling. One API key that manages several shops is also supported — that is what the Mirakl Shop ID field is for.

= How often are orders imported? =

You choose. The automatic import can run every five minutes, every fifteen minutes, hourly, twice daily or daily. You can also run an import manually at any time from the Import Orders tab, either for a date range or for specific Mirakl order IDs. Scheduled imports rely on WP-Cron, so on a quiet site consider a real server cron for reliable timing.

= Will the same order be imported twice? =

No. Every imported order is stored with its Mirakl order reference, and the plugin checks for that reference before creating anything. Re-running an import over a date range you have already pulled updates the existing orders instead of duplicating them.

= Does it work with High-Performance Order Storage (HPOS)? =

Yes. The plugin declares HPOS compatibility and works with both the legacy post-based order storage and the newer high-performance order tables.

= Can it accept Mirakl orders automatically? =

Yes, per shop. Marketplaces usually require orders to be accepted within a set window or they are cancelled, so you can enable auto-accept for shops where you always fulfil, and leave it off for shops where you want to check stock first.

= How do tracking numbers get back to Mirakl? =

When you complete an order in WooCommerce, the plugin sends the tracking number and carrier details to Mirakl and marks the order as shipped. Carrier code and name are set per shop, and you can turn the behaviour off in Settings if you prefer to confirm shipments in the marketplace portal yourself.

= What happens if a Mirakl order contains a SKU that is not in my store? =

Products are matched by SKU. If a SKU does not exist in WooCommerce, the plugin can create a placeholder product so the order still imports with correct totals rather than failing. That option is per shop, and can be left off if you would rather the mismatch be visible.

= Orders are not importing. How do I find out why? =

Turn on logging in Settings and check WooCommerce → Status → Logs, source ramos-order-sync. Every API call and import run is recorded there, including authentication failures and empty date ranges. The Test connection button on each shop is the quickest way to confirm the API URL and key are correct.

= What happens to my data if I uninstall the plugin? =

Uninstalling removes the plugin's own settings, including your saved shops and API keys. Orders that were already imported stay in WooCommerce, because they are ordinary WooCommerce orders.

== Screenshots ==

1. Shops — every connected Mirakl shop in one list, with its API endpoint, sync schedule and last import at a glance.
2. Add or edit a shop — enter the Mirakl API URL, shop ID and API key, then verify it with Test connection before saving.
3. Import Orders — pull orders on demand by date range, or fetch specific Mirakl order IDs when you need to re-sync just one.
4. Settings — choose the import interval, the WooCommerce status for imported orders, auto-accept, pricing and document options.
5. Imported orders in WooCommerce — Mirakl orders land as normal WooCommerce orders, HPOS included, ready to fulfil.
6. Logging — every API call and import run is recorded under WooCommerce, Status, Logs, so failures are easy to trace.

== Changelog ==

= 1.0.0 =
* Initial release: connect unlimited Mirakl shops, automatic scheduled order imports, auto-accept, per-shop import options (status, prices, documents, carrier).
* Tracking and shipment sync back to Mirakl, delivery bill downloads, SKU matching with optional placeholder products.
* Lightweight built-in API client on the WordPress HTTP API, HPOS compatibility, logging, connection tester, clean uninstall.

== Upgrade Notice ==

= 1.0.0 =
First public release.
