DocsStorefront integrationWhat to send on every order

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

What Kwik Needs On Every Order.

Every reward and every referral credit starts from an order. This is the data Kwik reads from each one, the fields that carry attribution, and the signals to send when an order changes. It applies to any platform.

Before you start

  • Shopify stores: Kwik reads orders from Shopify for you. You only need the share code to reach the order (track share links).
  • Other platforms: a server that can send each paid order, refund and cancellation to Kwik.

The signals Kwik needs

SignalWhen to send itWhat Kwik does with it
Order paidOnce the payment goes through. Send it again if the order changes.Finds who to credit, then calculates entries, points, cashback, commissions and Waves
RefundFor each full or partial refundTakes back the rewards for what was refunded
CancellationWhen an order is cancelledTakes back everything the order earned
Share-link visit (optional)The Kwik Pixel records visits where it is installedReporting. Credit always comes from the order, not the visit.

Rewards start as pending and clear after the return window, so a refund or cancellation that arrives later still counts.

The order body

This is the full shape, using the same hoodie and cap order as the other guides. Amounts are decimals in the order's currency. Times are ISO 8601 in UTC.

JSON · order body
{
  "order_id": "1042",
  "order_number": "#1042",
  "created_at": "2026-12-03T22:14:05Z",
  "paid_at": "2026-12-03T22:14:09Z",
  "status": "paid",
  "currency": "USD",
  "customer": {
    "id": "8812",
    "email": "jane@example.com",
    "first_name": "Jane",
    "last_name": "Lee",
    "phone": "+15555550123",
    "accepts_marketing": true
  },
  "line_items": [
    {
      "line_id": "1",
      "product_id": "8100000000001",
      "variant_id": "4400000000011",
      "sku": "HOOD-BLK-M",
      "title": "Hoodie",
      "quantity": 1,
      "unit_price": 40.00,
      "amount_paid": 40.00,
      "tags": ["outerwear"],
      "collections": ["Winter"]
    },
    {
      "line_id": "2",
      "product_id": "8100000000002",
      "variant_id": "4400000000022",
      "sku": "CAP-BLK",
      "title": "Cap",
      "quantity": 1,
      "unit_price": 20.00,
      "amount_paid": 20.00,
      "tags": [],
      "collections": ["Accessories"]
    }
  ],
  "discount_codes": [{ "code": "WELCOME100", "amount": 0.00 }],
  "subtotal": 60.00,
  "discount_total": 0.00,
  "shipping_total": 5.00,
  "tax_total": 4.80,
  "total": 69.80,
  "attribution": {
    "wave_link": "ABC123",
    "landing_url": "https://yourstore.com/products/hoodie?waveLink=ABC123",
    "first_seen_at": "2026-12-01T17:02:44Z"
  }
}
FieldNeededWhat Kwik uses it for
order_idRequiredOne order, counted once. Sending the same id again updates it and never awards rewards twice.
created_at, paid_atRequiredWhich giveaway week and promotion the order falls in, and when holds start.
statusRequiredpaid, partially_refunded, refunded or cancelled. Only paid orders earn.
currencyRequiredReads every amount in the right currency.
customer.emailRequiredWho earns the rewards. It links the order to the shopper's Kwik account.
customer.id, names, phoneRecommendedMatching repeat customers and personalizing emails. accepts_marketing keeps messages within consent.
line_items[].product_idRequiredProduct multipliers, product bonuses and excluded products. Use the same product ids Kwik has for the store (Shopify product ids on Shopify).
line_items[].amount_paidRequiredWhat each line earns on: after discounts, before tax and shipping.
line_items[].quantity, unit_priceRequiredFlat per-item rewards and partial refunds.
line_items[].tags, collectionsRecommendedTag and collection multipliers on large catalogs.
line_items[].line_id, variant_id, skuRecommendedMatching refunds to lines, and variant-level rules.
discount_codesRequired if usedPromo-code bonuses, and credit for an ambassador's personal code, even without a share link.
subtotal, discount_total, shipping_total, tax_total, totalRecommendedReporting and checks.
attribution.wave_linkRequired if presentWho referred the order, the people before them (Waves), and the referral multiplier.
attribution.landing_url, first_seen_atOptionalReporting on which links and pages bring orders.

