Configure Webhooks via API
Ordergroove can send webhook events to an endpoint or endpoints of your choosing. In order to set up which webhook events you want triggered to which endpoint, you’ll need to:
- Configure each target endpoint that you want events to be sent to
- Configure which events you want sent to the target endpoint
Legacy Method
We recommend setting up webhooks directly in the Ordergroove merchant dashboard under Developers > Webhooks. If you need to set up webhooks via API, please contact your Customer Success Manager or technical resource at Ordergroove.
Authentication
We recommend you set up webhooks directly in the Ordergroove merchant dashboard, under Developers > Webhooks. If you need to set webhooks up via API, please contact your Customer Success Manager or technical resource at Ordergroove to discuss authentication options.
Creating a Target Endpoint
Platform — Shopify
For merchants on Shopify, please make sure you create a new Target Endpoint and do not update or use an existing endpoint that is configured for Shopify Event Notifications.
Destination
- Staging:
https://staging.webhooks.ordergroove.com/webhook_targets/ - Production:
https://webhooks.ordergroove.com/webhook_targets/
For more information on all targets that exist, how to update targets, or how to get target metrics, check out our Webhook Targets REST endpoint documentation for additional details.
Defining Events to Send to a Webhook Target
Once you’ve created a Webhook Target, you can define which events you want to be sent to that endpoint. The ID returned in the response of the Target Creation step is what will be used in this API request for the target_id in the path parameter.
Destination
- Staging:
https://staging.webhooks.ordergroove.com/webhook_targets/{target_id}/filters - Production:
https://webhooks.ordergroove.com/webhook_targets/{target_id}/filters
To define multiple events, use a pipe separator as shown:
Subscriber Event Filters
subscriber.createsubscriber.cancelsubscriber.*(for all events)
Subscription Event Filters
subscription.create(this event is not triggered when creation is from your Ordergroove Admin)subscription.cancelsubscription.sku_swapsubscription.reactivatesubscription.change_frequencysubscription.change_componentssubscription.change_quantitysubscription.change_shipping_addresssubscription.change_paymentsubscription.change_livesubscription.*(for all events)
Order Event Filters
order.change_shipping_addressorder.change_paymentorder.change_billingorder.change_next_order_date(this event is not triggered when creation is from your Ordergroove Admin)order.skip_orderorder.send_noworder.cancelorder.successorder.generic_errororder.rejectorder.reminderorder.retryable_placement_failureorder.*(for all events)
Order Item Event Filters
item.createitem.change_quantityitem.removeitem.item_subscribeitem.update_priceitem.successfully_placeditem.*(for all events)
Receiving Event Notifications
Payload Verification
Requests will be signed using the HMAC-SHA256 algorithm with a symmetric key we store and share with you at the time of configuration.
A webhook event will be delivered with the request header OrderGroove-Signature which will contain:
- a timestamp of transmission
- a hex-encoded representation of a signature generated with HMAC-SHA256
It is strongly encouraged to verify the authenticity of events. A Python example below shows how one might go about using the JSON values provided in the header to verify the signature.
As shown above, via the sig_input variable, the signature is driven by:
- the timestamp provided in the request header
- a period (
.) - the payload of the webhook event
Signing Key Retrieval
Signing keys are considered sensitive data and should only be retrieved when absolutely necessary.
- Staging:
https://staging.webhooks.ordergroove.com/webhook_targets/<target_id>/signing_key - Production:
https://webhooks.ordergroove.com/webhook_targets/<target_id>/signing_key
Signing Key Rotation
Like passwords, keys should be rotated on a regular basis. While we do not dictate this cadence (yet), you may rotate keys for a particular target on demand. Once this process is activated, events will be delivered with one signature for each active key.
Patch Request Destination:
- Staging:
https://staging.webhooks.ordergroove.com/webhook_targets/<target_id>/signing_key/rotate - Production:
https://webhooks.ordergroove.com/webhook_targets/<target_id>/signing_key
The signing_key_expiry field will tell you when the expiring_signing_key will be discarded and no longer used. Consecutive requests to this endpoint will generate a new value in the signing_key, but the timer for the signing_key_expiry will not update. You will have 24 hours from the first time this endpoint is hit to make sure your applications are using the new key, whichever it may be. Any subsequent requests sent to the “Signing Key Retrieval” endpoint will only respond with the new key.
Key Rotation
If the rotation of a signing key occurred, there will be two sig fields present, providing one signature for each key.
Retries and Automatic URL Disabling
- Retries: If a target does not return a 2xx HTTP response status, the delivery of the event will be retried for no more than 3 days using an exponential back-off for each subsequent retry attempt. After 3 days, the delivery will be marked as a failure. The first retry will be delayed for 60 seconds and will be subsequently doubled.
- URL Disabling: After 3 days, if a target does not provide a 2xx HTTP response status, the URL will automatically be disabled. Any success will reset the disable logic. Re-enabling a disabled URL will also reset the disable logic.