销售 API v1 用例指南
销售 API 的用例。
API 版本:v1
什么是销售 API?
The Selling Partner API for Sales (Sales API) provides sellers with sales performance information. This is achieved through returning aggregated order metrics for a given period of time, broken down by granularity, and buyer type. Refer to the Sales API Reference for details about Sales API operations and associated data types and schemas.
先决条件
要成功完成本教程,您必须具备以下条件:
- Authorization from the selling partner for whom you are making calls. Refer to Authorizing Selling Partner API applications for more information.
- The Pricing role assigned to your developer profile.
- The Pricing role selected in the App registration page for your application.
教程:接收销售业绩信息
本节将引导您完成使用销售 API 接收销售业绩信息的过程。
获取销售业绩信息
Call the getOrderMetrics
operation with the following parameters to receive aggregated order metrics for a given interval:
查询参数:
参数 | 描述 | 必填项 |
marketplaceIds |
商城标识符。指定下订单的商城。只能指定一个商城。 例如, 类型:< 字符串 > 数组 |
有帮助 |
interval |
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 ISO 8601 format and must represent absolute time (either Z notation or offset notation). 示例: 类型:字符串 |
有帮助 |
granularityTimeZone |
与 IANA 兼容的时区,用于确定日边界。当指定的粒度值大于“小时”时,必须使用。 示例:US/Pacific 用于计算美国/太平洋地区的日界,并考虑夏令时。 类型:字符串 |
没有帮助 |
granularity |
订单指标分组的 示例:获取请求间隔每日细分的日期,其中日界由 Type: enum (Granularity) |
有帮助 |
buyerType |
按您指定的买家类型筛选结果, 示例: Type: enum (BuyerType) |
没有帮助 |
fulfillmentNetwork |
按您指定的配送网络筛选结果, 示例: 类型:字符串 |
没有帮助 |
firstDayOfWeek |
指定一周开始的那一天 示例: Type: enum (FirstDayOfWeek) |
没有帮助 |
asin |
按您指定的 ASIN 筛选结果。同时指定 示例: 类型:字符串 |
没有帮助 |
sku |
按您指定的 SKU 筛选结果。同时指定 示例: 类型:字符串 |
没有帮助 |
请求示例
GET https://sellingpartnerapi-na.amazon.com/sales/v1/orderMetrics?marketplaceIds=&interval=&granularityTimeZone=&granularity=&buyerType=&fulfillmentNetwork=&firstDayOfWeek=&asin=&sku="
响应
参数 | 描述 | 必填项 |
interval |
基于请求粒度的时间间隔(例如小时、日等)。如果这是列表中的第一个或最后一个间隔,则当请求的时间间隔与请求的粒度不一致时,可能会包含不完整的数据 (例如,请求间隔 类型:字符串 |
有帮助 |
unitCount |
基于指定筛选条件的订单中的商品数量。 类型:整数 |
有帮助 |
orderItemCount |
基于指定筛选条件的订单商品数量。 类型:整数 |
有帮助 |
orderCount |
基于指定筛选条件的订单数量。 类型:整数 |
有帮助 |
averageUnitPrice |
基于指定筛选条件的商品的平均价格。公式为“销售总额/单位数”。 Type: Money |
有帮助 |
totalSales |
基于指定筛选条件的所有订单的总已订购商品销售额。 Type: Money |
有帮助 |
响应示例
{
"request": {
"parameters": {
"granularity": {
"value": "Day"
}
}
},
"response": {
"payload": [
{
"interval": "2019-08-01T00:00-07:00--2018-08-02T00:00-07:00",
"unitCount": 1,
"orderItemCount": 1,
"orderCount": 1,
"averageUnitPrice": {
"amount": "22.95",
"currencyCode": "USD"
},
"totalSales": {
"amount": "22.95",
"currencyCode": "USD"
}
},
{
"interval": "2019-08-02T00:00-07:00--2018-08-03T00:00-07:00",
"unitCount": 1,
"orderItemCount": 1,
"orderCount": 1,
"averageUnitPrice": {
"amount": "2.05",
"currencyCode": "USD"
},
"totalSales": {
"amount": "2.05",
"currencyCode": "USD"
}
}
]
}
}
Updated 5 months ago