UX/UI & Dev

Zakeke → Shopify: Order Data Pipeline

A production webhook system that turns customized wristband orders into structured data for production, printing, and the ERP across six Shopify storefronts.

Role
Design and Development
Company
Artemax, Inc.
Stack
Next.js on Vercel
Scope
6 storefronts, 5 endpoints
Year
2026
  • Design and Development
  • Artemax, Inc.
  • Next.js on Vercel
  • 6 storefronts, 5 endpoints
  • 2026

01 / Summary

The Problem

Zakeke attaches each customer’s design to the Shopify order as loose line item properties. Production had no machine-readable specs, so someone opened every proof and retyped the details. The art links expired after 90 days.

The Solution

A set of webhook endpoints on Vercel that read each design, structure it, and write it to the order as Shopify metafields the ERP and print routing can use. One codebase serves all six storefronts.

The Outcome

Design specs reach production without retyping, art files no longer expire, silicone orders route to the print partner automatically, and each order shows its own status.

02 / Role

Design & Dev

I designed the data structure, built every endpoint, and I’m the only developer on the system. I maintain it as new products and order types come through.


  • Next.js
  • TypeScript
  • Vercel
  • Vercel Blob
  • Shopify Admin GraphQL
  • Webhooks

03 / The Problem

Design data with nowhere to go


  • Production retyped every design

    Nothing told the ERP or the printer routing the band type, front, back, and inside text, fonts, imprint color, or size. Someone opened the proof or the ZIP, read the design, and keyed it in by hand.


  • Silicone orders couldn’t route on their own

    Orders bound for the overseas print partner depend on knowing the product style. Without structured data, each one needed a person to sort it.


  • No one could see an order’s status

    Customer service had no way to tell from the order whether Zakeke’s files had arrived.


  • Old orders lost their art

    Zakeke’s file links expire after 90 days, so reorders and older orders pointed to dead files.

04 / How It Works

How the system fits together

Two webhooks start everything: Shopify’s when an order is created, and Zakeke’s when a design’s files are ready. Five endpoints on Vercel handle the rest.

SHOPIFY ZAKEKE VERCEL VERCEL BLOB ERP & PRINT orders/create raw copy 1 2 line_json Silicone orders via Shopify Flow Order placed Line item metafields Order metafields Design files ready Lookup snapshots Raw payloads ERP packets + art Business Central Print partner orders/create webhook files, colors, fonts line_json, status Zakeke webhook order id map per store unmodified copies staged files, mirrors ERP silicone orders Order intake Webhook Processor Reconciler ERP feed HMAC check, snapshot token check, replies first finds order, mirrors art structures design data read-only endpoint
  1. Shopify sends the orders/create webhook to Order intake on Vercel when an order is placed.
  2. Order intake runs an HMAC check and saves a lookup snapshot of order IDs per store to Vercel Blob.
  3. Zakeke sends its webhook to the Webhook endpoint on Vercel when a design’s files are ready.
  4. The Webhook checks its token, replies first, and saves an unmodified raw copy of the payload to Vercel Blob without waiting for it to finish.
  5. The Webhook calls the Processor first, step 1. The Processor finds the order, mirrors the art, writes line item metafields to Shopify (files, colors, fonts), and stages ERP packets and art in Vercel Blob.
  6. The ERP feed, a read-only endpoint, serves the staged ERP packets to Business Central.
  7. The Webhook then calls the Reconciler, step 2. The Reconciler structures the design data and writes line_json and status to the order metafields in Shopify.
  8. Business Central, the ERP, reads line_json from the order metafields.
  9. Silicone orders go from the order metafields to the print partner through Shopify Flow.
  1. Shopify Order placed orders/create webhook
  2. Vercel Order intake HMAC check, placeholders Saves a lookup snapshot to Vercel Blob
  3. Zakeke Design files ready Zakeke webhook
  4. Vercel Webhook token check, replies first Saves a raw copy to Vercel Blob. Then runs 1 and 2 in order.
  5. Vercel · 1 Processor finds order, mirrors art Writes line item fields to Shopify. Stages ERP packets and art in Vercel Blob.
  6. Vercel · 2 Reconciler structures design data Writes line_json, summary, and status to the order.
  7. Shopify Order metafields line_json, status
  8. ERP & print Business Central and print partner ERP flow and Shopify Flow Silicone orders route to the print partner.
  1. 01

    Order created

    The intake endpoint verifies the request, saves a lookup snapshot, and marks the order as waiting on Zakeke.

  2. 02

    Design files arrive

    The webhook checks its token, saves a raw copy, and replies right away. Then it runs the processor (1) and reconciler (2) in order.

  3. 03

    Data is structured

    The processor mirrors the art and writes line item fields. The reconciler writes line_json.

  4. 04

    Production picks it up

    The status changes to “Ready for ERP,” and automated flows send the order to Business Central and the print partner.

