All recipes
πŸ”„

Menu & inventory sync

Mirror a merchant's live catalogue and stock into any third-party channel.

No orders β€” just a rock-solid one-way mirror of the catalogue and per-location stock, kept fresh by webhooks. The pattern every aggregator needs before they can list a merchant.

Hand it to an agent

This prompt briefs an AI coding agent to implement the entire recipe against the live docs β€” authentication, every endpoint, and webhooks.

Build it with AI

Copy this prompt into your coding agent.

Build a one-way catalogue + inventory mirror from Ewity into <target system>. Base URL https://api.ewitypos.com/platform-v1, header Authorization: Bearer <EWITY_PLATFORM_TOKEN>.

IMPORTANT β€” the docs are authoritative. Read https://ewity-api.readme.io/docs/getting-started and confirm every field name / payload shape against the exact reference page linked below before you rely on it. Don't guess β€” refer to the docs.

1) Full sync: GET /stores (ref: https://ewity-api.readme.io/reference/liststores) -> for each online_locations[].id, GET /locations/{id}/catalogue (ref: https://ewity-api.readme.io/reference/getfullcatalogue). Upsert categories/products/variants. Record availability = available && !out_of_stock PER LOCATION. Prices tax-inclusive; keep taxes[] for breakdown.
2) Incremental: in the developer portal, on your app's Webhooks tab, add a webhook endpoint subscribed to the catalogue.updated event (keep the default "Signing secret" verification; copy the whsec_… signing secret from the same tab β€” docs: https://ewity-api.readme.io/docs/webhooks). Each delivery wraps the payload in the signed envelope { id, event, created_at, company, install, data } with data = { items:[{online_location_id,product_id,variant_id}], occurred_at }. Group data.items variant_ids by online_location_id and POST /locations/{id}/catalogue/lookup (ref: https://ewity-api.readme.io/reference/lookupcatalogue) { variant_ids } (max 500 ids). Upsert what returns; any requested id NOT returned = deleted -> remove it.
3) Robustness: verify X-Ewity-Signature on every delivery β€” t=<unix ts>,v1=<hex hmac_sha256(secret, "{t}.{raw_body}")>; recompute over the exact raw request bytes, compare in constant time, reject |now - t| > 300s. Dedupe on the envelope id (at-least-once delivery), 2xx fast, reconcile with a full re-sync every ~15 min as a safety net. Consult https://ewity-api.readme.io/docs/webhooks for the exact event payloads.

…or follow the build, step by step

  1. 1

    Initial full sync

    Snapshot every location's catalogue.

    • GET/stores
    • GET/locations/{locationId}/catalogue
    Read the docs for this step
  2. 2

    Subscribe to changes

    Create a webhook subscribed to catalogue.updated and re-fetch only what changed.

    • POST{your_webhook_url}
    • POST/locations/{locationId}/catalogue/lookup
    • On your app's Webhooks tab, add a webhook endpoint subscribed to `catalogue.updated` (keep the default signing-secret verification; the `whsec_…` secret lives on the same tab).
    • Deliveries arrive wrapped in the signed envelope `{ id, event, created_at, company, install, data }` where `data` is `{ items: [{ online_location_id, product_id, variant_id }], occurred_at }` β€” verify `X-Ewity-Signature`, group the changed `variant_id`s by location, and re-fetch them via `catalogue/lookup`.
    Read the docs for this step

Ready to build menu & inventory sync?

Create an app to get your API key, then follow the steps above.