ThriveCart Webhook vs Query String

by Dave | thrivecart

ThriveCart Webhook versus Query String.

In this video, I’m going to cover what are the differences between the web hook and the query string data that ThriveCart sends over. Now, the web hooks sends more information and it occurs on all transactions on a purchase, on a refund, subscription failure, those all get sent from ThriveCart to typically your web server or Zapier.

On the other hand, a query string is good for verifying the order in real time, is it valid or not and it only occurs on purchase. The link, there is a spreadsheet that I put together that shows the data that gets sent over and then compares the two. So let’s dive right in.

So to start with inside your ThriveCar account, one way to get your data is through the web hooks. So you want to go to ThriveCart settings, API and web hooks, web hooks and notifications, view settings, and I’ve got a couple setup. So I want to go here, and it’s basically just sends information to a web hook that you specified.

In this case, it’s on my account, in my web server, it could have been Zapier or something like that. And then you by default, get query string data if you send people to a custom URL, so let’s go take a look at a product. And under fulfillment you’re going to want to have send them to a URL and then tell them the success URL. And then check out success page needs to be redirect to your own custom page.

So I’ve gone ahead and I have already made a purchase. But let me just show you what I did here, it’s going to be this product here, I’m going to copy that URL and basically, I did apply a coupon. I did take the box and I think I may have taken the upsell. But all that information gets passed over.

Now what it looks like when it gets received something like this, and I’ve kind of made it pretty. So it’s a little bit of readable. But notice this is the web hook data that occurred at 15:35:09 and then about one second later, the query string data showed up on the thank you page and let me go briefly through this but the spreadsheet gives you a little bit more insight.

I’ll just say it this, frankly, there’s a lot more information in the web book than there is in the query string. So let me just point out a few things that are kind of important. You get timestamps in the web hook makes sense. The query string, the assumption is that time that it occurs is your timestamp. There’s more identifiers for customers, products, things like that, I know these are all consistent, I think this might be unique.

Here’s a good one to point out something this is TNC, terms and conditions and the one means that I tick the box if it was a zero, that would imply that I did not. But what’s interesting is this doesn’t necessarily show up for all products, because it may or may not exist. If it doesn’t, it doesn’t show up. So in other words, you can’t count on that being there.

Even address, if you don’t ask for it, it’s not going to show up. Email, I’m sure is going to be on every single one. Checkbook confirmation, I don’t think that shows up in the query string. One thing that’s interesting is this is first underscore Name and Last underscore name in the query string, its first name, last name, no underscore.

Under order, it’s a little bit more structured and I should point out, this is kind of an array of data. So the first, I don’t know what level is this key value pair. So event is a key and order success is the value. Now notice this ID is underneath this customer. So it just kind of embeds itself.

Down here, we’ve got no tax and again, I don’t think that gets passed over in the query string. Total versus total string. My preference is to use total, no decimal places and then if I want to do some math, I do at the very end.

And charges identifier, this is a little bit different here versus query screen, let me go down Oh, and I know this doesn’t show up in the query string, payment plan ID and payment plan name, do not.

This product or purchase map flat doesn’t show up in the query string, nor does coupon information. So if you need to use those, if you need that information, it only shows up in the webhook, not in the query string. And the purpose of the query string is to verify the transaction, ThriveCart sends over this array called ThriveCart, which with a bunch of information, and they also send over a ThriveCart hash, which you can use to verify if the order is actually valid.

And save information is there not as much and for instance, they’ve shortened things. So this is Type, this is ID, this is Name, this is Price, this is Quantity, and this is Purchase order. And then let’s take a look here, I’ve got two pages here, ones, the web hook data, one’s a query string with my comments. So anything highlighted over here on the right hand side, and yellow is not in the query string.

So event mode, mode_int whatever that is, your secret key, which of course, you really don’t want to be sent over the query string. The invoice ID, the order date timestamp are not in there. This ID i thought was interesting. I did not find that. You know what, maybe I did that wrong. But let’s go take a look.

Yeah, this is only in the web hook. Email, this information shows up, and what is his Terms and Conditions IP address doesn’t get sent over? Name, which is interesting, right? It’s first and last that doesn’t get sent over. But first name last name does, but in slightly different format I’ll show that in two minutes. Checkbook confirmation, did not check box, did not get sent over. Tax, tax type did not get thrown in the query string, total string Nope. Item identifier, I think they send it maybe a little bit differently send for instance 27 product that here they basically concatenate it together, they just done some work for you in the webhook.

Payment Plan ID payment plan name, not there. Timestamp, not there, that’s fine. Really no idea what this is, is this the ThriveCart specific or is it like a stripe specific piece of information since I did purchase stripe, this is just a little more details that are in the query string and this information, definitely no coupon code ID. So here’s the query string data.

Little bit simplified, if you will, I’ve highlighted the things that are same, this is Thrive so what I’m showing you over here in column F is what it’s called in the web hook. So in the query string, it’s called the account name. In the web hook, it’s called ThriveCart account. First Name, Last Name is first underscore Name, Last underscore name and so this is orders and then immediately it’s the first order, the second order but over in the web hook data, it’s orders charges then zero than one.

And I’ve already spelled this out, you know, this is type, its type underscore ID in the web hook, ID is reference name is name, amount is price quantities quantity, payment plan ID you know, what did I do that right? Let’s go check.

Purchase Order payment plan ID Okay, so that is over there. The payment plan ID does get passed, but the payment plan name does not. So this is item name, so this is the same except for instance, they have purchases zero 27. Web hook has purchases zero season. This is purchases, one bump, webhook as purchases one ddd, which is the name that I gave it, and then ThriveCart hash, which doesn’t get passed in a webhook.

That’s ThriveCart Webhook vs Query String.