lightspeed-retail-sdk 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +2 -0
  2. package/index.js +16 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -18,6 +18,8 @@ getVendors()
18
18
  getVendor()
19
19
  getSales()
20
20
  getSale()
21
+ getOrdersByVendorID()
22
+ getOpenOrdersByVendorID()
21
23
  ```
22
24
 
23
25
  ## Get started:
package/index.js CHANGED
@@ -288,6 +288,22 @@ class LightspeedRetailSDK {
288
288
  }
289
289
  }
290
290
 
291
+ async getOpenOrdersByVendorID(vendorID) {
292
+ const options = {
293
+ url: `${this.baseUrl}/${this.accountID}/Order.json?load_relations=["Vendor", "OrderLines"]&vendorID=${vendorID}&complete=false`,
294
+ method: "GET",
295
+ };
296
+
297
+ // if (relations) options.url = options.url + `?load_relations=${relations}`;
298
+
299
+ try {
300
+ const response = await this.getAllData(options);
301
+ return response;
302
+ } catch (error) {
303
+ return this.handleError("GET ORDER ERROR", error);
304
+ }
305
+ }
306
+
291
307
  async getVendors(relations) {
292
308
  const options = {
293
309
  url: `${this.baseUrl}/${this.accountID}/Vendor.json`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lightspeed-retail-sdk",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Another unofficial Lightspeed Retail API SDK for Node.js",
5
5
  "main": "index.js",
6
6
  "scripts": {