# Create RMA Link — Monta

> Create an RMA (return merchandise authorization) link for an order, so a customer can start a return. Review existing returns for the order with List Order Returns. See the documentation

- Key: `monta-create-rma-link`
- Type: Action (Write)
- Version: 0.0.2
- App: Monta (`monta`) — https://pipedream.com/apps/monta.md
- This page (HTML): https://pipedream.com/apps/monta/actions/create-rma-link
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/monta/actions/create-rma-link/create-rma-link.mjs

## Description

Create an RMA (return merchandise authorization) link for an order, so a customer can start a return. Review existing returns for the order with **List Order Returns**. [See the documentation](https://api-v6.monta.nl/index.html#tag/Order/paths/~1order~1%7Bwebshoporderid%7D~1rmalinks/post)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `orderId` | `string` | Yes | The ID of an order. Use the List Order ID Options action to discover order IDs. Options are loaded from the connected account. |
| `url` | `string` | No | The URL of the RMA link (e.g. https://returns.example.com/rma/abc) |
| `validUntil` | `string` | No | The expiry date and time of the RMA link in ISO 8601 format (e.g. 2026-07-31T23:59:59Z) |
| `isWarranty` | `boolean` | No | Whether the RMA link is for a warranty claim |
| `isFree` | `boolean` | No | Whether the return is free of charge |
| `guid` | `string` | No | A unique identifier for the RMA link. Leave blank to let Monta generate one, or supply your own UUID (e.g. 123e4567-e89b-12d3-a456-426614174000) |

## Run it

**MCP**

```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": "monta",
      },
    },
  },
)

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

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "monta-create-rma-link",
  arguments: {
    orderId: "Order ID",
    url: "URL",
  },
})
```

**TypeScript**

```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: "monta-create-rma-link",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    monta: { authProvisionId: "apn_xxxxxxx" },
    orderId: "Order ID",
    url: "URL",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "monta-create-rma-link",
    "configured_props": {
      "monta": { "authProvisionId": "apn_xxxxxxx" },
      "orderId": "Order ID",
      "url": "URL"
    }
  }'
```

---

- App: https://pipedream.com/apps/monta.md · All apps: https://pipedream.com/apps
