Kacper Jaszczerski
Kacper Jaszczerski

Reputation: 19

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. 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.

  1. Shall we have our own Seller Central account or can we use developer account created under our customer's API?
  2. What is the easiest way to provide such gateway -> user utilize Login With Amazon on our website to maintain persistent connection; every time user logs into the application, all orders are taken from the 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?
  3. Shall this AMAZON APP be public / available in marketplace?

Upvotes: 1

Views: 2060

Answers (2)

Gokhan Gunes
Gokhan Gunes

Reputation: 83

  1. You will need to make api definitions for the customer's account and register with aws. You will create iam role with execute-api permission in aws.

  2. You will request PII authorization from Amazon Developer Profile.

  3. It will be available in the current Market.

The document is a bit complicated, but it's fun when you solve it.

achievements.

Upvotes: 1

IrfanZ
IrfanZ

Reputation: 61

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.
  2. Same developer profile approved for PII access (if you need order's address)
  3. Once developer profile is approved, you can go ahead and create your first SP-API app/application (or App client).

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

  2. LWA Client secret

  3. Application ID/ App ID (important)

  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; every time user logs into the application, all orders are taken from the 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?

This part is perhaps most complex, but here how it goes:

  1. Prepare a url link. (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). 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". 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.

How to prepare Consent 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

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.

Hope it give some directions.

Upvotes: 6

Related Questions