node.jsebay-api

Ebay AddFixedPriceItem Variation Image not showing in listing


I am using the ebay-api npm package. I am creating a item with variations and this all works fine and the item gets created. The one problem I have, the images for each variation do not show on the listing.

const item = {
  Item: {
    Title: `${collection.title} - Complete Your Collection`,
    Description: `<p>${collection.collection}</p>`,
    PrimaryCategory: { CategoryID: collection.category },
    Site: "UK",
    Location: "Cannock",
    PostalCode: "WS12 4LU",
    ListingType: "FixedPriceItem",
    ConditionID: 3000,
    Country: "GB",
    Currency: "GBP",
    ReturnPolicy: {
      ReturnsAcceptedOption: "ReturnsAccepted",
      ReturnsWithinOption: "Days_30",
      ShippingCostPaidByOption: "Buyer",
    },
    ListingDuration: "GTC",
    ShippingDetails: {
      ShippingType: "Flat",
      ShippingServiceOptions: {
        ShippingServicePriority: 1,
        ShippingService: "UK_RoyalMail48",
        ShippingServiceCost: "0.99",
      },
    },
    DispatchTimeMax: 3,
    PictureDetails: {
      PictureURL: collection.collectionImage,
    },
    CategoryMappingAllowed: true,
    ItemSpecifics: {
      NameValueList: [
        {
          Name: "Type",
          Value: collection.type,
        },
        {
          Name: "Season",
          Value: collection.season,
        },
        {
          Name: "League",
          Value: collection.league,
        },
        {
          Name: "Manufacturer",
          Value: collection.manufacturer,
        },
        {
          Name: "Collection",
          Value: collection.collection,
        },
        {
          Name: "Sticker Condition",
          Value: "Good Condition",
        },
        {
          Name: "Sticker State",
          Value: "Non-stuck",
        },
        {
          Name: "Sport",
          Value: "Football",
        },
        {
          Name: "Event/Tournament",
          Value: collection.league,
        },
      ],
    },
    Variations: {
      Variation: filteredStickers.map((sticker) => {
        const randSku = generateSku();
        return {
          StartPrice: sticker.lowestPrice,
          Quantity: sticker.quantity,
          SKU: randSku,
          VariationSpecifics: {
            NameValueList: [
              {
                Name: "Sticker",
                Value: `${sticker["sticker-number"]} - ${sticker.title}`,
              },
            ],
          },
          VariationSpecificPictures: {
            VariationSpecificValue: `${sticker["sticker-number"]} - ${sticker.title}`,
            PictureURL: [sticker.imagePath],
          },
        };
      }),
      VariationSpecificsSet: {
        NameValueList: [
          {
            Name: "Sticker",
            Value: filteredStickers.map(
              (sticker) => `${sticker["sticker-number"]} - ${sticker.title}`
            ),
          },
        ],
      },
    },
  },
};


const result = await ebay.trading.AddFixedPriceItem(item);

sticker.imagePath is an image hosted on imgbb and loads fine in the browser. I get no error message, purely a success message, I am at a loss as to how I make an image show for a variation.

Thanks

I tried adjusting my code and tweaking values.

I am expecting images to show for variations.


Solution

  • I was constructing the object incorrectly, I needed to add this to the root of Variations:

    Pictures: [
          {
            VariationSpecificName: "Sticker",
            VariationSpecificPictureSet: filteredStickers.map((sticker) => {
              return {
                VariationSpecificValue: `${sticker["sticker-number"]} - ${sticker.title}`,
                PictureURL: [sticker.imagePath],
              };
            }),
          },
        ],