授权销售伙伴 API 应用程序
授权 SP-API 应用程序
The authorization model for the Selling Partner API is based on Login with Amazon, Amazon's implementation of OAuth 2.0. In this model your application is authorized through interactions with pages displayed by Amazon and by your website. The web browser is the user-agent that passes parameters between your website and Amazon at each selling partner action. To implement OAuth authorization you must configure your website to (1) accept and process the parameters that Amazon passes to it, and (2) redirect the web browser and pass parameters to Amazon.
我的应用程序如何获得授权?
-
面向卖家的公共应用程序:公开提供并由卖家授权的应用程序。可以使用以下方法对这些应用程序进行授权:
- Selling Partner Appstore authorization workflow An OAuth authorization workflow initiated from the Selling Partner Appstore detail page.
- Website authorization workflow An OAuth authorization workflow initiated from your own website.
-
面向供应商的公共应用程序:公开可用并由供应商授权的应用程序。可以使用以下方法对这些应用程序进行授权:
- Website authorization workflow An OAuth authorization workflow initiated from your own website.
-
面向卖家或供应商的私人应用程序:仅适用于贵组织的应用程序。这些可以是卖家或供应商应用程序。可以使用以下方法对这些应用程序进行授权:
注意
You can call Grantless operations without explicit authorization from a selling partner.
For more information, refer to Terminology.
构建 OAuth 授权 URI
OAuth 授权 URI 是创建和测试销售伙伴 API 授权工作流程的关键组件。OAuth 授权 URI 会将浏览器重定向到亚马逊同意页面,您或销售伙伴可以在该页面上同意您的应用程序调用销售伙伴 API。
If a selling partner authorizes your application starting from your own website using the Website authorization workflow, then your website uses an OAuth authorization URI to redirect the selling partner to the Amazon consent page. Even if a selling partner authorizes your application starting from the Selling Partner Appstore, the Selling Partner appstore authorization workflow, you still need an OAuth authorization URI to test your authorization workflow in draft status before creating a live listing in the Selling Partner Appstore.
构建 OAuth 授权 URI 时,应用程序分为两种类型:
-
所有公共应用程序和私人卖家应用程序:可以是:(1) 公开提供且由卖家或供应商授权的应用程序,(2) 仅适用于贵组织且经过自我授权的卖家应用程序。
-
私人供应商应用程序:仅适用于贵组织且经过自我授权的供应商应用程序。
以下步骤介绍如何根据应用程序类型构建 OAuth 授权 URI。
注意
您可以在开发者控制台上应用程序的名称后面找到应用程序 ID。
为公共卖家应用程序构建 OAuth 授权 URI
-
Get the Seller Central URL for the marketplace where you want selling partners to authorize your application. Refer to Seller Central URLs for a list of URLs by marketplace. Example:
https://sellercentral.amazon.com
-
将卖家平台 URL 与
/apps/authorize/consent?application_id={your application ID}
结合起来。示例:
https://sellercentral.amazon.com/apps/authorize/consent?application_id=amzn1.sellerapps.app.0bf296b5-36a6-4942-a13e-EXAMPLEfcd28
为公共供应商应用程序构建 OAuth 授权 URI
-
Get the Vendor Central URL for the marketplace where you want selling partners to authorize your application. Refer to Vendor Central URLs for a list of URLs by marketplace. Example:
https://vendorcentral.amazon.com
-
将 Vendor Central URL 与
/apps/authorize/consent?{your application ID}
结合起来。示例:
https://vendorcentral.amazon.com/apps/authorize/consent?application_id=amzn1.sellerapps.app.0bf296b5-36a6-4942-a13e-EXAMPLEfcd28
You must construct OAuth authorization URIs for the marketplaces in which selling partners will authorize your application. For example, if a seller has a Seller Central account for Mexico, they will need an OAuth authorization URI for Mexico (example: https://sellercentral.amazon.com.mx/apps/authorize/consent?application_id=amzn1.sellerapps.app.0bf296b5-36a6-4942-a13e-EXAMPLEfcd28
) to initiate authorization of your application. Authorizations are regional. When the authorization is complete, your application will have access to the seller's account in any marketplace in the North America region. The same concepts apply to vendors using Vendor Central. You can use the GetMarketplaceParticipations API to discover the active marketplaces for a selling partner.
如果您要创建用于测试授权工作流程的 OAuth 授权 URI,请添加 version=beta 参数。这表示授权工作流程适用于处于草稿状态的应用程序。示例:https://sellercentral-europe.amazon.com/apps/authorize/consent?application_id=amzn1.sellerapps.app.0bf296b5-36a6-4942-a13e-EXAMPLEfcd28&version=beta
For information about creating and testing an authorization workflow, refer to Selling Partner Appstore authorization workflow and Website authorization workflow.
Updated 7 months ago