Skip to content

coddin-web/lightspeed-php-sdk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Lightspeed eCom

Latest Stable Version Latest Unstable Version License

Improved Lightspeed eCom PHP API client

This package is a convenience wrapper to communicate with the Lightspeed eCom REST-API.

Requirements

To use the Lightspeed eCom PHP API client, the following things are required:

  • PHP >= 5.4
  • cURL, JSON, mbstring and FileInfo PHP extensions

Installation

By far the easiest way to install the Lightspeed eCom PHP API client is to require it with Composer.

$ composer require coddin-web/lightspeed-php-sdk:^1.9
{
    "require": {
        "coddin-web/lightspeed-php-sdk": "^1.9"
    }
}

Usage

There are a lot of API resources that are accessible through this client. You can look them up by looking at the code. Their name matches the name in the documentation.

<?php
require 'vendor/autoload.php';

$client = new \Lightspeed\ApiClient('[api-server]', '[api-key]', '[api-secret]', '[language]');

$shopInfo = $client->shop->get();

Explanation

[api-server] Available server(-clusters): live, eu1, us1

[api-key] The API key you've received or created

[api-secret] The API secret you've received or created

[language] Language shortcode that's available in the shop you're connecting to

Fetching response headers

After making a call, you can fetch the response headers from our API server and use it to check important data such as rate limiting.

$shopInfo = $client->shop->get();
$response = $shopInfo->getResponseHeaders();

Getting started

Lightspeed eCom offers a powerful set of API’s for developers to create awesome apps. The API provides developers the interface to connect with third party software such as accounting-, feedback-, e-mailmarketing- and inventory management-software, or extend with new features that interact with our core platform, such as loyalty programs, social-sharing programs or reporting tools.

Getting started with Lightspeed eCom is easy. Not a partner yet? Please sign up as a partner and claim your account details and API keys.

Read our tutorials on how to build and publish your first app. Check our introduction to find out how to use the API

Documentation

More documentation can be found at developers.lightspeedhq.com/ecom

Contributing

Send a PR!