Java api client for the lightspeed ecommerce platform, based on http://developers.lightspeedhq.com/ecom/
[] (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'
}
LightspeedEComClient lightspeedEComClient = LightspeedEComClient.builder()
.cluster("api.webshopapp.com")
.language("nl")
.authorisation("yourapikey", "yourapisecret")
.build();
The client supports the following methods:
- Account Rate limits
- getAccountRatelimit
- Attribute
- getAttribute
- Brand
- getBrand
- getBrands
- Categories
- getCategories
- getCategoryCount
- getCategory
- CategoriesProduct
- getCategoriesProducts
- getCategoriesProductsCount
- Customer
- createCustomer
- getCustomer
- getCustomers
- updateCustomer
- removeCustomer
- GroupsCustomer
- getGroupsCustomers
- getGroupsCustomersCount
- getGroupCustomer
- addGroupCustomer
- removeGroupCustomer
- Deliverydate
- getDeliverydate
- Filters
- getFilters
- getFilter
- FilterValue
- getFilterValues
- getFilterValue
- Language
- getLanguages
- Order
- getOrders
- Product
- getProducts
- getProduct
- getProductCount
- ProductAttribute
- getProductAttributes
- ProductFilterValue
- getProductFilterValues
- Quote
- getQuote
- getQuotes
- Supplier
- getSupplier
- TypeAttribute
- getTypeAttributes
- Type
- getType
- Variant
- getVariants
- getVariantCount
- Webhook
- getWebhooks
- getWebhooksCount
- getWebhook
- createWebhook
- updateWebhook
- deleteWebhook
- SingleSignOn
- createCustomerToken
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.
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.