# Update Return Location — Returnista

> Updates an existing return location for an account. All fields are optional — provide only the ones you want to change. At least one field must be provided. To find the return location ID, use Get Return Locations. Use a two-letter ISO…

- Key: `returnista-update-return-location`
- Type: Action (Write)
- Version: 0.0.3
- App: Returnista (`returnista`) — https://pipedream.com/apps/returnista.md
- This page (HTML): https://pipedream.com/apps/returnista/actions/update-return-location
- Hints: open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/returnista/actions/update-return-location/update-return-location.mjs

## Description

Updates an existing return location for an account. All fields are optional — provide only the ones you want to change. At least one field must be provided. To find the return location ID, use **Get Return Locations**. Use a two-letter ISO 3166-1 alpha-2 country code for `countryCode` (e.g., `NL`, `DE`, `GB`, `US`). [See the documentation](https://platform.returnista.com/reference/rest-api/#patch-/account/-accountId/return-location/-returnLocationId)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `accountId` | `string` | Yes | The unique identifier of your Returnista account. Find this in the Returnista dashboard under account settings. |
| `returnLocationId` | `string` | Yes | The ID of the return location. Use Get Return Locations to find IDs. Options are loaded from the connected account. |
| `name` | `string` | No | The name of the return location |
| `companyName` | `string` | No | The company name associated with the return location |
| `street` | `string` | No | The street of the return location |
| `houseNumber` | `string` | No | The house number of the return location |
| `suffix` | `string` | No | The suffix of the return location address |
| `city` | `string` | No | The city of the return location |
| `postalCode` | `string` | No | The postal code of the return location |
| `countryCode` | `string` | No | The ISO 3166-1 alpha-2 country code of the return location (e.g., NL, DE, GB, US) |
| `stateProvinceCode` | `string` | No | The state or province code of the return location |
| `attention` | `string` | No | The attention line for the return location, typically used to direct the return to a specific department or individual |
| `phoneNumber` | `string` | No | The phone number associated with the return location (e.g., +31201234567) |
| `contactName` | `string` | No | A contact person's name associated with the return location |

## 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": "returnista",
      },
    },
  },
)

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: "returnista-update-return-location",
  arguments: {
    accountId: "Account ID",
    returnLocationId: "Return Location ID",
  },
})
```

**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: "returnista-update-return-location",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    returnista: { authProvisionId: "apn_xxxxxxx" },
    accountId: "Account ID",
    returnLocationId: "Return Location ID",
  },
})

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": "returnista-update-return-location",
    "configured_props": {
      "returnista": { "authProvisionId": "apn_xxxxxxx" },
      "accountId": "Account ID",
      "returnLocationId": "Return Location ID"
    }
  }'
```

---

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