title: How to convert Amazon MWS credentials to SP-API creds
body: <p><a href="https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/use-case-guides/authorization-api-use-case-guide/authorization-api-use-case-guide-v1.md#tutorial-migrate-an-amazon-mws-authorization-to-a-selling-partner-api-application" rel="noreferrer">Here are the seemingly clear instructions from Amazon.</a></p>
  <p>Simply send the following:  sellingPartnerId, developerId, and mwsAuthToken</p>
  <p>I do this with <code>httparty</code> like so:</p>
  <pre><code>query = {
    sellingPartnerId: &quot;A3Kxxxxx&quot;,
    developerId: &quot;753xxxx&quot;,
    mwsAuthToken: &quot;amzn.mws.8abxxxxx-xxxx-xxxx-xxxx-xxxxxx&quot;,
  }
  </code></pre>
  <p>and then</p>
  <pre><code>send = HTTParty.get(&quot;https://sellingpartnerapi-na.amazon.com/authorization/v1/authorizationCode&quot;, 
    query: query
  )
  </code></pre>
  <p>This returns the following error:</p>
  <pre><code>{&quot;errors&quot;=&gt;
    [{&quot;message&quot;=&gt;&quot;Access to requested resource is denied.&quot;,
      &quot;code&quot;=&gt;&quot;MissingAuthenticationToken&quot;}]}
  </code></pre>
  <p>I've adjusted the call everyway I've seen. I've read the following articles:
  <a href="https://marco-tibaldeschi.medium.com/amazon-sp-api-auth-auth-demystified-ab3bc746729b" rel="noreferrer">This</a>
  <a href="https://vdanyliv.medium.com/amazon-selling-partner-api-spapi-how-to-quickly-and-simply-integrate-with-new-api-part-2-59d7458f24fe" rel="noreferrer">This</a></p>
  <p>Paged through the 695 issues on github for this API and still no luck.. I've adjusted my query to this with no luck either:</p>
  <pre><code>query = {
    grant_type: &quot;client_credentials&quot;,
    sellingPartnerId: &quot;A3K98Oxxxxxx&quot;,
    developerId: &quot;753xxxxxxxx&quot;,
    mwsAuthToken: &quot;amzn.mws.8abxxxxxxx-xxxx-xxxx-xxxx-xxxxxxx&quot;,
    client_id: &quot;amzn1.application-oa2-client.xxxxxxxxxxxxxxxxxxxxxxxx&quot;,
    client_secret: &quot;a473e76XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&quot;,
    scope: &quot;sellingpartnerapi::migration&quot;
  }
  </code></pre>
  <p>Nothing I've tried has worked.. Any suggestions? Has anyone actually migrated their MWS to SP-API credential successfully?</p>