API referenceInsights

Insights

2 operations. Every schema and example on this page is generated from the platform contract.

Get a store's Home-screen insight cards.

Auto-generated merchant insight cards for the Business-app Home screen, derived from recent loyalty activity: the busiest day of the week, week-over-week activity trend, customers within two stamps of their reward, and pending stamp approvals, with a friendly welcome fallback when there is nothing to show.

Parameters

store_idstring · uuidqueryrequired

Store whose insight cards to generate (also authorises the merchant).

Response, 200

insightsarray of objectrequired
8 child fields
idstringrequired

Stable insight identifier (e.g. busiest_day, pending_approvals).

titlestringrequired

Short card headline.

bodystringrequired

One-line insight body copy.

impact_levelenumrequired

Relative importance for ordering / styling.

lowmediumhigh
action_labelstringoptional

CTA button label when the card is actionable.

action_deeplinkstringoptional

App deeplink the CTA opens when actionable.

dismissiblebooleanrequired

Whether the merchant can dismiss the card.

expires_atstringoptional

ISO timestamp after which the card should hide, when time-bound.

curl -G "https://www.membber.com/api/v1/insights" \
  -H "Authorization: Bearer $MEMBBER_TOKEN" \
  --data-urlencode "store_id=6659c139-0000-4000-8000-d0c500000066"
Response, 200
{
  "insights": [
    {
      "id": "00000d1b-0000-4000-8000-d0c500000000",
      "title": "Morning class",
      "body": "<body>",
      "impact_level": "low",
      "action_label": "<action_label>",
      "action_deeplink": "<action_deeplink>",
      "dismissible": true,
      "expires_at": "<expires_at>"
    }
  ]
}

Get a store's at-risk member count.

The Home-screen 'Bring them back' Pulse headline: the count of a store's members whose pre-computed churn risk is medium or high (the retention audience), split into medium and high bands. Store-scoped and business-authed; every value is real store data and anonymized or archived customers are excluded via the reportable-customers guard.

Parameters

store_idstring · uuidqueryrequired

Store whose at-risk member count to read (also authorises the merchant).

Response, 200

at_risk_countnumberrequired

Members with churn_risk medium OR high, the retention audience (medium + high).

mediumnumberrequired

Members with churn_risk = medium.

highnumberrequired

Members with churn_risk = high.

as_ofstringrequired

ISO 8601 timestamp when this count was read (churn_risk is refreshed hourly).

curl -G "https://www.membber.com/api/v1/insights/at-risk" \
  -H "Authorization: Bearer $MEMBBER_TOKEN" \
  --data-urlencode "store_id=6659c139-0000-4000-8000-d0c500000066"
Response, 200
{
  "at_risk_count": 1,
  "medium": 1,
  "high": 1,
  "as_of": "<as_of>"
}
WhatsApp
Book a Call
Start Free