lightspeed-retail-sdk 1.0.7 → 1.0.8
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 +16 -0
- package/package.json +1 -1
package/README.md
CHANGED
package/index.js
CHANGED
|
@@ -180,6 +180,22 @@ class LightspeedRetailSDK {
|
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
+
async getvendorItems(vendorID, relations) {
|
|
184
|
+
const options = {
|
|
185
|
+
url: `${this.baseUrl}/${this.accountID}/Item.json?defaultVendorID=${vendorID}`,
|
|
186
|
+
method: "GET",
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
if (relations) options.url = options.url + `?load_relations=${relations}`;
|
|
190
|
+
|
|
191
|
+
try {
|
|
192
|
+
const response = await this.getAllData(options);
|
|
193
|
+
return response;
|
|
194
|
+
} catch (error) {
|
|
195
|
+
return this.handleError("GET ITEMS ERROR", error.response);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
183
199
|
async getItem(itemID, relations) {
|
|
184
200
|
const options = {
|
|
185
201
|
url: `${this.baseUrl}/${this.accountID}/Item/${itemID}.json`,
|