Skip to content

Import Inventory into Shopify

This task will update inventory levels and/or inventory items on your Shopify store using data supplied in an XML file. All variants with a matching SKU will have their inventory updated.

Settings

Shopify Connection

Required
The Shopify connection to use. See Shopify Connection if you require more information on how to create/manage connections.

Fail File

Required
The XML file to output any failed imports to.

Input File

Required
The XML file containing the records to import into Shopify. See below for a sample of the XML format.

Success File

Required
The XML file to output successful imports to.

Cache Time To Live

Required
Zynk will cache the IDs of certain records that it looks up against Shopify, to prevent the same lookup being performed more than is necessary. This setting controls the length of time (in minutes) that cached IDs are considered valid for. Before this time has elapsed, the cached copy of the ID will be used. Once this time has elapsed, the lookup will be performed again against Shopify.

Prevent Reprocessing

Required
When enabled, this setting will prevent the same records being processed more than once by the task. Records will be identified based on the <ZynkExternalId> values provided in the input file.

Timeout

Optional
The length of time to wait (in seconds) for Shopify to respond to each API request. If left blank, or set to 0 or less, a default value of 100 seconds will be applied.

Zynk Settings

See Common Task Settings

Permissions

This task requires the following permissions in your Shopify app:

  • read_locations
  • read_products
  • read_inventory
  • write_inventory

Examples

A sample input file is shown below.

<?xml version="1.0" encoding="utf-8"?>
<Inventories>
  <Inventory>
    <Id>gid://shopify/InventoryItem/19177384016</Id>
    <Sku>MEREXC1</Sku>
    <InventoryItem>
      <Cost>29.99</Cost>
      <CountryCodeOfOrigin>GB</CountryCodeOfOrigin>
      <CountryHarmonizedSystemCodes>
        <CountryHarmonizedSystemCode>
          <CountryCode>GB</CountryCode>
          <HarmonizedSystemCode>6603.20.3000</HarmonizedSystemCode>
        </CountryHarmonizedSystemCode>
      </CountryHarmonizedSystemCodes>
      <HarmonizedSystemCode>6603.20.3000</HarmonizedSystemCode>
      <Measurement>
        <Weight>
          <Unit>KILOGRAMS</Unit>
          <Value>0.5</Value>
        </Weight>
      </Measurement>
      <ProvinceCodeOfOrigin>GB-NBL</ProvinceCodeOfOrigin>
      <RequiresShipping>true</RequiresShipping>
      <Tracked>true</Tracked>
    </InventoryItem>
    <InventoryLevel>
      <IgnoreCompareQuantity>true</IgnoreCompareQuantity>
      <Name>available</Name> <!-- Can be either 'available' or 'on_hand' -->
      <Quantities>
        <Quantity>
          <CompareQuantity>95</CompareQuantity>
          <LocationId>gid://shopify/Location/16144367705</LocationId>
          <LocationName>6-8 Charlotte Square</LocationName>
          <Quantity>96</Quantity>
        </Quantity>
      </Quantities>
      <Reason>correction</Reason>
      <ReferenceDocumentUri>gid://shopify/Order/1974482927638</ReferenceDocumentUri>
    </InventoryLevel>
  </Inventory>
</Inventories>