[object Object]

← back to Dwha Harlequin Onboard

Fix Shopify variant payload and stop failed batches

c5a5e29d86ebedb561c29a6a817e24a9dac95651 · 2026-08-31 11:27:36 -0700 · Steve

Files touched

Diff

commit c5a5e29d86ebedb561c29a6a817e24a9dac95651
Author: Steve <steve@designerwallcoverings.com>
Date:   Mon Aug 31 11:27:36 2026 -0700

    Fix Shopify variant payload and stop failed batches
---
 scripts/onboard-batch.mjs | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/scripts/onboard-batch.mjs b/scripts/onboard-batch.mjs
index 835863c..c4ed584 100644
--- a/scripts/onboard-batch.mjs
+++ b/scripts/onboard-batch.mjs
@@ -197,16 +197,22 @@ function buildProductPayload(row) {
       status: 'draft',           // HARD RAIL — never 'active' here
       tags,
       body_html,
+      options: [
+        {
+          name: 'Format',
+          values: ['Single Roll', 'Sample'],
+        },
+      ],
       variants: [
         {
-          title: 'Single Roll',
+          option1: 'Single Roll',
           sku:   dw_sku,
           price: String(retailPrice),
           inventory_management: null,  // no tracking
           fulfillment_service: 'manual',
         },
         {
-          title: 'Sample',
+          option1: 'Sample',
           sku:   `${dw_sku}-Sample`,
           price: '4.25',
           inventory_management: null,
@@ -454,10 +460,10 @@ async function main() {
       const mapPath = saveRestoreMap(dw_sku, String(productId), row);
       console.log(`  restore-map: ${path.basename(mapPath)}`);
     } catch (shopErr) {
-      console.warn(`  SKIP — Shopify create failed: ${shopErr.message}`);
+      console.error(`  STOP — Shopify create failed: ${shopErr.message}`);
       errors.push({ dw_sku, stage: 'shopify-create', error: shopErr.message });
       skipped++;
-      continue;
+      break; // fail closed: a payload/API failure may affect every candidate
     }
 
     // 3. Attach image

← 25a836f Record DWHA verification commit identities  ·  back to Dwha Harlequin Onboard  ·  Record successful DWHA canary proof b2a829f →