ebay-api icon indicating copy to clipboard operation
ebay-api copied to clipboard

How to SetNotificationPreferences multiples

Open liberat0r opened this issue 1 year ago • 2 comments

  • [x] Are you running the latest version?
  • [x] Have you checked if you are using correct configuration?

Describe the bug How to subscribe to multiple notifications in one call? The object key is "UserDeliveryPreferenceArray" but it contains an object.

Code

   const notifs = await thisInstance.trading.SetNotificationPreferences({
      UserDeliveryPreferenceArray: {
          // https://developer.ebay.com/Devzone/XML/docs/Reference/eBay/types/NotificationEventTypeCodeType.html
          NotificationEnable: {
              EventType: 'ItemListed',
              EventEnable: 'Enable',
          },
          //NotificationEnable: {
          //    EventType: 'ItemSold',
          //    EventEnable: 'Enable',
          //},
          // ItemMarkedPaid ItemMarkedShipped ItemRevised ItemSold
      },
  });

Would you like to work on this issue?

  • [ ] Yes
  • [x] No
  • [ ] Maybe

liberat0r avatar Jul 01 '24 14:07 liberat0r

Good question. I'll work on that.

dantio avatar Jul 01 '24 21:07 dantio

I have release 9.1.0

This is how it should work:

eBay.trading.SetNotificationPreferences({
  UserDeliveryPreferenceArray: [{
    NotificationEnable: {
      EventType: 'ItemListed',
      EventEnable: 'Enable',
    }
  }, {
    NotificationEnable: {
      EventType: 'ItemSold',
      EventEnable: 'Enable',
    },
  }],
}, { xmlBuilderOptions: { oneListGroup: true }})

dantio avatar Jul 02 '24 19:07 dantio