Skip to main content

Stocks

Structure for sending stocks to location, a single call can contain updates on different locations.

The location_id refers to the Shopify location ID retrievable in the URL: e.g: https://admin.shopify.com/store/myshopify/settings/locations/99333760019

Flow-specific Stocks

Inventory updates update ONHAND stock, i.e. the quantity present in warehouse, which is debited from orders still to be fulfilled (fulfillment missing). Alternatively, it is possible to update AVAILABLE stock, i.e. the sellable quantity (ONHAND - COMMITTED = AVAILABLE).

The location_id corresponds to the Shopify location ID to which the stock is associated, in the case it is unique it is possible to configure it directly on Flowlyze thus avoiding sending it with every communication.

[
{
"sku": "BGSM001C210A-1",
"qty": 34,
"location_id": 99333760019
},
{
"sku": "BGSM001C210A-2",
"qty": 35,
"location_id": 99333760071
}
]

It is possible to send negative quantities, but care must be taken, as depending on the type of stock being updated there is a certain behavior:

  • if the update concerns AVAILABLE stock, the value will be synchronized as is;
  • if instead the update concerns ONHAND stock, the value will be set to 0 (negative quantities in warehouse are not allowed).

Destination configuration

Configure a Shopify destination and associate it with the flow, in addition to the basic data flow configuration.

FieldValueNotes
Destination TypeShopify
OperationStock updatePOST /egress/stock-to-shopify
GraphQL endpoint URLhttps://SHOPIFYURL.myshopify.com/Shopify Admin GraphQL endpoint URL
Admin API access tokenshpat_CODICEALFANUMERICOOr Client ID (API key) + Client secret — see Authentication
Client ID (API key)YOUR_CLIENT_ID
Client secretYOUR_CLIENT_SECRET
Fulfillment locationgid://shopify/Location/…Shopify location identifier used for inventory updates
Update available quantitytrue / falseWhen true, updates available inventory quantities at the location (required)
Ignore missing SKUtrue / falseWhen true, skips stock updates when the SKU is not found instead of failing (default: false, required)

Deprecated — previous configuration (HTTP Adapter)

Deprecated

Configuration via HTTP Adapter with Base Url, Resource Path, and x-api-key header in Settings Override is deprecated. Use the Shopify destination configuration described above.

In addition to the basic data flow configuration, the following Settings Override settings were required:

FieldValueNotes
Base Urlhttps://adapter.flowlyze.ioAdapter URL
Resource Path/api/adp/shopify/egress/stock-to-shopifyAdapter path for stock
Headers :: x-api-key**********API key for endpoint interaction verification
Headers :: x-shopify-graphql-urlhttps://SHOPIFYURL.myshopify.com/Shopify shop URL to connect to
Headers :: x-shopify-access-tokenshpat_CODICEALFANUMERICOSecret of the custom app created for integration
Headers :: x-shopify-update-availabletrueAllows modifying AVAILABLE stock directly
Headers :: x-shopify-locationlocationIDDefault location for each call
Headers :: x-ignore-missing-skutrueIgnores missing SKUs (default: false)