Loop Returns: returns and exchanges, orders, customers, destinations, labels, fraud reports and webhooks.
Loop Returns ships in the w6w first-party pack. It declares 30 actions, 3 health checks, and the host runs its code in a sandbox that never sees the credential.
io.w6w.loop-returnsLoop Returns runs the returns and exchanges experience for Shopify merchants. This app drives the Loop API from a workflow.
List and fetch returns, then act on them: process, cancel, flag, close, remove line items, read and add notes, generate a label, or report a return as fraudulent. Pull the advanced shipping notice for warehouse reconciliation, create return deep links and QR codes for a customer’s order, and check which items on an order are still eligible to return.
Read orders and customers held in Loop, upsert customers, list warehouse and donation destinations, inspect label requests and bulk operations, and subscribe webhooks so a workflow reacts to return events instead of polling.
It authenticates with a Loop API key sent as the X-Authorization header; the key’s scopes decide which actions work. Order writes, product, collection, inventory, listing and location data, draft returns, cart and Checkout+ APIs are not part of this app.
Three routes to the same 30 actions. The Workflow tab is generated from Loop Returns's own manifest and carries its real ids, so it is copy-pasteable; the Code and CLI examples are the same call for any action on any app, so every app-specific value in them is a blank you fill in.
bulk-operation-list List bulk operations (file imports of orders, products and more), cursor-paginated.
customer-get-by-external-id Fetch one customer by the id they carry in your own system.
customer-upsert Create a customer, or update the one that already has this external ID.
destination-list List the warehouse and donation destinations returns can be routed to.
fraud-report-create Report a return as fraudulent, with an optional category and comment.
label-request-list List label requests (third-party label integrations), filterable by return, status and time.
order-get-by-external-id Fetch one order by the id it carries in your own system.
order-return-eligibility Look up which items on an order are still eligible to be returned.
return-asn-report Pull the packages in a date range with their tracking status, plus order and return information.
return-close Close a return without fulfilling its outcomes (no exchange, no gift card).
return-deep-link-create Create a link that opens a customer's order directly in Loop's returns portal.
return-list List returns created (or updated) in a time window, newest page first, with cursor pagination.
return-process Queue a return for processing: archive it and fulfil its remaining outcomes (exchange orders, gift cards).
return-qr-create Create a QR code image link that opens a customer's order in Loop's returns portal.
return-remove-line-items Remove line items from an open refund or store-credit return.
webhook-list List webhook subscriptions, whether created through the API or in Loop Admin.
A workflow step names the app and the action, and the editor fills in the
connection when you pick one. This is the Step shape from the
workflow spec, carrying Loop Returns's real ids.
{
"manifestVersion": "2",
"name": "loop-returns-example",
"steps": [
{
"id": "customer-get",
"uses": {
"app": "io.w6w.loop-returns",
"action": "customer-get",
"connection": "conn_YOUR_CONNECTION_ID"
},
"with": {
"customerId": "<customerId>"
}
}
]
}customer-get bulk-operation-list customer-get-by-external-id customer-list customer-upsert +25 more actions available
Every app-specific value here is a blank you have to fill in. An
app action is reached through the connection that authenticates it, so the
address is a connection id, not the app id — and connections belong to your account,
so a public page cannot know yours. Create one for Loop Returns, then fill in
the three blanks: conn_YOUR_CONNECTION_ID, the action key, and the
parameters that action declares. The call itself is real — the shape is transcribed
from the studio's own snippet builder, which prints the same kind of blanks — but
nothing in it is specific to Loop Returns. The Workflow tab is where this app's
real ids are.
npm install @w6w/sdkyarn add @w6w/sdkpnpm add @w6w/sdkdeno add npm:@w6w/sdkimport { W6wClient, isActionRun } from "@w6w/sdk";
// Reads W6W_BASE_URL and W6W_TOKEN from the environment when omitted.
const client = new W6wClient();
const envelope = await client.run({
urn: "conn_YOUR_CONNECTION_ID",
action: "customer-get",
payload: {
customerId: "<value>",
},
});
if (isActionRun(envelope)) console.log(envelope.value); npm install -g @w6w/cli w6w run conn_YOUR_CONNECTION_ID --action customer-get --payload '{"customerId":"<value>"}' Give an AI agent Loop Returns — without giving it Loop Returns's credentials. One MCP endpoint exposes every app, function and workflow the caller is entitled to, as tools it can discover and run. Access is granted per team while we onboard.
One tool call{
"name": "w6w_invoke",
"arguments": {
"ref": "app:io.w6w.loop-returns#customer-get",
"input": {
"customerId": "<customerId>"
}
}
}
Every tool names its target with a single ref. The
app: form above doesn't name a connection at all — the
host resolves which of the caller's Loop Returns connections to sign
with, and refuses rather than guesses when the answer is ambiguous.
The token is attached host-side, at the moment of the call. It is never a tool argument, never in the model's context, and never in a transcript — so a prompt injection has nothing to exfiltrate.
Tools are derived per end user from what that person has actually connected and is entitled to — not one shared bot identity carrying the union of everyone's access.
Multi-step work runs on the workflow engine and returns a run handle the agent can poll — retries, branching and state survive the conversation that started them.
Loop Returns's declared health checks are on the surface too, so an agent can tell "the vendor is down" from "your credential expired" before it burns a retry on either.
The MCP surface is part of the hosted platform. Loop Returns itself is MIT, and the runtime that executes it is source-available (FSL).
Loop Returns declares its own checks, so its health is a property of the app rather than something the host guesses at.
Unsigned GET https://api.loopreturns.com/api/v1/webhooks. Loop's gateway answers a schema-correct JSON 401 (GEN-UNAUTHORIZED) when the API is serving; an HTML body or a 5xx is not the API.