lagerkoll-nodejs-sdk v0.1.1
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) {}
};