AfterShip ACTION
Create Tracking
Creates a tracking. See the documentation
- Action
- Writes data
- API key
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's AfterShip account once, then configure and run Create Tracking 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: "aftership-create-tracking",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
aftership: { authProvisionId: "apn_xxxxxxx" },
trackingNumber: "Tracking Number",
slug: "Slug",
},
})
console.log(result)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": "aftership-create-tracking",
"configured_props": {
"aftership": { "authProvisionId": "apn_xxxxxxx" },
"trackingNumber": "Tracking Number",
"slug": "Slug"
}
}'// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{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": "aftership",
},
},
},
)
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: "aftership-create-tracking",
arguments: {
trackingNumber: "Tracking Number",
slug: "Slug",
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| Property | Type | Description |
|---|---|---|
trackingNumber Tracking Number | string | The tracking number of the shipment. Required |
slug Slug | string | The unique code of the courier. Get courier codes here. Optional |
title Title | string | By default this field shows the tracking_number, but you can customize it as you wish with any info (e.g. the order number). Optional |
smses SMSes | string[] | The phone number(s) to receive sms notifications. Enter + andarea code before phone number. Accept either array or comma separated as input. Supports up to 3 phone numbers. Optional |
emails Emails | string[] | Email address(es) to receive email notifications. Accept either array or comma separated as input. Supports up to 3 email addresses. Optional |
customerName Customer Name | string | Customer name of the tracking. Optional |
orderId Order ID | string | A globally-unique identifier for the order. Optional |
orderIdPath Order ID Path | string | The URL for the order in your system or store. Optional |
customFields Custom Fields | object | Custom fields that accept an object with string field. In order to protect the privacy of your customers, do not include any personal data in custom fields. Optional |
orderNumber Order Number | string | A unique, human-readable identifier for the order. Optional |
language Language | string | The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. Optional |
orderPromisedDeliveryDate Order Promised Delivery Date | string | The promised delivery date of the order. It uses the format YYYY-MM-DD. Optional |
deliveryType Delivery Type | string | Shipment delivery type. Optional |
pickupLocation Pickup location | string | Shipment pickup location for receiver. Optional |
pickupNote Pickup Note | string | Shipment pickup note for receiver. Optional |
trackingAccountNumber Tracking Account Number | string | The shipper's carrier account number. Refer to this article on additional tracking fields for more details. Optional |
trackingKey Tracking Key | string | A type of tracking credential required by some carriers. Refer to this article on additional tracking fields for more details. Optional |
trackingShipDate Tracking Ship Date | string | The date the shipment was sent, using the format YYYYMMDD. Refer to this article on additional tracking fields for more details. Optional |
originCountryIso3 Origin Country ISO3 | string | The ISO Alpha-3 code (3 letters) for the origin country/region. E.g. USA for the United States. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. Optional |
originState Origin State | string | The state of the sender's address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. Optional |
originCity Origin City | string | The city of the sender's address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. Optional |
originPostalCode Origin Postal Code | string | The postal of the sender's address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. Optional |
originRawLocation Origin Raw Location | string | The sender address that the shipment is shipping from. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. Optional |
destinationCountryIso3 Destination Country ISO3 | string | The ISO Alpha-3 code (3 letters) for the destination country/region. E.g. USA for the United States. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. Optional |
destinationState Destination State | string | The state of the recipient's address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. Optional |
destinationCity Destination City | string | The city of the recipient's address. This can help AfterShip with various functions like tracking, carrier auto-detection and auto-correction, calculating an EDD, etc. Optional |
note Note | string | Text field for the note. Optional |
orderDate Order Date | string | Order date in YYYY-MM-DDTHH:mm:ssZ format. e.g. 2021-07-26T11:23:51-05:00 Optional |
shipmentType Shipment Type | string | The carrier service type for the shipment. If you provide info for this field, AfterShip will not update it with info from the carrier. Optional |
shipmentTags Shipment Tags | string[] | Used to add tags to your shipments to help categorize and filter them easily. Max 50 items. 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
- aftership-create-tracking
- Version
- 0.1.1
- App
- AfterShip
- Authentication
- API key
- Read-only
- No
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