Skip to content
+1-888-319-3663

COMMUNITY FORUM

SmartConnect and Woocommerce Rest Api

Marcin Bojarski asked 3 years ago
Hi,
 
i try update product data in WooCommerce over SmartConnect. Source Data is NAV connector, but i have problem with choose endpoint to rest. This is update multiple product with custom field. I map field to rest endpoints to name “qty_step”. I see it in postman when i call to Rest WooCommerce. If i will update multiple product, I must use /produts/id or /products/batch?
 
 
Regards 
Marcin
Answers
Marcin Bojarski answered 3 years ago
Or Mayby how i can turn over field (id) from Nav connector(source data) to parametr in rest api (destination data)?
Ethan Sorenson Staff replied 3 years ago

Marcin,

Looking briefly at the Woo Commerce API the best approach is to use the /wc/v3/products/batch end point. This will allow you to update multiple products at once.

Currently the REST Connector does not have a way to set the ID in the URL of a REST Method. This means the /wc/v3/products/ endpoint would not be a harder way to do what you need,
That said, if you did want to provide the ID in the URL you would need to update the method URL with a SQL task in one map, then tell a second map to use that URL. It requires a second map, but would work.

Marcin Bojarski replied 3 years ago

Ok, but to use /wc/v3/products/batch endpoint i must use “update”:[some fields] in body. So i must just add this to body in method fields? Now i create something like this:

“update”:[{“id”:”{[0]___id}”,”qty_step”:”{[0]___qty_step}”}]

but dont work.

Ethan Sorenson Staff replied 3 years ago

Marcin,

The Json you provided looks correct. You can try installing Fiddler and using that to see exactly what SmartConnect is sending to Woo Commerce and what the response is.
https://www.telerik.com/fiddler

It may be beneficial to work with our support team directly to fix the method. You can email them at support@eonesolutions.com


If you would like to submit an answer or comment, please sign in to the eOne portal.