Setting Up Wonderment Webhooks
Webhooks are a popular way to access event data as it happens. You can use Wonderment’s webhook integration to send data to any other platforms that might consume it - such as Zapier, Slack, or other apps that work with webhooks. Webhook support is available on all Wonderment paid plans and free trials. As of the time of publishing, to use Zapier, a Zapier Premium account is required as well. Slack allows webhooks to be used with free plans as well. Other services may have their own requirements for webhook support.
Setting Up Webhooks
The first step when setting up webhook support is to create your destination address for the data. Using a webhook involves supplying Where’s My Order with the URL to send data to. Open a window to Wonderment’s Settings screen, and the webhook screen of your app.
In our example, we’ll use Zapier’s Webhooks by Zapier trigger to receive data about a stalled shipment, parse it for a verification key, and then send it to a Google Spreadsheet.
First, create a new Zap and pick “Webhook” as the Zap trigger. When you need to select a Trigger Event, pick “Catch Hook”.
Click Continue, and Zapier will give you the URL to post to for your webhooks. Copy this URL using the button provided. You don’t need to configure anything else on this step.
Return to Wonderment’s settings screen. Pick the event type that you’re interested in, and paste in the URL. Click “Add Webhook”
The webhook will be listed in the space below. Click “Send Test Request” to send an example request on to the destination platform, to ensure that everything is entered properly. Note - If you’d like to receive data at this webhook address for multiple shipping events, repeat this step for each event you are interested in. You can use the same URL for each event.
Each webhook request comes with a security token attached to it as a data field. This can be used to validate that a request was sent from Wonderment to your webhook URL, and not from another source (potentially spam, bot, or whatever etc.) You’re not required to use it, but it can be useful if you’re concerned about data validation.
Return to Zapier and click “Test Trigger”. If you sent a test request from Wonderment, it should appear here immediately!
Here’s a successful test in Zapier:
If you’d like to use the secret to filter out any potentially incorrect data, add a Filter Action step below, like this one:
Click “Continue” and you can validate that the secret key is the same in your request and your filter. You should see the green status message here. If you don’t, check and make sure you have the same key in the Filter step as shown in your Settings screen. The key is the same for all your webhooks. It is unique per store.
Finally, add whatever action steps you’d like to use with this data. For example, you can populate a spreadsheet with data about stalled shipments:
All Wonderment Webhooks come with the same data attached as our Klaviyo and Postscript integrations. As a summary of the fields:
- status: The tracking number's current status
- token: The Wonderment security token
- trackingCode: The Tracking Number
- trackingURL: The Carrier Tracking URL
- orderNumber: Shopify Order Number
- orderID: Shopify Order ID
- carrierName: Carrier Name (such as USPS, UPS, DHL, FedEx)
- estimatedPackageDelivery: The Carrier’s Package ETA
- serviceLevel: The Carrier’s Service Level (encoded)
- serviceLevelFriendlyName: A title-cased version of the service level name
- destinationCountryCode: The two-character country code for the destination country
- businessDaysSinceFulfillmentCreated: The business days since fulfilled
- hoursStalled: The total hours the package has been stalled over its journey
- notUpdatedSince: The last update time from the carrier
Line Item Data
- lineItemID: Shopify order ID
- sku: product SKUU
- quantity: how many items were purchased in this order
- price: list price of the item
- discount: dollar amount discount
- taxable: true or false
- currencyCode: currency code
- productID: product ID
- productName: name of the product
- productImage: primary image of the product
- productImageAltText: description of the product image
- variantID: product variant ID
- variantName: the name of the product variant
- variantImage: the URL of the variant product image
- weight: how much the item weighs
- weightUnit: such as grams, pounds, etc