Dear Shopify Community!
We need help with the synchronisation script of our webshop. We are currently in the phase where we want to check our already existing variants and then update the variants that are already there but have different data in the database we are comparing (e.g. price, promotion, stock, size)
The endpoints we use for this are probably inadequate, because we don’t get a normal response back from the CURL log.
Query by SKU:
curl_setopt($ch, CURLOPT_URL, “https://$shopUrl/admin/api/2021-07/variants.json?sku=$sku”);
(Of course we process it and request a variant id to handle further API calls.)
To update:
curl_setopt($ch, CURLOPT_URL, “https://$shopUrl/admin/api/2021-07/variants/{$variantData[‘id’]}.json”);
It’s strange to me that for both of them, I found the API endpoint 2021-07 as the correct endpoint in the results, but the documentation says different, or I can’t really find in the documentation which one we should use.
I would like to ask for your help on this! We would like to find the right API endpoint to communicate with and have further questions.