cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unable to retrieve existing offers using the inventory API

I've been developing a way for our company to update eBay orders on a regular basis. We're selling items whose prices change frequently and we want to be able to update listings regularly (within the rate limits) on eBay. The problem is, that i've created a nodejs app that retrieves offers by skus using the offer endpoint with scope of inventory api:  https://api.ebay.com/sell/inventory/v1/offer?sku=19250

 

When I try to retireve the item, I get a 404 error, but I see this sku as an active listing on my account: https://www.ebay.com/sh/lst/active

I'm not sure how to proceed from here as this all was working on my Sandbox, when switching to production, it's not working now. The only difference I can think of is that I had to create the offers via the api on the sandbox account, is this why it's working in that environment only? The production listings were created via different venues. 

 

Any help is appreciated!

 

Here's the small function I'm using to get the offers by sku:

 

async function getOfferBySku(accessToken, sku) {
  console.log("eBayApiBase:", `${eBayApiBase}/offer?sku=${sku}`);
  try {
    const offersResponse = await axios.get(`${eBayApiBase}/offer?sku=${sku}`, {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "Content-Type": "application/json",
      },
    });
    return offersResponse.data;
  } catch (error) {
    console.error("Error fetching offers:");
    throw error;
  }
}

 

The url eBayApiBase console.log successfully logs as: https://api.ebay.com/sell/inventory/v1/offer?sku=19250

 

It always throws the error with the following message: Error fetching offers: Request failed with status code 404.

Any help is appreciated! 

Message 1 of 5
latest reply
4 REPLIES 4

Unable to retrieve existing offers using the inventory API

When you created an offer, did you also publish it? By default it is not published.

But I think it should still return the offer even If it is not published.

I just tried on my end with Postman and C# and it is working as expected.

C# wrapper for eBay REST API
https://github.com/CMS365-PTY-LTD/EbaySharp
Message 2 of 5
latest reply

Unable to retrieve existing offers using the inventory API

I didn't create these offers via the API, they are active listings on eBay though. I didn't have to publish them on the Sandbox to be able to view them using this exact code. Still not able to see why it's not working. Unless I'm missing something, I don't see why it shouldn't work on eBay production vs sandbox.

Message 3 of 5
latest reply

Unable to retrieve existing offers using the inventory API

If those Offers are not created by the API, then you can't access them with the API.

Old offers can be retrieved with the old trading API.

Another option is to migrate the old listing to the new API and then access offers.

I have give some detail here 

C# wrapper for eBay REST API
https://github.com/CMS365-PTY-LTD/EbaySharp
Message 4 of 5
latest reply

Unable to retrieve existing offers using the inventory API

Yes, this seems to be the issue. Thanks for pointing me in the right direction!

Message 5 of 5
latest reply