Catalog sync (Shopify)
Connect a Shopify store to Kelp - saving credentials, webhook registration, and order sync for product popularity. Catalog ingest, not storefront UI.
This guide covers the backend integration between your Shopify store and Kelp: connecting credentials, automatic webhook registration, and the order sync that populates product popularity fields (bestSeller, trending).
This page is catalog sync (credentials, webhooks, order popularity). Storefront search UI is separate: Shopify Liquid for Online Store themes, or Shopify Hydrogen / React storefronts for a React / Oxygen app.
Save Shopify credentials
Send a PUT /api/v1/tenants/{slug}/integration request with your Shopify store URL and API credentials. This is a tenant-admin operation.
PUT /api/v1/tenants/{slug}/integration
{
"shopifyStoreUrl": "https://your-store.myshopify.com",
"shopifyApiKey": "<custom-app-api-key>",
"shopifyApiSecret": "<custom-app-api-secret-key>"
}On success Kelp stores the credentials and immediately attempts to register product webhooks on the store (see the next step).
WebhookSecret - the critical detail
Kelp verifies every inbound webhook payload using an HMAC-SHA256 signature that Shopify attaches. Shopify signs API-created webhooks using the API secret key (client secret) of the custom app - not the Admin API access token.
The shopifyApiSecret you supply in the PUT /integration body is the value Kelp stores as the WebhookSecret and uses to verify every X-Shopify-Hmac-Sha256 header on inbound deliveries.
WebhookSecret must be the custom Shopify app's API secret key (client secret). Using the wrong value causes all inbound webhook deliveries to fail HMAC verification and be rejected with 401.
Where to find it:
- Shopify admin -> Apps -> Develop apps -> select your custom app.
- API credentials tab -> API secret key (the long alphanumeric string beginning with
shpss_...or similar). - That value is the
shopifyApiSecretin yourPUT /integrationpayload.
Automatic webhook registration
When credentials are saved, Kelp automatically registers three product webhooks on your Shopify store:
| Topic | Purpose |
|---|---|
PRODUCTS_CREATE | Index new products when they are created in Shopify |
PRODUCTS_UPDATE | Re-index products when any field changes |
PRODUCTS_DELETE | Remove products from the index when deleted |
All three deliver to:
https://events.{apex}/webhooks/shopifywhere {apex} is your Kelp tenant's apex domain (e.g. events.kelp.click for the managed service).
Registration is idempotent: Kelp never deletes or duplicates webhooks. If a webhook for a topic already exists and points to the correct URL, it is left unchanged.
Re-check and repair webhooks
If you suspect a webhook is missing or pointing to the wrong URL, trigger a re-check:
POST /api/v1/tenants/{slug}/integration/webhooksThe response reports the outcome for each topic:
{
"webhooks": [
{ "topic": "PRODUCTS_CREATE", "status": "Ok", "message": null },
{ "topic": "PRODUCTS_UPDATE", "status": "Updated", "message": "URL corrected" },
{ "topic": "PRODUCTS_DELETE", "status": "Created", "message": "Registered" }
]
}Possible status values:
| Status | Meaning |
|---|---|
Ok | Webhook exists and is correctly configured |
Created | Webhook was missing and has been registered |
Updated | Webhook existed but had a stale URL or config - corrected |
Failed | Kelp could not register or update the webhook; see message for the Shopify error |
This endpoint is safe to call repeatedly. It never removes existing webhooks.
Remove legacy admin-UI webhooks
Webhooks created manually through the Shopify admin UI (not via the API) are invisible to the Kelp API and cannot be managed by the re-check endpoint. If your store has any hand-created product webhooks from a previous setup, they will deliver duplicate events.
Delete them manually:
- Shopify admin -> Settings -> Notifications -> Webhooks.
- Remove any
PRODUCTS_CREATE,PRODUCTS_UPDATE, orPRODUCTS_DELETEwebhooks that point to a Kelp callback URL.
After removing, run POST /integration/webhooks to confirm the API-managed webhooks are in place.
Duplicate webhook deliveries cause products to be re-indexed twice per event. This is harmless for correctness but doubles Kelp's inbound event volume and may affect rate limits during high-activity periods.
Order sync and product popularity
Kelp tracks two popularity fields on every product in the index:
| Field | Covers |
|---|---|
bestSeller | All-time units sold, since tracking began |
trending | Units sold in the trailing 60 days |
These fields are populated (and kept up to date) by syncing your Shopify order history into Kelp.
Running an order sync
POST /api/v1/tenants/{slug}/sync/ordersThis is a tenant-admin operation. The sync reads your full Shopify order history, computes per-product unit totals, and writes bestSeller and trending scores to every document in the catalog.
On completion it automatically chains a catalog sync so updated scores are propagated to the search index without a separate step.
The response reports what happened:
{
"kind": "OrderSync",
"ordersProcessed": 14823,
"unitsRecorded": 38401,
"syncedFrom": "2024-01-01T00:00:00.000Z",
"chainedSyncRunId": "sync_01j..."
}| Field | Meaning |
|---|---|
ordersProcessed | Number of Shopify orders read |
unitsRecorded | Total line-item units counted across all orders |
syncedFrom | Earliest order date included in the sync |
chainedSyncRunId | ID of the catalog sync that was automatically triggered |
Automatic daily sync
Order sync also runs automatically once per day. You do not need to schedule it yourself. Manual triggers are useful after:
- An initial integration setup (to backfill history immediately)
- A data correction (e.g. after bulk order cancellations or refunds)
Products with no order data
Products that appear in no synced orders receive bestSeller: 0 and trending: 0. They still appear in results and can be sorted - they sort below products with real scores when you sort descending on either field.
Next steps
- Catalog fields reference - full list of Shopify product fields including
bestSeller,trending, andoptions - Ranking - how popularity fields feed into browse ranking and sort
- Shopify Liquid - Online Store theme search UI
- Shopify Hydrogen / React storefronts - Hydrogen storefront search UI
Shopify Hydrogen / React storefronts
Server-side search in route loaders behind a capability seam, same-origin analytics proxy, full client funnel wiring, and conversion tracking via a Shopify custom pixel - for Hydrogen on Oxygen.
SSR and custom fetch
Run the Kelp SDK in Node, Cloudflare Workers, or any SSR environment - inject a fetch implementation, pass request signals, and proxy same-origin.