Merchant Order Routes

GET/api/v1/orders
GET/api/v1/orders/:id

These JWT-authenticated routes are always scoped to the token's merchantId. The list is paginated; detail returns the order and its shipments. Platform-neutral logic uses externalOrderId, not the legacy WooCommerce-only wcOrderId.

WooCommerce Plugin Authentication

Protected routes below /plugin/* bypass the merchant JWT guard but are authenticated by plugin middleware. The current plugin sends its API key plus the current WordPress site URL in X-OT-Store-URL; legacy store flows use HMAC headers. After normalizing case and trailing slashes, the middleware requires the header to exactly match the store bound to the key before it attaches merchant/store context, records key use, or runs the route.

GET/api/v1/plugin/health
GET/api/v1/plugin/woocommerce/latest
POST/api/v1/plugin/heartbeat
POST/api/v1/plugin/orders/sync
POST/api/v1/plugin/shipments/repoll
POST/api/v1/plugin/shipments/statuses
POST/api/v1/plugin/shipments/delete
RoutePurpose
plugin/healthValidate the stored plugin key and return connected store context plus a complete plan, usage, quota, renewal/trial/cancellation lifecycle, shipmentAccess, and merchant-facing access-copy snapshot.
plugin/dashboard-summaryReturn selected-range operational metrics and exact-sum status percentages, a zero-filled 12-month volume series, and all-time carrier/destination performance scoped to the bound merchant and exact WooCommerce store. analyticsScopes documents each cohort.
plugin/woocommerce/latestReturn current plugin release metadata (1.1.55).
plugin/heartbeatUpdate scheduled/admin heartbeat and environment metadata, then return the same complete plan, usage, quota, lifecycle, and access snapshot.
plugin/orders/syncIdempotently create/update a platform-neutral order, its normalized shippingAddress destination country, and its tracking numbers. Each tracking item may include an HTTP(S) trackingLink for a custom provider. Bulk sync traffic is isolated by the authenticated store; each shipment result reports trackingState and nullable trackingHoldReason.
plugin/shipments/repollRequest an immediate carrier check, or return 402 SHIPMENT_ACCESS_BLOCKED with access details when held.
plugin/shipments/statusesRead carrier status plus operational tracking state/hold reason without polling the carrier.
plugin/shipments/deleteDelete a shipment for the authenticated store/order.
Connection contract: A plugin client must not treat an identity-only or otherwise incomplete 2xx health/heartbeat response as verified. During a rolling deployment it should retry and keep the store in verification until the complete entitlement snapshot arrives.

trackingState: held and its hold reason are merchant-only processing metadata. They must not replace the shipment's carrier status or be written into a customer event timeline.

Do not expose plugin credentials in browser code. These endpoints are intended for the installed WooCommerce plugin and all lookups remain tied to the resolved merchant and store.