lightspeed-retail-sdk 1.0.12 → 1.0.13
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.
- package/README.md +1 -0
- package/index.js +18 -0
- package/package.json +1 -1
package/README.md
CHANGED
package/index.js
CHANGED
|
@@ -437,6 +437,24 @@ class LightspeedRetailSDK {
|
|
|
437
437
|
return this.handleError("GET SALE ERROR", error);
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
+
|
|
441
|
+
async getSaleLinesByVendorID(vendorID, startDate = undefined, endDate = undefined) {
|
|
442
|
+
const options = {
|
|
443
|
+
url: `${this.baseUrl}/${this.accountID}/SaleLine.json?load_relations=["Item"]&Item.defaultVendorID=${vendorID}`,
|
|
444
|
+
method: "GET",
|
|
445
|
+
};
|
|
446
|
+
|
|
447
|
+
if (startDate && endDate)
|
|
448
|
+
options.url =
|
|
449
|
+
options.url + `&timeStamp=%3E%3C%2C${startDate}%2C${endDate}&sort=timeStamp`;
|
|
450
|
+
|
|
451
|
+
try {
|
|
452
|
+
const response = await this.getAllData(options);
|
|
453
|
+
return response;
|
|
454
|
+
} catch (error) {
|
|
455
|
+
return this.handleError("GET SALE ERROR", error);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
440
458
|
}
|
|
441
459
|
|
|
442
460
|
export default LightspeedRetailSDK;
|