CONNECT APP
Build with Commerce Tools
Commerce
- OAuth
MCP
Give your agent Commerce Tools tools
Every Commerce Tools action is exposed as an MCP tool on Pipedream's remote server. Point a client at it with your end user's ID and Connect resolves that user's Commerce Tools account for each tool call — you store no tokens.
// 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": "commerce_tools",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// e.g. run Change Order Search Status:
const result = await mcp.callTool({
name: "commerce_tools-change-order-search-status",
arguments: {
status: "Status",
},
})# access_token: mint a short-lived token with the Connect SDK — see the MCP guide
headers = {
"Authorization": f"Bearer {access_token}",
"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": "commerce_tools",
}
async with streamablehttp_client("https://remote.mcp.pipedream.net/v3", headers=headers) as (read, write, _):
async with ClientSession(read, write) as session:
await session.initialize()
tools = await session.list_tools()
# e.g. run Change Order Search Status:
result = await session.call_tool("commerce_tools-change-order-search-status", {
"status": "Status",
})API PROXY
Call the Commerce Tools API directly
For an endpoint with no pre-built tool, the Connect proxy forwards your request to the Commerce Tools API with the connected user's credentials attached. You store no tokens and write no refresh logic.
const resp = await pd.proxy.get({
externalUserId: "{external_user_id}", // any stable ID for this user in your system
accountId: "apn_xxxxxxx",
url: "https://api.example.com/v1/me",
})
// Any allowed Commerce Tools endpoint works here. Pipedream attaches the
// connected account's credentials to the outgoing request.# The path segment is the target URL, URL-safe base64 encoded:
# https://api.example.com/v1/me
curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9hcGkuZXhhbXBsZS5jb20vdjEvbWU?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
-H "Authorization: Bearer {access_token}" \
-H "x-pd-environment: production"SDK
Run Commerce Tools actions from your backend
Connect a user's Commerce Tools account once, then run Change Order Search Status on their behalf from your own code — TypeScript, Python, or plain HTTP.
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: "commerce_tools-change-order-search-status",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
commerce_tools: { authProvisionId: "apn_xxxxxxx" },
status: "Status",
},
})from pipedream import Pipedream
pd = Pipedream(
client_id="{oauth_client_id}",
client_secret="{oauth_client_secret}",
project_id="{project_id}",
project_environment="production",
)
result = pd.actions.run(
id="commerce_tools-change-order-search-status",
external_user_id="{external_user_id}", # any stable ID for this user in your system
configured_props={
"commerce_tools": {"authProvisionId": "apn_xxxxxxx"},
"status": "Status",
},
)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": "commerce_tools-change-order-search-status",
"configured_props": {
"commerce_tools": { "authProvisionId": "apn_xxxxxxx" },
"status": "Status"
}
}'TOOLS
Commerce Tools actions
On-demand operations your product or agent can configure and run on behalf of a connected user.
-
Change Order Search Status
actionActivate or deactivate the Order Search feature for the Project. This is the first step to enable the Search Orders action; after activating, run the Reindex Orders action to build the search index. See the documentation.Writev0.0.2 -
Get Order by ID
actionRetrieve an Order by its unique ID. See the documentation.Read-onlyv0.0.1 -
Get Order by Order Number
actionRetrieve an Order by itsorderNumber. See the documentation.Read-onlyv0.0.1 -
Query Orders
actionRetrieve Orders in the Project, optionally filtered and sorted. See the documentation.Read-onlyv0.0.1 -
Reindex Orders
actionTrigger a (re)build of the Order Search index for the Project. Required before the Search Orders action returns results - enabling Order Search with the Change Order Search Status action does not build the index on its own. See the documentation.Writev0.0.2 -
Search Orders
actionSearch Orders using the Order Search API. The endpoint must be activated and indexed for your Project first - run the Change Order Search Status action to enable it, then the Reindex Orders action to build the index. See the documentation.Read-onlyv0.0.2
EVENTS
Commerce Tools triggers
Event sources your backend can deploy for users and receive through a webhook.
No Commerce Tools triggers are available yet.
- App slug
- commerce_tools
- Authentication
- OAuth
- Categories
- Commerce
- Actions
- 6
- Triggers
- 0
- API proxy
- Available