Lightspeed API Rust Crate
This crate provides a Rust interface for the Lightspeed eCommerce (C-Series) API. It allows you to easily integrate Lightspeed's powerful e-commerce features into your Rust applications.
Features
- Simple and intuitive API client
- Asynchronous operations using Tokio
- Comprehensive error handling
- Support for all major Lightspeed API endpoints
- Easily extensible for custom use cases
Installation
Add this to your Cargo.toml:
[]
= { = "https://github.com/NickTacke/lightspeed-api-rust.git" }
Quick Start
Here's a simple example to get you started:
use ;
use Error;
async
Usage
Initializing the Client
First, create an instance of LightspeedClient with your Lightspeed API credentials:
let client = new;
Working with Resources
Each API resource (e.g., products, orders, customers) has its own struct. Here's an example using the ProductResource:
use ;
use json;
async
Available Resources
AccountResourceProductResourceOrderResourceCustomerResource- More coming soon!
Error Handling
This crate uses a custom LightspeedApiError for API-related errors. You can catch and handle these errors in your code:
match result
License
This project is licensed under the MIT License - see the LICENSE file for details.
Disclaimer
This crate is not officially associated with or endorsed by Lightspeed. Use at your own risk.