Stockeo Help
  • What is Stockeo?
  • Update inventory from a Google Sheet
  • Update inventory from an XML feed
  • Create products from a JSON feed
  • Data Mapping
    • Format
      • CSV
      • JSON
      • XML
    • SKU
    • Price calculation
    • Quantity settings
    • Quantity format
    • Image URL settings
    • Variants
    • Metafields
    • Title
    • Description
    • Translations
    • Continue selling when out of stock
    • Charge tax
  • Filters
  • TROUBLESHOOTING
    • Invalid Closing Quote
    • Invalid Record Length
Powered by GitBook
On this page
  • XML
  • JSON
  1. Data Mapping

Image URL settings

PreviousQuantity formatNextVariants

Last updated 2 years ago

XML

You may encounter an XML structure where links to images are stored in separate Image nodes.

<Product>
  <Items>
    <ProductItem>
      <ItemCode>A012345</ItemCode>
      <ItemImage1>http://warehouse.com/images/A012345.jpg</ItemImage1>
      <ItemImage2>http://warehouse.com/images/A012345_1.jpg</ItemImage2>
    </ProductItem>
  </Items>
</Product>

For the notation above, use the following settings in the Image URL fields:

Image URL: Items/ProductItem/ItemImage1

Image URL: Items/ProductItem/ItemImage2

It may also happen that the URLs are nested as children of the Image node.

<Product>
  <Items>
    <ProductItem>
      <ItemCode>A012345</ItemCode>
      <ItemImages xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d5p1:string>http://warehouse.com/images/A012345.jpg</d5p1:string>
        <d5p1:string>http://warehouse.com/images/A012345_1.jpg</d5p1:string>
      </ItemImages>
    </ProductItem>
  </Items>
</Product>

Use the following settings to access them:

Image URL: Items/ProductItem/ItemImages/*[1]

Image URL: Items/ProductItem/ItemImages/*[2]

Another case is when the URLs are nested as the same named children of the Image node.

<Product>
  <Items>
    <ProductItem>
      <ItemCode>A012345</ItemCode>
      <ItemImages>
        <ItemImage>http://warehouse.com/images/A012345.jpg</ItemImage>
        <ItemImage>http://warehouse.com/images/A012345_1.jpg</ItemImage>
      </ItemImages>
    </ProductItem>
  </Items>
</Product>

Get accees to them with these settings:

Image URL: Items/ProductItem/ItemImages/ItemImage[1]

Image URL: Items/ProductItem/ItemImages/ItemImage[2]

JSON

In the JSON file images may be stored as an array of objects that consist of e.g. image id and image URL.

{
  "data": [
    {
      "product_code": "A012345",
      "product_name": "Sitting Jazz Band Strings",
      "product_images": [
        {
          "id": 5856,
          "image": "https://warehouse.com/images/A012345.jpeg"
        },
        {
          "id": 5857,
          "image": "https://warehouse.com/images/A012345_1.jpeg"
        }
      ]
    }
  ]
}

In this case use the following settings:

Image URL: product_images[0].image

Image URL: product_images[1].image

Image URL: product_images[2].image

Please note that the indexing of array elements in JSON starts at 0.

You can add fields up to the highest expected number of images. This will not cause an error, even if there is no link to the image on the given index.

Images stored in separate Image nodes
Stockeo settings for Image URL fields when images are stored in separate ItemImage nodes
Images stored in the child nodes of ItemImages node
Stockeo settings for Image URL fields when images are stored in in the child nodes of ItemImage node
URLs nested as the same named children of the Image node
Stockeo settings when URLs are nested as the same named children of the Image node
Image URLs are stored as a property of the object in the product_images array
Stockeo settings when Image URLs are stored as a property of the object in the product_images array
Images stored in separate Image nodes annotated
Stockeo settings for Image URL fields when images are stored in separate ItemImage nodes annotated
Images stored in the child nodes of ItemImages node annotated
Stockeo settings for Image URL fields when images are stored in in the child nodes of ItemImage node annotated
URLs are nested as the same named children of the Image node annotated
Stockeo settings when URLs are nested as the same named children of the Image node annotated
Image URLs are stored as a property of the object in the product_images array annotated
Stockeo settings when Image URLs are stored as a property of the object in the product_images array annotated