In this article, you’ll learn how to use an incoming webhook to give buyers access to a Thrive Apprentice course when they purchase through a WooCommerce store, and how to remove access again on a refund.
Step 1: Create the Webhook in Thrive Apprentice
- Go to Thrive Dashboard › Thrive Apprentice › Settings › Incoming Webhooks.
- Click Add your first webhook (or Add another webhook).
- Name the webhook, for example “WooCommerce → Photography Masterclass.”
- Under Action, keep Find or create user, then grant access.
- Under Product, choose the Thrive Apprentice product the buyer should get.
- Under Paste this URL into your tool, click Copy URL.
Step 2: Add the Webhook in WooCommerce
- In the WooCommerce store’s admin, go to WooCommerce › Settings › Advanced › Webhooks and click Add webhook.
- Enter a name and set Status to Active.
- Set Topic to Order updated.
- Paste the Thrive Apprentice URL into Delivery URL.
- Copy the value in the Secret field (or enter your own) – you’ll need it in Step 4.
- Save the webhook.
Step 3: Send a Test
In Thrive Apprentice, click Start Listening, then place a test order in the WooCommerce store within 60 seconds. If that’s not practical, choose Skip for now, save the webhook, place the order, and use Use to map fields on the logged request.
Map the Fields
On the Field mapping tab, check that Thrive Apprentice picked the buyer’s email address for the Email field, and their first and last name if your test included them. The previews show the real values from your test, so you can confirm at a glance. Adjust anything that looks off.
Step 4: Only Act on Completed Orders
WooCommerce sends a request every time an order changes. On the Field mapping tab, click Add a condition, click the status field in your test request, and set it to equals completed. If your store marks paid orders as processing instead, use that value.
Step 5: Protect the Webhook
- Open the Security tab and choose HMAC-SHA256.
- Set Signature header to
X-WC-Webhook-Signature. - Set Signature encoding to Base64.
- Set the header format to The signature on its own.
- Paste the WooCommerce webhook’s Secret as the signing secret.
Save, Test, and Check the Log
- Leave Activate on save on and click Save & activate.
- Make a test purchase in the WooCommerce store.
- Open the webhook’s Logs tab. You should see Granted access to followed by the product and the buyer’s email.
If the result is different, see How to Read Incoming Webhook Logs in Thrive Apprentice for what each result means.
Removing Access on a Refund
Each webhook does one job, so refunds need a second webhook:
- Open the webhook’s actions menu and click Duplicate. The copy has a new URL and starts paused.
- Edit the copy, rename it (for example, add “Refund”), and change the Action to Revoke access.
- On the Field mapping tab, change the condition value to
refunded. Then add a second webhook in WooCommerce with the copy’s URL, the same topic, and the same secret. - Save and activate the copy.
Revoking access keeps the student’s account and course progress, so they can pick up where they left off if they buy again.
That’s it! Completed WooCommerce orders now give buyers their Thrive Apprentice course automatically, and refunds take access away.