merchant integration.md

Merchant Integration Guide

This page describes the production shape of a Hexagon merchant rollout. It is intentionally implementation-oriented for coding agents.

Integration Goal

The integration should make the merchant's product catalog AI-readable, AI-channel-ready, measurable, and connected to purchase paths. Treat it as commerce infrastructure, not a one-time content export.

Required Inputs

A production integration usually needs access to:

The exact source depends on the merchant platform. Shopify may have a native path; custom platforms may require feed or API work; enterprise merchants may need scoped custom integration.

Data Freshness

Product recommendations are only useful if the underlying data is current. For each data type, define the update strategy:

Data Freshness Concern Implementation Note
Product title and description Moderate Update on product edits or daily sync.
Price High Sync whenever prices change.
Inventory High Sync frequently or use live checks for low-stock products.
Variant availability High Keep variant state aligned with checkout.
Images Moderate Sync on product media changes.
Shipping constraints High Avoid recommending products the shopper cannot receive.

Server-Side Boundary

All Hexagon credentials and commerce platform credentials must stay server-side. For browser or mobile surfaces, expose only application-owned endpoints that proxy safe operations.

Do not put these in client code:

SDK-Based Path

When the official SDK supports the merchant's framework, prefer it. Current Markdown SDK examples are published at https://joinhexagon.com/docs/sdk.md.

For Node.js and Next.js, the expected pattern is:

  1. Install the official package shown in the current docs.
  2. Configure merchant ID and API key from environment variables.
  3. Mount middleware or routes server-side.
  4. Verify public AI content routes and sitemap routes.
  5. Confirm catalog and attribution behavior in the Hexagon dashboard or rollout workflow.

Custom Backend Path

If the merchant framework is not covered by current SDK docs, do not invent package names or endpoint paths. Treat the rollout as custom:

Attribution Events

Attribution can include referrals, citations, product clicks, purchase events, and revenue. Implement attribution with approved SDK or server-side event flows. The merchant should be able to answer:

Launch Verification

Before declaring a rollout complete: