hendt / ebay-api

eBay Node API in TypeScript for Node and Browser with RESTful and Traditional APIs. This library aims to implement all available eBay apis.
https://hendt.gitbook.io/ebay-api
MIT License
153 stars 41 forks source link

"could not be found or is not available in the system for the marketplace EBAY_AU" #153

Closed zenith77 closed 1 year ago

zenith77 commented 1 year ago

Describe the bug In Production, using the setup below, I'm getting the error;

the-name-of-the-sku could not be found or is not available in the system for the marketplace EBAY_AU.

I also get the error in the Sandbox, too.

Code


const eBay = new eBayApi({
  appId: '...',
  certId: '...',

  sandbox: false,

  siteId: eBayApi.SiteId.EBAY_AU,
  marketplaceId: eBayApi.MarketplaceId.EBAY_AU,
  acceptLanguage: eBayApi.Locale.en_AU,
  contentLanguage: eBayApi.ContentLanguage.en_AU,

  ruName: '...'
});

....

    const item = await eBay.sell.inventory.createOrReplaceInventoryItem(sku, {
      "product": {
        "title": "Title",
        "description": "Test listing - do not bid or buy \n This is a description ",
        "imageUrls": [
          "https://a.url.webp"
        ],

      },
      condition: Condition.LIKE_NEW,
      "availability": {
        "shipToLocationAvailability": {
          "quantity": 1
        }
      },
    });
    console.log(item);
    console.log('item created');

    const offer = await eBay.sell.inventory.createOffer({
      sku: sku,
      marketplaceId: Marketplace.EBAY_AU,
      format: FormatType.FIXED_PRICE,
      categoryId: '259104',
      listingPolicies: {
        fulfillmentPolicyId: '123'
        paymentPolicyId: '123'
        returnPolicyId: '123',
      },
      merchantLocationKey: 'LocationName',
      pricingSummary: {
        price: {
          value: '0.99',
          currency: CurrencyCode.AUD,
        }
      },
    });
zenith77 commented 1 year ago

I realised there was a mismatch in the accept language in the headers, that was causing the issue.

Naturally worked that out almost as soon as I posted this.