Selling Partner API (SP-API) ACTION
Retrieve Sales Performance Reports
Fetches sales reports for visualization in third-party dashboarding tools. See the documentation
- Action
- Read only
- OAuth
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's Selling Partner API (SP-API) account once, then configure and run Retrieve Sales Performance Reports 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: "amazon_selling_partner-retrieve-sales-performance-reports",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
amazon_selling_partner: { authProvisionId: "apn_xxxxxxx" },
marketplaceId: "Marketplace ID",
interval: "Interval",
},
})
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": "amazon_selling_partner-retrieve-sales-performance-reports",
"configured_props": {
"amazon_selling_partner": { "authProvisionId": "apn_xxxxxxx" },
"marketplaceId": "Marketplace ID",
"interval": "Interval"
}
}'// 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": "amazon_selling_partner",
},
},
},
)
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: "amazon_selling_partner-retrieve-sales-performance-reports",
arguments: {
marketplaceId: "Marketplace ID",
interval: "Interval",
},
})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 |
|---|---|---|
marketplaceId Marketplace ID | string | The Amazon Marketplace ID Required Dynamic |
interval Interval | string | A time interval used for selecting order metrics. This takes the form of two dates separated by two hyphens (first date is inclusive; second date is exclusive). Dates are in ISO8601 format and must represent absolute time (either Z notation or offset notation). Example: 2018-09-01T00:00:00-07:00--2018-09-04T00:00:00-07:00 requests order metrics for Sept 1st, 2nd and 3rd in the -07:00 zone. Required |
granularity Granularity | string | The granularity of the grouping of order metrics, based on a unit of time Required |
granularityTimeZone Granularity Time Zone | string | An IANA-compatible time zone for determining the day boundary. Required when specifying a granularity value greater than Hour. Optional |
buyerType Buyer Type | string | Filters the results by the buyer type that you specify, B2B (business to business) or B2C (business to customer). Example: B2B, if you want the response to include order metrics for only B2B buyers. Optional |
fulfillmentNetwork Fulfillment Network | string | Filters the results by the fulfillment network that you specify, MFN (merchant fulfillment network) or AFN (Amazon fulfillment network). Do not include this filter if you want the response to include order metrics for all fulfillment networks. Example: AFN, if you want the response to include order metrics for only Amazon fulfillment network. Optional |
firstDayOfWeek First Day of Week | string | Specifies the day that the week starts on when granularity=Week, either Monday or Sunday. Default: Monday. Example: Sunday, if you want the week to start on a Sunday. Optional |
asin ASIN | string | Filters the results by the ASIN that you specify. Specifying both ASIN and SKU returns an error. Do not include this filter if you want the response to include order metrics for all ASINs. Example: B0792R1RSN, if you want the response to include order metrics for only ASIN B0792R1RSN. Optional |
sku SKU | string | Filters the results by the SKU that you specify. Specifying both ASIN and SKU returns an error. Do not include this filter if you want the response to include order metrics for all SKUs. Example: TestSKU, if you want the response to include order metrics for only SKU TestSKU. 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
- amazon_selling_partner-retrieve-sales-performance-reports
- Version
- 0.0.5
- App
- Selling Partner API (SP-API)
- Authentication
- OAuth
- Read-only
- Yes
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