npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

lightspeed-retail-sdk

v2.0.11

Published

Another unofficial Lightspeed Retail API SDK for Node.js

Downloads

46

Readme

Another Unofficial Lightspeed Retail V3 API SDK

A JavaScript SDK for interacting with the Lightspeed Retail API. This SDK provides a convenient way to access Lightspeed Retail's functionalities, including customer, item, order management, and more.

Update

  • This package has been enhanced to support both CommonJS and module usage. I have also added methods for fetching both a gift card, and all gift cards.
  • I've added PUT and POST methods to many of the domains now.

Features

  • Easy-to-use methods for interacting with various Lightspeed Retail endpoints.
  • Built-in handling of API rate limits.
  • Automatic token management for authentication.
  • Support for paginated responses from the Lightspeed API.
  • Retry logic for handling transient network issues.

Installation

npm install lightspeed-retail-sdk

Get started:

import LightspeedRetailSDK from "lightspeed-retail-sdk";

const api = new LightspeedRetailSDK({
  accountID: "Your Account No.",
  clientID: "Your client ID.",
  clientSecret: "Your client secret.",
  refreshToken: "Your refresh token.",
});

export default api

Example Request

const item = await api.getItem(7947, '["Category", "Images"]');
console.log(item);

7497 being the itemID. You can pass required relations as above.

Methods

  • getCustomer(id, relations): Fetches a specific customer by ID. Optionally, related data can be included.
  • getCustomers(relations): Retrieves all customers. Optionally, related data can be included.
  • getItem(id, relations): Fetches a specific item by ID. Optionally, related data can be included.
  • getMultipleItems(items, relations): Retrieves multiple items by their IDs. Optionally, related data can be included.
  • getItems(relations): Retrieves all items. Optionally, related data can be included.
  • getvendorItems(vendorID, relations): Retrieves all items for a specific vendor. Optionally, related data can be included.
  • getMatrixItems(relations): Fetches all matrix items. Optionally, related data can be included.
  • getMatrixItem(id, relations): Fetches a specific matrix item by ID. Optionally, related data can be included.
  • getCategory(id, relations): Retrieves a specific category by ID. Optionally, related data can be included.
  • getCategories(relations): Retrieves all categories. Optionally, related data can be included.
  • getManufacturer(id, relations): Fetches a specific manufacturer by ID. Optionally, related data can be included.
  • getManufacturers(relations): Retrieves all manufacturers. Optionally, related data can be included.
  • getOrder(id, relations): Fetches a specific order by ID. Optionally, related data can be included.
  • getOrders(relations): Retrieves all orders. Optionally, related data can be included.
  • getOrdersByVendorID(id, relations): Retrieves all orders for a specific vendor. Optionally, related data can be included.
  • getOpenOrdersByVendorID(id, relations): Fetches all open orders for a specific vendor. Optionally, related data can be included.
  • getVendor(id, relations): Fetches a specific vendor by ID. Optionally, related data can be included.
  • getVendors(relations): Retrieves all vendors. Optionally, related data can be included.
  • getSale(id, relations): Fetches a specific sale by ID. Optionally, related data can be included.
  • getSales(relations): Retrieves all sales. Optionally, related data can be included.
  • getMultipleSales(saleIDs, relations): Fetches multiple sales by their IDs. Optionally, related data can be included.
  • getSaleLinesByItem(itemID, relations): Retrieves sale lines for a specific item. Optionally, related data can be included.
  • getSaleLinesByItems(ids, startDate, endDate, relations): Retrieves sale lines for multiple items, filtered by date range. Optionally, related data can be included.
  • getSaleLinesByVendorID(id, startDate, endDate, relations): Fetches sale lines for a specific vendor, filtered by date range. Optionally, related data can be included.
  • getSpecialOrders(relations): Fetches special orders. Optionally, related data can be included.

Contributing

Contributions are welcome!

License

This project is licensed under the MIT License - see the LICENSE file for details.

Disclaimer

This SDK is not officially affiliated with Lightspeed HQ and is provided "as is" with no warranty.

More Info

The documentation for the Lightspeed Retail API can be found at https://developers.lightspeedhq.com/retail/introduction/introduction/