=== CarryBee ===
Contributors: carrybee
Tags: courier, shipping, delivery, bangladesh, cash on delivery
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.0
Requires Plugins: woocommerce
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Send WooCommerce orders to CarryBee Courier in one click. Book parcels, print labels and track cash on delivery (COD) orders across Bangladesh.

== Description ==

**CarryBee** connects your WooCommerce store to [CarryBee](https://carrybee.com), a courier and parcel delivery service in Bangladesh. Book deliveries straight from your WooCommerce orders. You don't need to copy addresses into a separate courier panel.

Send one order or hundreds at once. Print shipping labels, and let delivery status update your orders automatically, from pickup to delivered or returned.

= Why use CarryBee? =

* **One-click courier booking**: send any WooCommerce order to CarryBee from the order screen or the order list.
* **Bulk send**: select many orders and book them in one go with an editable spreadsheet view.
* **Smart address parsing**: the customer's address is read automatically to fill in the delivery city and zone.
* **Cash on delivery (COD) support**: the collectable amount is sent with every parcel.
* **Print shipping labels (POD)**: print parcel labels with barcodes for one or many orders.
* **Live order tracking**: a webhook updates the courier status, delivery fee and tracking ID on each order, with an order note for every change.
* **Courier status filter**: filter the WooCommerce order list by courier status.
* **Multiple pickup stores**: choose the CarryBee store that each order ships from.
* **Sandbox mode**: test with the CarryBee sandbox before going live.
* **HPOS ready**: works with WooCommerce High-Performance Order Storage and with legacy post storage.

= Who is it for? =

Online shops, Facebook and F-commerce sellers, and WooCommerce merchants in Bangladesh who ship parcels with home delivery and cash on delivery inside Dhaka and across the country.

= Requirements =

* A CarryBee merchant account ([sign up](https://merchant.carrybee.com))
* WooCommerce 7.0 or newer
* PHP 8.0 or newer

== External services ==

This plugin connects to the CarryBee Courier API to book and track deliveries. It does not work without it.

* **What it is:** CarryBee Courier API. Production: `https://developers.carrybee.com/`. Sandbox: `https://sandbox.carrybee.com/`.
* **When data is sent:** when you test the connection, load cities, zones and stores, parse an address, send an order to the courier, refresh an order's status or print a label. Nothing is sent until you add your API credentials and take one of these actions.
* **What is sent:** your CarryBee API credentials, and for each order you send: the customer name, phone number and delivery address, the order ID, the amount to collect, item descriptions and weight.
* **Status updates:** CarryBee sends delivery status updates to your site's webhook URL, `/wp-json/carrybee-courier/v1/webhook`.

CarryBee [Terms of Service](https://carrybee.com/terms-condition) and [Privacy Policy](https://carrybee.com/privacy-policy).

== Third-party libraries ==

These files ship inside the plugin. Nothing is loaded from a CDN.

* [JsBarcode](https://github.com/lindell/JsBarcode) 3.11.6 draws the barcode on printed labels. MIT licence. Readable source: `assets/vendor/jsbarcode/JsBarcode.all.js`.
* [qrcode-generator](https://github.com/kazuhikoarase/qrcode-generator) 1.4.4 draws the QR code on printed labels. MIT licence. Readable source: `assets/vendor/qrcode-generator/qrcode.js`.
* [Noto Sans Bengali](https://github.com/notofonts/bengali) for Bangla text on printed labels. SIL Open Font License 1.1.

== Installation ==

1. In WordPress, go to **Plugins > Add New**, search for "CarryBee", then click **Install Now** and **Activate**. You can also upload the plugin zip under **Plugins > Add New > Upload Plugin**.
2. Make sure WooCommerce is installed and active.
3. Go to **CarryBee > Settings**.
4. Choose **Production** or **Sandbox**, enter your **Client ID**, **Client Secret** and **Client Context**, then click **Save Changes**.
5. Click **Test Connection** to check your credentials.
6. Set the **Webhook Secret** from CarryBee (required), then share the **Webhook URL** shown on the settings page with CarryBee.

== Frequently Asked Questions ==

= Where do I get my CarryBee API credentials? =

Log in to your CarryBee merchant panel, or contact CarryBee support to get your Client ID, Client Secret and Client Context.

= Do I need a CarryBee account? =

Yes. The plugin books parcels with CarryBee Courier, so you need an active merchant account.

= Can I send many orders at once? =

Yes. In **CarryBee > Orders**, tick the orders and click **Review & send selected** (check each row in a table first) or **Quick send selected**. In **WooCommerce > Orders** you can also choose **CarryBee: Quick send** from the bulk actions.

= Does it support cash on delivery? =

Yes. The order's amount to collect is sent to CarryBee, and the collected amount comes back through the webhook.

= How does order tracking work? =

CarryBee calls your webhook whenever a parcel's status changes, such as picked, in transit, delivered or returned. The plugin saves the status on the order and adds an order note.

= Is it compatible with WooCommerce HPOS? =

Yes. It supports High-Performance Order Storage and the legacy posts storage.

= Can I test before going live? =

Yes. Choose **Sandbox** in the settings and use your sandbox credentials.

= Orders are not updating. What should I check? =

Check that the webhook URL was shared with CarryBee and that the Webhook Secret is set and matches on both sides. Without a Webhook Secret, the plugin refuses all status updates to protect your orders from fake updates. Also check that your site is reachable over HTTPS.

== Screenshots ==

1. Settings page: environment, API credentials, webhook URL and secret.
2. Send a single order to CarryBee Courier with an address auto-fill.
3. Bulk send many WooCommerce orders from one editable table.
4. Courier status and tracking columns in the WooCommerce order list.
5. Printed shipping label with barcode.

== Changelog ==

= 1.1.0 =
* Fix: "Send to CarryBee" in the order actions box no longer stops with an error.
* Fix: an order can't be sent twice by a double click or a second tab.
* Fix: "Undelivered" updates no longer mark an order Completed.
* Fix: Shop Managers can save the settings. Order links work with HPOS.
* Privacy: customer details are never written to logs. Debug logging is off unless `CARRYBEE_WP_DEBUG` is on.
* Barcode library and Bangla font now ship with the plugin, with no CDN.
* Security: webhooks now require the Webhook Secret, and support signed (HMAC-SHA256) requests.
* Bulk send uses City and Zone. Area is no longer required.
* Bulk address parser fills in the city and zone automatically.
* Invalid cells are highlighted with row and column details in bulk send.
* Cache is scoped per environment and account.

= 1.0.0 =
* First release.

== Upgrade Notice ==

= 1.1.0 =
Faster bulk sending with automatic city and zone detection.