Never send card numbers or other payment details. Kwik doesn't need them.

Needs confirmationWhich order time places an order in a giveaway week (created or paid) and the exact field names for non-Shopify orders. Confirm both with your Kwik contact before you build. On Shopify, Kwik reads these from the Shopify order itself.

Where the share code goes

PlatformPut the code hereExample
Any platform, order bodyattribution.wave_link"wave_link": "ABC123"
Shopify, cart attributeCart attribute waveLink (shows on the order as an attribute)waveLink = ABC123
Shopify, line attributeHidden line attribute _kwik_waveLink on each line (Kwik 2.0 app stores)_kwik_waveLink = ABC123
Shopify, order tagOrder tag, when the store's setup reads tagswaveLink=ABC123
  • Send the code exactly as it arrived. It is case-sensitive, and only 1 to 64 letters and digits.
  • The last link wins. If a shopper followed two reps' links, send the newer code.
  • No code? Send nothing. Leave attribution out or set it to null. Never guess or fill in a default rep.
  • Discount codes count too. An order that used an ambassador's personal code is credited to them even without a share link, so always send discount_codes.

Shopify: where each field comes from

On Shopify stores you send nothing. Kwik reads the Shopify order as it is paid, with a regular full sync as a backup. This is how the fields line up, for checking an order by hand:

Kwik fieldShopify order
order_id, order_numberid, name
created_at, paid_at, statuscreated_at, processed_at, financial_status and cancelled_at
customercustomer and email
line_items[].amount_paidLine price × quantity, minus its discount_allocations
discount_codesdiscount_codes
attribution.wave_linkThe waveLink attribute (note_attributes), the _kwik_waveLink line property, or a waveLink= tag
Refundsrefunds

Refunds and cancellations

Send one refund for each refund in your system, with the lines and amounts refunded. Kwik takes back the rewards for those lines only. For a cancellation, send the order again with status set to cancelled.

JSON · refund
{
  "order_id": "1042",
  "refund_id": "r-7781",
  "refunded_at": "2026-12-09T15:30:00Z",
  "line_items": [
    { "line_id": "2", "quantity": 1, "amount": 20.00 }
  ],
  "shipping_refunded": 0.00
}

Sending orders from another platform

Send orders from your server, never from the browser, because the request carries your secret key. Retry on errors: the same order_id is never counted twice.

TypeScript · server
// Server only. Run when an order is paid, and again for each refund or cancellation.
// Preview: the path and auth below are a sample. Get the current way to send orders from Kwik.
export async function sendOrderToKwik(order: KwikOrder) {
  const res = await fetch('https://api.kwik.com/v1/orders', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.KWIK_API_KEY}`,   // never in the browser
      'Content-Type': 'application/json',
    },
    body: JSON.stringify(order),                               // the order body on this page
  });
  if (res.status === 429 || res.status >= 500) throw new Error('retry later');  // safe to retry: same order_id never counts twice
  return res.json();
}

Needs confirmationThe self-serve orders endpoint is part of the API preview and not live yet. Today, non-Shopify order connections are set up with your Kwik contact. Build your order data in the shape on this page, and they will tell you where to send it.

End-to-end test

  1. Follow a share link (?waveLink=ABC123) and place a test order with two products and a promo code.
  2. Check your order record: the code is saved exactly as ABC123, and the lines show amounts after discounts.
  3. Send the order (or let Shopify sync it). In Kwik, the order shows the right customer, the rep behind ABC123, and rewards matching your estimate.
  4. Send the same order again. Nothing is awarded twice.
  5. Refund one line. Only that line's rewards are taken back.
  6. Place an order with no share link. It has no referrer, and the buyer still earns their own rewards.