View as Markdown
Returnista icon

Returnista ACTION

Create Draft Return Order

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
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Returnista account once, then configure and run Create Draft Return Order from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

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

const result = await pd.actions.run({
  id: "returnista-create-draft-return-order",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    returnista: { authProvisionId: "apn_xxxxxxx" },
    consumerId: "Consumer ID",
    purchaseId: "Purchase ID",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Create Draft Return Order inputs
Property Type Description
consumerId Consumer ID string
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.
Required
purchaseId Purchase ID string
The ID of the purchase to return. Use Get Consumer Purchases to find purchase IDs.
Required
returnReasonId Return Reason ID string
The UUID of the return reason. Use Get Return Reasons to find available IDs. Leave blank to submit without a reason (sends null).
Optional
returnReasonComment Return Reason Comment string
An optional free-text comment explaining the return reason.
Optional
resolutionType Resolution Type string
The desired resolution type for the return.
Optional
exchangeProductId Exchange Product ID string
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
exchangeOptionSku Exchange Option SKU string
The SKU of the product variant to exchange for. Typically required when resolutionType is Exchange.
Optional
answers Answers string[]
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://..."}].
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
returnista-create-draft-return-order
Version
0.0.2
App
Returnista
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes