View as Markdown
Sendcloud icon

Sendcloud ACTION

Create Return

Create a return. See the documentation
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Sendcloud account once, then configure and run Create Return 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: "sendcloud-create-return",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    sendcloud: { authProvisionId: "apn_xxxxxxx" },
    fromAddress: "From Address",
    toAddress: "To Address",
  },
})

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 Return inputs
Property Type Description
fromAddress From Address object

Required fields:

  • name (string): Name associated with the address. Example: John Doe
  • address_line_1 (string): First line of the address. Example: Stadhuisplein
  • postal_code (string): Zip code. Example: 1013 AB
  • city (string): City. Example: Eindhoven
  • country_code (string): ISO 3166-1 alpha-2 code. Example: NL

Optional fields:

  • company_name (string): Company name. Example: Sendcloud
  • house_number (string): House number. Example: 50
  • address_line_2 (string): Additional info. Example: Apartment 17B
  • po_box (string | null): PO box code
  • state_province_code (string): ISO 3166-2 code. Example: IT-RM
  • email (string): Email. Example: johndoe@gmail.com
  • phone_number (string): Phone number. Example: +319881729999

Example:

{
  "name": "John Doe",
  "address_line_1": "Stadhuisplein",
  "postal_code": "1013 AB",
  "city": "Eindhoven",
  "country_code": "NL"
}
Required
toAddress To Address object

Required fields:

  • name (string): Name associated with the address. Example: John Doe
  • address_line_1 (string): First line of the address. Example: Stadhuisplein
  • postal_code (string): Zip code. Example: 1013 AB
  • city (string): City. Example: Eindhoven
  • country_code (string): ISO 3166-1 alpha-2 code. Example: NL

Optional fields:

  • company_name (string): Company name. Example: Sendcloud
  • house_number (string): House number. Example: 50
  • address_line_2 (string): Additional info. Example: Apartment 17B
  • po_box (string | null): PO box code
  • state_province_code (string): ISO 3166-2 code. Example: IT-RM
  • email (string): Email. Example: johndoe@gmail.com
  • phone_number (string): Phone number. Example: +319881729999

Example:

{
  "name": "John Doe",
  "address_line_1": "Stadhuisplein",
  "postal_code": "1013 AB",
  "city": "Eindhoven",
  "country_code": "NL"
}
Required
shipWith Ship With object

Shipping specifications chosen for the return.

Fields:

  • type (string): How the carrier/method is selected. One of shipping_option_code or shipping_product_code (default is shipping_product_code).
  • shipping_option_code (string): Required if type = shipping_option_code. Example: dpd:return/return
  • shipping_product_code (string): Required if type = shipping_product_code. Example: dpd:return/return
  • functionalities (object): Shipping functionalities. Provide only when type = shipping_product_code.
  • contract (integer): Contract ID to ship the return with.
  • dimensions (object):
    • length (number, >= 0)
    • width (number, >= 0)
    • height (number, >= 0)
    • unit (string): One of cm, mm, m, yd, ft, in
  • weight (object):
    • value (number, > 0)
    • unit (string): One of kg, g, lbs, oz

Example:

{
  "type": "shipping_option_code",
  "shipping_option_code": "dpd:return/return",
  "contract": 1234,
  "dimensions": { "length": 15, "width": 20.5, "height": 37, "unit": "mm" },
  "weight": { "value": 14.5, "unit": "g" }
}
Required
dimensionsLength Dimensions Length integer
Length in the specified unit.
Optional
dimensionsWidth Dimensions Width integer
Width in the specified unit.
Optional
dimensionsHeight Dimensions Height integer
Height in the specified unit.
Optional
dimensionsUnit Dimensions Unit string
Unit of the dimensions.
Optional
weightValue Weight Value integer
Weight value in the specified unit.
Required
weightUnit Weight Unit string
Unit of the weight.
Required

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
sendcloud-create-return
Version
0.0.3
App
Sendcloud
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes