DocsStorefront integrationGiveaway data reference

Coming soon Kwik's public API and MCP server are coming soon. These docs are an early preview, in the beginning stages: endpoints, fields and examples are samples and will change before launch. Brands on Kwik today can ask their account manager about integrations.

Read every docs page as one Markdown file, ready to paste into ChatGPT, Claude or any AI assistant.

Storefront integration · Reference

Giveaway Data In Shopify.

The Kwik 2.0 Shopify app keeps the giveaway schedule, rates, multipliers and banners in shop metafields. Read them to build timers, badges, banners and trackers.

Before you start

  • The Kwik 2.0 Shopify app installed (Kwik 1 stores don't have this data).
  • A giveaway set up in Kwik with weeks, timer text and, optionally, banner images.

How the data gets to the store

  1. The brand sets up the giveaway in Kwik: weeks, rates, multipliers, timer text and banners.
  2. When those settings are saved, the Kwik 2.0 app syncs them to shop metafields, usually within a minute.
  3. Your theme reads them in Liquid, or your Hydrogen app reads them through the Storefront API.

The storefront never calls Kwik directly. Everything it needs is already in the store.

The namespace

Every key lives in the Kwik 2.0 app's namespace, app--330349150209. It is the same on every store. Kwik's own app blocks can use the $app shortcut, but your custom sections, snippets and Custom Liquid blocks must use the full name:

Liquid
{{ shop.metafields['app--330349150209'].giveaway_entries.value | json }}

The keys

KeyTypeWhat it holds
giveaway_weeksJSON object{version, weeks: [...]}: the running and upcoming weeks of every giveaway, with dates, timer text and banner images.
giveaway_entriesJSON arrayOne object per running giveaway: this week's base rate and its multipliers.
cashback_configJSON objectThe cashback rate and rules.
loyalty_pointsJSON arrayThe loyalty point earning rules.
wavelink_requiredBooleantrue when rewards should only show to shoppers who came in on a share link.

giveaway_weeks

FieldWhat it is
geId, geNameThe giveaway's id and name. Several giveaways can run at once.
weekIdThe week (earning period) id.
startTs, endTsStart and end in Unix seconds. A week is running when startTs <= now < endTs.
startsAt, endsAtThe same moments as ISO dates in UTC.
timeZoneThe giveaway's time zone, for showing dates, like America/Denver.
timerTextShort text for the timer or bar, like "50X Ends Tonight".
desktopImage, mobileImage{url, width, height}, or null. Always check before using.
JSON · example
{
  "version": 1,
  "weeks": [
    {
      "geId": 11,
      "geName": "Truck Giveaway",
      "weekId": 204,
      "startsAt": "2026-11-30T07:00:00Z",
      "endsAt": "2026-12-04T07:00:00Z",
      "startTs": 1796022000,
      "endTs": 1796367600,
      "timeZone": "America/Denver",
      "timerText": "50X Ends Tonight",
      "desktopImage": { "url": "https://cdn.example.com/50x-desktop.jpg", "width": 2400, "height": 800 },
      "mobileImage": { "url": "https://cdn.example.com/50x-mobile.jpg", "width": 1080, "height": 1350 }
    },
    {
      "geId": 11,
      "geName": "Truck Giveaway",
      "weekId": 205,
      "startsAt": "2026-12-04T07:00:00Z",
      "endsAt": "2026-12-07T07:00:00Z",
      "startTs": 1796367600,
      "endTs": 1796626800,
      "timeZone": "America/Denver",
      "timerText": "25X Through Sunday",
      "desktopImage": null,
      "mobileImage": null
    }
  ]
}
Liquid · the running week
{%- assign weeks = shop.metafields['app--330349150209'].giveaway_weeks.value.weeks -%}
{%- assign now_ts = 'now' | date: '%s' | plus: 0 -%}
{%- for week in weeks -%}
  {%- if week.startTs <= now_ts and week.endTs > now_ts -%}
    {{ week.timerText }}: through {{ week.endTs | minus: 1 | date: '%A, %b %-d' }}
  {%- endif -%}
{%- endfor -%}

Pages can be cached, so a running week picked in Liquid can be out of date. Pick it again in JavaScript on load.

giveaway_entries

One object per running giveaway, for the week running now. Between weeks there is no rate, and Kwik awards no entries. Hide entry displays then.

JSON · example
[
  {
    "geId": 11,
    "geName": "Truck Giveaway",
    "forEachAmt": null,
    "forEachPct": 100,
    "pointValue": 1,
    "multipliers": [
      { "multiplierType": "purchase_multiplier", "forEachAmt": 5, "shopifyProductIds": [8100000000001],
        "stkAny": false, "stkRefMulti": false, "stkMulRef": false },
      { "multiplierType": "site_wide_multiplier", "forEachAmt": 2 },
      { "multiplierType": "order_multiplier", "forEachAmt": 2, "shopifyProductIds": [8100000000001, 8100000000002],
        "stkAny": false, "stkRefMulti": false, "stkMulRef": false },
      { "multiplierType": "referral_multiplier", "forEachAmt": 3 }
    ]
  }
]

Per product, Kwik counts: entries = round(base × referral × (product or sitewide) × order). Base is the flat forEachAmt, or price × forEachPct / 100 × pointValue. Different types multiply. The same type: the highest wins. Sitewide only counts when no product multiplier matches. See the entries guide for the full walk-through.

Multiplier flagsWho gets it
none setThe buyer
stkRefMultiThe buyer, on a referred order only
stkMulRefThe referrer only. Never show it to the buyer.
stkAnyBoth

Sitewide and referral multipliers ignore the flags. A referral multiplier needs a share link. Promo-code multipliers (multiOn 5) can't be shown on the storefront.

cashback_config and loyalty_points

JSON · cashback_config
{ "amount": 5, "calculationMethod": "variable", "firstOrderOnly": false, "referralMultiplier": 1, "referralFirstOrderOnly": false }
  • amount is a percentage when calculationMethod is variable ("5% back"), and a fixed amount when it is fixed. Check before you print a % sign.
  • loyalty_points rows use lpName, forEachAmt, forEachPct, pointValue, multp and currencyCode. Print the raw JSON on a test page to see a store's real rules before building on them.

When true, show rewards only to shoppers who came in on a share link. Check the URL first (waveLink, wavelink or kwiklink), then the _kwik_waveLink cookie. Only codes of 1 to 64 letters and digits count. Liquid can't see the cookie on first paint, so render reward displays hidden and let JavaScript decide.

Native app blocks

For Liquid themes, check these before building anything. Add them from the App blocks page in the Kwik 2.0 app. They don't run on Hydrogen.

NeedBlockKey setting
Weekly hero bannerGiveaway BannerOptional link, alt text, fallback image for days between weeks
Countdown and timer textGiveaway CountdownDays, hours, minutes, seconds, optional progress bar
Entries on the product page and thank-you pageGiveaway entries blockUses the running week's rate. Shows nothing between weeks.
A customer's own entries and historyPoint Tracker, Points Overview, Loyalty popupShow: loyalty points, giveaway entries, or both
Referral link and codeShareLink"Require promo code" is optional. Untick it on older installs.
Share-link trackingReferral Attribution (app embed)Turn it on under App embeds

NoteA shared entries calculation that themes can call anywhere (product cards, featured products, mini cart and product pages) is in development. When it ships, prefer it to custom entry math.

Banner images

  • Desktop about 2400px wide, mobile about 1080px wide, JPG or WebP at full quality.
  • Public HTTPS links with no login or expiry. Upload a new file each time an image changes. Replacing a file at the same address can keep showing the old one.
  • The images are outside links, not Shopify files, so use <picture> with the width and height from the metafield, with the mobile source at max-width: 749px.
  • Keep timerText short. It shows in large letters.

When the data is empty

  1. Check that today is inside a week. Between weeks, no rate is correct.
  2. Print the raw metafields on a test page to rule out a bug in your code.
  3. In the Kwik 2.0 app, open the Sync page and click Resync now, then check again.
  4. Still empty while the giveaway is clearly live? Contact Kwik with the giveaway name and dates.
  5. Meanwhile, show your manual fallback (a fixed title, end date and image) so the page is never blank.

Every custom display should have a manual fallback and a debug switch that prints the raw data. Turn the debug switch off before publishing.