用于与LightSpeed HQ API交互的简单库
lightspeed-api的Python项目详细描述
lightspeed hq api python库
轻松访问LightSpeed零售点API。
使用在字典中创建具有设置的新对象。那就说明 请求中的终结点和参数。
有关API文档,请参见:https://developers.lightspeedhq.com/retail/introduction/introduction/
一些用法示例:
# Create a new dictionary with some settings that we will need.importlightspeed_apic={'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 recordls.get('Customer/1234')# Delete a customer by id numberls.delete('Customer/1234')# Create a new customerformatted={'Customer':{'firstName':'Joe','lastName':'Smith','companyRegistrationNumber':'1234','customerTypeID':1,'Contact':{'custom':'','noEmail':'false','noPhone':'false','noMail':'false','Emails':{'ContactEmail':{'address':'joe.smith@company.com','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"])