# Validate Shipment — FedEx

> Validate a shipment. See the documentation

- Key: `fedex-validate-shipment`
- Type: Action (Read-only)
- Version: 0.0.3
- App: FedEx (`fedex`) — https://pipedream.com/apps/fedex.md
- This page (HTML): https://pipedream.com/apps/fedex/actions/validate-shipment
- Hints: read-only · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/fedex/actions/validate-shipment/validate-shipment.mjs

## Description

Validate a shipment. [See the documentation](https://developer.fedex.com/api/en-us/catalog/ship/docs.html#operation/ShipmentPackageValidate)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `accountNumber` | `string` | Yes | The account number associated with the shipment |
| `shipperStreetLines` | `string[]` | Yes | Combination of number, street name, etc. At least one line is required for a valid physical address. Empty lines should not be included. Max Length is 35. Example: [1550 Union Blvd,Suite 302] |
| `shipperCity` | `string` | Yes | The name of city, town of the recipient.Max length is 35. Example: Beverly Hills |
| `shipperStateOrProvinceCode` | `string` | No | It is used to identify the principal subdivisions (e.g., provinces or states) of countries. The Format and presence of this field may vary depending on the country. Note: For specific countries, such as the United States and Canada, and Puerto Rico, there is a two-character state, province, codes limit . Example: TX |
| `shipperPostalCode` | `string` | No | This is the postal code. Note: This is Optional for non postal-aware countries. Maximum length is 10. Example: 65247 |
| `shipperCountryCode` | `string` | Yes | Is a capitalized two-character alpha code representing the country of the address. Example: US |
| `shipperContactName` | `string` | Yes | Contact name, e.g. for customer support. Maximum length is 35. Example: John Doe |
| `shipperPhoneNumber` | `string` | Yes | Contact phone number, e.g. for customer support. Maximum length is 10. Example: 15014321111 |
| `recipientStreetLines` | `string[]` | Yes | Combination of number, street name, etc. At least one line is required for a valid physical address. Empty lines should not be included. Max Length is 35. Example: [1550 Union Blvd,Suite 302] |
| `recipientCity` | `string` | Yes | The name of city, town of the recipient.Max length is 35. Example: Beverly Hills |
| `recipientStateOrProvinceCode` | `string` | No | It is used to identify the principal subdivisions (e.g., provinces or states) of countries. The Format and presence of this field may vary depending on the country. Note: For specific countries, such as the United States and Canada, and Puerto Rico, there is a two-character state, province, codes limit . Example: TX |
| `recipientPostalCode` | `string` | No | This is the postal code. Note: This is Optional for non postal-aware countries. Maximum length is 10. Example: 65247 |
| `recipientCountryCode` | `string` | Yes | Is a capitalized two-character alpha code representing the country of the address. Example: US |
| `recipientContactName` | `string` | Yes | Contact name, e.g. for customer support. Maximum length is 35. Example: John Doe |
| `recipientPhoneNumber` | `string` | Yes | Contact phone number, e.g. for customer support. Maximum length is 10. Example: 15014321111 |
| `pickupType` | `string` | Yes | Indicates if shipment is being dropped off at a FedEx location or being picked up by FedEx or if it's a regularly scheduled pickup for this shipment. |
| `serviceType` | `string` | Yes | Indicate the FedEx service type used for this shipment |
| `packagingType` | `string` | Yes | Specify the packaging type used |
| `totalWeight` | `string` | Yes | Indicate the shipment total weight in pounds |
| `paymentType` | `string` | Yes | Indicates who and how the shipment will be paid for |
| `labelFormatType` | `string` | Yes | Specifies the label Format Type |
| `labelStockType` | `string` | Yes | Label stock type used to create labels |
| `imageType` | `string` | Yes | Specifies the image type of this shipping document |
| `weightUnit` | `string` | Yes | Specifies the package weight unit type |
| `weights` | `string[]` | Yes | An array of weight values for each of the requested pieces of the shipment |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

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

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "fedex",
      },
    },
  },
)

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

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "fedex-validate-shipment",
  arguments: {
    accountNumber: "Account Number",
    shipperStreetLines: ["Shipper Street Lines"],
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

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

const result = await pd.actions.run({
  id: "fedex-validate-shipment",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    fedex: { authProvisionId: "apn_xxxxxxx" },
    accountNumber: "Account Number",
    shipperStreetLines: ["Shipper Street Lines"],
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "fedex-validate-shipment",
    "configured_props": {
      "fedex": { "authProvisionId": "apn_xxxxxxx" },
      "accountNumber": "Account Number",
      "shipperStreetLines": ["Shipper Street Lines"]
    }
  }'
```

---

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