Magidoc

How to ingest products

Products in Cloudshelf are made up of two parts, the Product and the Product Variants.

Therefore, when ingesting products you need to ingest the Product and then 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.

Note: If you are providing more than one variant for a product, then the variants should include attributes that differentiate between them so that they can be selected on the Cloudshelf Engine.

For example the following attribute might be added to a variant for Coke Zero Caffeine Free:

    
  

Attributes should be an array of Key Value Pairs .

Finally, you should Report Expected Catalog Information .

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

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…