Can I use WooCommerce in a headless CMS setup?

Yes. WooCommerce has endpoints and you can access them with the standard WordPress REST API.

/wp-json/wc/v3/products
/wp-json/wc/v3/products/<id>

Did a little search and found that they have documentation available here: https://woocommerce.github.io/woocommerce-rest-api-docs/

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)