woocommerce / woocommerce-rest-api

This is the WooCommerce core REST API Package. It runs standalone as a feature plugin too.
71 stars 46 forks source link

Shouln't the webhook endpoint also retrieve the secret value? #259

Closed rafa-acioly closed 3 years ago

rafa-acioly commented 3 years ago

I'm building a new platform that will be integrated with woocommerce and inside of my platform I have a job that creates webhooks on client's shop (product and order update), I've managed to create the webhooks successfully but I cannot receive any "secure" notifications because I didn't receive the secret created for this webhooks.

Looking at the documentation I cannot pass a secret value to create a webhook

https://woocommerce.github.io/woocommerce-rest-api-docs/#create-a-webhook

And even if i GET a webhook it will not show the secret

https://woocommerce.github.io/woocommerce-rest-api-docs/#retrieve-a-webhook

What may be the solutions?

  1. Ask the users to go through the configuration and get the secrets for me. (not cool because this will need human interaction)
  2. Retrieve the secret on the rest API requests
  3. Have a convention to generate secrets, this way I can predict what the secret will be.