Newegg SDK for Java - Common


License

License

GroupId

GroupId

com.newegg.marketplace
ArtifactId

ArtifactId

sdk-common
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

Newegg SDK for Java - Common
Project URL

Project URL

https://developer.newegg.com/

Download sdk-common

How to add to project

<!-- https://jarcasting.com/artifacts/com.newegg.marketplace/sdk-common/ -->
<dependency>
    <groupId>com.newegg.marketplace</groupId>
    <artifactId>sdk-common</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.newegg.marketplace/sdk-common/
implementation 'com.newegg.marketplace:sdk-common:1.0.0'
// https://jarcasting.com/artifacts/com.newegg.marketplace/sdk-common/
implementation ("com.newegg.marketplace:sdk-common:1.0.0")
'com.newegg.marketplace:sdk-common:jar:1.0.0'
<dependency org="com.newegg.marketplace" name="sdk-common" rev="1.0.0">
  <artifact name="sdk-common" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.newegg.marketplace', module='sdk-common', version='1.0.0')
)
libraryDependencies += "com.newegg.marketplace" % "sdk-common" % "1.0.0"
[com.newegg.marketplace/sdk-common "1.0.0"]

Dependencies

compile (12)

Group / Artifact Type Version
io.github.openfeign : feign-jackson jar 10.1.0
io.github.openfeign : feign-jaxb jar 10.1.0
io.github.openfeign : feign-slf4j jar 10.1.0
io.github.openfeign : feign-mock jar 10.1.0
org.apache.logging.log4j : log4j-jcl jar 2.11.1
org.apache.logging.log4j : log4j-slf4j-impl jar 2.11.1
org.apache.logging.log4j : log4j-jul jar 2.11.1
commons-io : commons-io jar 2.6
org.apache.commons : commons-configuration2 jar 2.4
commons-beanutils : commons-beanutils jar 1.9.3
org.eclipse.persistence : eclipselink jar 2.7.4
org.eclipse.persistence : org.eclipse.persistence.moxy jar 2.7.4

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

Newegg SDK for Java

Newegg Marketplace SDK(Java) is a library to help Java programmer easily integrates with Newegg Marketplace API. It provides the definition of the data objects models to help coder create the request and resolve the response. It also provides customize of logger and retry mechanism. To use the SDK to communicate with the Newegg API, you need to be a registered seller and get the 'API Key(Authorization)' and 'Secret Key' by mail [email protected]. You can put this information into a 'newegg.properties' file. Without the Authorization Token and Secret Key, you can run the test project with Simulation Mode. This mode is to help you understand the SDK before actual use.

Technology

  • java 1.8+
  • openfeign
  • log4j2
  • commons-configuration2

build

  • mvn package

How to use it in your project

Maven

  • Set pom.xml of project
  <parent>
    <groupId>com.newegg.marketplace</groupId>
    <artifactId>sdk-all</artifactId>
    <version>{version}</version>
  </parent>
	
	and other that you used

Project

  • Write your property (newegg.properties)
newegg.simulation=false
newegg.platform=USA
newegg.hosturl=https://api.newegg.com/marketplace
newegg.sellerid=XXX
newegg.authorization=XXXXXXXXXXXX
newegg.secretkey=XXXX-XXXXX-XXXX-XXXX-XXXX
newegg.retry.period=100
newegg.retry.maxperiod=1000
newegg.retry.maxattempts=2
newegg.loglevel=NONE
newegg.connectTimeoutMillis=10000
newegg.readTimeoutMillis=60000
newegg.item.simulation=false
newegg.item.retry.period=100
newegg.item.retry.maxperiod=1000
newegg.item.retry.maxattempts=2
newegg.item.loglevel=FULL
  • loglevel
NONE: No logging
BASIC: Log only the request method and URL and the response status code and execution time
HEADERS: Log the basic information along with request and response headers
FULL: Log the headers, body, and metadata for both requests and responses
  • Write your code
APIConfig.load(ItemConfig.class);	
ItemCall call=new ItemCall();
GetVolumeDiscountRequest request=new GetVolumeDiscountRequest();
GetVolumeDiscountRequest.RequestBody body=new GetVolumeDiscountRequest.RequestBody();                          
body.setNeweggItemNumber("XXXXXXXXXXXXXX");
request.setRequestBody(body);		
GetVolumeDiscountResponse r=call.getVolumeDiscountRequestResult(request);

Do something

How to get the API key and Secret Key?

1. Send the request to [email protected] from the seller default email address.
2. The message should include seller name or default email address.
Newegg Marketplace team will process all requests in 24 hours.

Note

  • There is a file "newegg.properties" at same directory.
  • The jar of common module must be have.
  • The properties of common module must be set up.
  • If the APP not load the configuration ,the simulation will be enabled
How to load configuration ?
APIConfig.load(SellerConfig.class);

  • Log4j configuration file location
By default, Log4j looks for a configuration file named log4j2.xml (not log4j.xml) in the classpath.
You can also specify the full path of the configuration file with this system property: -Dlog4j.configurationFile=path/to/log4j2.xml
Web applications can specify the Log4j configuration file location with a servlet context parameter.

Modules

common

  • used for other modules

Item

Seller

Order

Shipping

Other

SBN

DataFeed

Report

RMA

com.newegg.marketplace

Newegg Inc

Versions

Version
1.0.0
0.1.1
0.1.0