Greenbarfor Sage 100
Guides / Connect Sage 100 to other apps

Sage 100 Shopify integration: stock levels and web orders

How a Sage 100 Shopify integration works - publishing stock from Sage, matching SKUs, and getting web orders back into Sage as sales orders.

For: DevelopersUpdated 2026-12-043 min read

A Sage 100 Shopify integration has two jobs that move in opposite directions. Stock and prices flow from Sage to Shopify, so the store never sells what the warehouse does not have. Orders flow from Shopify to Sage, so the warehouse ships and accounting invoices without retyping. The first is a read from Sage and is easy. The second is a write and is where most of the work is.

The data that has to line up

ShopifySage 100Notes
Variant SKUCI_Item.ItemCodeThe join key. Make them identical before you start
Inventory level at a locationIM_ItemWarehouse.QuantityOnHand minus committedPick one Sage warehouse per Shopify location
Variant priceCI_Item.StandardUnitPrice or a price levelB2B stores often need customer pricing instead
CustomerAR_Customer (division + customer number)Many stores post all web orders to one cash customer
OrderSO_SalesOrderHeader + SO_SalesOrderDetailCreated through BOI so tax and pricing rules run

Direction 1: stock from Sage to Shopify

Read item quantities from Sage on a schedule and set the matching inventory levels in Shopify. Every 15 minutes is a common compromise; faster is rarely needed for B2B volumes.

javascript
// Node 18+. Reads items from the Greenbar sandbox, then sets Shopify stock for matching SKUs.
const SAGE = "https://api.greenbar.octor.top/v1/companies/ABC";
const SHOP = `https://${process.env.SHOP}.myshopify.com/admin/api/2024-07/graphql.json`;

async function sageItems() {
  const r = await fetch(`${SAGE}/items?limit=100`, { headers: { Authorization: "Bearer sk_test_demo" } });
  return (await r.json()).data; // [{ item_code, quantity_on_hand, ... }]
}

async function shopify(query, variables) {
  const r = await fetch(SHOP, {
    method: "POST",
    headers: { "X-Shopify-Access-Token": process.env.SHOPIFY_TOKEN, "Content-Type": "application/json" },
    body: JSON.stringify({ query, variables }),
  });
  return r.json();
}

const SET_QTY = `mutation ($input: InventorySetQuantitiesInput!) {
  inventorySetQuantities(input: $input) { userErrors { field message } }
}`;

const items = await sageItems();
const quantities = items
  .filter((i) => skuToInventoryItem[i.item_code])          // your SKU -> inventoryItemId map
  .map((i) => ({ inventoryItemId: skuToInventoryItem[i.item_code], locationId: process.env.LOCATION_ID,
                 quantity: Math.max(0, i.quantity_on_hand) }));
await shopify(SET_QTY, { input: { name: "available", reason: "correction", ignoreCompareQuantity: true, quantities } });

Build the skuToInventoryItem map once from Shopify's product variants and cache it. Check the field names against the Shopify API version you use; the inventory mutations changed across 2024 releases.

Direction 2: orders from Shopify to Sage

Subscribe to Shopify's orders/create webhook. For each order:

  1. Find or create the Sage customer. Decide early whether consumer orders go to one cash customer.
  2. Create a Sage sales order with one line per item, using Sage item codes.
  3. Let Sage calculate tax and price, or pass Shopify's prices explicitly and mark the difference rule.
  4. Store the Sage sales order number on the Shopify order (as a note or metafield) so support can find it.

Step 2 is a write, so it goes through the Business Object Interface (SO_SalesOrder_bus) on the Sage server, or through an API that wraps BOI. In the Greenbar sandbox, POST /sales-orders answers 403 with a waitlist link: write access is in private beta.

Common problems

Related: Sync Sage 100 stock levels with Node.js and WooCommerce integration.

Try it against the sandboxOpen the playground →
curl "https://api.greenbar.octor.top/v1/companies/ABC/items?below_reorder=true" \
  -H "Authorization: Bearer sk_test_demo"

A REST API for Sage 100, self-serve

One HTTPS endpoint and a typed SDK instead of BOI scripts and ODBC DSNs on every customer's server. Read access is free during the beta.

Join the waitlist