← back to Shopify Sample Shipping
TK-11333: remove redundant Priority Sample Only $24.95 rate (Steve-approved)
6dc2c3286f1eda3428e2adac73df855559db695a · 2026-09-09 14:36:44 -0700 · Steve Abrams
Finalizes the sample free-shipping fix on the price band. Removed the $24.95
'Priority Sample Only' ($0-20) rate that stacked with the free $0-30 band on
small carts. Snapshot-first (verification/priority-sample-snapshot.json);
one-command undo = restore-priority-sample.mjs; verified live ($17 cart shows
Free $0 + carriers, no $24.95). GAP2 knowingly accepted per Steve.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QiMydL4hVbmto91Ty7tRss
Files touched
A remove-priority-sample.mjsA restore-priority-sample.mjsA verification/priority-sample-delete-result.jsonA verification/priority-sample-snapshot.json
Diff
commit 6dc2c3286f1eda3428e2adac73df855559db695a
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Wed Sep 9 14:36:44 2026 -0700
TK-11333: remove redundant Priority Sample Only $24.95 rate (Steve-approved)
Finalizes the sample free-shipping fix on the price band. Removed the $24.95
'Priority Sample Only' ($0-20) rate that stacked with the free $0-30 band on
small carts. Snapshot-first (verification/priority-sample-snapshot.json);
one-command undo = restore-priority-sample.mjs; verified live ($17 cart shows
Free $0 + carriers, no $24.95). GAP2 knowingly accepted per Steve.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QiMydL4hVbmto91Ty7tRss
---
remove-priority-sample.mjs | 31 ++++++++++++++++++++
restore-priority-sample.mjs | 16 +++++++++++
verification/priority-sample-delete-result.json | 9 ++++++
verification/priority-sample-snapshot.json | 38 +++++++++++++++++++++++++
4 files changed, 94 insertions(+)
diff --git a/remove-priority-sample.mjs b/remove-priority-sample.mjs
new file mode 100644
index 0000000..8adbce2
--- /dev/null
+++ b/remove-priority-sample.mjs
@@ -0,0 +1,31 @@
+import {query} from './query.mjs';
+import fs from 'node:fs';
+const PROFILE='gid://shopify/DeliveryProfile/29033627699';
+// 1) Read full structure to locate Priority Sample Only + its owning locationGroup/zone ids
+const rq=`query($id:ID!){deliveryProfile(id:$id){profileLocationGroups{
+ locationGroup{id}
+ locationGroupZones(first:20){nodes{ zone{id name}
+ methodDefinitions(first:30){nodes{id name active
+ rateProvider{__typename ... on DeliveryRateDefinition{id price{amount currencyCode}}}
+ methodConditions{operator conditionCriteria{__typename ... on Weight{value unit} ... on MoneyV2{amount currencyCode}}}}}}}}}}`;
+const d=await query(rq,{id:PROFILE});
+let target=null, lgId=null, zoneId=null;
+for(const g of d.deliveryProfile.profileLocationGroups){
+ for(const z of g.locationGroupZones.nodes){
+ for(const m of z.methodDefinitions.nodes){
+ if(m.name==='Priority Sample Only'){ target=m; lgId=g.locationGroup.id; zoneId=z.zone.id; }
+ }
+ }
+}
+if(!target){ console.log('ABORT: "Priority Sample Only" not found — nothing to remove.'); process.exit(0); }
+// 2) SNAPSHOT (for reversible undo)
+const snap={ removedAt:new Date().toISOString(), profile:PROFILE, locationGroupId:lgId, zoneId, zoneName:'Domestic', methodDefinition:target };
+fs.writeFileSync(new URL('./verification/priority-sample-snapshot.json',import.meta.url), JSON.stringify(snap,null,2)+'\n');
+console.log('SNAPSHOT saved. Target method definition id =', target.id, '| price', target.rateProvider?.price);
+// 3) DELETE the method definition
+const mut=`mutation($id:ID!,$profile:DeliveryProfileInput!){deliveryProfileUpdate(id:$id,profile:$profile){profile{id name} userErrors{field message}}}`;
+const profile={ methodDefinitionsToDelete:[target.id] };
+const r=await query(mut,{id:PROFILE,profile});
+fs.writeFileSync(new URL('./verification/priority-sample-delete-result.json',import.meta.url), JSON.stringify(r,null,2)+'\n');
+console.log('DELETE result:', JSON.stringify(r.deliveryProfileUpdate.userErrors));
+if(r.deliveryProfileUpdate.userErrors.length) process.exitCode=1;
diff --git a/restore-priority-sample.mjs b/restore-priority-sample.mjs
new file mode 100644
index 0000000..72fb1be
--- /dev/null
+++ b/restore-priority-sample.mjs
@@ -0,0 +1,16 @@
+// One-command UNDO for the Priority Sample Only removal (reads the pre-delete snapshot).
+import {query} from './query.mjs';
+import fs from 'node:fs';
+const snap=JSON.parse(fs.readFileSync(new URL('./verification/priority-sample-snapshot.json',import.meta.url)));
+const m=snap.methodDefinition;
+const price=m.rateProvider?.price?.amount || '24.95';
+// Rebuild price conditions from the snapshot (Priority Sample Only was $0-$20 subtotal)
+const pc=(m.methodConditions||[]).filter(c=>c.conditionCriteria?.__typename==='MoneyV2').map(c=>({operator:c.operator,criteria:{amount:String(c.conditionCriteria.amount),currencyCode:c.conditionCriteria.currencyCode||'USD'}}));
+const mut=`mutation($id:ID!,$profile:DeliveryProfileInput!){deliveryProfileUpdate(id:$id,profile:$profile){profile{id} userErrors{field message}}}`;
+const profile={locationGroupsToUpdate:[{id:snap.locationGroupId,zonesToUpdate:[{id:snap.zoneId,methodDefinitionsToCreate:[{
+ name:m.name, active:true, rateDefinition:{price:{amount:price,currencyCode:'USD'}},
+ priceConditionsToCreate: pc.length?pc:[{operator:'GREATER_THAN_OR_EQUAL_TO',criteria:{amount:'0',currencyCode:'USD'}},{operator:'LESS_THAN_OR_EQUAL_TO',criteria:{amount:'20',currencyCode:'USD'}}]
+}]}]}]};
+const r=await query(mut,{id:snap.profile,profile});
+console.log('RESTORE result:',JSON.stringify(r.deliveryProfileUpdate.userErrors));
+if(r.deliveryProfileUpdate.userErrors.length) process.exitCode=1; else console.log('Priority Sample Only re-created.');
diff --git a/verification/priority-sample-delete-result.json b/verification/priority-sample-delete-result.json
new file mode 100644
index 0000000..14c0762
--- /dev/null
+++ b/verification/priority-sample-delete-result.json
@@ -0,0 +1,9 @@
+{
+ "deliveryProfileUpdate": {
+ "profile": {
+ "id": "gid://shopify/DeliveryProfile/29033627699",
+ "name": "General profile"
+ },
+ "userErrors": []
+ }
+}
diff --git a/verification/priority-sample-snapshot.json b/verification/priority-sample-snapshot.json
new file mode 100644
index 0000000..5af055c
--- /dev/null
+++ b/verification/priority-sample-snapshot.json
@@ -0,0 +1,38 @@
+{
+ "removedAt": "2026-09-09T21:35:44.961Z",
+ "profile": "gid://shopify/DeliveryProfile/29033627699",
+ "locationGroupId": "gid://shopify/DeliveryLocationGroup/29032120371",
+ "zoneId": "gid://shopify/DeliveryZone/54097215539",
+ "zoneName": "Domestic",
+ "methodDefinition": {
+ "id": "gid://shopify/DeliveryMethodDefinition/668951019571",
+ "name": "Priority Sample Only",
+ "active": true,
+ "rateProvider": {
+ "__typename": "DeliveryRateDefinition",
+ "id": "gid://shopify/DeliveryRateDefinition/608114540595",
+ "price": {
+ "amount": "24.95",
+ "currencyCode": "USD"
+ }
+ },
+ "methodConditions": [
+ {
+ "operator": "GREATER_THAN_OR_EQUAL_TO",
+ "conditionCriteria": {
+ "__typename": "MoneyV2",
+ "amount": "0.0",
+ "currencyCode": "USD"
+ }
+ },
+ {
+ "operator": "LESS_THAN_OR_EQUAL_TO",
+ "conditionCriteria": {
+ "__typename": "MoneyV2",
+ "amount": "20.0",
+ "currencyCode": "USD"
+ }
+ }
+ ]
+ }
+}
← 01626d9 Correct stale README + add live-state verification for TK-11
·
back to Shopify Sample Shipping
·
Weight-band feasibility check for TK-11333: REFUTED (no stor 48c00bb →