Skip to content
Free Shipping on Orders $25+
School Supplies
Bible Supplies
Art Supplies
Other
School Supplies
Bible Supplies
Art Supplies
Other
Search
Cart
Item added to your cart
View cart
Check out
Continue shopping
All Blogs
Choosing a selection results in a full page refresh.
Opens in a new window.
async function submitOrder() { let items = []; document.querySelectorAll("#orderTable tr").forEach((row, index) => { if (index < 2) return; // Skip header and email row let sku = row.querySelector(".sku").value.trim(); let qty = parseInt(row.querySelector(".qty").value) || 0; if (sku && qty > 0) { items.push({ variant_id: sku, quantity: qty }); } }); let response = await fetch("https://gomrpen.myshopify.com/admin/api/2023-01/draft_orders.json", { method: "POST", headers: { "X-Shopify-Access-Token": "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", "Content-Type": "application/json" }, body: JSON.stringify({ draft_order: { line_items: items, note: "Wholesale order from Shopify frontend", use_customer_default_address: true } }) }); let data = await response.json(); alert("Order Submitted! Draft Order ID: " + data.draft_order.id); }
{"themeColor":"#4c5950","iconColor":"#4c5950","showLogo":true,"topBottomPosition":10,"rightLeftPosition":10,"iconSize":"small","iconCustomSize":64,"position":"bottom-left"}