有两种接收通知的方式:
LISTINGS_ITEM_STATUS_CHANGE
LISTINGS_ITEM_MFN_QUANTITY_CHANGE
BRANDED_ITEM_CONTENT_CHANGE
接口: POST /notifications/v1/destinations
参数:
{
"resourceSpecification": {
"eventBridge": {
"region": "us-east-1",
"accountId": "AWS_ACCOUNT_ID"
}
},
"name": "MyEventBridgeDestination"
}
返回值中保存:
destinationId
resource.eventBridge.name
(用于 EventBridge 配置)aws.partner/sellingpartnerapi.amazon.com/{AWS Account Id}/{Application Id}
的 sourceRules > Create rule
{
"source": [
{
"prefix": "aws.partner/sellingpartnerapi.amazon.com"
}
],
"detail-type": ["LISTINGS_ITEM_STATUS_CHANGE"]
}
接口: POST /notifications/v1/subscriptions/{notificationType}
参数示例:
{
"payloadVersion": "1.0",
"destinationId": "YOUR_DESTINATION_ID"
}
notificationType 示例值:
"LISTINGS_ITEM_STATUS_CHANGE"
"BRANDED_ITEM_CONTENT_CHANGE"
ORDER_CHANGE
ANY_OFFER_CHANGED
(可以包含 marketplaceIds
过滤器)参考 AWS 文档配置权限策略,允许 SP-API 写入您指定的 SQS 队列。
提供以下 IAM policy 示例:
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::437568002678:root"
},
"Action": ["kms:GenerateDataKey", "kms:Decrypt"],
"Resource": "*"
}
接口: POST /notifications/v1/destinations
参数:
{
"resourceSpecification": {
"sqs": {
"arn": "arn:aws:sqs:region:account_id:queue_name"
}
},
"name": "MySQSQueueDestination"
}
返回值中保存:
destinationId
接口: POST /notifications/v1/subscriptions/{notificationType}
常见 notificationType 示例:
"ORDER_CHANGE"
(订单状态/买家取消)"ANY_OFFER_CHANGED"
(包含市场过滤器)参数示例(带过滤器):
{
"payloadVersion": "1.0",
"destinationId": "YOUR_DESTINATION_ID",
"processingDirective": {
"eventFilter": {
"eventFilterType": "ANY_OFFER_CHANGED",
"marketplaceIds": ["ATVPDKIKX0DER"]
},
"aggregationSettings": {
"aggregationTimePeriod": "FiveMinutes"
}
}
}
NotificationMetadata.notificationId
ORDER_CHANGE
不支持 marketplaceIds
过滤,若需要请使用 ANY_OFFER_CHANGED
具体流程是这个文档:https://developer-docs.amazon.com/sp-api/docs/notifications-api-v1-use-case-guide