Skip to main content

This is a simple Python wrapper for the Lightspeed X Series API.

Project description

Lightspeed X Series Python Wrapper (lightspeed_x)

This is a simple Python wrapper for the Lightspeed X Series API. It allows you to easily interact with your Lightspeed POS system using Python code.

PLEASE NOTE: This package is intended for my portfolio, rather than public use. It is subject to change or abandonment. Feel free to use it, at your own risk.

Installation

Install the package using pip:

pip install lightspeed_x

Usage

from lightspeed_x import LightspeedX


# Replace with your credentials
personal_token = "YOUR_PERSONAL_TOKEN"
domain_prefix = "YOUR_DOMAIN_PREFIX"

# Create a LightspeedX object
lightspeed = LightspeedX(personal_token, domain_prefix)

# Get all products
products = lightspeed.get("/products")

# Create a new product
new_product = {
"name": "T-Shirt",
"sku": "TSHIRT123",
"price": 19.99,
}

lightspeed.post("/products", data=new_product)

# Update a product. You must specify api_version 2.1 to use this endpoint.
product_id = 456
updated_product = {
"name": "T-Shirt (Updated)",
"price": 24.99,
}

lightspeed.put(
    f"/products/{product_id}",
    data=updated_product,
    api_version="2.1",
)

# Delete a product
lightspeed.delete(f"/products/{product_id}")

Features

  • Supports all available Lightspeed X Series API endpoints.
  • Provides convenient methods for GET, POST, PUT, and DELETE requests.
  • Automatically handles authentication and request formatting.
  • Allows specifying the API version for each request. Default: 2.0

Documentation

Full API reference: https://x-series-api.lightspeedhq.com/reference

Contributing

Pull requests and suggestions are welcome! Please see the CONTRIBUTING.md file for details.

License

MIT License

Additional Notes

Refer to the Lightspeed X Series API documentation for more details on available endpoints and data structures.

Remember to replace the placeholder credentials with your own before using the code.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lightspeed_x-0.1.2.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

lightspeed_x-0.1.2-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file lightspeed_x-0.1.2.tar.gz.

File metadata

  • Download URL: lightspeed_x-0.1.2.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.7

File hashes

Hashes for lightspeed_x-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c60ae049c86335176b04b0367b5149c8aaaf003566c4132a227991926482f7c9
MD5 60f892cd701ffe2b7b6573921d804a28
BLAKE2b-256 fde90488f40927eccc52951126b0e32e84c747d3a70a19c99644891b574e5bdd

See more details on using hashes here.

File details

Details for the file lightspeed_x-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for lightspeed_x-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c35b7dd155965abee2f25b0198147a595ba6119468f54782d2e6350f6988920c
MD5 2bfb5c9435758c4c3422ff7e0c8e292c
BLAKE2b-256 8b62cb114ce98c9b23b7c41a571db94bbb8d4d76cbe2d0c4364f52c1a11d0d6d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page