简体   繁体   English

亚马逊集成 SP-API 订单

[英]Amazon Integration SP-API orders

we are developing an web app for our customer which let their customers to integrate with Amazon (using their own accounts) and takes the information about all orders - especially shipment details.我们正在为我们的客户开发一个 web 应用程序,让他们的客户与亚马逊集成(使用他们自己的账户)并获取有关所有订单的信息 - 特别是发货细节。 We were trying for several weeks to achieve that based on the SP-API documentation but unfortunately we are stuck with some questions to be clarified as there are plenty of misleading information in the Internet (amazon employees answers.) and the official documentation.根据 SP-API 文档,我们尝试了几个星期来实现这一目标,但不幸的是,我们遇到了一些需要澄清的问题,因为互联网(亚马逊员工的回答)和官方文档中有大量误导性信息。

  1. Shall we have our own Seller Central account or can we use developer account created under our customer's API?我们应该拥有自己的卖家中心帐户,还是可以使用在客户的 API 下创建的开发者帐户?
  2. What is the easiest way to provide such gateway -> user utilize Login With Amazon on our website to maintain persistent connection;提供此类网关的最简单方法是什么 -> 用户在我们的网站上使用 Login With Amazon 来保持持久连接; every time user logs into the application, all orders are taken from the SP-API;每次用户登录应用程序时,所有订单均来自 SP-API; user selects orders he'd like to ship and our application passes infromation previously taken from API to our backend which integrates with the delivery services?用户选择他想发货的订单,我们的应用程序将之前从 API 获取的信息传递到我们与交付服务集成的后端?
  3. Shall this AMAZON APP be public / available in marketplace?这个亚马逊应用程序应该在市场上公开/可用吗?

I agree it can be quite complex, but here are my two cents:我同意这可能很复杂,但这是我的两分钱:

**Shall we have our own Seller Central account or can we use developer account created under our customer's API?**

