Falkplan/lightspeedecom-api


Java api client for the lightspeed ecommerce platform http://developers.lightspeedhq.com/ecom/

Download


Step 1. Add the JitPack repository to your build file

Add it in your root settings.gradle at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url 'https://jitpack.io' }
		}
	}

Add it in your settings.gradle.kts at the end of repositories:

	dependencyResolutionManagement {
		repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
		repositories {
			mavenCentral()
			maven { url = uri("https://jitpack.io") }
		}
	}

Add to pom.xml

	<repositories>
		<repository>
		    <id>jitpack.io</id>
		    <url>https://jitpack.io</url>
		</repository>
	</repositories>

Add it in your build.sbt at the end of resolvers:

 
    resolvers += "jitpack" at "https://jitpack.io"
        
    

Add it in your project.clj at the end of repositories:

 
    :repositories [["jitpack" "https://jitpack.io"]]
        
    

Step 2. Add the dependency

	dependencies {
		implementation 'com.github.falkplan:lightspeedecom-api:v1.1.0'
	}
	dependencies {
		implementation("com.github.falkplan:lightspeedecom-api:v1.1.0")
	}
	<dependency>
	    <groupId>com.github.falkplan</groupId>
	    <artifactId>lightspeedecom-api</artifactId>
	    <version>v1.1.0</version>
	</dependency>

                            
    libraryDependencies += "com.github.falkplan" % "lightspeedecom-api" % "v1.1.0"
        
        

                            
    :dependencies [[com.github.falkplan/lightspeedecom-api "v1.1.0"]]
        
        

Readme


lightspeedecom-api

Java api client for the lightspeed ecommerce platform, based on http://developers.lightspeedhq.com/ecom/

install

[Release] (https://jitpack.io/#falkplan/lightspeedecom-api)

Add jitpack.io repository: https://jitpack.io/

Add dependency to maven:

dependency>
    <groupId>com.github.Falkplan</groupId>
    <artifactId>lightspeedecom-api</artifactId>
    <version>v1.0.0</version>
</dependency>

or gradle:

dependencies {
  compile 'com.github.Falkplan:lightspeedecom-api:v1.0.0'
}

Usage

LightspeedEComClient lightspeedEComClient = LightspeedEComClient.builder()
                .cluster("api.webshopapp.com")
                .language("nl")
                .authorisation("yourapikey", "yourapisecret")
                .build();

The client supports the following methods:

Error handling

LightspeedEComErrorException (RunTimeException) can be thrown at any call when the api returns an error status, the error description will be contained in the .error object inside the exception.

Know that your api key has a rate limit that will throw an error when it exceeds the limit.

There is an option to use the "force" method in the builder to retry a request when the limit was exceeded, this will block the tread though!

There is also an option to set a request limit ("limit" in builder) to only use a certain amount of requests, to preserve the rate limit for other usages.

Testing

To run the tests rename default.test.properties to test.properties and set all values.

To acquire authentication see: http://developers.lightspeedhq.com/ecom/introduction/authentication/ and see http://developers.lightspeedhq.com/ecom/introduction/clusters/ for cluster.

Warning: Tests are not setup for users of this library, but they could be edited for universal usage.


Notice: Falkplan is not to be associated with Lightspeed, Falkplan is merely a customer of Lightspeed.