零售CRM API客户端
retailcrm的Python项目详细描述
这是python retailcrm api客户端。这个库允许使用所有 可用的API版本。
安装
pip install retailcrm
用法
# coding utf-8importretailcrmclient=retailcrm.v3('https://demo.retailcrm.ru','uLxXKBwjQteE9NkO3cJAqTXNwvKktaTc')order={'firstName':'John','lastName':'Doe','phone':'+79000000000','email':'john@example.com','orderMethod':'call-request',}result=client.order_create(order)
# coding utf-8importretailcrmclient=retailcrm.v4('https://demo.retailcrm.ru','uLxXKBwjQteE9NkO3cJAqTXNwvKktaTc')result=client.customers_history(filter={'sinceId':'1500','startDate':'2018-03-01'})print(result['pagination']['totalCount'])
# coding utf-8importretailcrmclient=retailcrm.v5('https://demo.retailcrm.ru','uLxXKBwjQteE9NkO3cJAqTXNwvKktaTc')site='example-com'task={'text':'Product availability problem','commentary':'Take a look ASAP','order':{'externalId':'100500'},'performerId':1}result=client.task_create(task,site)