Yes, we definitely need Seller central account you also gonna need following:是的,我们绝对需要卖家中心帐户,您还需要以下内容:

  1. Developer profile approved for SP-API.为 SP-API 批准的开发人员配置文件。
  2. Same developer profile approved for PII access (if you need order's address)相同的开发者资料获准用于 PII 访问(如果您需要订单地址)
  3. Once developer profile is approved, you can go ahead and create your first SP-API app/application (or App client).一旦开发人员资料获得批准,您就可以提前 go 并创建您的第一个 SP-API 应用程序/应用程序(或应用程序客户端)。

Remember this app client will be used by other third-parties sellers to delegate their account's access to this app.请记住,此应用程序客户端将被其他第三方卖家用于委托他们的帐户访问此应用程序。 So keep a note of your app clients credentials which includes:因此,请记下您的应用客户端凭据,其中包括:

  1. LWA Client ID LWA 客户端 ID

  2. LWA Client secret LWA 客户端密码

  3. Application ID/ App ID (important)应用程序 ID/应用程序 ID(重要)

  4. Application name应用名称

  5. Refresh token (once you authorize your app)刷新令牌(一旦您授权您的应用程序)

    What is the easiest way to provide such gateway -> user utilize Login With Amazon on our website to maintain persistent connection;提供此类网关的最简单方法是什么 -> 用户在我们的网站上使用 Login With Amazon 来保持持久连接; every time user logs into the application, all orders are taken from the SP-API;每次用户登录应用程序时,所有订单均来自 SP-API; user selects orders he'd like to ship and our application passes infromation previously taken from API to our backend which integrates with the delivery services?用户选择他想发货的订单,我们的应用程序将之前从 API 获取的信息传递到我们与交付服务集成的后端?

This part is perhaps most complex, but here how it goes:这部分可能是最复杂的,但它是如何进行的:

  1. Prepare a url link.准备 url 链接。 (Aka consent link), this is a link that you will either provide to a seller through email or whatever way or make him click this link from your website (your probably will want him to create account on your website and make him login and then expose him this link). (又名同意链接),这是一个链接,您可以通过 email 或任何方式提供给卖家,或者让他从您的网站单击此链接(您可能希望他在您的网站上创建帐户并让他登录,然后向他公开此链接)。 Click on this link will take seller to "his" seller central account (if he is not logged in already he will be asked to do so first), then he will be asked to grant/delegate access to "Your" app, once he has granted access (clicked check-boxes) then will be redirected back to your website again with a special code in redirected url, which you will need to extract that code from url and generate a new "Refresh token".单击此链接会将卖家带到“他的”卖家中央帐户(如果他尚未登录,他将被要求先登录),然后他将被要求授予/委托对“您的”应用程序的访问权限,一旦他已授予访问权限(单击复选框),然后将使用重定向 url 中的特殊代码再次重定向回您的网站,您需要从 url 中提取该代码并生成新的“刷新令牌”。 This new refresh token is basically is kind of authentication and authorization, which you will need to save in database/somewhere for future usage.这个新的刷新令牌基本上是一种身份验证和授权,您需要将其保存在数据库/某处以备将来使用。 Anytime you want to perform any SP-API operation against that seller's account you will need this refresh token.任何时候你想对该卖家的账户执行任何 SP-API 操作,你都需要这个刷新令牌。

How to prepare Consent url:如何准备同意书 url:

$applicationId: amzn1.sp.solution.xxxx-xx-xxxx-xxxx-xx-xxxx-x
$redirect_uri: https://mywebsite.com/callback.php
$version: 'beta'
$state: 'xyz-or-anything'
https://sellercentral.amazon.com/apps/authorize/consent?application_id=$applicationId&state=$state&version=$version&redirect_uri=$redirect_uri

Version is important here:版本在这里很重要:

IF you have not published your app on seller central marketplace then you will have to set version as "beta"如果您尚未在卖家中心市场上发布您的应用程序,那么您必须将版本设置为“测试版”

for more information, please see: https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/developer-guide/SellingPartnerApiDeveloperGuide.md#selling-partner-api-sandbox-endpoints更多信息,请参见: https://github.com/amzn/ sell-partner-api-docs/blob/main/guides/en-US/developer-guide/SellingPartnerApiDeveloperGuide.md# sell-partner-api-sandbox -端点

Shall this AMAZON APP be public / available in marketplace?

Yes, But you can authorize "your app" from "Your own seller central", and still be able to make sellers delegate their access to your app and you can do live operations for that seller.是的,但是您可以从“您自己的卖家中心”授权“您的应用程序”,并且仍然可以让卖家委托他们访问您的应用程序,您可以为该卖家进行实时操作。 Once everything is in place you can go ahead and publish your app on seller central marketplace.一切就绪后,您可以提前 go 并在卖家中心市场上发布您的应用程序。

Hope it give some directions.希望能给一些方向。

  1. You will need to make api definitions for the customer's account and register with aws.您需要为客户的帐户定义 api 并在 aws 注册。 You will create iam role with execute-api permission in aws.您将在 aws 中创建具有 execute-api 权限的 iam 角色。

  2. You will request PII authorization from Amazon Developer Profile.您将从 Amazon Developer Profile 请求 PII 授权。

  3. It will be available in the current Market.它将在当前市场中可用。

The document is a bit complicated, but it's fun when you solve it.文档有点复杂,但是解决的时候很有趣。

achievements.成就。

This article gives an overview of the development process and then links to the Amazon development pages (at bottom of page).本文概述了开发过程,然后链接到亚马逊开发页面(在页面底部)。 It gives the steps to create the new SP-API GetOrders flow.它提供了创建新 SP-API GetOrders 流的步骤。

It is important to also note that you will also need to build functionality to get the restricted access tokens (RTD) from Amazon in order to get personal information like Bill To and Ship To addresses.还需要注意的是,您还需要构建功能以从 Amazon 获取受限访问令牌 (RTD),以便获取个人信息,例如 Bill To 和 Ship To 地址。

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

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