Creating WooCommerce Custom API

2019-08-28 23:28发布

问题:

I'm looking into creating a WooCommerce endpoint due to the lack of many functionalities in the WooCommerce REST API provided out of the box.

Examples are : Payment, Product-Addons, etc

But I can't find anything to start with, no documentation on how to extend WooCommerce to create a new endpoint. All I could find was creating a Plugin, but I'm not sure if that's what I need.

I want to create php files when called return the desired data like products and orders.

I've tried adding actions and filters to the functions.php file, but I can't seem to find the right action/filter for what I want, and looking online I only find old answers that used the old versions of WooCommerce API (legacy v1-2-3 instead of the new v1-2-3).