1. Home
  2. Knowledge Base
  3. Thrive Apprentice
  4. Thrive Apprentice Settings
  5. How to Connect SamCart to Thrive Apprentice with Incoming Webhooks

How to Connect SamCart to Thrive Apprentice with Incoming Webhooks

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 SamCart, and how to remove access again on a refund.

Note: Incoming webhooks are available in Thrive Apprentice 11.1 and later. For a full tour of the feature, see How to Use Incoming Webhooks in Thrive Apprentice.

Step 1: Create the Webhook in Thrive Apprentice

  1. Go to Thrive Dashboard › Thrive Apprentice › Settings › Incoming Webhooks.
  2. Click Add your first webhook (or Add another webhook).
  3. Name the webhook, for example “SamCart → Photography Masterclass.”
  4. Under Action, keep Find or create user, then grant access.
  5. Under Product, choose the Thrive Apprentice product the buyer should get.
  6. Under Paste this URL into your tool, click Copy URL.

Step 2: Add the Webhook in SamCart

  1. In SamCart, click Apps in the left navigation, search for Webhooks, and click Install.
  2. Paste the Thrive Apprentice URL into the Notify URL box and click Connect.
  3. On the Webhooks page, click + Add New Rule.
  4. Choose Product Specific Rule and select the SamCart product that should unlock this course.
  5. Under the action, choose Send NotifyURL Post. Under the trigger, choose Product purchased.
  6. Click Add Rule.

Because the rule only sends this product’s purchases to this URL, you don’t need a condition in Thrive Apprentice.

Step 3: Send a Test

In Thrive Apprentice, click Start Listening, then make a test purchase of the product in SamCart within 60 seconds. If you can’t complete a purchase that quickly, choose Skip for now instead: save the webhook, make the test purchase, then open the request on the Logs tab and click Use to map fields.

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: Protect the Webhook

Open the Security tab and choose how Thrive Apprentice should check requests. SamCart’s webhook requests don’t include a custom header or a signature. Check the request you captured in Step 3 for a value SamCart sends with every request; if there is one, choose Shared secret › In a field inside the request body and enter that field and value. Keep the rate limit on, and keep the webhook URL private.

Save, Test, and Check the Log

  1. Leave Activate on save on and click Save & activate.
  2. Make a test purchase in SamCart.
  3. 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

  1. In Thrive Apprentice, open the webhook’s actions menu and click Duplicate. Edit the copy, rename it, change the Action to Revoke access, and copy its URL.
  2. In SamCart, open the Webhooks app, click the three dots, and choose Connect New App Instance. Paste the copy’s URL as the Notify URL.
  3. Add a Product Specific Rule for the same product on the new connection, with the Product refunded trigger.
  4. Save and activate the copy in Thrive Apprentice.

Revoking access keeps the student’s account and course progress.

Tip: New students created by a webhook get your New Account Created email, as long as the Incoming webhook trigger is ticked under Settings › Email Templates. If you’ve customized that email before, tick the trigger yourself.

That’s it! SamCart purchases now give buyers their Thrive Apprentice course automatically, and refunds take access away.

Was this article helpful?

Related Articles

>