Testing

Validate the integration before going live.

Test keys begin with sw_test_. They return deterministic demo recommendations, making QA reliable across environments.

Verify an API key

The verify endpoint confirms the key, merchant name, environment, catalog readiness, and allowed origins. Run it before sending a storefront to production.

Request

bash

curl https://mysillage.co/api/widget/verify \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{ "api_key": "sw_test_your_key" }'

Response

json

{
  "valid": true,
  "merchant_name": "Maison Parfum",
  "environment": "test",
  "catalog_count": 120,
  "matched_count": 95,
  "in_stock_count": 118,
  "unmatched_count": 25,
  "enrichment_pending": 23,
  "match_rate": 0.79,
  "average_match_confidence": 0.91,
  "allowed_origins": ["https://store.example.com"],
  "widget_url": "https://mysillage.co/widget/v1/sillage-widget.js"
}

Troubleshooting checklist

Widget does not render

Confirm the containerId exists before init runs and the loader script is not blocked by CSP.

401 invalid key

Use the full key value and confirm it has not been revoked.

403 origin not allowed

Add the storefront origin, including protocol, to the key allowlist.

No products returned

Check that the connected catalog has products, or pass page products for this demo/page.

Styling looks off

Check contrast on primaryColor and ensure borderRadius includes units such as px.

Purchase not attributed

Call trackPurchase on the confirmation page with the same API key or explicit sessionId.