amzn / selling-partner-api-models

This repository contains OpenAPI models for developers to use when developing software to call Selling Partner APIs.
Apache License 2.0
570 stars 730 forks source link

Website Authorization Workflow: spapi_outh_token not found in query parameters #4119

Closed Bhanishi-at-Github closed 1 week ago

Bhanishi-at-Github commented 2 weeks ago

Hey there!

I am new to amazon seller central as a developer. After building the application which is draft status for my client, I raised one issue #4093 where I was unable to get the callback. Once I fixed that issue, another thing came up, I got query parameters from amazon as mentioned

https://printasta-build.vercel.app/auth/callback/?amazon_callback_uri=https%3A%2F%2Fsellercentral.amazon.com%2Fapps%2Fauthorize%2Fconfirm%2Famzn1.sp.solution.8d796277-9887-484c-b059-bb78ef5bc5c4&amazon_state=MTcyNDQwMjI3NTkxN8i177-9Y2vvv71gOO-_vXLvv71T77-9We-_vRfvv73vv70o77-9a--_vS_vv73vv707eiYa77-977-9H--_vS57dO-_vSVd77-9T--_vU5t77-977-9Vu-_ve-_ve-_vSN5KHJWTO-_ve-_vVnvv73vv7*************&version=beta&selling_partner_id=A3FYFX****V0XQ

In this uri, the spapi_oauth_code was missing and I was getting this screen according to my code.

{ "message": "Authorization code not provided", "status": 400, "state": "{amazon_state}", "seller_id": "{seller_id}" }

I have tried with a sample parameter of spapi_outh_code by assigning a random value and it worked until the validation.

Please refer this repo: https://github.com/Bhanishi-at-Github/printasta_build.git

Bhanishi-at-Github commented 2 weeks ago

I needed to do this within a few days please let me know how I can proceed

Mizan3050 commented 2 weeks ago

Make sure you are adding state (has to be a number like 1234) parameter in the URI for eg https://sellercentral.amazon.in/apps/authorize/consent?application_id=YOU_APP_ID&version=beta&state=1234

Bhanishi-at-Github commented 2 weeks ago

Yes, I am adding it

Bhanishi-at-Github commented 2 weeks ago

Still not working

leonardonakagawa commented 2 weeks ago

Hi @Bhanishi-at-Github,

Could you please verify, if you are following this workflow? Website Authorization Workflow

Also, have you updated your app OAuth Login URI and OAuth Redirect URI correctly into the Seller Central?

Thanks, Leonardo Nakagawa Solutions Architect, Selling Partner API Developer Support

Bhanishi-at-Github commented 1 week ago

I am getting error as 'invalid client'

leonardonakagawa commented 1 week ago

Hi @Bhanishi-at-Github,

Can you please open a support case with us, providing all of your app details?

Thanks, Leonardo Nakagawa Solutions Architect, Selling Partner API Developer Support

Bhanishi-at-Github commented 1 week ago

I have resolved that issue but now I am facing Readonly Database error when storing data in the database.