How to ingest products

There are two steps to ingesting products into Cloudshelf, and it is important to understand the relationships between products and variants. So before we jump into how to do this, we are going to look at a real-world example of what a product might look like in Cloudshelf.

Product and Variant Relationships


A Product can be thought of as a parent container for a collection of Variants. Products have very limited data as most of the data is related to a variant.

A Product Variant can be thought of as a child entity of the Product, and it cannot exist without a parent Product. A Product Variant contains all the information you would expect such as price & skus.

Therefore, using the above information we could see a relationship that looks something like this:

  • Product One
    • Variant One for Product One
    • Variant Two for Product One
  • Product Two
    • Variant One for Product Two
    • Variant Two for Product Two
    • Variant Three for Product Two
  • Product Three
    • Variant One for Product Three

A real world example here might look like:

  • Coca Cola Drink
    • Original
    • Diet Coke
    • Coca Cola Zero
    • Caffeine Free Coke
    • Diet Coke - Caffeine Free
    • etc…

Ingesting data:


As mentioned above there are two steps, you need to ingest the Product (the parent object), and then ingest the Product Variants.

First, call the UpsertProducts Mutation ; optionally provide your own GlobalIds or, make a note of the IDs returned to you; you’ll need to know one of these for the next step.

Second, call the UpsertProductVariants Mutation ; again optionally provide your own GlobalIds or, make a note of the IDs returned to you.

That's it! You’ve ingested product data correctly, and you should be able to call the Product Query and see the variants.