Socket
Socket
Sign inDemoInstall

@lettopia/ebay-api

Package Overview
Dependencies
64
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lettopia/ebay-api

Wrap XML eBay api in node js


Version published
Maintainers
1
Weekly downloads
2
increased by100%

Weekly downloads

Readme

Source

Lettopia eBay API

Reason

  • 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.

Class

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

Test

Use mocha as the unit test.

FAQs

Last updated on 06 Jun 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc