Shopify Inventory XML
The XML format documented here is used for the import of inventory into Shopify, via the Import Inventory Updates to Shopify task.
We recommend that the external_id
field be populated with the unique ID of the product from the external system, Zynk uses this field to track data already imported into Shopify.
XML
Any fields not documented below are not supported by our Shopify connector. Examples of where in the XML the fields should appear are shown in the samples below.
<?xml version="1.0" encoding="utf-8"?>
<inventory_collection>
<inventory>
<external_id>12345</external_id>
<inventory_item>
<id>9879143234</id>
<sku>MER99AMP2</sku>
<cost>29.99</cost>
<country-code-of-origin>GB</country-code-of-origin>
<country-harmonized-system-codes>
<country-harmonized-system-code>
<harmonized-system-code>6603.20.3000</harmonized-system-code>
<country-code>GB</country-code>
</country-harmonized-system-code>
</country-harmonized-system-codes>
<harmonized-system-code>6603.20.3000</harmonized-system-code>
<province-code-of-origin>GB-NBL</province-code-of-origin>
<tracked>true</tracked>
<requires-shipping>true</requires-shipping>
</inventory_item>
<inventory_level>
<inventory_item_id>9879143234</inventory_item_id>
<sku>MER99AMP2</sku>
<available>15</available>
<location_id>3374104341</location_id>
<location>Home</location>
</inventory_level>
</inventory>
</inventory_collection>
In each of the following sections most of the XML has been omitted to make the samples easier to read. The whole structure of the inventory_collection
schema is used below as a reference of where fields should be in the object model.
Inventory
The following information can be specified at the 'inventory' level.
Shopify Field | XML Field | Type | Input | Notes |
---|---|---|---|---|
- | external_id | string | Optional | Stored in Zynk's internal DB and used in conjunction with the 'Prevent Reprocessing' setting |
- | inventory_item | Guid | Optional | Used for updating the item information in Shopify. See below for details |
- | inventory_level | string | Optional | Used for updating the inventory information in Shopify. See below for details |
<?xml version="1.0" encoding="utf-8"?>
<inventory_collection>
<inventory>
<external_id>12345</external_id>
<inventory_item>
<!-- See below -->
</inventory_item>
<inventory_level>
<!-- See below -->
</inventory_level>
</inventory>
</inventory_collection>
Inventory Item
The following information can be specified at the 'inventory_item' level.
Shopify Field | XML Field | Type | Input | Notes |
---|---|---|---|---|
ID | id | long | Dependant | Required if a sku is not provided |
SKU | sku | string | Dependant | Required if an id is not provided |
Cost per item | cost | decimal | Optional | |
Country/Region of origin | country-code-of-origin | string | Optional | Use the 2 letter ISO code |
Country/Region of origin | country-harmonized-system-codes/country-code-of-origin | string | Optional | Use the 2 letter ISO code |
HS (Harmonized System) code | country-harmonized-system-codes/harmonized-system-code | string | Optional | Country specific HS code. Must be a valid HS Code. |
HS (Harmonized System) code | harmonized-system-code | string | Optional | Used when a country specific HS code is not available. Must be a valid HS Code. |
Country/Region of origin | province-code-of-origin | string | Optional | Use the (ISO 3166-2 alpha-2)[https://en.wikipedia.org/wiki/ISO_3166-2] code |
Track quantity | tracked | bool | Optional | |
Physical product/Digital product or service | requires-shipping | bool | Optional | Set to true to select the 'Physical product' option, or false to select 'Digital product or service'. |
<?xml version="1.0" encoding="utf-8"?>
<inventory_collection>
<inventory>
<inventory_item>
<id>9879143234</id>
<sku>MER99AMP2</sku>
<cost>29.99</cost>
<country-code-of-origin>GB</country-code-of-origin>
<country-harmonized-system-codes>
<country-harmonized-system-code>
<harmonized-system-code>6603.20.3000</harmonized-system-code>
<country-code>GB</country-code>
</country-harmonized-system-code>
</country-harmonized-system-codes>
<harmonized-system-code>6603.20.3000</harmonized-system-code>
<province-code-of-origin>GB-NBL</province-code-of-origin>
<tracked>true</tracked>
<requires-shipping>true</requires-shipping>
</inventory_item>
</inventory>
</inventory_collection>
Inventory Level
The following information can be specified at the 'inventory_level' level.
Shopify Field | XML Field | Type | Input | Notes |
---|---|---|---|---|
ID | inventory_item_id | long | Dependant | Required if a sku is not provided |
SKU | sku | string | Dependant | Required if an inventory_item_id is not provided |
Available | available | int | Required | |
Location | location_id | long | Dependant | Required if a location is not provided |
Location | location | string | Dependant | Required if a location_id is not provided |
<?xml version="1.0" encoding="utf-8"?>
<inventory_collection>
<inventory>
<inventory_level>
<inventory_item_id>9879143234</inventory_item_id>
<sku>MER99AMP2</sku>
<available>15</available>
<location_id>3374104341</location_id>
<location>Home</location>
</inventory_level>
</inventory>
</inventory_collection>