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
611 stars 733 forks source link

InvalidInput: 'Developer ID 5xxxxxxxxxxxx0 is not associated with the application id.' #805

Closed intellifox-hq closed 3 years ago

intellifox-hq commented 3 years ago

I'm trying to migrate my users from MWS to SP-API using GET /authorization/v1/authorizationCode

I'm getting the following error:

{
  errors: [
    {
      code: 'InvalidInput',
      message: 'Developer ID 5xxxxxxxxxxxx0 is not associated with the application id.',
      details: ''
    }
  ]
}

Here is the complete code I'm using. It works perfectly for self authorized operations (I'm able to list my own orders for instance).

const convert_mws_token_to_auth_token = async ({ mws_auth_token, selling_partner_id, developer_id }) => {
  try {
    const lwa_response = await axios.post('https://api.amazon.com/auth/o2/token', {
      grant_type: 'client_credentials',//   The type of access grant requested. Must be authorization_code.
      scope: 'sellingpartnerapi::migration',

      client_id,//  Part of your LWA credentials. To get this value, see Viewing your developer information.
      client_secret,//  Part of your LWA credentials. To get this value, see Viewing your developer information.
    })

    const grantless_token = lwa_response.data.access_token

    const endpoint = 'sellingpartnerapi-eu.amazon.com'
    const region = 'eu-west-1'

    // const endpoint = 'sellingpartnerapi-na.amazon.com'
    // const region = 'us-east-1'

    const HTTP_method = 'GET'
    const path = '/authorization/v1/authorizationCode'
    const query_string = `sellingPartnerId=${selling_partner_id}&mwsAuthToken=${mws_auth_token}&developerId=${developer_id}`
    const service = 'execute-api'

    const now = new Date()

    const headers_to_sign = {
      host: endpoint,
      'x-amz-access-token': grantless_token,
      'x-amz-date': `${moment(now).toISOString()}`,
      'user-agent': 'intellifox-api-1.6',
    }

    const canonical_request = createCanonicalRequest(
      HTTP_method, path, query_string, headers_to_sign,
    )

    const string_to_sign = createStringToSign(
      now, region, service, canonical_request,
    )

    const signature = createSignature(
      secret, now, region, service, string_to_sign,
    )

    const sp_api_response = await axios({
      method: HTTP_method,
      url: `https://${endpoint}${path}?${query_string}`,
      headers: {
        Authorization: `AWS4-HMAC-SHA256 Credential=${key_id}/${moment(now).format('YYYYMMDD')}/${region}/${service}/aws4_request, SignedHeaders=host;user-agent;x-amz-access-token;x-amz-date, Signature=${signature}`,

        'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8',
        ...headers_to_sign,
      },
    })

    console.log('ok', sp_api_response.data)
  } catch (e) {
    console.log(e.response.data)
    /*
      {
        errors: [
          {
            code: 'InvalidInput',
            message: 'Developer ID {developer_id} is not associated with the application id.',
            details: ''
          }
        ]
      }
     */
  }
}

Am I missing something?

I opened a case ( case id is 6552816932 ) but I'm posting this issue here in the hope I can solve it on my side.

Thanks for any help.

parvathm commented 2 years ago

Hi @AndrewTamb ,

This is an old case and we couldn't verify application id. If you still have same issue can you please open a new support case from your developer account.

Thanks, Parvathm, Selling Partner API Developer Support .

AndrewTamb commented 2 years ago

@parvathm I created another case. Please check it. ID 9404181611

AntanasMisiunas commented 2 years ago

Hi @parvathm ,

We're still having the issue. Would you be able to check (case id: 9301898371)?

AnjaEk commented 2 years ago

Hi @parvathm ,

We are also having the same issue with response { "errors": [ { "code": "InvalidInput", "message": "Developer ID 6XXXXXXX71 is not associated with the application id.", "details": "" } ] } Can you please check our case (caseID=7584121812)? Thank you.

S4T-TP commented 2 years ago

Hi @parvathm, our app is also published and we are having the same issue:

Developer ID 5xxxxxxxxxx2 is not associated with the application id.

Can you please check our case ID: 7584686832.

Thank you.

AnjaEk commented 2 years ago

Hi @parvathm, we got closed case, but the solution does not make sense for our account. We opened a new case ID7595453582.

Developer ID 6XXXXXXXX1 is not associated with the application id.

Can you please check our case (caseID=7595453582)?

Thank you.

parvathm commented 2 years ago

Hi @AnjaEk ,

Thank you for the feed back. Case is with right team now. Please expect a valid response soon.

Thanks, Parvathm Selling Partner API Developer Support

0xSekar commented 2 years ago

Hi @parvathm , We are having the exact same issue with our recently published app. Can you please take a look at our casaId also? CaseId: 9722940431 Thanks

jswiniarski commented 2 years ago

Hi @parvathm You seem to be very helpful engineer here ;) please take a look at our configuration as well. Previously we received 500 internal error. It was solved in case 7689429162 after re-publishing our app but now few days after re-publishing we receive 400 bad request. Please Case: 7689429162 Thanks a million!

avvarga commented 2 years ago

Hello,

This issue was opened a long time ago, has been closed for some time now and seems to have deviated from the original purpose, and so, I will be locking it.

Please note that we do not handle specific troubleshooting requests via GitHub issues since there is sensitive data that is needed to resolve this issues, reason why a Support Case is required.

Recently this post has been used to request updates to Support Cases that have been opened and this is not what GitHub Issues should be used for (this is for reporting issues with the API or suggest improvements, not request support updates).

If you require further assistance with a Support Case, please do not hesitate to send such request via the Support Case since those cases are constantly monitored.

Thanks, Alejandro C Selling Partner API Developer Support