commerce.catalog > invalid scope
Hi, thanks for this library.
I have a problem, when i try to use your library in production mode, and try to use the scope https://api.ebay.com/oauth/api_scope/commerce.catalog.readonly
and then when try to enter to the auth url, i got the error in the redirect url: https://signin.ebay.com/ws/eBayISAPI.dll?ThirdPartyAuthSucessFailure&isAuthSuccessful=true&error=invalid_scope
how can i use the api catalog in production (not sandbox)
thanks in advance
Which API do you want to call? Check if your App is granted to use this scope. Visit https://developer.ebay.com/my/keys and click on "OAuth Scopes" below productions keys. In the modal window you will see all the scopes you can use.
hi @dantio , thanks for reply.
now i see, this scope ( https://api.ebay.com/oauth/api_scope/commerce.catalog.readonly ) only appears in the sandbox oauth scopes, and i was triing in production mode.
Now, when i test this on sandbox, and i try to get a product i got the next error:
EBayError: The specified EPID value 313642744618 was not found.
at handleEBayError (/home/shopea6/public_html/shopeando.mx/ends/tests/ebapi/node_modules/@hendt/ebay-api/lib/errors/index.js:186:11)
at Catalog.request (/home/mypath/ebapi/node_modules/@hendt/ebay-api/lib/api/restful/index.js:160:42)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Catalog.doRequest (/home/mypath/ebapi/node_modules/@hendt/ebay-api/lib/api/restful/index.js:127:20)
at async a (/home/shopea6/public_html/mypath/ebapi/controllers/test.controller.js:34:26) {
description: 'Not Found',
meta: {
errorId: 75010,
domain: 'API_CATALOG',
category: 'REQUEST',
message: 'The specified EPID value 313642744618 was not found.',
parameters: [ { name: 'epid', value: '313642744618' } ],
res: {
status: 404,
statusText: 'Not Found',
....
and the epid (313642744618) exists on ebay-us. is this error is common on sandbox?
do you know how can i get this scope on production mode?
@shopeandodev the eBay sandbox has only limited static data. I would try it with production and add https://api.ebay.com/oauth/api_scope/sell.inventory to the scope.
@dantio i added that scope to the list, and try to get product info by catalog and got the next error:
meta: {
errorId: 75015,
domain: 'API_CATALOG',
category: 'REQUEST',
message: 'Insufficient permissions to fulfill the request.',
res: {
status: 403,
statusText: 'Forbidden',
headers: {
Do you know how can i get access to the scope : https://api.ebay.com/oauth/api_scope/commerce.catalog.readonly
Can you show me all scopes that you are using?
@dantio

i commented the last scope, because if i send it i got the error: invalid scope
Do you set the correct scope in the auth process? This is important.
The fastest way to test it:
- https://developer.ebay.com/my/auth?env=production&index=0&auth_type=oauth
- click on "Sign in to Production"
- Copy the long generated access token
-
eBay.OAuth2.setCredentials('paste the access token here'); - Call the catalog api
Now you should have "all" available scopes.
i got the next message:
description: 'Forbidden',
meta: {
errorId: 75015,
domain: 'API_CATALOG',
category: 'REQUEST',
message: 'Insufficient permissions to fulfill the request.',
res: {
status: 403,
statusText: 'Forbidden',
Did you use the access token from eBay directly? Which marketplace are using?
Currently the Catalog API is supported in the US, GB, AU, and CA (en) marketplaces.
@dantio yes Im using the token direct from eBay as you said me in the previous steps
Im using the US marketplace
You are calling it like this?
eBay.OAuth2.setCredentials('ACCESS TOKEN');
eBay.commerce.catalog.getProduct('240206279')
.then(result => {
console.log(JSON.stringify(result, null, 2));
})
.catch(e => {
console.log(e);
});
I see insufficient permissions only if the access token is not set.
Try the API Explorer also: https://developer.ebay.com/my/api_test_tool?index=0&api=catalog&call=product-epid__GET&variation=json&env=production
i got the next error on the Api Explorer:
{
"errors": [
{
"errorId": 75015,
"domain": "API_CATALOG",
"category": "REQUEST",
"message": "Insufficient permissions to fulfill the request."
}
]
}
@dantio i send you an email with more details, thanks
@shopeandodev hey did you managed to call API?
@dantio no yet, it seems i not have the enough scopes.
In the eBay forums someone told me i need to send my app to be checked by ebay support, but i need to pay premium support and waste my limit api calls by day to apply
i had the same issue, i believe it is to do with the ruName , once i added that to my configs ebay stopped fetching .buy.browse.getItem , so i created a second with same details less ruName and it worked , now i have 2 sets one for buy and the other for the rest
import eBayApi from 'ebay-api' import dotenv from 'dotenv'
dotenv.config()
export const eBay2 = new eBayApi({ appId: process.env.EBAY_APP_ID, certId: process.env.EBAY_CERT_ID, sandbox: false, siteId: eBayApi.SiteId.EBAY_AU, marketplaceId: eBayApi.MarketplaceId.EBAY_AU, })
export const eBay = new eBayApi({ appId: process.env.EBAY_APP_ID, certId: process.env.EBAY_CERT_ID, devId: process.env.EBAY_DEV_ID, ruName: process.env.EBAY_RU_NAME, sandbox: process.env.EBAY_SANDBOX === 'true', siteId: eBayApi.SiteId.EBAY_AU, marketplaceId: eBayApi.MarketplaceId.EBAY_AU,
})
eBay.OAuth2.setScope([ 'https://api.ebay.com/oauth/api_scope', 'https://api.ebay.com/oauth/api_scope/sell.marketing.readonly', 'https://api.ebay.com/oauth/api_scope/sell.marketing', 'https://api.ebay.com/oauth/api_scope/sell.inventory.readonly', 'https://api.ebay.com/oauth/api_scope/sell.inventory', 'https://api.ebay.com/oauth/api_scope/sell.account.readonly', 'https://api.ebay.com/oauth/api_scope/sell.account', 'https://api.ebay.com/oauth/api_scope/sell.fulfillment.readonly', 'https://api.ebay.com/oauth/api_scope/sell.fulfillment', 'https://api.ebay.com/oauth/api_scope/sell.analytics.readonly', 'https://api.ebay.com/oauth/api_scope/sell.finances', 'https://api.ebay.com/oauth/api_scope/sell.payment.dispute', 'https://api.ebay.com/oauth/api_scope/commerce.identity.readonly', 'https://api.ebay.com/oauth/api_scope/commerce.notification.subscription', 'https://api.ebay.com/oauth/api_scope/commerce.notification.subscription.readonly', ])