=== Todogift Shipping API ===
Contributors: todogift
Tags: woocommerce, shipping, api, rest-api
Requires at least: 5.3
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expose a REST endpoint that returns WooCommerce-calculated shipping rates for a given address and products list.

== Description ==

Todogift Shipping API exposes a simple, production-focused REST API endpoint so an external service can retrieve shipping rates calculated by WooCommerce on a vendor's store.

This plugin is primarily built for stores integrating with the Todogift platform. It can also be used by any external system that needs authenticated access to WooCommerce-calculated shipping rates.

This plugin does not re-implement shipping logic. It delegates to WooCommerce shipping calculation, so all configured rules apply:

* Shipping zones and locations
* Shipping methods (Flat rate, Free shipping, etc.)
* Table/weight/amount rules from shipping plugins (e.g. relay / carrier plugins)

= Endpoints =

* GET /wp-json/todogift/v1/status (auth required)
* GET /wp-json/todogift/v1/shipping/free-shipping-rules (auth required; core WooCommerce Free shipping min amount rules)
* POST /wp-json/todogift/v1/shipping/calculate (auth required)

= Authentication =

All endpoints require authentication using WooCommerce REST API keys.

For security, always use HTTPS and HTTP Basic Auth when calling the API. Do not transmit API keys over plain HTTP.

= Privacy =

The plugin does not track users and does not send data to third-party servers by itself. It only responds to authenticated API requests.

== Installation ==

1. Upload the `todogift-shipping-api` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Ensure WooCommerce is installed and active.
4. Create WooCommerce REST API keys (WooCommerce → Settings → Advanced → REST API) and share them with your integration.

== Frequently Asked Questions ==

= Does this plugin send any data to Todogift automatically? =

No. The plugin only responds to authenticated API requests. It does not phone home.

= What data is exposed by the API? =

The `shipping/calculate` endpoint returns shipping rates for a provided address and product IDs. It does not return customer account data. Access is restricted by WooCommerce REST API keys.

= Does this plugin require a Todogift account? =

To use it with Todogift, you will need a Todogift integration. Without Todogift (or another integration calling the endpoints), the plugin has no user-facing UI and simply exposes authenticated endpoints.

= Is this compatible with all shipping plugins? =

The plugin relies on WooCommerce shipping calculation. Compatibility depends on whether the installed shipping plugins properly register rates via WooCommerce shipping APIs.

== Changelog ==

= 1.0.1 =
* Shipping rates response now includes method_id and instance_id (WooCommerce shipping method identifiers).

= 1.0.0 =
* Initial release: calculate shipping endpoint.
* Added status endpoint and free-shipping rules endpoint.

