I'm new in WooCommerce REST API, I have worked with custom endpoints but I need some help/tutorial related to WooCommerce REST API. I have research about it but I didn't found any tutorial(s) for this.
I have got automattic/woocommerce and I have used below code in functions.php file:
require __DIR__ . '/vendor/autoload.php'; use Automattic\WooCommerce\Client; $woocommerce = new Client( 'http://example.com', 'ck_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 'cs_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', [ 'wp_api' => true, 'version' => 'wc/v2', ] );
but when I use this on functions file my website shows 500 server error. I don't know am I doing some wrong/foolish thing on it.
Let me know what can I do for this issue