Skip to content

Simple Python Library to use with Lightspeed HQ API

Notifications You must be signed in to change notification settings

beckf/lightspeed_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lightspeed HQ API Python Library

Updated for Lightspeed API V3

Gives easy access to the Lightspeed retail point of sale api.

To use create a new object with settings in a dictionary. Then just specify the endpoints and parameters in your request.

For API documentation see: https://developers.lightspeedhq.com/retail/introduction/introduction/

Some examples of uses:

# Create a new dictionary with some settings that we will need.
import lightspeed_api

c = {'account_id': '12345678',
    'client_id': 'developer_client_id',
    'client_secret': 'developer_client_secret',
    'refresh_token': 'special_refresh_token'
}
    
ls = lightspeed_api.Lightspeed(c)

# Get a customer record
ls.get('Customer/1234')

# Delete a customer by id number
ls.delete('Customer/1234')

# Create a new customer
formatted = {'Customer':
                {'firstName': 'Joe',
                 'lastName': 'Smith',
                 'companyRegistrationNumber': '1234',
                 'customerTypeID': 1,
                 'Contact': {
                     'custom': '',
                     'noEmail': 'false',
                     'noPhone': 'false',
                     'noMail': 'false',
                     'Emails': {
                         'ContactEmail': {
                             'address': '[email protected]',
                             'useType': 'Primary'
                         }
                     },
                     'Addresses': {
                         'ContactAddress': {
                             'address1': '1212 Street Drive',
                             'address2': '',
                             'city': 'New York',
                             'state': 'New York',
                             'zip': '12345',
                             'country': 'USA',
                             'countryCode': '',
                             'stateCode': ''
                         }
                     }
                 },
                 }
            }
ls.create("Customer", formatted["Customer"])

About

Simple Python Library to use with Lightspeed HQ API

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages