Woocommerce update product quantity & price from a service

Need some advise. I have a xml service which returns Product name / stock price / stock available. I want to update my woocommerce product price & quantity from this service on a regular basis.
How do I go about it ? I believe I need to create a php program where I call this service and then setup a cron job to schedule this program.
is this the right approach ?

which woocommerce function I should call once I have received product price etc from service ?

Read More

also my XML service is in below format, how do i format it ?

<pricelist>
<row>
<itemid>
<![CDATA[ PRD-0010 ]]>
</itemid>
<class>
<![CDATA[ Asus ]]>
</class>
<subclass>
<![CDATA[ Asus Accessories ]]>
</subclass>
<product>
<![CDATA[ Asus ]]>
</product>
<desc>
<![CDATA[ Asus TX300CA AC Adaptor ]]>
</desc>
<price>
<![CDATA[ 899.00 ]]>
</price>
<stock>
<![CDATA[ low-level ]]>
</stock>
</row>
</pricelist>

thanks

Related posts