简体   繁体   English

如何使亚马逊 SP-API 迁移卖家说明生效

[英]How do I make the Amazon SP-API Migrating sellers instructions work

We have a long running MWS application that we migrated to use the new SP-API interface.我们有一个长期运行的 MWS 应用程序,我们将其迁移为使用新的 SP-API 接口。 We have done most of our work in the sandbox environment and have been trying to migrate our existing customers over.我们已经在沙盒环境中完成了大部分工作,并且一直在尝试将现有客户迁移过来。 The instructions at this website seem simple enough but step 3 is resulting in an unauthorized response.该网站上的说明看起来很简单,但第 3 步会导致未经授权的响应。 This includes both our personal amazon seller account and our current customers amazon seller accounts.这包括我们的个人亚马逊卖家账户和我们当前客户的亚马逊卖家账户。 I have been using PostMan for testing the process of migrating accounts before moving it to our c# process.在将其移至我们的 c# 流程之前,我一直在使用 PostMan 来测试迁移帐户的流程。

I am at an actual loss of what it could be.我实际上失去了它可能是什么。 We created our IAM Roles and user according to these instructions: https://developer-docs.amazon.com/sp-api/docs/creating-and-configuring-iam-policies-and-entities我们根据这些说明创建了我们的 IAM 角色和用户: https://developer-docs.amazon.com/sp-api/docs/creating-and-configuring-iam-policies-and-entities

I then did the migration process according to these instructions: https://developer-docs.amazon.com/sp-api-blog/docs/migrate-seller-authorizations-from-mws-to-sp-api然后我根据这些说明进行了迁移过程: https://developer-docs.amazon.com/sp-api-blog/docs/migrate-seller-authorizations-from-mws-to-sp-api

Step 1 and Step 2 work as expected but getting the temporary token at step 3 results in the following error response第 1 步和第 2 步按预期工作,但在第 3 步获取临时令牌会导致以下错误响应

{
"errors": [
    {
        "message": "Access to requested resource is denied.",
        "code": "Unauthorized",
        "details": ""
    }
]
}

I have made the step 3 connection from both the instructions by hand and using the model as supplied by https://github.com/amzn/selling-partner-api-models/tree/main/models/authorization-api-model我已经根据手动说明和使用 https 提供的model 进行了第 3 步连接://github.com/amzn/selling-partner-api-models/tree/main/models/authorization-api-model

I guess you have a public application and make sure you add a developer id in the seller application.我猜您有一个公共应用程序,并确保您在卖方应用程序中添加了一个开发人员 ID。 Share more detail to resolve your issue, as I have migrated 10+ app and its work smoothly.分享更多细节以解决您的问题,因为我已经迁移了 10 多个应用程序并且它的工作顺利。

You mean the access token?你的意思是访问令牌? To get the access token, you need LWA credentials, these consist of a "Client identifier" (amzn1.application-oa2-client.ed722....) and a "Client secret" (a2873b4.......).要获取访问令牌,您需要 LWA 凭据,这些凭据包括“客户端标识符”(amzn1.application-oa2-client.ed722....)和“客户端密码”(a2873b4....) . And a refresh token that you can get by Action->Authorize.还有一个刷新令牌,您可以通过 Action->Authorize 获得。 You can find these in the seller account, "Partner Network"->"Develop Apps"您可以在卖家账户中找到这些,“合作伙伴网络”->“开发应用程序”

As to get the access token in Postman:在 Postman 中获取访问令牌:

POST https://api.amazon.com/auth/o2/token

In Body -> x-www-form-urlencoded在正文 -> x-www-form-urlencoded

grant_type :: refresh_token
refresh_token :: Atzr|IwE.... (the refresh token u got when u clicked on "Authorize" on your app)
client_id :: amzn1.application-oa2-client.ed752....
client_secret :: a2953b4......

As a result, you should get:结果,您应该得到:

{
"access_token": "Atza|IwEBIKJpxfB....",
"refresh_token": "Atzr|IwEBIM9QsQUPTJ....",
"token_type": "bearer",
"expires_in": 3600
}

The access token is the temporary token that you're talking about No idea what the refresh token does since its not the same as the one you enter but i never had to use it.访问令牌是您正在谈论的临时令牌不知道刷新令牌的作用,因为它与您输入的令牌不同,但我从未使用过它。 By the way, if you used an iAM Role as your IAM ARN, you have to use STS Credentials (ASIA3SXMG.....), if you used an iAM user as your IAM ARN, you can use AWS credentials, (AKIA3SXMG....)顺便说一句,如果您使用 iAM 角色作为 IAM ARN,则必须使用 STS 凭证 (ASIA3SXMG.....),如果您使用 iAM 用户作为 IAM ARN,则可以使用 AWS 凭证 (AKIA3SXMG. ...)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM