1.1资料准备
确认是否收到通过sp-api开发人员资料申请。
1.2创建账户
1.3为新创建用户创建策略
创建一个策略,我们建议您将 IAM 策略命名为 SellingPartnerAPI
。
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "execute-api:Invoke",
"Resource": "arn:aws:execute-api:*:*:*"
}
]
}
1.4创建IAM职权
1.5向 IAM 用户添加 AWS 安全令牌服务策略
1.6注册您的应用程序
1.7为开发人员收授权
开发商名称:任意字符
开发者id :accessKeyId
客户端相关信息,包含clientId和clientSecret。
1.8使用亚马逊官方提供生成的javaSDK访问数据
1.8.1访问需要的参数和数据如图
参数 | 说明 | 样例 |
---|---|---|
roleArn | 角色Arn,在角色中 | arn:aws:iam::role/demo |
clientId | 应用id,在开发者中心新建引用 | amzn1.application-oa2-.cc8a746d40394ca5b37ec8eb17b34fb2....... |
clientSecret | 开发者中心->LWA凭证中 | fa1a3cb55c93b521552f5f51aea949a4... |
refreshToken | 刷新token | Atzr|-7CSlXlmlgQhifGgsrHuInAvO8gOV8MLkiJ2km3RnNQ2sdY96eyCEf_....... |
accessKeyId | 开发者id | AKIASPMQX... |
secretKey | 开发者访问密钥 | mPYeQSYZrRToxVqPdmo358uyU....... |
1.8.2调用接口正确返回数据即为成功。
返回示例文章来源:https://www.toymoban.com/news/detail-438454.html
class OrderList {
[class Order {
amazonOrderId: 114-0000000-7599439
sellerOrderId: 114-0000000-7599439
purchaseDate: 2021-07-19T10:18:10Z
lastUpdateDate: 2021-07-26T07:01:40Z
orderStatus: Shipped
fulfillmentChannel: AFN
salesChannel: Amazon.com
orderChannel: null
shipServiceLevel: Standard
orderTotal: class Money {
currencyCode: USD
amount: 10.76
}
numberOfItemsShipped: 1
numberOfItemsUnshipped: 0
paymentExecutionDetail: null
paymentMethod: Other
paymentMethodDetails: class PaymentMethodDetailItemList {
[Standard]
}
marketplaceId: ATVPDKIKX0DER
shipmentServiceLevelCategory: Standard
easyShipShipmentStatus: null
cbaDisplayableShippingLabel: null
orderType: StandardOrder
earliestShipDate: 2021-07-24T06:59:59Z
latestShipDate: 2021-07-24T06:59:59Z
earliestDeliveryDate: null
latestDeliveryDate: null
isBusinessOrder: false
isPrime: false
isPremiumOrder: false
isGlobalExpressEnabled: false
replacedOrderId: null
isReplacementOrder: false
promiseResponseDueDate: null
isEstimatedShipDateSet: null
isSoldByAB: false
assignedShipFromLocationAddress: null
fulfillmentInstruction: null
}, class Order {
amazonOrderId: 111-0000000-1185025
sellerOrderId: 111-0000000-1185025
purchaseDate: 2021-07-19T10:37:46Z
lastUpdateDate: 2021-07-23T03:39:41Z
orderStatus: Shipped
fulfillmentChannel: AFN
salesChannel: Amazon.com
orderChannel: null
shipServiceLevel: SecondDay
orderTotal: class Money {
currencyCode: USD
amount: 7.41
}
numberOfItemsShipped: 1
numberOfItemsUnshipped: 0
paymentExecutionDetail: null
paymentMethod: Other
paymentMethodDetails: class PaymentMethodDetailItemList {
[Standard]
}
marketplaceId: ATVPDKIKX0DER
shipmentServiceLevelCategory: SecondDay
easyShipShipmentStatus: null
cbaDisplayableShippingLabel: null
orderType: StandardOrder
earliestShipDate: 2021-07-23T06:59:59Z
latestShipDate: 2021-07-23T06:59:59Z
earliestDeliveryDate: null
latestDeliveryDate: null
isBusinessOrder: false
isPrime: false
isPremiumOrder: false
isGlobalExpressEnabled: false
replacedOrderId: null
isReplacementOrder: false
promiseResponseDueDate: null
isEstimatedShipDateSet: null
isSoldByAB: false
assignedShipFromLocationAddress: null
fulfillmentInstruction: null
}, class Order {
amazonOrderId: 113-0000000-4495420
sellerOrderId: 113-0000000-4495420
purchaseDate: 2021-07-19T11:10:41Z
lastUpdateDate: 2021-07-19T19:03:37Z
orderStatus: Shipped
fulfillmentChannel: AFN
salesChannel: Amazon.com
orderChannel: null
shipServiceLevel: Expedited
orderTotal: class Money {
currencyCode: USD
amount: 7.48
}
numberOfItemsShipped: 1
numberOfItemsUnshipped: 0
paymentExecutionDetail: null
paymentMethod: Other
paymentMethodDetails: class PaymentMethodDetailItemList {
[Standard]
}
marketplaceId: ATVPDKIKX0DER
shipmentServiceLevelCategory: Expedited
easyShipShipmentStatus: null
cbaDisplayableShippingLabel: null
orderType: StandardOrder
earliestShipDate: 2021-07-20T06:59:59Z
latestShipDate: 2021-07-20T06:59:59Z
earliestDeliveryDate: null
latestDeliveryDate: null
isBusinessOrder: false
isPrime: false
isPremiumOrder: false
isGlobalExpressEnabled: false
replacedOrderId: null
isReplacementOrder: false
promiseResponseDueDate: null
isEstimatedShipDateSet: null
isSoldByAB: false
assignedShipFromLocationAddress: null
fulfillmentInstruction: null
}
]
}
微信文章来源地址https://www.toymoban.com/news/detail-438454.html
到了这里,关于Java 亚马逊Amazon spapi对接开发,java Sdk,授权和接口访问步骤详细说明的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!