ecwid.com API
NodeJS wrapper forModule fully relies on ecwid.com REST API v3
Simple usage
YOUR_STORE_ID and YOUR_PRIVATE_OR_PUBLIC_ACCESS_TOKEN values are reuired to work with ecwid.com REST API
const ecwid = YOUR_STORE_ID YOUR_PRIVATE_OR_PUBLIC_ACCESS_TOKEN;
Every method returns a Promise with result of the request
Get store profile
ecwid ;
Add product
const productData = name: 'New product' price: 100 enabled: true ...ecwid ;
Upload product image
Product image upload function accepts a Buffer
const imagePath = 'path/to/my/product/image.jpg'fs
The whole list of available methods
- getClasses()
- getStoreProfile()
- getOrderDetails(orderId)
- searchProducts(options)
- getProducts(options)
- getProduct(productId)
- addProduct(product)
- deleteProduct(productId)
- updateProduct(productId, product)
- uploadProductImage(productId, buffer)
- uploadProductImageExternal(productId, externalUrl)
- deleteProductImage(productId)
- uploadGalleryImage(productId, buffer)
- uploadGalleryImageExternal(productId, externalUrl)
- cleanGallery(productId)
- searchOrders(options)
- getOrderDetails(orderNumber)
- updateOrder(orderNumber, data)
- deleteOrder(orderNumber)
- getCategories(options)
- addCategory(category)
- deleteCategory(categoryId)
- updateCategory(categoryId, data)
- searchCustomers(options)
- getCustomer(customerId)
- createCustomer(data)
- updateCustomer(customerId, data)
- deleteCustomer(customerId)
- getAllStorage()
- getStorage(key)
- addStorage(key, data)
- editStorage(key, data)
- deleteStorage(key)
Testing
For running tests copy config.js.example to config.js (gitignored) and fill it with your store id and secret key.
Then run npm test