I am writing a small utility app that connects a 3rd party API to a WooCommerce store (actually, it's multisite, but that's not really relevant) in order to update customer records. The WooCommerce API docs state that the
role property is read-only, but I need to update the roles in order to enable role-based pricing on the front-end. It looks like I can edit roles using the core WordPress API, but I'm writing this app using wc-api-node, which is a node wrapper for WooCommerce's API. Should I use a separate wrapper and/or method to access the core WordPress API after creating/updating a customer record, or is this something I could handle with the
woocommerce_rest_insert_customer action? (Note: I am primarily a node / JS developer, so don't have a ton of experience with WordPress or WooCommerce.)
I'm also considering the possibility of making my own plugin and using the WordPress cron system to talk to the 3rd party API, but would prefer not to.