0.1.1 • Published 8 years ago

lagerkoll-nodejs-sdk v0.1.1

Weekly downloads
-
License
ISC
Repository
-
Last release
8 years ago

This SDK wraps the API of Lagerkoll (www.lagerkoll.com).

Url to API: http://www.lagerkoll.com/capi-doc/v1/

To get started: The SDK has been implemented in TestSDK.js. Check there for reference to callback-methods and usage of the methods

Create an instance of DataManager:

var dataManager = new DataManager(BASE_URL, API_KEY, MAIN_STORE_ID, CALLBACK_URL, CALLBACK_PORT, CALLBACK_METHOD);

BASE_URL: is the base-url of the API (http://www.lagerkoll.com/capi/v1) API_KEY: is used to validate the requests and can be fetched from where the API is activated on Lagerkoll.com MAIN_STORE_ID: if you only have one stock/store, this is the id for that stock/store. If you have more than one, this should point to the main one (the one created when you registered to Lagerkoll) CALLBACK_URL: If you'd like Lagerkoll to let you know when something has been updated on their server-side you can start a server, listening on a specific endpoint and port CALLBACK_PORT: If you'd like Lagerkoll to let you know when something has been updated on their server-side you can start a server, listening on a specific endpoint and port CALLBACK_METHOD: This is the interface that will receive the callbacks. See below for an implementation of the interface

Callback-interface:

var callback = function() { this.onArticleCreated = function(storeId, article) {} this.onArticleUpdated = function(storeId, article) {} this.onArticleDeleted = function(storeId, articleId) {}

this.onStoreCreated = function(storeId) {}
this.onStoreUpdated = function(storeId) {}
this.onStoreDeleted = function(storeId) {}

this.onPricelistCreated = function(storeGroupId, pricelist) {}
this.onPricelistUpdated = function(storeGroupId, pricelist) {}
this.onPricelistDeleted = function(storeGroupId, pricelistId) {}

this.onPriceCreated = function(storeGroupId, price) {}
this.onPriceUpdated = function(storeGroupId, price) {}
this.onPriceDeleted = function(storeGroupId, pricelistId, articleId, fromQuantity) {}

this.onCurrencyUpdated = function(storeId, response) {}

this.onCustomerCreated = function(storeId, customer) {}
this.onCustomerUpdated = function(storeId, customer) {}
this.onCustomerDeleted = function(storeId, customerId) {}

this.onCustomerDeliveryTermCreated = function(storeId, customerDeliveryTerm) {}
this.onCustomerDeliveryTermUpdated = function(storeId, customerDeliveryTerm) {}
this.onCustomerDeliveryTermDeleted = function(storeId, code) {}

this.onWayOfDeliveryCreated = function(storeId, wayOfDelivery) {}
this.onWayOfDeliveryUpdated = function(storeId, wayOfDelivery) {}
this.onWayOfDeliveryDeleted = function(storeId, code) {}

this.onPaymentTermCreated = function(storeId, paymentTerm) {}
this.onPaymentTermUpdated = function(storeId, paymentTerm) {}
this.onPaymentTermDeleted = function(storeId, code) {}

this.onCustomerOrderCreated = function(storeId, customerOrder) {}
this.onCustomerOrderUpdated = function(storeId, customerOrder) {}
this.onCustomerOrderDeleted = function(storeId, customerOrderId) {}

this.onSupplierCreated = function(storeId, supplier) {}
this.onSupplierUpdated = function(storeId, supplier) {}
this.onSupplierDeleted = function(storeId, supplierId) {}

this.onSupplierDeliveryTermCreated = function(storeId, supplierDeliveryTerm) {}
this.onSupplierDeliveryTermUpdated = function(storeId, supplierDeliveryTerm) {}
this.onSupplierDeliveryTermDeleted = function(storeId, code) {}

};

0.1.1

8 years ago

0.1.0

8 years ago

0.0.12

8 years ago

0.0.11

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago