How it works
Loop sends Order Protection a webhook when a subscription is created, cancelled, about to bill, or billed. For each subscription:- If the originating order had Order Protection on it, we start tracking the subscription and keep Order Protection on it automatically.
- If the customer turns Order Protection on in the Loop customer portal, we add it to their next order right away, and to every order after that while it stays on. Turning it off removes it from the next order right away.
- Before each order bills, when Loop sends its upcoming order notification, we add Order Protection to that order as a one-time line, priced from your Order Protection price tiers.
- Otherwise, nothing changes. Loop bills the subscription exactly as it did before.
Requirements
- A Loop Pro plan. Admin API tokens are only available on Pro.
- Access to Loop’s customer portal Custom JS (theme settings), to show the Order Protection toggle to subscribers.
Installation
Generate a Loop Admin API token
- Subscription contracts: read and write
- Orders: read
- Webhooks: read and write
Generate a Loop webhook secret
Connect Loop in Order Protection
- Paste the token into Admin API Token.
- Paste the secret into Webhook Secret.
- Click Save.
LOOPWORK_TOKEN_INVALID;
check the scopes above and that your Loop plan is Pro.Check Loop's upcoming-order lead time
Create the Subscription Widget in Order Protection
Add the Order Protection toggle to the Loop customer portal
- In Layout, click + Add section to create a custom section.
Set its HTML ID to
op-loopworkand add a short heading such as Order Protection. Drag it to where the toggle should appear on the subscription page, for example above Next order. - Open the Custom JS panel and paste the following, replacing
the shop domain with your store’s
.myshopify.comdomain:
- Click Publish changes.
op-loopwork section on each
subscription’s page. Custom JS only runs on the published portal,
not in the theme editor’s preview, so open a subscription from the
live customer portal to see it.anchorSelector setting inserts the toggle next to your section
instead.- Subscriptions whose originating order had Order Protection keep it on every renewal automatically.
- Any subscriber can turn Order Protection on or off from the subscription page in the Loop customer portal. Their next order reflects the change immediately.
What gets added (and what doesn’t)
- Subscriptions that started with Order Protection, or that the customer opted in: Order Protection is added to each upcoming order as a one-time line. The price comes from your Order Protection price tiers, based on the order’s merchandise subtotal (shipping and Order Protection itself excluded), and the toggle shows the same price that will be charged.
- Subscriptions that didn’t start with Order Protection and aren’t opted in: nothing changes.
- Cancelled subscriptions: Order Protection stops being added as soon as Loop sends the cancellation webhook.
- Turning the integration off in Order Protection stops Order Protection from being added and removes its Loop webhooks. Protection already added to a subscriber’s next order stays on that order unless the subscriber turns it off in the portal.
Webhook events Order Protection listens for
Troubleshooting
Saving the integration fails with LOOPWORK_TOKEN_INVALID
Saving the integration fails with LOOPWORK_TOKEN_INVALID
Saving the integration fails with LOOPWORK_WEBHOOK_SECRET_REQUIRED
Saving the integration fails with LOOPWORK_WEBHOOK_SECRET_REQUIRED
The toggle isn't showing in the Loop customer portal
The toggle isn't showing in the Loop customer portal
- The theme changes were published. Custom JS doesn’t run in the editor preview.
- The custom section’s HTML ID is exactly
op-loopwork, and the Custom JSanchorSelectormatches it. - The
shopvalue in Custom JS is your.myshopify.comdomain. - Your store’s widget bundle is live. The snippet loads
cdn.orderprotection.com/subscriptions-widget/<your-store>/widget.js, where<your-store>is the part of your Shopify domain before.myshopify.com:
200 OK means the bundle is live. On 404, your Onboarding &
Implementation manager can trigger a Cart Deployment from the Order
Protection admin dashboard to build it.A subscriber turned Order Protection on but a renewal didn't include it
A subscriber turned Order Protection on but a renewal didn't include it
The toggle renders with default styling
The toggle renders with default styling

