Webhooks
Webhooks are a powerful tool that enables you to keep track of the subscription events occurring in the Loop system.
This article details the use of Webhooks with Loop and how you can leverage the same for your store.
- How can Webhooks help?
- How to respond to a Webhook?
- What are Webhook attributes/headers?
- Supported webhooks
- List Webhook topics
- How to subscribe/unsubscribe webhook?
- FAQs
- Need help?
Webhooks help stay in sync with the activities that matter most to you and automate actions based on those events. By subscribing to webhooks, you can receive notifications about specific events and use the data payload from the event to trigger custom logic. Overall, webhooks provide a reliable and efficient way to integrate with the Loop system and streamline your workflow.
In order to confirm the receipt of data through your webhook, it is important to send a response with a status code in the 200 range, indicating success. If the response falls outside this range, it will signal that the webhook was not received.
Our system has been designed to include a 5-second time-out period for all webhook requests. If a response is not received within this timeframe, the request is considered to have failed.
To ensure that webhook requests are properly processed, our system will automatically retry failed requests over the next 48 hours. However, if a request continues to fail during each retry attempt, our system will take appropriate action and delete the webhook request.
By implementing these measures, we aim to provide a reliable and efficient webhook service that minimizes any potential disruptions to our client's operations.
Attributes and headers are two important components of a webhook payload. Attributes are key-value pairs that provide additional information about the event that triggered the webhook.
Following are the Webhook attributes for Loop.
Headers, on the other hand, are pieces of information sent along with the payload to provide additional context or instructions for how the payload should be processed.
Following are the Webhook headers for Loop.
Webhook can be created in Loop for the following topics from object types - "Subscription", "Order", "Customer's Payment Method" and "Flows".
You can list your Webhook topics here
Sample response:
How to subscribe to Webhooks?
You can subscribe to a webhook subscription by specifying both an address and a topic.
Sample response of Subscribe Webhook :
How to unsubscribe from a Webhook?
You can unsubscribe from a webhook subscription using the Loop webhook subscription id.
Sample response of Unsubscribe Webhook :
Q: How will I know that incoming webhooks are sent from Loop?
A: Loop webhook headers will always begin with "X-Loop-Webhook-{{variable_name}}".
Q: Can I use regular HTTP for my webhooks connections?
A: No, you must use a secure HTTPS connection in order to connect to our webhooks.
There is no need to worry. We are here to assist you. Please contact us at support@loopwork.co or feel free to reach out to us through the chat by clicking on the support beacon located at the bottom right corner.
Regards,
Loop Subscription Team 🙂
This article details the use of Webhooks with Loop and how you can leverage the same for your store.
Contents of the article
- How can Webhooks help?
- How to respond to a Webhook?
- What are Webhook attributes/headers?
- Supported webhooks
- List Webhook topics
- How to subscribe/unsubscribe webhook?
- FAQs
- Need help?
How can webhooks help?
Webhooks help stay in sync with the activities that matter most to you and automate actions based on those events. By subscribing to webhooks, you can receive notifications about specific events and use the data payload from the event to trigger custom logic. Overall, webhooks provide a reliable and efficient way to integrate with the Loop system and streamline your workflow.
How to respond to a webhook?
In order to confirm the receipt of data through your webhook, it is important to send a response with a status code in the 200 range, indicating success. If the response falls outside this range, it will signal that the webhook was not received.
Our system has been designed to include a 5-second time-out period for all webhook requests. If a response is not received within this timeframe, the request is considered to have failed.
To ensure that webhook requests are properly processed, our system will automatically retry failed requests over the next 48 hours. However, if a request continues to fail during each retry attempt, our system will take appropriate action and delete the webhook request.
By implementing these measures, we aim to provide a reliable and efficient webhook service that minimizes any potential disruptions to our client's operations.
What are webhook attributes/headers?
Attributes and headers are two important components of a webhook payload. Attributes are key-value pairs that provide additional information about the event that triggered the webhook.
Following are the Webhook attributes for Loop.
Attribute | Description |
---|---|
id | Unique numeric identifier for the webhook. |
address | The URI where the webhook should send the POST request when the event occurs. |
topic | The event that will trigger the webhook. |
version | The version of the API used to populate the body of the webhook. |
Headers, on the other hand, are pieces of information sent along with the payload to provide additional context or instructions for how the payload should be processed.
Following are the Webhook headers for Loop.
Header | Description |
---|---|
X-Loop-Webhook-Id | The unique id to identify duplicate entries |
X-Loop-Webhook-Api-Version | API version of the payload/webhook |
X-Loop-Webhook-Topic | Topic of the webhook e.g., 'subscription/cancelled' |
X-Loop-Webhook-Created-At | Date time string when the event was created (remains same in every retry) |
X-Loop-Webhook-Delivery-At | Date time string when the webhook is being delivered (also can be referred to as the time when it was retried) |
X-Loop-Webhook-Retry-Count | Number of retries/tries done |
Supported webhooks
Webhook can be created in Loop for the following topics from object types - "Subscription", "Order", "Customer's Payment Method" and "Flows".
Subscription topics
Topics | Trigger Explanation |
---|---|
Subscription/created | This event will be triggered when a subscription is created. |
subscription/paused | This event will be triggered when a subscription is paused. |
subscription/updated | This event will be triggered when a subscription is updated. |
subscription/cancelled | This event will be triggered when a subscription is cancelled. |
subscription/resumed | This event will be triggered when a subscription is resumed. |
subscription/reactivated | This event will be triggered when a subscription is reactivated. |
subscription/delayed | This event will be triggered when a subscription is delayed. |
subscription/rescheduled | This event will be triggered when a subscription is rescheduled. |
subscription/expired | This event will be triggered when a subscription is expired. |
Order topics
Topics | Trigger Explanation |
---|---|
order/upcoming | Triggered before processing an order. |
order/processed | Triggered when order is processed. |
order/partiallyProcessed | Triggered when order is partially processed due to low inventory levels. |
order/outOfStock | Triggered when order is out of stock. |
order/skipped | Triggered when customer skipped an order. |
order/unskipped | Triggered when customer un-skipped an order. |
order/paymentFailed | Triggered when customer payment on an order is failed. |
Customer's Payment Method
Topics | Trigger Explanation |
---|---|
paymentMethod/updateRequested | Triggered when a customer request's payment method update request from Loop. |
paymentMethod/updated | Triggered when customer's payment method is updated. |
paymentMethod/expiringSoon | Triggered when customer payment method is about to expire (3 days, 15 days, 30 days before payment method expiring). |
Flows
Topics | Trigger Explanation |
---|---|
flow/completed | Triggered when a flow is successfully completed. |
List webhook topics
You can list your Webhook topics here
Sample response:
{
"success": true,
"message": "Fetched available topics",
"data": [
"subscription/created",
"subscription/paused",
"subscription/cancelled",
"subscription/resumed",
"subscription/reactivated",
"subscription/expired"
]
}
How to subscribe / unsubscribe Webhook ?
How to subscribe to Webhooks?
You can subscribe to a webhook subscription by specifying both an address and a topic.
Sample response of Subscribe Webhook :
{
"success": true,
"message": "Successfully subscribed to the topic",
"data": {
"uuid": "533690245e3d47a683463304bf319136",
"topic": "subscription/cancelled",
"status": "ACTIVE",
"version": "2022-10",
"myshopifyDomain": "aug26-v2release.myshopify.com"
}
}
How to unsubscribe from a Webhook?
You can unsubscribe from a webhook subscription using the Loop webhook subscription id.
Sample response of Unsubscribe Webhook :
{
"success": true,
"message": "Successfully unsubscribed from the topic",
"data": {}
}
FAQs
Q: How will I know that incoming webhooks are sent from Loop?
A: Loop webhook headers will always begin with "X-Loop-Webhook-{{variable_name}}".
Q: Can I use regular HTTP for my webhooks connections?
A: No, you must use a secure HTTPS connection in order to connect to our webhooks.
Need help?
There is no need to worry. We are here to assist you. Please contact us at support@loopwork.co or feel free to reach out to us through the chat by clicking on the support beacon located at the bottom right corner.
Regards,
Loop Subscription Team 🙂
Updated on: 10/07/2024
Thank you!