Order metafields

status line_json summary advanced_print_ready

Placeholders are written when the order is created. The reconciler writes the final values the ERP reads.

Line item metafields

file_zip, file_zip_blob file_preview, file_preview_blob design_doc_id imprint_color, band_type, band_color font_family, font_style, font_size, qty imprint_color, band_type band_color, font_family font_style, font_size, qty

Written by the processor for each customized line, with both Zakeke’s links and stable mirrored copies.

05 / Key Decisions

Two patterns that keep it reliable

The code excerpts below are simplified, with real identifiers and values removed.


Decision 01

Find the order fast, then fall back

Zakeke sends a bare order number, while Shopify names each order with a store prefix. When an order is created, the intake endpoint saves a store-scoped snapshot that maps one to the other. The processor checks that snapshot first and only searches Shopify, with retries, when it’s missing.

zakeke-process (simplified)
// 1. Store-scoped snapshot saved at order creation
const snap = await fetchOrderLookupSnapshot(storeKey, orderNumber);
if (snap?.gids?.length) return orderFromSnapshot(snap);

// 2. Nothing to search for: stop early
if (!orderNumber && !altName && !numericId) return null;

// 3. Live Shopify search, retried while the order indexes
for (const wait of waits) {
  const order = await searchShopify(storeKey, candidates);
  if (order) return order;
  await sleep(wait);
}

Decision 02

Fit every order into one metafield

Shopify caps a metafield value at 64KB, and large orders with many designs can exceed it. The reconciler tries the full payload first, drops the heaviest fields in stages, and flags a truncated payload so no one mistakes it for a complete one. I’ve refined it as new order sizes and product combinations came through.

zakeke-reconcile (simplified)
const LIMIT = 65000; // Shopify metafield value limit
let value = JSON.stringify(payload, null, 2);

// Stage 1a: compact, keep art and preview URLs
if (value.length > LIMIT)
  value = compact(payload, { keepArt: true });

// Stage 1b: compact, drop art and preview URLs
if (value.length > LIMIT)
  value = compact(payload, { keepArt: false });

// Stage 2: routing fields only, flagged as truncated
if (value.length > LIMIT)
  value = minimal(payload, { truncated: true });

06 / Before and After

From loose properties to structured data

Zakeke’s raw properties next to the line_json the reconciler writes. The values are made up.

Before: what Zakeke attaches

line item properties
_customization   {"designId":"d1a7…","model":"…"}
_previews        https://cdn.example.com/p/9c2e.png
_zakekeZip       https://cdn.example.com/z/41bd.zip

Unstructured and controlled by Zakeke.

After: line_json the ERP reads

order metafield: zakeke.line_json
{
  "orderName": "DEMO1042",
  "digiProof": true,
  "lines": [
    {
      "sku": "BAND-1IN-RED",
      "bandColor": "Red",
      "__type": "debossed",
      "__front_message": "SPRING FUN RUN",
      "__back_message": "EST. 2026",
      "__inside_message": "",
      "__fontFamily": "Oswald",
      "__imprintColor": "White",
      "__product_dimension": "1\" Width X 8\" Length",
      "qty": 500
    }
  ]
}

One entry per line, with every field production needs.

07 / Maintaining It

Maintaining it in production

Two recent updates, made as new products launched and edge cases came up.


  • Webhook response: about 4 minutes to 0.65 seconds

    The webhook waited for all downstream work before replying to Zakeke. When an order couldn’t be found, a retry loop held the reply for about 4 minutes. Zakeke timed out and retried, and one stuck order delayed deliveries for every store.

    I moved the work after the reply with Next.js after(), ignored requests with no order identifiers, and stopped the search early when there was nothing to look for. The output stayed byte-identical. It measured 0.99 seconds on a preview deployment and 0.65 seconds in production.

    zakeke-webhook (simplified)
    // Respond to Zakeke immediately, then do the work
    after(async () => {
      await fetch(processUrl, {
        method: "POST",
        body: JSON.stringify({ ...body, storeKey }),
      });
      await fetch(reconcileUrl, {
        method: "POST",
        body: JSON.stringify(reconcilePayload),
      });
    });
    
    return NextResponse.json({ received: true }, { status: 200 });
    Webhook response time
    • Before about 4 min
    • After 0.65 s

    Before: Zakeke support’s test request. After: production, measured after release.


  • Inside messages and cloth bands

    New products needed fields the parser didn’t know about. Silicone bands gained inside messages with their own font and color, so those values now come only from the inside text. Cloth bands place front text in a different print area, so the parser maps it to the front message.

08 / What’s Next

What’s Next

Durable queue

Zakeke’s retries are the safety net today. A durable queue would let failed work retry on its own schedule.

Digital proof field

A dedicated proof field is planned so production can see proof status without reading line_json.