Wrap XML eBay api in node js


stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
Minified + gzip package size for @lettopia/ebay-api in KB


Lettopia eBay API


  • The original code has ebay api coupled into the code, which makes it hard to do unit test.
  • Make it a seperate package also help us to reuse it.
  • Decouple the code will help ebay.js looks more clear.


1. Ebay

A singleton in the application. It takes appId, devId and certId secret to construct. Provide the following functions:

[x] GetOAuthToken: For OAuth

[x] GetRefreshToken: For OAuth renew

[x] GetSessionId: For Auth'nAuth

2. EbayClient

It is like eBay seller. It takes token to construct. There are two authentication methods provided by eBay, i.e OAuth and Auth'nAuth which you have to specify when you create it.

[x] GetOrders: For getting ebay order

[x] GetSellerList: For getting ebay seller products

[x] GetUser: Get account when create ebay user

[x] CompleleSale: Update tracking number

[x] SetNotificationPreferences: Set the user notification

[x] AddFixedPriceItem: List item to ebay

[x] GetUserPreferences: Get user preference including its listing limit

[x] GetMyeBaySelling: Get seller's selling

[x] SetUserPreferences: Set the user's preference, including Out-of-Stock feature

[x] ReviseInventoryStatus: Used for inventory sync

[x] ReviseFixedPriceItem: Set the item to GTC listing for out-of-stock feature

3. ParsedFixedPriceItemNotification

Parse info from the recieved ebay notification

General flow of calling eBay API:

  1. Build XML request by API name and authentication type. xml-builder
  2. Send the request to ebay endpoint.
  3. Parse the response into json. xpath is a good way


Use mocha as the unit test.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.