From cb1e69cdc886d6dd9074a7d9851dabcb135485f3 Mon Sep 17 00:00:00 2001 From: Vigneshwaran Kannan Date: Mon, 8 Jun 2026 12:09:38 +0530 Subject: [PATCH 01/16] feat(returnista): add MCP-optimized actions for returns and order management Adds 5 new list/process actions and refactors 6 existing actions with improved prop descriptions, optional parameters, and structured response summaries for LLM usability. Updates app.mjs with paginated methods and new API endpoints. Co-Authored-By: Claude Sonnet 4.6 --- .../create-return-location.mjs | 30 ++++--- .../get-consumer-purchases.mjs | 16 ++-- .../get-return-order-emails.mjs | 20 +++-- .../get-return-order/get-return-order.mjs | 22 +++-- .../get-return-request/get-return-request.mjs | 14 +-- .../list-return-locations.mjs | 39 ++++++++ .../list-return-orders/list-return-orders.mjs | 90 +++++++++++++++++++ .../list-return-reasons.mjs | 31 +++++++ .../list-return-requests.mjs | 60 +++++++++++++ .../process-draft-return-order.mjs | 52 +++++++++++ .../update-return-location.mjs | 40 ++++----- components/returnista/package.json | 2 +- components/returnista/returnista.app.mjs | 90 +++++++++---------- 13 files changed, 397 insertions(+), 109 deletions(-) create mode 100644 components/returnista/actions/list-return-locations/list-return-locations.mjs create mode 100644 components/returnista/actions/list-return-orders/list-return-orders.mjs create mode 100644 components/returnista/actions/list-return-reasons/list-return-reasons.mjs create mode 100644 components/returnista/actions/list-return-requests/list-return-requests.mjs create mode 100644 components/returnista/actions/process-draft-return-order/process-draft-return-order.mjs diff --git a/components/returnista/actions/create-return-location/create-return-location.mjs b/components/returnista/actions/create-return-location/create-return-location.mjs index 113601f938aa7..f74b744bb505c 100644 --- a/components/returnista/actions/create-return-location/create-return-location.mjs +++ b/components/returnista/actions/create-return-location/create-return-location.mjs @@ -3,14 +3,20 @@ import returnista from "../../returnista.app.mjs"; export default { key: "returnista-create-return-location", name: "Create Return Location", - description: "Creates a new return location for the given account. [See the documentation](https://platform.returnista.com/reference/rest-api/#post-/account/-accountId/return-location)", - version: "0.0.1", + description: "Creates a new return location (warehouse or depot address) for an account." + + " Return locations are the physical addresses where consumers send returned items." + + " All address fields (street, houseNumber, city, postalCode, countryCode) are required." + + " Use a two-letter ISO 3166-1 alpha-2 country code for `countryCode` (e.g., `NL`, `DE`, `GB`, `US`)." + + " To see existing locations, use **List Return Locations**." + + " To update a location after creation, use **Update Return Location** with the returned ID." + + " [See the documentation](https://platform.returnista.com/reference/rest-api/#post-/account/-accountId/return-location)", + version: "0.0.2", + type: "action", annotations: { destructiveHint: false, openWorldHint: true, readOnlyHint: false, }, - type: "action", props: { returnista, accountId: { @@ -25,6 +31,12 @@ export default { "name", ], }, + companyName: { + propDefinition: [ + returnista, + "companyName", + ], + }, street: { propDefinition: [ returnista, @@ -42,7 +54,6 @@ export default { returnista, "suffix", ], - optional: true, }, city: { propDefinition: [ @@ -67,20 +78,12 @@ export default { returnista, "stateProvinceCode", ], - optional: true, - }, - companyName: { - propDefinition: [ - returnista, - "companyName", - ], }, attention: { propDefinition: [ returnista, "attention", ], - optional: true, }, phoneNumber: { propDefinition: [ @@ -93,7 +96,6 @@ export default { returnista, "contactName", ], - optional: true, }, }, async run({ $ }) { @@ -117,7 +119,7 @@ export default { contactName: this.contactName, }, }); - $.export("$summary", `Successfully created return location with ID: ${response.id}`); + $.export("$summary", `Successfully created return location "${this.name}" with ID: ${response.id}`); return response; }, }; diff --git a/components/returnista/actions/get-consumer-purchases/get-consumer-purchases.mjs b/components/returnista/actions/get-consumer-purchases/get-consumer-purchases.mjs index 4a5db150bcf4b..53712b0cebf55 100644 --- a/components/returnista/actions/get-consumer-purchases/get-consumer-purchases.mjs +++ b/components/returnista/actions/get-consumer-purchases/get-consumer-purchases.mjs @@ -3,14 +3,17 @@ import returnista from "../../returnista.app.mjs"; export default { key: "returnista-get-consumer-purchases", name: "Get Consumer Purchases", - description: "Get consumer purchases. [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/consumer/-consumerId/purchases)", - version: "0.0.1", + description: "Gets the purchase history for a consumer by their consumer ID." + + " Useful for support workflows to understand what a consumer has purchased before they initiated a return." + + " To find a consumer ID, use **List Return Orders** with `expand: [\"consumer\"]` on a related return order — the consumer object will include the ID." + + " [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/consumer/-consumerId/purchases)", + version: "0.0.2", + type: "action", annotations: { destructiveHint: false, openWorldHint: true, readOnlyHint: true, }, - type: "action", props: { returnista, consumerId: { @@ -21,11 +24,14 @@ export default { }, }, async run({ $ }) { - const { data: response } = await this.returnista.getConsumerPurchases({ + const response = await this.returnista.getConsumerPurchases({ $, consumerId: this.consumerId, }); - $.export("$summary", `Successfully retrieved ${response.length} consumer purchases`); + const purchases = response?.data ?? (Array.isArray(response) + ? response + : []); + $.export("$summary", `Retrieved ${purchases.length} purchase(s) for consumer ${this.consumerId}`); return response; }, }; diff --git a/components/returnista/actions/get-return-order-emails/get-return-order-emails.mjs b/components/returnista/actions/get-return-order-emails/get-return-order-emails.mjs index 8811477ed57dc..d5d0bc975b9a8 100644 --- a/components/returnista/actions/get-return-order-emails/get-return-order-emails.mjs +++ b/components/returnista/actions/get-return-order-emails/get-return-order-emails.mjs @@ -3,14 +3,17 @@ import returnista from "../../returnista.app.mjs"; export default { key: "returnista-get-return-order-emails", name: "Get Return Order Emails", - description: "Returns emails related to a return order. [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/account/-accountId/return-orders/emails)", - version: "0.0.1", + description: "Gets all email communications associated with a return order." + + " Useful for support and audit workflows to see what emails were sent to the consumer during the return process." + + " To find a return order ID, use **List Return Orders** first." + + " [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/account/-accountId/return-orders/emails)", + version: "0.0.2", + type: "action", annotations: { destructiveHint: false, openWorldHint: true, readOnlyHint: true, }, - type: "action", props: { returnista, accountId: { @@ -23,20 +26,19 @@ export default { propDefinition: [ returnista, "returnOrderId", - ({ accountId }) => ({ - accountId, - }), ], }, }, async run({ $ }) { - const { data: response } = await this.returnista.getReturnOrderEmails({ + const response = await this.returnista.getReturnOrderEmails({ $, accountId: this.accountId, returnOrderId: this.returnOrderId, }); - - $.export("$summary", `Successfully retrieved ${response.length} return order emails`); + const emails = response?.data ?? (Array.isArray(response) + ? response + : []); + $.export("$summary", `Retrieved ${emails.length} email(s) for return order ${this.returnOrderId}`); return response; }, }; diff --git a/components/returnista/actions/get-return-order/get-return-order.mjs b/components/returnista/actions/get-return-order/get-return-order.mjs index 1e86c994a3e03..5d16db5b6fc26 100644 --- a/components/returnista/actions/get-return-order/get-return-order.mjs +++ b/components/returnista/actions/get-return-order/get-return-order.mjs @@ -3,14 +3,18 @@ import returnista from "../../returnista.app.mjs"; export default { key: "returnista-get-return-order", name: "Get Return Order", - description: "Gets a return order by ID. [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/account/-accountId/return-order/-id)", - version: "0.0.1", + description: "Gets the full details of a single return order by ID." + + " Use `expand` to inline related objects (consumer, shipments, returnRequests) in one call instead of making separate requests." + + " To find a return order ID, use **List Return Orders** first." + + " To view the email communications for a return order, use **Get Return Order Emails**." + + " [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/account/-accountId/return-order/-id)", + version: "0.0.2", + type: "action", annotations: { destructiveHint: false, openWorldHint: true, readOnlyHint: true, }, - type: "action", props: { returnista, accountId: { @@ -23,9 +27,12 @@ export default { propDefinition: [ returnista, "returnOrderId", - ({ accountId }) => ({ - accountId, - }), + ], + }, + expand: { + propDefinition: [ + returnista, + "expand", ], }, }, @@ -34,6 +41,9 @@ export default { $, accountId: this.accountId, returnOrderId: this.returnOrderId, + params: { + expand: this.expand, + }, }); $.export("$summary", `Successfully retrieved return order ${this.returnOrderId}`); return response; diff --git a/components/returnista/actions/get-return-request/get-return-request.mjs b/components/returnista/actions/get-return-request/get-return-request.mjs index cc534617db104..377e999589ebc 100644 --- a/components/returnista/actions/get-return-request/get-return-request.mjs +++ b/components/returnista/actions/get-return-request/get-return-request.mjs @@ -3,14 +3,17 @@ import returnista from "../../returnista.app.mjs"; export default { key: "returnista-get-return-request", name: "Get Return Request", - description: "Gets a return request by ID. [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/account/-accountId-/return-request/-id-)", - version: "0.0.1", + description: "Gets the full details of a single return request by ID." + + " Return requests contain item-level information: purchase order number, return reason, requested resolution (refund, exchange, etc.)." + + " To find a return request ID, use **List Return Requests** first." + + " [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/account/-accountId-/return-request/-id-)", + version: "0.0.2", + type: "action", annotations: { destructiveHint: false, openWorldHint: true, readOnlyHint: true, }, - type: "action", props: { returnista, accountId: { @@ -23,9 +26,6 @@ export default { propDefinition: [ returnista, "returnRequestId", - ({ accountId }) => ({ - accountId, - }), ], }, }, @@ -35,7 +35,7 @@ export default { accountId: this.accountId, returnRequestId: this.returnRequestId, }); - $.export("$summary", `Successfully retrieved return request with ID: ${this.returnRequestId}`); + $.export("$summary", `Successfully retrieved return request ${this.returnRequestId}`); return response; }, }; diff --git a/components/returnista/actions/list-return-locations/list-return-locations.mjs b/components/returnista/actions/list-return-locations/list-return-locations.mjs new file mode 100644 index 0000000000000..3b6ca9c1b0230 --- /dev/null +++ b/components/returnista/actions/list-return-locations/list-return-locations.mjs @@ -0,0 +1,39 @@ +import returnista from "../../returnista.app.mjs"; + +export default { + key: "returnista-list-return-locations", + name: "List Return Locations", + description: "Lists all return locations (warehouse or depot addresses) configured for an account." + + " Return locations are the physical addresses where consumers send returned items." + + " Use this tool to discover available location IDs before creating or updating a location." + + " To create a new return location, use **Create Return Location**." + + " To update an existing location, pass the location ID to **Update Return Location**." + + " [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/account/-accountId/return-locations)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + returnista, + accountId: { + propDefinition: [ + returnista, + "accountId", + ], + }, + }, + async run({ $ }) { + const response = await this.returnista.getReturnLocations({ + $, + accountId: this.accountId, + }); + const locations = response?.data ?? (Array.isArray(response) + ? response + : []); + $.export("$summary", `Retrieved ${locations.length} return location(s)`); + return response; + }, +}; diff --git a/components/returnista/actions/list-return-orders/list-return-orders.mjs b/components/returnista/actions/list-return-orders/list-return-orders.mjs new file mode 100644 index 0000000000000..0cbde5fddc167 --- /dev/null +++ b/components/returnista/actions/list-return-orders/list-return-orders.mjs @@ -0,0 +1,90 @@ +import returnista from "../../returnista.app.mjs"; + +export default { + key: "returnista-list-return-orders", + name: "List Return Orders", + description: "Lists and searches return orders for an account, with support for filtering, searching, sorting, pagination, and response expansion." + + " Use this tool to find return orders by status, purchase order number, consumer name, or date range." + + " This tool replaces both get-return-orders and get-draft-return-orders — do NOT use those legacy tools." + + " To list draft return orders specifically, set the `filter` parameter to `status:draft`." + + " To accept or reject a draft return order, use **Process Draft Return Order** with the order ID." + + " To get full details of a specific order (including shipments and consumer info), use the returned ID with **Get Return Order**." + + " Filter syntax: use `:` for equality (`purchaseOrderNumber:12345`, `status:draft`), and `>`, `<`, `>=`, `<=` for dates (`createdAt>2024-01-01T00:00:00Z`)." + + " [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/account/-accountId/return-orders)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + returnista, + accountId: { + propDefinition: [ + returnista, + "accountId", + ], + }, + filter: { + propDefinition: [ + returnista, + "filter", + ], + }, + search: { + propDefinition: [ + returnista, + "search", + ], + }, + sortBy: { + propDefinition: [ + returnista, + "sortBy", + ], + }, + orderBy: { + propDefinition: [ + returnista, + "orderBy", + ], + }, + limit: { + propDefinition: [ + returnista, + "limit", + ], + }, + page: { + propDefinition: [ + returnista, + "page", + ], + }, + expand: { + propDefinition: [ + returnista, + "expand", + ], + }, + }, + async run({ $ }) { + const response = await this.returnista.getReturnOrders({ + $, + accountId: this.accountId, + params: { + filter: this.filter, + search: this.search, + sortBy: this.sortBy, + orderBy: this.orderBy, + limit: this.limit, + page: this.page, + expand: this.expand, + }, + }); + const orders = response?.data ?? []; + $.export("$summary", `Retrieved ${orders.length} return order(s)`); + return response; + }, +}; diff --git a/components/returnista/actions/list-return-reasons/list-return-reasons.mjs b/components/returnista/actions/list-return-reasons/list-return-reasons.mjs new file mode 100644 index 0000000000000..f8b456ba87cdb --- /dev/null +++ b/components/returnista/actions/list-return-reasons/list-return-reasons.mjs @@ -0,0 +1,31 @@ +import returnista from "../../returnista.app.mjs"; + +export default { + key: "returnista-list-return-reasons", + name: "List Return Reasons", + description: "Lists all configured return reasons in Returnista." + + " Return reasons are the catalog of options consumers can select when initiating a return (e.g., 'Wrong size', 'Damaged', 'Changed my mind')." + + " No account ID is required — return reasons are shared across the platform." + + " Use this tool to discover available reason IDs and their descriptions before filtering return requests by reason." + + " [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/return-reasons)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + returnista, + }, + async run({ $ }) { + const response = await this.returnista.getReturnReasons({ + $, + }); + const reasons = Array.isArray(response) + ? response + : (response?.data ?? []); + $.export("$summary", `Retrieved ${reasons.length} return reason(s)`); + return response; + }, +}; diff --git a/components/returnista/actions/list-return-requests/list-return-requests.mjs b/components/returnista/actions/list-return-requests/list-return-requests.mjs new file mode 100644 index 0000000000000..218f2e718256d --- /dev/null +++ b/components/returnista/actions/list-return-requests/list-return-requests.mjs @@ -0,0 +1,60 @@ +import returnista from "../../returnista.app.mjs"; + +export default { + key: "returnista-list-return-requests", + name: "List Return Requests", + description: "Lists return requests for an account with optional filtering and pagination." + + " Return requests are item-level records representing individual products a consumer wants to return (purchase order number, return reason, requested resolution)." + + " Multiple return requests can belong to a single return order." + + " To get the full details of a specific return request, use the returned ID with **Get Return Request**." + + " Filter syntax: use `:` for equality (`purchaseOrderNumber:12345`) and `>`, `<`, `>=`, `<=` for dates (`createdAt>2024-01-01T00:00:00Z`)." + + " [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/account/-accountId-/return-requests)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + returnista, + accountId: { + propDefinition: [ + returnista, + "accountId", + ], + }, + filter: { + propDefinition: [ + returnista, + "filter", + ], + }, + limit: { + propDefinition: [ + returnista, + "limit", + ], + }, + page: { + propDefinition: [ + returnista, + "page", + ], + }, + }, + async run({ $ }) { + const response = await this.returnista.getReturnRequests({ + $, + accountId: this.accountId, + params: { + filter: this.filter, + limit: this.limit, + page: this.page, + }, + }); + const requests = response?.data ?? []; + $.export("$summary", `Retrieved ${requests.length} return request(s)`); + return response; + }, +}; diff --git a/components/returnista/actions/process-draft-return-order/process-draft-return-order.mjs b/components/returnista/actions/process-draft-return-order/process-draft-return-order.mjs new file mode 100644 index 0000000000000..3a7cfe857587e --- /dev/null +++ b/components/returnista/actions/process-draft-return-order/process-draft-return-order.mjs @@ -0,0 +1,52 @@ +import returnista from "../../returnista.app.mjs"; + +export default { + key: "returnista-process-draft-return-order", + name: "Process Draft Return Order", + description: "Accepts or rejects a draft return order." + + " Draft return orders are created when a consumer initiates a return and are pending merchant review." + + " Set `action` to `accept` to approve the return (this triggers shipment label creation) or `reject` to decline it." + + " Use **List Return Orders** with `filter: \"status:draft\"` to find draft order IDs." + + " [See the documentation](https://platform.returnista.com/reference/rest-api/#put-/account/-accountId/draft-return-order/-id/accept)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + props: { + returnista, + accountId: { + propDefinition: [ + returnista, + "accountId", + ], + }, + draftReturnOrderId: { + propDefinition: [ + returnista, + "draftReturnOrderId", + ], + }, + action: { + type: "string", + label: "Action", + description: "Whether to accept or reject the draft return order. `accept` approves the return and triggers shipment label creation. `reject` declines the return.", + options: [ + "accept", + "reject", + ], + }, + }, + async run({ $ }) { + const response = await this.returnista.processDraftReturnOrder({ + $, + accountId: this.accountId, + draftReturnOrderId: this.draftReturnOrderId, + action: this.action, + }); + $.export("$summary", `Successfully ${this.action}ed draft return order ${this.draftReturnOrderId}`); + return response; + }, +}; diff --git a/components/returnista/actions/update-return-location/update-return-location.mjs b/components/returnista/actions/update-return-location/update-return-location.mjs index f0ab10aca61a6..3f87f9e79a400 100644 --- a/components/returnista/actions/update-return-location/update-return-location.mjs +++ b/components/returnista/actions/update-return-location/update-return-location.mjs @@ -4,14 +4,19 @@ import returnista from "../../returnista.app.mjs"; export default { key: "returnista-update-return-location", name: "Update Return Location", - description: "Updates a return location for the given account. [See the documentation](https://platform.returnista.com/reference/rest-api/#patch-/account/-accountId/return-location/-returnLocationId)", - version: "0.0.1", + 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 **List 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)", + version: "0.0.2", + type: "action", annotations: { destructiveHint: false, openWorldHint: true, readOnlyHint: false, }, - type: "action", props: { returnista, accountId: { @@ -24,9 +29,6 @@ export default { propDefinition: [ returnista, "returnLocationId", - ({ accountId }) => ({ - accountId, - }), ], }, name: { @@ -36,6 +38,13 @@ export default { ], optional: true, }, + companyName: { + propDefinition: [ + returnista, + "companyName", + ], + optional: true, + }, street: { propDefinition: [ returnista, @@ -55,7 +64,6 @@ export default { returnista, "suffix", ], - optional: true, }, city: { propDefinition: [ @@ -83,21 +91,12 @@ export default { returnista, "stateProvinceCode", ], - optional: true, - }, - companyName: { - propDefinition: [ - returnista, - "companyName", - ], - optional: true, }, attention: { propDefinition: [ returnista, "attention", ], - optional: true, }, phoneNumber: { propDefinition: [ @@ -111,7 +110,6 @@ export default { returnista, "contactName", ], - optional: true, }, }, async run({ $ }) { @@ -132,9 +130,11 @@ export default { if (this.stateProvinceCode) returnAddress.stateProvinceCode = this.stateProvinceCode; if (!Object.keys(data).length && !Object.keys(returnAddress).length) { - throw new ConfigurationError("At least one field must be provided"); + throw new ConfigurationError("At least one field must be provided to update"); + } + if (Object.keys(returnAddress).length > 0) { + data.returnAddress = returnAddress; } - if (Object.keys(returnAddress).length > 0) data.returnAddress = returnAddress; const response = await this.returnista.updateReturnLocation({ $, @@ -142,7 +142,7 @@ export default { returnLocationId: this.returnLocationId, data, }); - $.export("$summary", `Successfully updated return location with ID: ${this.returnLocationId}`); + $.export("$summary", `Successfully updated return location ${this.returnLocationId}`); return response; }, }; diff --git a/components/returnista/package.json b/components/returnista/package.json index 6a7c77d7a3561..75c6641df5ce1 100644 --- a/components/returnista/package.json +++ b/components/returnista/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/returnista", - "version": "0.1.0", + "version": "0.1.1", "description": "Pipedream Returnista Components", "main": "returnista.app.mjs", "keywords": [ diff --git a/components/returnista/returnista.app.mjs b/components/returnista/returnista.app.mjs index 826b2bffe8181..0d4b2737eb882 100644 --- a/components/returnista/returnista.app.mjs +++ b/components/returnista/returnista.app.mjs @@ -13,7 +13,7 @@ export default { accountId: { type: "string", label: "Account ID", - description: "The ID of the account", + description: "The ID of the Returnista account", }, limit: { type: "integer", @@ -36,13 +36,13 @@ export default { filter: { type: "string", label: "Filter", - description: "A filter to apply to the results. Supports filtering by purchaseOrderNumber, status, createdAt, updatedAt, store, and other fields. For date filters, use operators: >, <, >=, <= (e.g., createdAt>2024-05-24T12:05:15.264Z). For other filters, use colon format (e.g., purchaseOrderNumber:12345)", + description: "A filter to apply to the results. Supports filtering by purchaseOrderNumber, status, createdAt, updatedAt, store, and other fields. For date filters, use operators: >, <, >=, <= (e.g., `createdAt>2024-05-24T12:05:15.264Z`). For other filters, use colon format (e.g., `purchaseOrderNumber:12345` or `status:draft`)", optional: true, }, search: { type: "string", label: "Search", - description: "A search string to filter the results. Searches across purchase order numbers, consumer first name, last name, email, and consumer full name. Examples: search=12345 ┃ search=john@example.com", + description: "A search string to filter the results. Searches across purchase order numbers, consumer first name, last name, email, and consumer full name. Examples: `search=12345` | `search=john@example.com`", optional: true, }, sortBy: { @@ -68,16 +68,23 @@ export default { returnOrderId: { type: "string", label: "Return Order ID", - description: "The ID of the return order", - async options({ accountId }) { - const { data } = await this.getReturnOrders({ - accountId, - }); - return data.map(({ id }) => ({ - label: `Return Order ID: ${id}`, - value: id, - })); - }, + description: "The ID of the return order. Use **List Return Orders** to find IDs.", + }, + draftReturnOrderId: { + type: "string", + label: "Draft Return Order ID", + description: "The ID of the draft return order. Use **List Return Orders** with `filter: \"status:draft\"` to find draft order IDs.", + }, + expand: { + type: "string[]", + label: "Expand", + description: "Related objects to inline in the response. Select one or more to enrich the result without additional API calls.", + options: [ + "consumer", + "shipments", + "returnRequests", + ], + optional: true, }, name: { type: "string", @@ -97,7 +104,8 @@ export default { suffix: { type: "string", label: "Suffix", - description: "The suffix of the return location", + description: "The suffix of the return location address", + optional: true, }, city: { type: "string", @@ -112,67 +120,46 @@ export default { countryCode: { type: "string", label: "Country Code", - description: "The country code of the return location", + description: "The ISO 3166-1 alpha-2 country code of the return location (e.g., `NL`, `DE`, `GB`, `US`)", options: COUNTRY_CODE_OPTIONS, }, stateProvinceCode: { type: "string", - label: "State Province Code", - description: "The state province code of the return location", + label: "State/Province Code", + description: "The state or province code of the return location", + optional: true, }, companyName: { type: "string", label: "Company Name", - description: "The company name associated with the Return Location", + description: "The company name associated with the return location", }, attention: { type: "string", label: "Attention", - description: "The attention line for the Return Location. This is typically used to direct the return to a specific department or individual within the organization", + description: "The attention line for the return location, typically used to direct the return to a specific department or individual", + optional: true, }, phoneNumber: { type: "string", label: "Phone Number", - description: "The phone number associated with the Return Location", + description: "The phone number associated with the return location (e.g., `+31201234567`)", }, contactName: { type: "string", label: "Contact Name", - description: "A contact name associated with the Return Location", + description: "A contact person's name associated with the return location", + optional: true, }, returnLocationId: { type: "string", label: "Return Location ID", - description: "The ID of the return location to get", - async options({ accountId }) { - const { data: returnLocations = [] } = await this.getReturnLocations({ - accountId, - }); - return returnLocations.map(({ - id, name, - }) => ({ - label: `${name} (${id})`, - value: id, - })); - }, + description: "The ID of the return location. Use **List Return Locations** to find IDs.", }, returnRequestId: { type: "string", label: "Return Request ID", - description: "The ID of the return request to get", - async options({ accountId }) { - const { data: returnRequests = [] } = await this.getReturnRequests({ - accountId, - }); - return returnRequests.map(({ - id, purchaseOrderNumber, returnReasonComment, - }) => ({ - label: `${purchaseOrderNumber}${returnReasonComment - ? ` - ${returnReasonComment}` - : ""}`, - value: id, - })); - }, + description: "The ID of the return request. Use **List Return Requests** to find IDs.", }, }, methods: { @@ -283,6 +270,15 @@ export default { ...opts, }); }, + processDraftReturnOrder({ + accountId, draftReturnOrderId, action, ...opts + }) { + return this._makeRequest({ + method: "PUT", + path: `/account/${accountId}/draft-return-order/${draftReturnOrderId}/${action}`, + ...opts, + }); + }, createWebhook({ accountId, ...opts }) { From 3fdf9373056126d805347ab51f7bc59377a0cf20 Mon Sep 17 00:00:00 2001 From: Vigneshwaran Kannan Date: Tue, 9 Jun 2026 14:46:19 +0530 Subject: [PATCH 02/16] new component addition and removal of newly added component for list new component addition and removal of newly added component for list --- .../create-draft-return-order.mjs | 92 +++++++++++++++++++ .../list-return-locations.mjs | 39 -------- .../list-return-orders/list-return-orders.mjs | 90 ------------------ .../list-return-reasons.mjs | 31 ------- .../list-return-requests.mjs | 60 ------------ .../resend-confirmation-email.mjs | 39 ++++++++ components/returnista/returnista.app.mjs | 62 +++++++++++++ 7 files changed, 193 insertions(+), 220 deletions(-) create mode 100644 components/returnista/actions/create-draft-return-order/create-draft-return-order.mjs delete mode 100644 components/returnista/actions/list-return-locations/list-return-locations.mjs delete mode 100644 components/returnista/actions/list-return-orders/list-return-orders.mjs delete mode 100644 components/returnista/actions/list-return-reasons/list-return-reasons.mjs delete mode 100644 components/returnista/actions/list-return-requests/list-return-requests.mjs create mode 100644 components/returnista/actions/resend-confirmation-email/resend-confirmation-email.mjs diff --git a/components/returnista/actions/create-draft-return-order/create-draft-return-order.mjs b/components/returnista/actions/create-draft-return-order/create-draft-return-order.mjs new file mode 100644 index 0000000000000..38affd411a7dd --- /dev/null +++ b/components/returnista/actions/create-draft-return-order/create-draft-return-order.mjs @@ -0,0 +1,92 @@ +import returnista from "../../returnista.app.mjs"; + +export default { + key: "returnista-create-draft-return-order", + name: "Create Draft Return Order", + description: "Creates a new draft return order for a consumer." + + " Draft return orders are pending merchant review before being accepted or rejected." + + " Use **Process Draft Return Order** to accept or reject the created draft." + + " [See the documentation](https://platform.returnista.com/reference/rest-api/#post-/consumer/-consumerId-/draft-return-order)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + props: { + returnista, + consumerId: { + propDefinition: [ + returnista, + "consumerId", + ], + }, + purchaseId: { + propDefinition: [ + returnista, + "purchaseId", + ], + }, + returnReasonId: { + propDefinition: [ + returnista, + "returnReasonId", + ], + }, + returnReasonComment: { + propDefinition: [ + returnista, + "returnReasonComment", + ], + }, + resolutionType: { + propDefinition: [ + returnista, + "resolutionType", + ], + }, + exchangeProductId: { + propDefinition: [ + returnista, + "exchangeProductId", + ], + }, + exchangeOptionSku: { + propDefinition: [ + returnista, + "exchangeOptionSku", + ], + }, + answers: { + propDefinition: [ + returnista, + "answers", + ], + }, + }, + async run({ $ }) { + const answers = Array.isArray(this.answers) + ? this.answers.map((a) => JSON.parse(a)) + : undefined; + const response = await this.returnista.createDraftReturnOrder({ + $, + consumerId: this.consumerId, + data: { + selectedPurchases: [ + { + purchaseId: this.purchaseId, + returnReasonId: this.returnReasonId || null, + returnReasonComment: this.returnReasonComment, + resolutionType: this.resolutionType, + answers, + exchangeProductId: this.exchangeProductId, + exchangeOptionSku: this.exchangeOptionSku, + }, + ], + }, + }); + $.export("$summary", `Successfully created draft return order for consumer ${this.consumerId}`); + return response; + }, +}; diff --git a/components/returnista/actions/list-return-locations/list-return-locations.mjs b/components/returnista/actions/list-return-locations/list-return-locations.mjs deleted file mode 100644 index 3b6ca9c1b0230..0000000000000 --- a/components/returnista/actions/list-return-locations/list-return-locations.mjs +++ /dev/null @@ -1,39 +0,0 @@ -import returnista from "../../returnista.app.mjs"; - -export default { - key: "returnista-list-return-locations", - name: "List Return Locations", - description: "Lists all return locations (warehouse or depot addresses) configured for an account." - + " Return locations are the physical addresses where consumers send returned items." - + " Use this tool to discover available location IDs before creating or updating a location." - + " To create a new return location, use **Create Return Location**." - + " To update an existing location, pass the location ID to **Update Return Location**." - + " [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/account/-accountId/return-locations)", - version: "0.0.1", - type: "action", - annotations: { - destructiveHint: false, - openWorldHint: true, - readOnlyHint: true, - }, - props: { - returnista, - accountId: { - propDefinition: [ - returnista, - "accountId", - ], - }, - }, - async run({ $ }) { - const response = await this.returnista.getReturnLocations({ - $, - accountId: this.accountId, - }); - const locations = response?.data ?? (Array.isArray(response) - ? response - : []); - $.export("$summary", `Retrieved ${locations.length} return location(s)`); - return response; - }, -}; diff --git a/components/returnista/actions/list-return-orders/list-return-orders.mjs b/components/returnista/actions/list-return-orders/list-return-orders.mjs deleted file mode 100644 index 0cbde5fddc167..0000000000000 --- a/components/returnista/actions/list-return-orders/list-return-orders.mjs +++ /dev/null @@ -1,90 +0,0 @@ -import returnista from "../../returnista.app.mjs"; - -export default { - key: "returnista-list-return-orders", - name: "List Return Orders", - description: "Lists and searches return orders for an account, with support for filtering, searching, sorting, pagination, and response expansion." - + " Use this tool to find return orders by status, purchase order number, consumer name, or date range." - + " This tool replaces both get-return-orders and get-draft-return-orders — do NOT use those legacy tools." - + " To list draft return orders specifically, set the `filter` parameter to `status:draft`." - + " To accept or reject a draft return order, use **Process Draft Return Order** with the order ID." - + " To get full details of a specific order (including shipments and consumer info), use the returned ID with **Get Return Order**." - + " Filter syntax: use `:` for equality (`purchaseOrderNumber:12345`, `status:draft`), and `>`, `<`, `>=`, `<=` for dates (`createdAt>2024-01-01T00:00:00Z`)." - + " [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/account/-accountId/return-orders)", - version: "0.0.1", - type: "action", - annotations: { - destructiveHint: false, - openWorldHint: true, - readOnlyHint: true, - }, - props: { - returnista, - accountId: { - propDefinition: [ - returnista, - "accountId", - ], - }, - filter: { - propDefinition: [ - returnista, - "filter", - ], - }, - search: { - propDefinition: [ - returnista, - "search", - ], - }, - sortBy: { - propDefinition: [ - returnista, - "sortBy", - ], - }, - orderBy: { - propDefinition: [ - returnista, - "orderBy", - ], - }, - limit: { - propDefinition: [ - returnista, - "limit", - ], - }, - page: { - propDefinition: [ - returnista, - "page", - ], - }, - expand: { - propDefinition: [ - returnista, - "expand", - ], - }, - }, - async run({ $ }) { - const response = await this.returnista.getReturnOrders({ - $, - accountId: this.accountId, - params: { - filter: this.filter, - search: this.search, - sortBy: this.sortBy, - orderBy: this.orderBy, - limit: this.limit, - page: this.page, - expand: this.expand, - }, - }); - const orders = response?.data ?? []; - $.export("$summary", `Retrieved ${orders.length} return order(s)`); - return response; - }, -}; diff --git a/components/returnista/actions/list-return-reasons/list-return-reasons.mjs b/components/returnista/actions/list-return-reasons/list-return-reasons.mjs deleted file mode 100644 index f8b456ba87cdb..0000000000000 --- a/components/returnista/actions/list-return-reasons/list-return-reasons.mjs +++ /dev/null @@ -1,31 +0,0 @@ -import returnista from "../../returnista.app.mjs"; - -export default { - key: "returnista-list-return-reasons", - name: "List Return Reasons", - description: "Lists all configured return reasons in Returnista." - + " Return reasons are the catalog of options consumers can select when initiating a return (e.g., 'Wrong size', 'Damaged', 'Changed my mind')." - + " No account ID is required — return reasons are shared across the platform." - + " Use this tool to discover available reason IDs and their descriptions before filtering return requests by reason." - + " [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/return-reasons)", - version: "0.0.1", - type: "action", - annotations: { - destructiveHint: false, - openWorldHint: true, - readOnlyHint: true, - }, - props: { - returnista, - }, - async run({ $ }) { - const response = await this.returnista.getReturnReasons({ - $, - }); - const reasons = Array.isArray(response) - ? response - : (response?.data ?? []); - $.export("$summary", `Retrieved ${reasons.length} return reason(s)`); - return response; - }, -}; diff --git a/components/returnista/actions/list-return-requests/list-return-requests.mjs b/components/returnista/actions/list-return-requests/list-return-requests.mjs deleted file mode 100644 index 218f2e718256d..0000000000000 --- a/components/returnista/actions/list-return-requests/list-return-requests.mjs +++ /dev/null @@ -1,60 +0,0 @@ -import returnista from "../../returnista.app.mjs"; - -export default { - key: "returnista-list-return-requests", - name: "List Return Requests", - description: "Lists return requests for an account with optional filtering and pagination." - + " Return requests are item-level records representing individual products a consumer wants to return (purchase order number, return reason, requested resolution)." - + " Multiple return requests can belong to a single return order." - + " To get the full details of a specific return request, use the returned ID with **Get Return Request**." - + " Filter syntax: use `:` for equality (`purchaseOrderNumber:12345`) and `>`, `<`, `>=`, `<=` for dates (`createdAt>2024-01-01T00:00:00Z`)." - + " [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/account/-accountId-/return-requests)", - version: "0.0.1", - type: "action", - annotations: { - destructiveHint: false, - openWorldHint: true, - readOnlyHint: true, - }, - props: { - returnista, - accountId: { - propDefinition: [ - returnista, - "accountId", - ], - }, - filter: { - propDefinition: [ - returnista, - "filter", - ], - }, - limit: { - propDefinition: [ - returnista, - "limit", - ], - }, - page: { - propDefinition: [ - returnista, - "page", - ], - }, - }, - async run({ $ }) { - const response = await this.returnista.getReturnRequests({ - $, - accountId: this.accountId, - params: { - filter: this.filter, - limit: this.limit, - page: this.page, - }, - }); - const requests = response?.data ?? []; - $.export("$summary", `Retrieved ${requests.length} return request(s)`); - return response; - }, -}; diff --git a/components/returnista/actions/resend-confirmation-email/resend-confirmation-email.mjs b/components/returnista/actions/resend-confirmation-email/resend-confirmation-email.mjs new file mode 100644 index 0000000000000..88e8ad54bb7ca --- /dev/null +++ b/components/returnista/actions/resend-confirmation-email/resend-confirmation-email.mjs @@ -0,0 +1,39 @@ +import returnista from "../../returnista.app.mjs"; + +export default { + key: "returnista-resend-confirmation-email", + name: "Resend Confirmation Email", + description: "Resends the confirmation email for a return order." + + " [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/account/-accountId/return-order/-id/resend-confirmation-email)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: false, + }, + props: { + returnista, + accountId: { + propDefinition: [ + returnista, + "accountId", + ], + }, + returnOrderId: { + propDefinition: [ + returnista, + "returnOrderId", + ], + }, + }, + async run({ $ }) { + const response = await this.returnista.resendConfirmationEmail({ + $, + accountId: this.accountId, + returnOrderId: this.returnOrderId, + }); + $.export("$summary", `Successfully resent confirmation email for return order ${this.returnOrderId}`); + return response; + }, +}; diff --git a/components/returnista/returnista.app.mjs b/components/returnista/returnista.app.mjs index 0d4b2737eb882..1be8edd532ccc 100644 --- a/components/returnista/returnista.app.mjs +++ b/components/returnista/returnista.app.mjs @@ -161,6 +161,51 @@ export default { label: "Return Request ID", description: "The ID of the return request. Use **List Return Requests** to find IDs.", }, + purchaseId: { + type: "string", + label: "Purchase ID", + description: "The ID of the purchase to return. Use **Get Consumer Purchases** to find purchase IDs.", + }, + returnReasonId: { + type: "string", + label: "Return Reason ID", + description: "The UUID of the return reason. Use **Get Return Reasons** to find available IDs. Leave blank to submit without a reason (sends `null`).", + }, + returnReasonComment: { + type: "string", + label: "Return Reason Comment", + description: "An optional free-text comment explaining the return reason.", + optional: true, + }, + resolutionType: { + type: "string", + label: "Resolution Type", + description: "The desired resolution type for the return.", + options: [ + "Refund", + "Exchange", + "StoreCredit", + ], + optional: true, + }, + exchangeProductId: { + type: "string", + label: "Exchange Product ID", + description: "The ID of the product to exchange for. Typically required when `resolutionType` is `Exchange`.", + optional: true, + }, + exchangeOptionSku: { + type: "string", + label: "Exchange Option SKU", + description: "The SKU of the product variant to exchange for. Typically required when `resolutionType` is `Exchange`.", + optional: true, + }, + answers: { + type: "string[]", + label: "Answers", + description: "Array of form field answers for the return questionnaire. Each entry must be a JSON string with `formField` (object with `id`, `type`, `required`, `position`, `options`) and an `answer` value (string, array of strings, or array of file objects with `mimeType` and `url`) [here](https://platform.returnista.com/reference/rest-api/#post-/consumer/-consumerId-/draft-return-order)", + optional: true, + }, }, methods: { _baseUrl() { @@ -190,6 +235,15 @@ export default { ...opts, }); }, + createDraftReturnOrder({ + consumerId, ...opts + }) { + return this._makeRequest({ + method: "POST", + path: `/consumer/${consumerId}/draft-return-order`, + ...opts, + }); + }, getDraftReturnOrders({ accountId, ...opts }) { @@ -214,6 +268,14 @@ export default { ...opts, }); }, + resendConfirmationEmail({ + accountId, returnOrderId, ...opts + }) { + return this._makeRequest({ + path: `/account/${accountId}/return-order/${returnOrderId}/resend-confirmation-email`, + ...opts, + }); + }, getReturnOrder({ accountId, returnOrderId, ...opts }) { From ccbaea54748b8676ebe316c44eb233fd1b141609 Mon Sep 17 00:00:00 2001 From: Vigneshwaran Kannan Date: Tue, 9 Jun 2026 14:59:04 +0530 Subject: [PATCH 03/16] version update version update --- .../actions/get-draft-return-orders/get-draft-return-orders.mjs | 2 +- .../actions/get-return-locations/get-return-locations.mjs | 2 +- .../returnista/actions/get-return-orders/get-return-orders.mjs | 2 +- .../actions/get-return-reasons/get-return-reasons.mjs | 2 +- .../actions/get-return-requests/get-return-requests.mjs | 2 +- .../new-return-order-created-instant.mjs | 2 +- .../new-shipment-label-created-instant.mjs | 2 +- .../return-order-completed-instant.mjs | 2 +- .../return-order-confirmed-instant.mjs | 2 +- .../sales-order-approved-or-denied-instant.mjs | 2 +- .../shipment-received-tracking-updates-instant.mjs | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/components/returnista/actions/get-draft-return-orders/get-draft-return-orders.mjs b/components/returnista/actions/get-draft-return-orders/get-draft-return-orders.mjs index ce03bd93d2fbc..803b19dd082ba 100644 --- a/components/returnista/actions/get-draft-return-orders/get-draft-return-orders.mjs +++ b/components/returnista/actions/get-draft-return-orders/get-draft-return-orders.mjs @@ -6,7 +6,7 @@ export default { key: "returnista-get-draft-return-orders", name: "Get Draft Return Orders", description: "Gets a list of draft return orders for the given account. [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/account/-accountId-/draft-return-orders)", - version: "0.0.1", + version: "0.0.2", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/returnista/actions/get-return-locations/get-return-locations.mjs b/components/returnista/actions/get-return-locations/get-return-locations.mjs index f51d8e71409b0..5e77de8fda78f 100644 --- a/components/returnista/actions/get-return-locations/get-return-locations.mjs +++ b/components/returnista/actions/get-return-locations/get-return-locations.mjs @@ -4,7 +4,7 @@ export default { key: "returnista-get-return-locations", name: "Get Return Locations", description: "Gets a list of return locations for the given account. [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/account/-accountId/return-locations)", - version: "0.0.1", + version: "0.0.2", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/returnista/actions/get-return-orders/get-return-orders.mjs b/components/returnista/actions/get-return-orders/get-return-orders.mjs index 7bb5535964764..97de040c0307d 100644 --- a/components/returnista/actions/get-return-orders/get-return-orders.mjs +++ b/components/returnista/actions/get-return-orders/get-return-orders.mjs @@ -4,7 +4,7 @@ export default { key: "returnista-get-return-orders", name: "Get Return Orders", description: "Gets a list of return orders for the given account. [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/account/-accountId/return-orders)", - version: "0.0.1", + version: "0.0.2", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/returnista/actions/get-return-reasons/get-return-reasons.mjs b/components/returnista/actions/get-return-reasons/get-return-reasons.mjs index fc433b6f0aebf..20c7af276ea7c 100644 --- a/components/returnista/actions/get-return-reasons/get-return-reasons.mjs +++ b/components/returnista/actions/get-return-reasons/get-return-reasons.mjs @@ -4,7 +4,7 @@ export default { key: "returnista-get-return-reasons", name: "Get Return Reasons", description: "Gets a list of return reasons for the given account. [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/return-reasons)", - version: "0.0.1", + version: "0.0.2", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/returnista/actions/get-return-requests/get-return-requests.mjs b/components/returnista/actions/get-return-requests/get-return-requests.mjs index fad3fe713af19..e811d1178bc29 100644 --- a/components/returnista/actions/get-return-requests/get-return-requests.mjs +++ b/components/returnista/actions/get-return-requests/get-return-requests.mjs @@ -4,7 +4,7 @@ export default { key: "returnista-get-return-requests", name: "Get Return Requests", description: "Gets a list of return requests for the given account. [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/account/-accountId-/return-requests)", - version: "0.0.1", + version: "0.0.2", annotations: { destructiveHint: false, openWorldHint: true, diff --git a/components/returnista/sources/new-return-order-created-instant/new-return-order-created-instant.mjs b/components/returnista/sources/new-return-order-created-instant/new-return-order-created-instant.mjs index 7cc74230e41b6..7ffad4efb5a08 100644 --- a/components/returnista/sources/new-return-order-created-instant/new-return-order-created-instant.mjs +++ b/components/returnista/sources/new-return-order-created-instant/new-return-order-created-instant.mjs @@ -6,7 +6,7 @@ export default { key: "returnista-new-return-order-created-instant", name: "New Return Order Created (Instant)", description: "Emit new event when a new return order is created. [See the documentation](https://platform.returnista.com/reference/rest-api/#post-/account/-accountId/webhook-subscription)", - version: "0.0.1", + version: "0.0.2", type: "source", dedupe: "unique", methods: { diff --git a/components/returnista/sources/new-shipment-label-created-instant/new-shipment-label-created-instant.mjs b/components/returnista/sources/new-shipment-label-created-instant/new-shipment-label-created-instant.mjs index ee833d36785e3..3a1e061bbb4a3 100644 --- a/components/returnista/sources/new-shipment-label-created-instant/new-shipment-label-created-instant.mjs +++ b/components/returnista/sources/new-shipment-label-created-instant/new-shipment-label-created-instant.mjs @@ -6,7 +6,7 @@ export default { key: "returnista-new-shipment-label-created-instant", name: "New Shipment Label Created (Instant)", description: "Emit new event when a new shipment label is created. [See the documentation](https://platform.returnista.com/reference/rest-api/#post-/account/-accountId/webhook-subscription)", - version: "0.0.1", + version: "0.0.2", type: "source", dedupe: "unique", methods: { diff --git a/components/returnista/sources/return-order-completed-instant/return-order-completed-instant.mjs b/components/returnista/sources/return-order-completed-instant/return-order-completed-instant.mjs index 6d47507792420..e179ede2792c8 100644 --- a/components/returnista/sources/return-order-completed-instant/return-order-completed-instant.mjs +++ b/components/returnista/sources/return-order-completed-instant/return-order-completed-instant.mjs @@ -6,7 +6,7 @@ export default { key: "returnista-return-order-completed-instant", name: "Return Order Completed (Instant)", description: "Emit new event when a return order is completed. [See the documentation](https://platform.returnista.com/reference/rest-api/#post-/account/-accountId/webhook-subscription)", - version: "0.0.1", + version: "0.0.2", type: "source", dedupe: "unique", methods: { diff --git a/components/returnista/sources/return-order-confirmed-instant/return-order-confirmed-instant.mjs b/components/returnista/sources/return-order-confirmed-instant/return-order-confirmed-instant.mjs index 30041997482bf..3e0d700f7296f 100644 --- a/components/returnista/sources/return-order-confirmed-instant/return-order-confirmed-instant.mjs +++ b/components/returnista/sources/return-order-confirmed-instant/return-order-confirmed-instant.mjs @@ -6,7 +6,7 @@ export default { key: "returnista-return-order-confirmed-instant", name: "Return Order Confirmed (Instant)", description: "Emit new event when a return order is confirmed. [See the documentation](https://platform.returnista.com/reference/rest-api/#post-/account/-accountId/webhook-subscription)", - version: "0.0.1", + version: "0.0.2", type: "source", dedupe: "unique", methods: { diff --git a/components/returnista/sources/sales-order-approved-or-denied-instant/sales-order-approved-or-denied-instant.mjs b/components/returnista/sources/sales-order-approved-or-denied-instant/sales-order-approved-or-denied-instant.mjs index 172dc631657bf..14894862b3fcc 100644 --- a/components/returnista/sources/sales-order-approved-or-denied-instant/sales-order-approved-or-denied-instant.mjs +++ b/components/returnista/sources/sales-order-approved-or-denied-instant/sales-order-approved-or-denied-instant.mjs @@ -6,7 +6,7 @@ export default { key: "returnista-sales-order-approved-or-denied-instant", name: "Sales Order Approved or Denied (Instant)", description: "Emit new event when a sales order is approved or denied. [See the documentation](https://platform.returnista.com/reference/rest-api/#post-/account/-accountId/webhook-subscription)", - version: "0.0.1", + version: "0.0.2", type: "source", dedupe: "unique", methods: { diff --git a/components/returnista/sources/shipment-received-tracking-updates-instant/shipment-received-tracking-updates-instant.mjs b/components/returnista/sources/shipment-received-tracking-updates-instant/shipment-received-tracking-updates-instant.mjs index d466d832564e5..fdfd09a30fc65 100644 --- a/components/returnista/sources/shipment-received-tracking-updates-instant/shipment-received-tracking-updates-instant.mjs +++ b/components/returnista/sources/shipment-received-tracking-updates-instant/shipment-received-tracking-updates-instant.mjs @@ -6,7 +6,7 @@ export default { key: "returnista-shipment-received-tracking-updates-instant", name: "Shipment Received Tracking Updates (Instant)", description: "Emit new event when a shipment receives tracking updates. [See the documentation](https://platform.returnista.com/reference/rest-api/#post-/account/-accountId/webhook-subscription)", - version: "0.0.1", + version: "0.0.2", type: "source", dedupe: "unique", methods: { From 47418ab7f0c03b3697e4718a83c6c75f457072d8 Mon Sep 17 00:00:00 2001 From: Vigneshwaran Kannan Date: Wed, 10 Jun 2026 11:55:31 +0530 Subject: [PATCH 04/16] coderabbit review comment addressed coderabbit review comment addressed --- .../create-draft-return-order.mjs | 8 +++++++- .../create-return-location/create-return-location.mjs | 9 ++++----- .../actions/get-return-order/get-return-order.mjs | 2 +- .../update-return-location/update-return-location.mjs | 4 ++++ components/returnista/package.json | 2 +- components/returnista/returnista.app.mjs | 6 +++++- .../return-order-completed-instant.mjs | 2 +- .../return-order-confirmed-instant.mjs | 2 +- .../sales-order-approved-or-denied-instant.mjs | 2 +- .../shipment-received-tracking-updates-instant.mjs | 2 +- 10 files changed, 26 insertions(+), 13 deletions(-) diff --git a/components/returnista/actions/create-draft-return-order/create-draft-return-order.mjs b/components/returnista/actions/create-draft-return-order/create-draft-return-order.mjs index 38affd411a7dd..767da7b47f19b 100644 --- a/components/returnista/actions/create-draft-return-order/create-draft-return-order.mjs +++ b/components/returnista/actions/create-draft-return-order/create-draft-return-order.mjs @@ -86,7 +86,13 @@ export default { ], }, }); - $.export("$summary", `Successfully created draft return order for consumer ${this.consumerId}`); + const createdDraftId = response?.id ?? response?.data?.id; + $.export( + "$summary", + createdDraftId + ? `Successfully created draft return order ${createdDraftId}` + : `Successfully created draft return order for consumer ${this.consumerId}`, + ); return response; }, }; diff --git a/components/returnista/actions/create-return-location/create-return-location.mjs b/components/returnista/actions/create-return-location/create-return-location.mjs index f74b744bb505c..2b01ebedbc662 100644 --- a/components/returnista/actions/create-return-location/create-return-location.mjs +++ b/components/returnista/actions/create-return-location/create-return-location.mjs @@ -4,13 +4,12 @@ export default { key: "returnista-create-return-location", name: "Create Return Location", description: "Creates a new return location (warehouse or depot address) for an account." - + " Return locations are the physical addresses where consumers send returned items." - + " All address fields (street, houseNumber, city, postalCode, countryCode) are required." - + " Use a two-letter ISO 3166-1 alpha-2 country code for `countryCode` (e.g., `NL`, `DE`, `GB`, `US`)." - + " To see existing locations, use **List Return Locations**." + + " Required: `accountId`, `name`, `companyName`, `phoneNumber`, `street`, `houseNumber`, `city`, `postalCode`," + + " `countryCode` (ISO 3166-1 alpha-2, e.g. `NL`, `DE`, `GB`, `US`)." + + " Optional: `suffix`, `stateProvinceCode`, `attention`, `contactName`." + " To update a location after creation, use **Update Return Location** with the returned ID." + " [See the documentation](https://platform.returnista.com/reference/rest-api/#post-/account/-accountId/return-location)", - version: "0.0.2", + version: "1.0.0", type: "action", annotations: { destructiveHint: false, diff --git a/components/returnista/actions/get-return-order/get-return-order.mjs b/components/returnista/actions/get-return-order/get-return-order.mjs index 5d16db5b6fc26..7b1aabc1ed5ef 100644 --- a/components/returnista/actions/get-return-order/get-return-order.mjs +++ b/components/returnista/actions/get-return-order/get-return-order.mjs @@ -8,7 +8,7 @@ export default { + " To find a return order ID, use **List Return Orders** first." + " To view the email communications for a return order, use **Get Return Order Emails**." + " [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/account/-accountId/return-order/-id)", - version: "0.0.2", + version: "0.1.0", type: "action", annotations: { destructiveHint: false, diff --git a/components/returnista/actions/update-return-location/update-return-location.mjs b/components/returnista/actions/update-return-location/update-return-location.mjs index 3f87f9e79a400..22e0114e23f28 100644 --- a/components/returnista/actions/update-return-location/update-return-location.mjs +++ b/components/returnista/actions/update-return-location/update-return-location.mjs @@ -64,6 +64,7 @@ export default { returnista, "suffix", ], + optional: true, }, city: { propDefinition: [ @@ -91,12 +92,14 @@ export default { returnista, "stateProvinceCode", ], + optional: true, }, attention: { propDefinition: [ returnista, "attention", ], + optional: true, }, phoneNumber: { propDefinition: [ @@ -110,6 +113,7 @@ export default { returnista, "contactName", ], + optional: true, }, }, async run({ $ }) { diff --git a/components/returnista/package.json b/components/returnista/package.json index 75c6641df5ce1..95109795034bd 100644 --- a/components/returnista/package.json +++ b/components/returnista/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/returnista", - "version": "0.1.1", + "version": "1.0.0", "description": "Pipedream Returnista Components", "main": "returnista.app.mjs", "keywords": [ diff --git a/components/returnista/returnista.app.mjs b/components/returnista/returnista.app.mjs index 1be8edd532ccc..d4df01e181743 100644 --- a/components/returnista/returnista.app.mjs +++ b/components/returnista/returnista.app.mjs @@ -170,6 +170,7 @@ export default { type: "string", label: "Return Reason ID", description: "The UUID of the return reason. Use **Get Return Reasons** to find available IDs. Leave blank to submit without a reason (sends `null`).", + optional: true, }, returnReasonComment: { type: "string", @@ -203,7 +204,10 @@ export default { answers: { type: "string[]", label: "Answers", - description: "Array of form field answers for the return questionnaire. Each entry must be a JSON string with `formField` (object with `id`, `type`, `required`, `position`, `options`) and an `answer` value (string, array of strings, or array of file objects with `mimeType` and `url`) [here](https://platform.returnista.com/reference/rest-api/#post-/consumer/-consumerId-/draft-return-order)", + description: "Array of form field answers for the return questionnaire. Each entry is a stringified JSON object with `formField` and `answer`. " + + "Example entry: `{\"formField\":{\"id\":\"uuid-here\",\"type\":\"SingleChoice\",\"required\":true},\"answer\":\"value\"}`. " + + "`answer` can also be an array of strings (MultiChoice) or an array of file objects: `[{\"mimeType\":\"image/jpeg\",\"url\":\"https://...\"}]`. " + + "[See the documentation](https://platform.returnista.com/reference/rest-api/#post-/consumer/-consumerId-/draft-return-order)", optional: true, }, }, diff --git a/components/returnista/sources/return-order-completed-instant/return-order-completed-instant.mjs b/components/returnista/sources/return-order-completed-instant/return-order-completed-instant.mjs index e179ede2792c8..e8d0a54361d6a 100644 --- a/components/returnista/sources/return-order-completed-instant/return-order-completed-instant.mjs +++ b/components/returnista/sources/return-order-completed-instant/return-order-completed-instant.mjs @@ -4,7 +4,7 @@ import sampleEmit from "./test-event.mjs"; export default { ...common, key: "returnista-return-order-completed-instant", - name: "Return Order Completed (Instant)", + name: "New Return Order Completed (Instant)", description: "Emit new event when a return order is completed. [See the documentation](https://platform.returnista.com/reference/rest-api/#post-/account/-accountId/webhook-subscription)", version: "0.0.2", type: "source", diff --git a/components/returnista/sources/return-order-confirmed-instant/return-order-confirmed-instant.mjs b/components/returnista/sources/return-order-confirmed-instant/return-order-confirmed-instant.mjs index 3e0d700f7296f..c3aa23949451c 100644 --- a/components/returnista/sources/return-order-confirmed-instant/return-order-confirmed-instant.mjs +++ b/components/returnista/sources/return-order-confirmed-instant/return-order-confirmed-instant.mjs @@ -4,7 +4,7 @@ import sampleEmit from "./test-event.mjs"; export default { ...common, key: "returnista-return-order-confirmed-instant", - name: "Return Order Confirmed (Instant)", + name: "New Return Order Confirmed (Instant)", description: "Emit new event when a return order is confirmed. [See the documentation](https://platform.returnista.com/reference/rest-api/#post-/account/-accountId/webhook-subscription)", version: "0.0.2", type: "source", diff --git a/components/returnista/sources/sales-order-approved-or-denied-instant/sales-order-approved-or-denied-instant.mjs b/components/returnista/sources/sales-order-approved-or-denied-instant/sales-order-approved-or-denied-instant.mjs index 14894862b3fcc..ea2b768d43bc4 100644 --- a/components/returnista/sources/sales-order-approved-or-denied-instant/sales-order-approved-or-denied-instant.mjs +++ b/components/returnista/sources/sales-order-approved-or-denied-instant/sales-order-approved-or-denied-instant.mjs @@ -4,7 +4,7 @@ import sampleEmit from "./test-event.mjs"; export default { ...common, key: "returnista-sales-order-approved-or-denied-instant", - name: "Sales Order Approved or Denied (Instant)", + name: "New Sales Order Approved or Denied (Instant)", description: "Emit new event when a sales order is approved or denied. [See the documentation](https://platform.returnista.com/reference/rest-api/#post-/account/-accountId/webhook-subscription)", version: "0.0.2", type: "source", diff --git a/components/returnista/sources/shipment-received-tracking-updates-instant/shipment-received-tracking-updates-instant.mjs b/components/returnista/sources/shipment-received-tracking-updates-instant/shipment-received-tracking-updates-instant.mjs index fdfd09a30fc65..143bbd326a41e 100644 --- a/components/returnista/sources/shipment-received-tracking-updates-instant/shipment-received-tracking-updates-instant.mjs +++ b/components/returnista/sources/shipment-received-tracking-updates-instant/shipment-received-tracking-updates-instant.mjs @@ -4,7 +4,7 @@ import sampleEmit from "./test-event.mjs"; export default { ...common, key: "returnista-shipment-received-tracking-updates-instant", - name: "Shipment Received Tracking Updates (Instant)", + name: "New Shipment Received Tracking Updates (Instant)", description: "Emit new event when a shipment receives tracking updates. [See the documentation](https://platform.returnista.com/reference/rest-api/#post-/account/-accountId/webhook-subscription)", version: "0.0.2", type: "source", From cb5334768b86d84f720f92536a5472b461b2edb0 Mon Sep 17 00:00:00 2001 From: Vigneshwaran Kannan Date: Thu, 11 Jun 2026 17:30:26 +0530 Subject: [PATCH 05/16] fix for the coderabbbit comment fix for the coderabbbit comment --- .../actions/create-return-location/create-return-location.mjs | 4 ++++ components/returnista/returnista.app.mjs | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/components/returnista/actions/create-return-location/create-return-location.mjs b/components/returnista/actions/create-return-location/create-return-location.mjs index 2b01ebedbc662..59b5f93acd2cb 100644 --- a/components/returnista/actions/create-return-location/create-return-location.mjs +++ b/components/returnista/actions/create-return-location/create-return-location.mjs @@ -53,6 +53,7 @@ export default { returnista, "suffix", ], + optional: true, }, city: { propDefinition: [ @@ -77,12 +78,14 @@ export default { returnista, "stateProvinceCode", ], + optional: true, }, attention: { propDefinition: [ returnista, "attention", ], + optional: true, }, phoneNumber: { propDefinition: [ @@ -95,6 +98,7 @@ export default { returnista, "contactName", ], + optional: true, }, }, async run({ $ }) { diff --git a/components/returnista/returnista.app.mjs b/components/returnista/returnista.app.mjs index d4df01e181743..0bcef4134a97b 100644 --- a/components/returnista/returnista.app.mjs +++ b/components/returnista/returnista.app.mjs @@ -206,8 +206,7 @@ export default { label: "Answers", description: "Array of form field answers for the return questionnaire. Each entry is a stringified JSON object with `formField` and `answer`. " + "Example entry: `{\"formField\":{\"id\":\"uuid-here\",\"type\":\"SingleChoice\",\"required\":true},\"answer\":\"value\"}`. " - + "`answer` can also be an array of strings (MultiChoice) or an array of file objects: `[{\"mimeType\":\"image/jpeg\",\"url\":\"https://...\"}]`. " - + "[See the documentation](https://platform.returnista.com/reference/rest-api/#post-/consumer/-consumerId-/draft-return-order)", + + "`answer` can also be an array of strings (MultiChoice) or an array of file objects: `[{\"mimeType\":\"image/jpeg\",\"url\":\"https://...\"}]`.", optional: true, }, }, From bb42fa3405d0de94f0b8f08c3086de39f9e15fc6 Mon Sep 17 00:00:00 2001 From: Vigneshwaran Kannan Date: Mon, 15 Jun 2026 21:32:06 +0530 Subject: [PATCH 06/16] fix for the code review fix for the code review --- .../list-shipping-products.mjs | 26 +++++++++++++++++++ components/returnista/returnista.app.mjs | 16 ++++++++---- 2 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 components/returnista/actions/list-shipping-products/list-shipping-products.mjs diff --git a/components/returnista/actions/list-shipping-products/list-shipping-products.mjs b/components/returnista/actions/list-shipping-products/list-shipping-products.mjs new file mode 100644 index 0000000000000..e549cd4f109ef --- /dev/null +++ b/components/returnista/actions/list-shipping-products/list-shipping-products.mjs @@ -0,0 +1,26 @@ +import returnista from "../../returnista.app.mjs"; + +export default { + key: "returnista-list-shipping-products", + name: "List Shipping Products", + description: "Returns all shipping product options available in Returnista, including carrier integrations, label types, and product codes." + + " [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/shipping-products)", + version: "0.0.1", + type: "action", + annotations: { + destructiveHint: false, + openWorldHint: true, + readOnlyHint: true, + }, + props: { + returnista, + }, + async run({ $ }) { + const response = await this.returnista.getShippingProducts({ + $, + }); + const products = response?.data ?? []; + $.export("$summary", `Retrieved ${products.length} shipping product(s)`); + return products; + }, +}; diff --git a/components/returnista/returnista.app.mjs b/components/returnista/returnista.app.mjs index 0bcef4134a97b..93cb66039ab69 100644 --- a/components/returnista/returnista.app.mjs +++ b/components/returnista/returnista.app.mjs @@ -68,12 +68,12 @@ export default { returnOrderId: { type: "string", label: "Return Order ID", - description: "The ID of the return order. Use **List Return Orders** to find IDs.", + description: "The ID of the return order. Use **Get Return Orders** to find IDs.", }, draftReturnOrderId: { type: "string", label: "Draft Return Order ID", - description: "The ID of the draft return order. Use **List Return Orders** with `filter: \"status:draft\"` to find draft order IDs.", + description: "The ID of the draft return order. Use **Get Return Orders** with `filter: \"status:draft\"` to find draft order IDs.", }, expand: { type: "string[]", @@ -154,12 +154,12 @@ export default { returnLocationId: { type: "string", label: "Return Location ID", - description: "The ID of the return location. Use **List Return Locations** to find IDs.", + description: "The ID of the return location. Use **Get Return Locations** to find IDs.", }, returnRequestId: { type: "string", label: "Return Request ID", - description: "The ID of the return request. Use **List Return Requests** to find IDs.", + description: "The ID of the return request. Use **Get Return Requests** to find IDs.", }, purchaseId: { type: "string", @@ -192,7 +192,7 @@ export default { exchangeProductId: { type: "string", label: "Exchange Product ID", - description: "The ID of the product to exchange for. Typically required when `resolutionType` is `Exchange`.", + description: "The ID of the shipping product to exchange for. Typically required when `resolutionType` is `Exchange`. Use **List Shipping Products** to find available product IDs.", optional: true, }, exchangeOptionSku: { @@ -319,6 +319,12 @@ export default { ...opts, }); }, + getShippingProducts(opts = {}) { + return this._makeRequest({ + path: "/shipping-products", + ...opts, + }); + }, getReturnRequests({ accountId, ...opts }) { From 65c13763e2f25a6d901db04e88c925ceaed8d61d Mon Sep 17 00:00:00 2001 From: Vigneshwaran Kannan Date: Mon, 15 Jun 2026 22:39:04 +0530 Subject: [PATCH 07/16] Updating already existing async options for the existing props Updating already existing async options for the existing props --- .../get-return-order-emails.mjs | 3 ++ .../get-return-order/get-return-order.mjs | 3 ++ .../get-return-request/get-return-request.mjs | 3 ++ .../resend-confirmation-email.mjs | 3 ++ .../update-return-location.mjs | 3 ++ components/returnista/returnista.app.mjs | 39 +++++++++++++++++-- 6 files changed, 51 insertions(+), 3 deletions(-) diff --git a/components/returnista/actions/get-return-order-emails/get-return-order-emails.mjs b/components/returnista/actions/get-return-order-emails/get-return-order-emails.mjs index d5d0bc975b9a8..07e5ba23bde6c 100644 --- a/components/returnista/actions/get-return-order-emails/get-return-order-emails.mjs +++ b/components/returnista/actions/get-return-order-emails/get-return-order-emails.mjs @@ -26,6 +26,9 @@ export default { propDefinition: [ returnista, "returnOrderId", + (c) => ({ + accountId: c.accountId, + }), ], }, }, diff --git a/components/returnista/actions/get-return-order/get-return-order.mjs b/components/returnista/actions/get-return-order/get-return-order.mjs index 7b1aabc1ed5ef..e1e65c65ef98f 100644 --- a/components/returnista/actions/get-return-order/get-return-order.mjs +++ b/components/returnista/actions/get-return-order/get-return-order.mjs @@ -27,6 +27,9 @@ export default { propDefinition: [ returnista, "returnOrderId", + (c) => ({ + accountId: c.accountId, + }), ], }, expand: { diff --git a/components/returnista/actions/get-return-request/get-return-request.mjs b/components/returnista/actions/get-return-request/get-return-request.mjs index 377e999589ebc..584fb7e5b5e69 100644 --- a/components/returnista/actions/get-return-request/get-return-request.mjs +++ b/components/returnista/actions/get-return-request/get-return-request.mjs @@ -26,6 +26,9 @@ export default { propDefinition: [ returnista, "returnRequestId", + (c) => ({ + accountId: c.accountId, + }), ], }, }, diff --git a/components/returnista/actions/resend-confirmation-email/resend-confirmation-email.mjs b/components/returnista/actions/resend-confirmation-email/resend-confirmation-email.mjs index 88e8ad54bb7ca..7c074a9993310 100644 --- a/components/returnista/actions/resend-confirmation-email/resend-confirmation-email.mjs +++ b/components/returnista/actions/resend-confirmation-email/resend-confirmation-email.mjs @@ -24,6 +24,9 @@ export default { propDefinition: [ returnista, "returnOrderId", + (c) => ({ + accountId: c.accountId, + }), ], }, }, diff --git a/components/returnista/actions/update-return-location/update-return-location.mjs b/components/returnista/actions/update-return-location/update-return-location.mjs index 22e0114e23f28..94ffe273a5362 100644 --- a/components/returnista/actions/update-return-location/update-return-location.mjs +++ b/components/returnista/actions/update-return-location/update-return-location.mjs @@ -29,6 +29,9 @@ export default { propDefinition: [ returnista, "returnLocationId", + (c) => ({ + accountId: c.accountId, + }), ], }, name: { diff --git a/components/returnista/returnista.app.mjs b/components/returnista/returnista.app.mjs index 93cb66039ab69..79a98de6e4d16 100644 --- a/components/returnista/returnista.app.mjs +++ b/components/returnista/returnista.app.mjs @@ -68,7 +68,16 @@ export default { returnOrderId: { type: "string", label: "Return Order ID", - description: "The ID of the return order. Use **Get Return Orders** to find IDs.", + description: "The ID of the return order.", + async options({ accountId }) { + const { data } = await this.getReturnOrders({ + accountId, + }); + return data.map(({ id }) => ({ + label: `Return Order ID: ${id}`, + value: id, + })); + }, }, draftReturnOrderId: { type: "string", @@ -154,12 +163,36 @@ export default { returnLocationId: { type: "string", label: "Return Location ID", - description: "The ID of the return location. Use **Get Return Locations** to find IDs.", + description: "The ID of the return location.", + async options({ accountId }) { + const { data: returnLocations = [] } = await this.getReturnLocations({ + accountId, + }); + return returnLocations.map(({ + id, name, + }) => ({ + label: `${name} (${id})`, + value: id, + })); + }, }, returnRequestId: { type: "string", label: "Return Request ID", - description: "The ID of the return request. Use **Get Return Requests** to find IDs.", + description: "The ID of the return request.", + async options({ accountId }) { + const { data: returnRequests = [] } = await this.getReturnRequests({ + accountId, + }); + return returnRequests.map(({ + id, purchaseOrderNumber, returnReasonComment, + }) => ({ + label: `${purchaseOrderNumber}${returnReasonComment + ? ` - ${returnReasonComment}` + : ""}`, + value: id, + })); + }, }, purchaseId: { type: "string", From 5b1bd3620bafa13936fcbf25ecd392a2642ff902 Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Tue, 16 Jun 2026 10:43:57 -0400 Subject: [PATCH 08/16] Update components/returnista/returnista.app.mjs --- components/returnista/returnista.app.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/returnista/returnista.app.mjs b/components/returnista/returnista.app.mjs index 79a98de6e4d16..ace21ca69be12 100644 --- a/components/returnista/returnista.app.mjs +++ b/components/returnista/returnista.app.mjs @@ -68,7 +68,7 @@ export default { returnOrderId: { type: "string", label: "Return Order ID", - description: "The ID of the return order.", + description: "The ID of the return order. Use **Get Return Orders** to find IDs.", async options({ accountId }) { const { data } = await this.getReturnOrders({ accountId, From 6644ea6bd35c0c4058848865d2dfc8f2c7e6e15d Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Tue, 16 Jun 2026 10:44:05 -0400 Subject: [PATCH 09/16] Update components/returnista/returnista.app.mjs --- components/returnista/returnista.app.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/returnista/returnista.app.mjs b/components/returnista/returnista.app.mjs index ace21ca69be12..67bff2cbd647f 100644 --- a/components/returnista/returnista.app.mjs +++ b/components/returnista/returnista.app.mjs @@ -163,7 +163,7 @@ export default { returnLocationId: { type: "string", label: "Return Location ID", - description: "The ID of the return location.", + description: "The ID of the return location. Use **Get Return Locations** to find IDs.", async options({ accountId }) { const { data: returnLocations = [] } = await this.getReturnLocations({ accountId, From fee94bf21bf398947601610ad8b83326626dd1c5 Mon Sep 17 00:00:00 2001 From: michelle0927 Date: Tue, 16 Jun 2026 10:44:14 -0400 Subject: [PATCH 10/16] Update components/returnista/returnista.app.mjs --- components/returnista/returnista.app.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/returnista/returnista.app.mjs b/components/returnista/returnista.app.mjs index 67bff2cbd647f..f1030ae5a23bf 100644 --- a/components/returnista/returnista.app.mjs +++ b/components/returnista/returnista.app.mjs @@ -179,7 +179,7 @@ export default { returnRequestId: { type: "string", label: "Return Request ID", - description: "The ID of the return request.", + description: "The ID of the return request. Use **Get Return Requests** to find IDs.", async options({ accountId }) { const { data: returnRequests = [] } = await this.getReturnRequests({ accountId, From 53ec92eaf5530de844647638a9afafce5d372e7b Mon Sep 17 00:00:00 2001 From: Michelle Bergeron Date: Tue, 16 Jun 2026 10:54:48 -0400 Subject: [PATCH 11/16] coderabbit suggestion --- .../list-shipping-products/list-shipping-products.mjs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/returnista/actions/list-shipping-products/list-shipping-products.mjs b/components/returnista/actions/list-shipping-products/list-shipping-products.mjs index e549cd4f109ef..22df735bc795a 100644 --- a/components/returnista/actions/list-shipping-products/list-shipping-products.mjs +++ b/components/returnista/actions/list-shipping-products/list-shipping-products.mjs @@ -19,8 +19,10 @@ export default { const response = await this.returnista.getShippingProducts({ $, }); - const products = response?.data ?? []; + const products = response?.data ?? (Array.isArray(response) + ? response + : []); $.export("$summary", `Retrieved ${products.length} shipping product(s)`); - return products; + return response; }, }; From a76acdea49dfc4a2bac9f3a183f72e6137631060 Mon Sep 17 00:00:00 2001 From: Vigneshwaran Kannan Date: Tue, 30 Jun 2026 12:50:46 +0530 Subject: [PATCH 12/16] update the version update the version --- .../tracking-update-delivered-instant.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/returnista/sources/tracking-update-delivered-instant/tracking-update-delivered-instant.mjs b/components/returnista/sources/tracking-update-delivered-instant/tracking-update-delivered-instant.mjs index d105e1dd6f27b..6732a4185b08d 100644 --- a/components/returnista/sources/tracking-update-delivered-instant/tracking-update-delivered-instant.mjs +++ b/components/returnista/sources/tracking-update-delivered-instant/tracking-update-delivered-instant.mjs @@ -6,7 +6,7 @@ export default { key: "returnista-tracking-update-delivered-instant", name: "New Tracking Update Delivered (Instant)", description: "Emit new event when a tracking update is received and the shipment status changes to delivered. [See the documentation](https://platform.returnista.com/reference/webhooks/)", - version: "0.0.1", + version: "0.0.2", type: "source", dedupe: "unique", methods: { From a7883a763789ad9a3e94cd31cf4f4946da5a1ac1 Mon Sep 17 00:00:00 2001 From: Vigneshwaran Kannan Date: Tue, 30 Jun 2026 14:12:32 +0530 Subject: [PATCH 13/16] Change in the description Change in the description --- .../actions/get-consumer-purchases/get-consumer-purchases.mjs | 2 +- .../get-return-order-emails/get-return-order-emails.mjs | 4 ++-- .../returnista/actions/get-return-order/get-return-order.mjs | 2 +- .../actions/get-return-request/get-return-request.mjs | 2 +- .../process-draft-return-order/process-draft-return-order.mjs | 2 +- .../actions/update-return-location/update-return-location.mjs | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/returnista/actions/get-consumer-purchases/get-consumer-purchases.mjs b/components/returnista/actions/get-consumer-purchases/get-consumer-purchases.mjs index 53712b0cebf55..442951b4772f8 100644 --- a/components/returnista/actions/get-consumer-purchases/get-consumer-purchases.mjs +++ b/components/returnista/actions/get-consumer-purchases/get-consumer-purchases.mjs @@ -5,7 +5,7 @@ export default { name: "Get Consumer Purchases", description: "Gets the purchase history for a consumer by their consumer ID." + " Useful for support workflows to understand what a consumer has purchased before they initiated a return." - + " To find a consumer ID, use **List Return Orders** with `expand: [\"consumer\"]` on a related return order — the consumer object will include the ID." + + " To find a consumer ID, use **Get Return Orders** with `expand: [\"consumer\"]` on a related return order — the consumer object will include the ID." + " [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/consumer/-consumerId/purchases)", version: "0.0.2", type: "action", diff --git a/components/returnista/actions/get-return-order-emails/get-return-order-emails.mjs b/components/returnista/actions/get-return-order-emails/get-return-order-emails.mjs index 07e5ba23bde6c..a540293153094 100644 --- a/components/returnista/actions/get-return-order-emails/get-return-order-emails.mjs +++ b/components/returnista/actions/get-return-order-emails/get-return-order-emails.mjs @@ -5,8 +5,8 @@ export default { name: "Get Return Order Emails", description: "Gets all email communications associated with a return order." + " Useful for support and audit workflows to see what emails were sent to the consumer during the return process." - + " To find a return order ID, use **List Return Orders** first." - + " [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/account/-accountId/return-orders/emails)", + + " To find a return order ID, use **Get Return Orders** first." + + " [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/account/-accountId/return-order/-id/emails)", version: "0.0.2", type: "action", annotations: { diff --git a/components/returnista/actions/get-return-order/get-return-order.mjs b/components/returnista/actions/get-return-order/get-return-order.mjs index e1e65c65ef98f..3801a2da42435 100644 --- a/components/returnista/actions/get-return-order/get-return-order.mjs +++ b/components/returnista/actions/get-return-order/get-return-order.mjs @@ -5,7 +5,7 @@ export default { name: "Get Return Order", description: "Gets the full details of a single return order by ID." + " Use `expand` to inline related objects (consumer, shipments, returnRequests) in one call instead of making separate requests." - + " To find a return order ID, use **List Return Orders** first." + + " To find a return order ID, use **Get Return Orders** first." + " To view the email communications for a return order, use **Get Return Order Emails**." + " [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/account/-accountId/return-order/-id)", version: "0.1.0", diff --git a/components/returnista/actions/get-return-request/get-return-request.mjs b/components/returnista/actions/get-return-request/get-return-request.mjs index 584fb7e5b5e69..b308b467df78c 100644 --- a/components/returnista/actions/get-return-request/get-return-request.mjs +++ b/components/returnista/actions/get-return-request/get-return-request.mjs @@ -5,7 +5,7 @@ export default { name: "Get Return Request", description: "Gets the full details of a single return request by ID." + " Return requests contain item-level information: purchase order number, return reason, requested resolution (refund, exchange, etc.)." - + " To find a return request ID, use **List Return Requests** first." + + " To find a return request ID, use **Get Return Requests** first." + " [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/account/-accountId-/return-request/-id-)", version: "0.0.2", type: "action", diff --git a/components/returnista/actions/process-draft-return-order/process-draft-return-order.mjs b/components/returnista/actions/process-draft-return-order/process-draft-return-order.mjs index 3a7cfe857587e..3970aa08cefc7 100644 --- a/components/returnista/actions/process-draft-return-order/process-draft-return-order.mjs +++ b/components/returnista/actions/process-draft-return-order/process-draft-return-order.mjs @@ -6,7 +6,7 @@ export default { description: "Accepts or rejects a draft return order." + " Draft return orders are created when a consumer initiates a return and are pending merchant review." + " Set `action` to `accept` to approve the return (this triggers shipment label creation) or `reject` to decline it." - + " Use **List Return Orders** with `filter: \"status:draft\"` to find draft order IDs." + + " Use **Get Return Orders** with `filter: \"status:draft\"` to find draft order IDs." + " [See the documentation](https://platform.returnista.com/reference/rest-api/#put-/account/-accountId/draft-return-order/-id/accept)", version: "0.0.1", type: "action", diff --git a/components/returnista/actions/update-return-location/update-return-location.mjs b/components/returnista/actions/update-return-location/update-return-location.mjs index 94ffe273a5362..3f34dfb4e880a 100644 --- a/components/returnista/actions/update-return-location/update-return-location.mjs +++ b/components/returnista/actions/update-return-location/update-return-location.mjs @@ -7,7 +7,7 @@ export default { 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 **List Return Locations**." + + " 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)", version: "0.0.2", From 28ed987262235e3e2191abdc7a49f55955bbf726 Mon Sep 17 00:00:00 2001 From: Vigneshwaran Kannan Date: Tue, 30 Jun 2026 14:55:10 +0530 Subject: [PATCH 14/16] changes with respect to mcp changes with respect to mcp --- .../create-draft-return-order.mjs | 9 ++++++++- .../get-consumer-purchases/get-consumer-purchases.mjs | 2 +- .../get-return-order-emails/get-return-order-emails.mjs | 2 +- .../actions/get-return-order/get-return-order.mjs | 9 --------- .../list-shipping-products/list-shipping-products.mjs | 2 +- .../resend-confirmation-email.mjs | 7 ++++++- components/returnista/returnista.app.mjs | 6 +++--- 7 files changed, 20 insertions(+), 17 deletions(-) diff --git a/components/returnista/actions/create-draft-return-order/create-draft-return-order.mjs b/components/returnista/actions/create-draft-return-order/create-draft-return-order.mjs index 767da7b47f19b..4a7e293c20da0 100644 --- a/components/returnista/actions/create-draft-return-order/create-draft-return-order.mjs +++ b/components/returnista/actions/create-draft-return-order/create-draft-return-order.mjs @@ -1,3 +1,4 @@ +import { ConfigurationError } from "@pipedream/platform"; import returnista from "../../returnista.app.mjs"; export default { @@ -67,7 +68,13 @@ export default { }, async run({ $ }) { const answers = Array.isArray(this.answers) - ? this.answers.map((a) => JSON.parse(a)) + ? this.answers.map((a, index) => { + try { + return JSON.parse(a); + } catch { + throw new ConfigurationError(`answers[${index}] must be valid JSON: ${a}`); + } + }) : undefined; const response = await this.returnista.createDraftReturnOrder({ $, diff --git a/components/returnista/actions/get-consumer-purchases/get-consumer-purchases.mjs b/components/returnista/actions/get-consumer-purchases/get-consumer-purchases.mjs index 442951b4772f8..4243cb82c50d9 100644 --- a/components/returnista/actions/get-consumer-purchases/get-consumer-purchases.mjs +++ b/components/returnista/actions/get-consumer-purchases/get-consumer-purchases.mjs @@ -32,6 +32,6 @@ export default { ? response : []); $.export("$summary", `Retrieved ${purchases.length} purchase(s) for consumer ${this.consumerId}`); - return response; + return purchases; }, }; diff --git a/components/returnista/actions/get-return-order-emails/get-return-order-emails.mjs b/components/returnista/actions/get-return-order-emails/get-return-order-emails.mjs index a540293153094..7df2c4958c3c1 100644 --- a/components/returnista/actions/get-return-order-emails/get-return-order-emails.mjs +++ b/components/returnista/actions/get-return-order-emails/get-return-order-emails.mjs @@ -42,6 +42,6 @@ export default { ? response : []); $.export("$summary", `Retrieved ${emails.length} email(s) for return order ${this.returnOrderId}`); - return response; + return emails; }, }; diff --git a/components/returnista/actions/get-return-order/get-return-order.mjs b/components/returnista/actions/get-return-order/get-return-order.mjs index 3801a2da42435..7ad8b7bbd16f1 100644 --- a/components/returnista/actions/get-return-order/get-return-order.mjs +++ b/components/returnista/actions/get-return-order/get-return-order.mjs @@ -32,21 +32,12 @@ export default { }), ], }, - expand: { - propDefinition: [ - returnista, - "expand", - ], - }, }, async run({ $ }) { const response = await this.returnista.getReturnOrder({ $, accountId: this.accountId, returnOrderId: this.returnOrderId, - params: { - expand: this.expand, - }, }); $.export("$summary", `Successfully retrieved return order ${this.returnOrderId}`); return response; diff --git a/components/returnista/actions/list-shipping-products/list-shipping-products.mjs b/components/returnista/actions/list-shipping-products/list-shipping-products.mjs index 22df735bc795a..f4d4a690897ad 100644 --- a/components/returnista/actions/list-shipping-products/list-shipping-products.mjs +++ b/components/returnista/actions/list-shipping-products/list-shipping-products.mjs @@ -23,6 +23,6 @@ export default { ? response : []); $.export("$summary", `Retrieved ${products.length} shipping product(s)`); - return response; + return products; }, }; diff --git a/components/returnista/actions/resend-confirmation-email/resend-confirmation-email.mjs b/components/returnista/actions/resend-confirmation-email/resend-confirmation-email.mjs index 7c074a9993310..1187fb2463360 100644 --- a/components/returnista/actions/resend-confirmation-email/resend-confirmation-email.mjs +++ b/components/returnista/actions/resend-confirmation-email/resend-confirmation-email.mjs @@ -3,7 +3,12 @@ import returnista from "../../returnista.app.mjs"; export default { key: "returnista-resend-confirmation-email", name: "Resend Confirmation Email", - description: "Resends the confirmation email for a return order." + description: "Resends the return confirmation email to the consumer for an existing return order." + + " Use this when a consumer did not receive their original confirmation, when an email bounced, or to re-trigger a notification after a return order is updated." + + " To look up a return order ID, use **Get Return Orders** or **Get Return Order** first." + + " To view the email history before resending, use **Get Return Order Emails**." + + " Requires both an Account ID (from your Returnista dashboard settings) and a Return Order ID." + + " Note: this triggers an immediate send — there is no scheduling or preview step." + " [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/account/-accountId/return-order/-id/resend-confirmation-email)", version: "0.0.1", type: "action", diff --git a/components/returnista/returnista.app.mjs b/components/returnista/returnista.app.mjs index f1030ae5a23bf..2b33f0e57ce20 100644 --- a/components/returnista/returnista.app.mjs +++ b/components/returnista/returnista.app.mjs @@ -8,12 +8,12 @@ export default { consumerId: { type: "string", label: "Consumer ID", - description: "The ID of the consumer", + description: "The unique identifier of the consumer in Returnista.", }, accountId: { type: "string", label: "Account ID", - description: "The ID of the Returnista account", + description: "The unique identifier of your Returnista account. Find this in the Returnista dashboard under account settings.", }, limit: { type: "integer", @@ -42,7 +42,7 @@ export default { search: { type: "string", label: "Search", - description: "A search string to filter the results. Searches across purchase order numbers, consumer first name, last name, email, and consumer full name. Examples: `search=12345` | `search=john@example.com`", + description: "A search string to filter the results. Searches across purchase order numbers, consumer first name, last name, email, and consumer full name. Examples: `12345` | `john@example.com`", optional: true, }, sortBy: { From 2041a921d95f9774e24993529d6debda4c2edd73 Mon Sep 17 00:00:00 2001 From: Vigneshwaran Kannan Date: Tue, 30 Jun 2026 15:07:10 +0530 Subject: [PATCH 15/16] Update in the version Update in the version --- .../returnista/actions/get-return-order/get-return-order.mjs | 2 +- components/returnista/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/returnista/actions/get-return-order/get-return-order.mjs b/components/returnista/actions/get-return-order/get-return-order.mjs index 7ad8b7bbd16f1..7bda773b613af 100644 --- a/components/returnista/actions/get-return-order/get-return-order.mjs +++ b/components/returnista/actions/get-return-order/get-return-order.mjs @@ -8,7 +8,7 @@ export default { + " To find a return order ID, use **Get Return Orders** first." + " To view the email communications for a return order, use **Get Return Order Emails**." + " [See the documentation](https://platform.returnista.com/reference/rest-api/#get-/account/-accountId/return-order/-id)", - version: "0.1.0", + version: "0.0.2", type: "action", annotations: { destructiveHint: false, diff --git a/components/returnista/package.json b/components/returnista/package.json index 95109795034bd..dc3bdd7e57503 100644 --- a/components/returnista/package.json +++ b/components/returnista/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/returnista", - "version": "1.0.0", + "version": "0.3.0", "description": "Pipedream Returnista Components", "main": "returnista.app.mjs", "keywords": [ From 86c938ac0e0b744c5ea65cf78054c392598b049f Mon Sep 17 00:00:00 2001 From: Vigneshwaran Kannan Date: Tue, 30 Jun 2026 15:34:32 +0530 Subject: [PATCH 16/16] Update in the description Update in the description --- components/returnista/returnista.app.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/returnista/returnista.app.mjs b/components/returnista/returnista.app.mjs index 2b33f0e57ce20..def5297d181aa 100644 --- a/components/returnista/returnista.app.mjs +++ b/components/returnista/returnista.app.mjs @@ -8,7 +8,7 @@ export default { consumerId: { type: "string", label: "Consumer ID", - description: "The unique identifier of the consumer in Returnista.", + description: "The unique identifier of the consumer in Returnista. To find a consumer ID, use **Get Return Orders** or **Get Return Order** — the consumer ID is included directly in the response.", }, accountId: { type: "string",