[object Object]

← back to Designerwallcoverings

sanderson-onboard: golive uses SHOPIFY_FULL_ACCESS_TOKEN for write_inventory (TK-11046)

9cbce4532fbc0fe376247280e36a58bbaebfb981 · 2026-08-31 12:39:11 -0700 · Steve Abrams

The narrow custom-app ADMIN token (…7d19) has only read/write_products + read/write_publications
and lacks write_inventory, so golive's inventory mutations (inventoryItemUpdate/inventoryActivate/
inventorySetQuantities) died. Repoint ONLY the golive branch of run.sh to SHOPIFY_FULL_ACCESS_TOKEN
(…2ea5, carries write_inventory); create stays on the least-privilege ADMIN token. Falls back to
ADMIN if FULL is unset.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit 9cbce4532fbc0fe376247280e36a58bbaebfb981
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Mon Aug 31 12:39:11 2026 -0700

    sanderson-onboard: golive uses SHOPIFY_FULL_ACCESS_TOKEN for write_inventory (TK-11046)
    
    The narrow custom-app ADMIN token (…7d19) has only read/write_products + read/write_publications
    and lacks write_inventory, so golive's inventory mutations (inventoryItemUpdate/inventoryActivate/
    inventorySetQuantities) died. Repoint ONLY the golive branch of run.sh to SHOPIFY_FULL_ACCESS_TOKEN
    (…2ea5, carries write_inventory); create stays on the least-privilege ADMIN token. Falls back to
    ADMIN if FULL is unset.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 scripts/sanderson-onboard/run.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/scripts/sanderson-onboard/run.sh b/scripts/sanderson-onboard/run.sh
index 80b8dfb..8abe35a 100755
--- a/scripts/sanderson-onboard/run.sh
+++ b/scripts/sanderson-onboard/run.sh
@@ -11,10 +11,16 @@ NODE="$(command -v node || true)"
 SEC="$HOME/Projects/secrets-manager/.env"
 export SHOPIFY_STORE="designer-laboratory-sandbox.myshopify.com"
 export SHOPIFY_ADMIN_TOKEN="$(grep -hiE '^SHOPIFY_ADMIN_TOKEN=' "$SEC" | head -1 | cut -d= -f2- | tr -d '"'"'"' ')"
+# golive does inventory mutations (inventoryItemUpdate/inventoryActivate/inventorySetQuantities)
+# which require write_inventory — a scope the narrow custom-app ADMIN token (…7d19) lacks. So ONLY
+# the golive branch uses SHOPIFY_FULL_ACCESS_TOKEN (…2ea5, which carries write_inventory); create
+# stays on the least-privilege ADMIN token. Falls back to ADMIN if FULL is unset. (TK-11046)
+export SHOPIFY_FULL_ACCESS_TOKEN="$(grep -hiE '^SHOPIFY_FULL_ACCESS_TOKEN=' "$SEC" | head -1 | cut -d= -f2- | tr -d '"'"'"' ')"
 step="${1:-}"; shift || true
 case "$step" in
   payloads) exec "$NODE" build-payloads.mjs "$@";;
   create)   [ -z "${SHOPIFY_ADMIN_TOKEN:-}" ] && { echo "no shopify token"; exit 1; }; exec "$NODE" create-drafts.mjs "$@";;
-  golive)   [ -z "${SHOPIFY_ADMIN_TOKEN:-}" ] && { echo "no shopify token"; exit 1; }; exec "$NODE" go-live.mjs "$@";;
+  golive)   SHOPIFY_ADMIN_TOKEN="${SHOPIFY_FULL_ACCESS_TOKEN:-$SHOPIFY_ADMIN_TOKEN}"; export SHOPIFY_ADMIN_TOKEN
+            [ -z "${SHOPIFY_ADMIN_TOKEN:-}" ] && { echo "no shopify token"; exit 1; }; exec "$NODE" go-live.mjs "$@";;
   *) echo "usage: bash run.sh {payloads|create|golive} [args]"; exit 1;;
 esac

← 7afe903 auto-data-snapshot: 2026-08-31T12:34:16 (1 data files) — boa  ·  back to Designerwallcoverings  ·  sanderson onboard batch#1: 56 products created+activated liv dbfa0d1 →