=== UltimaTour Bókun Sync ===
Contributors: tesystems
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 8.2
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connect Bókun with every UltimaTour Operator edition using guarded booking reconciliation and availability protection.

== Description ==

UltimaTour Bókun Sync is an optional companion integration for UltimaTour Operator. It works with the same Operator intake contract in every Operator edition.

The integration:

* imports future Bókun bookings into the matching Operator departure;
* prevents duplicate imports by reconciling Bókun and Viator references;
* preserves Operator as the operational source of truth;
* closes a Bókun slot when Bókun could sell more seats than Operator has remaining;
* never expands Bókun capacity during background synchronization;
* opens only one exact public Bókun slot after an administrator explicitly opens its matching Operator departure;
* never opens private departures in Bókun;
* requires explicit product and time mappings and fails closed when matching is missing or ambiguous;
* leaves Bókun cancellations for operator review instead of cancelling Operator bookings automatically; and
* records freshness, failures, conflicts, and unresolved items in WordPress administration.

This is not an unrestricted two-way channel manager. Its outbound behavior is deliberately limited to availability protection and an administrator’s explicit opening of one mapped public departure.

== Installation ==

1. Install and activate UltimaTour Operator.
2. Install and activate UltimaTour Bókun Sync.
3. Open Operator > Bókun Sync.
4. Enter the Bókun API access key and secret key from the operator’s own account.
5. Enter the operator’s Bókun product ID and exact product code.
6. Add explicit time mappings when Bókun times differ from Operator meeting times.
7. Enable booking intake and availability protection, then run a manual sync to verify the mapping.

== External Services ==

= Bókun API =

Purpose: Optional reconciliation of Bókun bookings into UltimaTour Operator and guarded synchronization of mapped Bókun availability.

Data sent: The administrator-supplied Bókun API access key, a timestamped request signature derived from the administrator-supplied secret key, the configured Bókun product ID, requested date ranges, and—when closing or explicitly reopening a mapped public slot—the product ID, date, and Bókun start-time ID. The secret key itself is not transmitted. Credentials are stored encrypted in the WordPress database using keys derived from the site’s WordPress salts.

Data received: Bókun booking references, booking status, product identity, travel date/time, party size, lead-customer contact details supplied by Bókun, availability, remaining capacity, closeout state, and Bókun start-time identifiers for the configured product.

When data is sent: Only after an administrator configures credentials and explicitly enables synchronization, during the configured WordPress cron interval, when an administrator selects Run sync now, and when an administrator explicitly opens a mapped public Operator departure while availability protection is enabled.

Service URL: `https://api.bokun.io/`.

Privacy policy: https://www.bokun.io/privacy-policy

Terms: https://www.bokun.io/terms

API terms: https://www.bokun.io/api-terms

== Changelog ==

= 1.0.0 =

* Productized the proven guarded Bókun reconciliation workflow for every Operator edition.
* Removed SNUBA-specific product defaults; each operator must supply its own Bókun product identity.
* Documented booking intake, capacity protection, fail-closed mapping, limitations, configuration, and external-service data flow.

