#wordpress #Polylang #Woocommerce_rest_api #Language_mapping_wordpress #Product Translation #post_translation

Create multilang product and mapping each other [Make Translate Version of a product/post or any kind of post type in wordpress]

Currently I am using Polylang Pro to translate.

Post request: https://base_url.com/wp-json/wp/v2/posts/72?lang=de&translations[en]=1180

To assign a language via Rest API, add the lang parameter with the correct language code:
POST /wp-json/wc/v3/products/product-id?lang=fr
Whre product_id is the id.

To link an existing product by the translation use the route as follow:
POST /wp-json/wc/v3/products/189?lang=fr&translations[en]=174
Here we're assigning French to product id 189 and link it to the English product id 174.