I have a client that uses WP All Import and WPML in order to create and update their products.
They now need to create a bridge with the software that handles their stock in order to update the current products and create new ones.
There is no issue when updating a product, in English or Greek. When creating a new product though, the new product is created successfully in English, but when trying to create it's Greek translation we get an error that the sku is invalid or already exists.
The code that we run to create the translation is the following:
{"name": "Elastique pour Cheveux Black","type": "simple","regular_price": "0","sale_price": "0","description": "A handcrafted hair elastic made from durable cellulose acetate designed with the Balmain’s signature 18K gold plated B logo.
The extremely strong yet flexible material is hypoallergenic and gentle to the hair and scalp. The hair elastic is specially designed to accentuate one of the iconic Balmain hairstyles∶ the ponytail.",
"short_description": "A handcrafted hair elastic made from durable cellulose acetate designed with the Balmain’s signature 18K gold plated B logo. The extremely strong yet flexible material is hypoallergenic and gentle to the hair and scalp.
The hair elastic is specially designed to accentuate one of the iconic Balmain hairstyles∶ the ponytail.","sku": "1870687.0","lang":"el","categories": [{ "id":556}],"translation_of":24327}
When WPML manages the translation of a product, it copies some of the properties of the original product, SKU among them. As these are actually the same product, just in a different language, they will share the same SKU, inventory and price.
Please try running the same code, without the "SKU" field in the request.