=== Sendelly ===
Contributors: sendelly
Tags: woocommerce, shipping, pickup points, shipping labels, delivery
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.3.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connect WooCommerce to Sendelly in one click: orders sync for labels and tracking, carrier pickup points (points relais) show at checkout.

== Description ==

[Sendelly](https://sendelly.com) is a shipping platform for online shops: connect your store, and your orders arrive in Sendelly to be packed, labelled with the right carrier (Mondial Relay, Chronopost, Colis Privé, UPS…) and tracked until delivery. Tracking numbers are written back to your WooCommerce orders.

This plugin connects your WooCommerce store to Sendelly and brings **carrier pickup points (points relais)** to your checkout:

* **One-click connection.** Click "Connect to Sendelly", approve the access on WooCommerce's own authorization screen, and sign in to (or create) your Sendelly account. No API key to create, nothing to copy and paste.
* **Pickup points at checkout.** The nearest pickup points of the carriers configured in your Sendelly account appear as **native shipping options**: each point is one selectable line with its carrier, distance and name.
* Works in **both** the classic shortcode checkout and the **Checkout Blocks**: no custom JavaScript, no iframe, no map widget.
* When the buyer picks a point and orders, the plugin stamps the order so Sendelly creates the shipping label for that point.
* The price is yours: set it on the shipping method, or leave it empty and let a Sendelly shipping rule decide.

Requirements: a Sendelly account (free plan available) and a store reachable over HTTPS.

Compatible with High-Performance Order Storage (HPOS) and the cart/checkout Blocks.

== External services ==

This plugin connects your store to **Sendelly**, a shipping service operated by Sendelly ([terms of service](https://sendelly.com/cgv.html), [privacy policy](https://sendelly.com/confidentialite.html)). It talks to the Sendelly API (`api.sendelly.com`) in these cases only:

* **When you click "Connect to Sendelly"**: your site's address is sent to Sendelly, which answers with the address of WooCommerce's authorization screen on your own site. If you approve there, WooCommerce itself sends Sendelly a REST API key (read/write) so Sendelly can import your orders and products and write tracking back. You can revoke that key at any time in WooCommerce → Settings → Advanced → REST API.
* **Once connected**: Sendelly sends this plugin its connection (store id, rates address, signing secret) through your site's REST API, authenticated with that key.
* **At checkout**, each time WooCommerce computes shipping rates for a cart with a delivery address: the destination address, the cart contents (product titles, SKUs, quantities, weights and totals) and the shipping method's title and price are sent to Sendelly, signed with your store's secret, to get the nearest pickup points. No payment data is ever sent.
* **When you click "Test connection"**: a sample request with a fixed Paris address.

Nothing is sent before you connect the store.

== Installation ==

1. In WordPress, go to Plugins → Add New, search for "Sendelly", install and activate the plugin (WooCommerce must be active).
2. Click **Connect to Sendelly** in the notice (or in WooCommerce → Settings → Shipping → Sendelly – Pickup points).
3. Approve the access on WooCommerce's authorization screen, then sign in to Sendelly or create your account: the store is added to your Sendelly organization and its orders start importing.
4. To offer pickup points, add **Sendelly – Pickup points** as a shipping method to the shipping zone(s) where you want them (e.g. France), and optionally set its price.

Without the button (a site that cannot be reached over HTTPS from the Internet, for example), connect the store from the Sendelly dashboard, copy its **connection code** and paste it in WooCommerce → Settings → Shipping → Sendelly – Pickup points.

== Frequently Asked Questions ==

= Do I need a Sendelly account? =

Yes. The connection creates or opens it: after approving the access in WooCommerce you land on Sendelly, where you sign in or sign up. A free plan is available.

= Does it work with the Checkout Blocks? =

Yes. The pickup points are ordinary WooCommerce shipping rates, so they render natively in the classic checkout and in the Checkout Blocks alike.

= What data is sent to Sendelly? =

See "External services" above. In short: your orders and products (through the REST API key you approve), and at checkout the delivery address and cart contents needed to find the nearest pickup points. No payment data.

= The pickup points do not show up at checkout. =

Check that: the plugin is connected (status row in WooCommerce → Settings → Shipping → Sendelly – Pickup points), the method is added to the matching shipping zone, and the customer entered a postcode or city. Enable "Debug logging" and read the `sendelly` source in WooCommerce → Status → Logs.

== Screenshots ==

1. The nearest pickup points as native shipping options at checkout (Checkout Blocks shown; the classic checkout works the same way).
2. After activation: one click on "Connect to Sendelly".
3. WooCommerce's own authorization screen: approve, and Sendelly receives its API key. Nothing to copy.
4. The plugin settings: connection status and connection test.
5. In Sendelly: ship with Sendelly's built-in rates or your own carrier contracts.
6. In Sendelly: every parcel tracked live, and the tracking written back to the WooCommerce order.

== Changelog ==

= 1.3.1 =
* One-click connection: "Connect to Sendelly" opens WooCommerce's authorization screen, and Sendelly sends the plugin its connection itself. No API key to create, no code to paste (pasting still works).
* First release on WordPress.org, as "Sendelly". Translations now come from translate.wordpress.org.
* The settings screen's script is loaded as a file.
* Tested with WordPress 7.1 and WooCommerce 11.3.
