Create Basproduct and Variants one after another

Hello I am trying to figure out how to work with Product and variants in shopify and have some trouble to get my problem solved.

Here is what I have at the moment:

I am using SAP ERP ECC 6.o and have products and variants stored there.
What I am trying to do is to create Baseproducts with one call and their respective variants with another and use SAP BTP Integration Suite for this problem.

Now I was able to create baeproducts using productCreate but now I have the problem to create the respective variants one-by-another.

My biggest problem is, that if I create a baseproduct with options and values the respective variants are created automaticly.

Now I have a problem, because there exit productVariantByIdentifier but no productVariantByOptions.

Now I found that there productSet exist, but this one only works, when I create Products with all their variants at once, but this will not happen.

is there a way to create variants and update the options at the same time?

here is what I had in mind:

  1. MATMAS of variant comes in
  2. check if variant exist by identifier
  3. if yes update → 8
  4. if not the get baseproduct id
  5. check if baseproduct exist by identifier
  6. if yes
    1. check if options exist (in loop)
      1. if no update option with value
      2. if yes create new option with value
    2. create variant
  7. if no create baseproduct with variant using productset
  8. end

This was my idea but I don’t know how to realisie this baseproduct update with new variantoptions
the identifier will be the matnr ov the vairant/baseproduct

I hope some can give me the right hints how to solve my problem.

Cheers,

Serdar

1 Like

Hey @Serdar_Dere, take a look at this guide. This guide walks through updating products in the way you’ve mentioned: