Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

136
Views
How to get access_token using refresh token from Ebay?

I'm trying to get access_token from a refresh token I got from eBay. I'm using Axios but I keep getting getting grant type in request is not supported error.

  const refreshToken = 'xxxxxxxx';
  const appID = 'xxxxxxx';
  const certID = 'xxxxxx';
  const scopes = [
        'https://api.ebay.com/oauth/api_scope',
        'https://api.ebay.com/oauth/api_scope/sell.fulfillment',
        'https://api.ebay.com/oauth/api_scope/sell.account',
        'https://api.ebay.com/oauth/api_scope/sell.inventory'
  ]
  const params = {
    grant_type: 'refresh_token',
    refresh_token: refreshToken,
    'scope': encodeURI(scopes.join(" ")),
    // scope: scopes,
  

const token = Buffer.from(`${appID}:${certID}`);
const URL = 'https://api.ebay.com/identity/v1/oauth2/token'
const { data } = await axios.post(URL, params, {
      'headers': {
        'Authorization': `Basic ${token.toString('base64')}`,
        'Content-Type': 'application/x-www-form-urlencoded',
      },
    })
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Turns out you'll have to UriEncode the entire request body, made use of node's querystring.encode():

const qs = require("querystring")
...
const { data } = await axios.post(URL, qs.encode(params), {
  'headers': {
    'Authorization': `Basic ${token.toString('base64')}`,
    'Content-Type': 'application/x-www-form-urlencoded',
  },
})
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!