# Loop Returns — Pipedream Connect

> The best return experience, for your customers and for your team.

- API slug: `loop_returns` (use in MCP headers and tool keys)
- Auth: API key (Pipedream-managed)
- Categories: Commerce
- Website: https://www.loopreturns.com/
- This page (HTML): https://pipedream.com/apps/loop-returns
- Tools: 3 actions · 3 triggers

## Connect via MCP (recommended)

- Endpoint: `https://remote.mcp.pipedream.net/v3`
- Headers: `Authorization: Bearer <token>` · `x-pd-project-id` · `x-pd-environment` · `x-pd-external-user-id` · `x-pd-app-slug: loop_returns`

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "loop_returns",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// e.g. run Cancel Return:
const result = await mcp.callTool({
  name: "loop_returns-cancel-return",
  arguments: {
    returnId: "Return ID",
  },
})
```

Docs: [MCP guide](https://pipedream.com/docs/connect/mcp/developers.md)

## API proxy

For a Loop Returns endpoint with no pre-built tool, the proxy forwards your request with the connected user's credentials attached.

```bash
# The path segment is the target URL, URL-safe base64 encoded:
# https://api.loopreturns.com/api/v1/allowlists

curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9hcGkubG9vcHJldHVybnMuY29tL2FwaS92MS9hbGxvd2xpc3Rz?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
  -H "Authorization: Bearer {access_token}" \
  -H "x-pd-environment: production"
```

Docs: [API proxy guide](https://pipedream.com/docs/connect/api-proxy.md)

## SDK

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "loop_returns-cancel-return",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    loop_returns: { authProvisionId: "apn_xxxxxxx" },
    returnId: "Return ID",
  },
})
```

Docs: [Managed auth guide](https://pipedream.com/docs/connect/managed-auth/quickstart.md) · [Tools guide](https://pipedream.com/docs/connect/components.md)

## Actions (3)

### `loop_returns-cancel-return` — Cancel Return (Write)

Cancels a pending return request in Loop. See the documentation

Full schema: https://pipedream.com/apps/loop-returns/actions/cancel-return.md

### `loop_returns-flag-return` — Flag Return (Write)

Flags a particular return as important inside Loop. Requires return ID as a mandatory prop. See the documentation

Full schema: https://pipedream.com/apps/loop-returns/actions/flag-return.md

### `loop_returns-process-return` — Process Return (Write)

Starts the processing of a return inside Loop. Return ID is a required prop to initiate the process. See the documentation

Full schema: https://pipedream.com/apps/loop-returns/actions/process-return.md

## Triggers (3)

### `loop_returns-label-updated-instant` — Label Updated (Instant) (Instant)

Emit new event when a label is updated. See the documentation

Full schema: https://pipedream.com/apps/loop-returns/triggers/label-updated-instant.md

### `loop_returns-return-created-instant` — New Return Created (Instant) (Instant)

Emit new event when a new return is created. See the documentation

Full schema: https://pipedream.com/apps/loop-returns/triggers/return-created-instant.md

### `loop_returns-return-status-updated-instant` — Return Status Updated (Instant) (Instant)

Emit new event when the status of a return has been updated. See the documentation

Full schema: https://pipedream.com/apps/loop-returns/triggers/return-status-updated-instant.md

---

- All apps: https://pipedream.com/apps — index: https://pipedream.com/llms.txt
- Pipedream docs for agents: https://pipedream.com/docs/llms.txt
