NEXARA SYNC API SETUP
=====================

Upload the api folder to the document root of https://whct.nexarasolutions.cloud/
The API expects /config/database.php to exist.

Set hosting environment variable NEXARA_SYNC_SETUP_PASSWORD before using register_device.php.

Register device by POST JSON to /api/register_device.php:
{
  "setup_password":"YOUR_SETUP_PASSWORD",
  "installation_uuid":"0908ea41-7ff7-11f1-9058-f0038c579b2c",
  "shop_code":"SHOP-001",
  "branch_code":"MAHARAGAMA",
  "device_code":"POS-01",
  "token":"LONG-RANDOM-DEVICE-TOKEN-AT-LEAST-24-CHARACTERS"
}

Authenticated requests need:
Authorization: Bearer YOUR_DEVICE_TOKEN
X-Installation-UUID: 0908ea41-7ff7-11f1-9058-f0038c579b2c
Content-Type: application/json

Test order:
1. register_device.php
2. heartbeat.php
3. push.php with one product
4. pull.php
5. enable continuous local sync

Keep local sync_enabled=0 until heartbeat and one-product push both work.
