theme development - Woocommerce REST API for my account & checkout process

admin2025-06-04  46

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(
    '', 
    '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

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749029836a315764.html

最新回复(0)