Python client for retailCRM API
Go to file
2020-02-19 15:30:40 +03:00
retailcrm правильная проверка на ошибки 2020-01-08 18:49:10 +03:00
tests fix tests 2020-02-19 15:28:27 +03:00
.gitignore update meta-data for pypi 2018-03-20 21:07:34 +03:00
.python-version pyenv file 2020-02-19 14:29:13 +03:00
.travis.yml fix tests 2020-02-19 15:28:27 +03:00
LICENSE new major version with multiply API version support 2018-03-20 20:32:43 +03:00
README rst formatted README for pypi 2018-03-20 21:07:34 +03:00
README.md fix readme & setup.py 2018-03-20 20:50:26 +03:00
requirements.txt Bump requests from 2.18.4 to 2.20.0 2019-11-02 09:29:18 +00:00
setup.py fix post methods bug 2018-04-22 21:39:48 +03:00

Build Status PyPI PyPI - Python Version

retailCRM python API client

This is python retailCRM API client. This library allows to use all available API versions.

Install

pip install retailcrm

Usage

API version 3 order create

# coding utf-8

import retailcrm


client = 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)

API version 4 customers history

# coding utf-8

import retailcrm


client = retailcrm.v4('https://demo.retailcrm.ru', 'uLxXKBwjQteE9NkO3cJAqTXNwvKktaTc')

result = client.customers_history(filter={'sinceId': '1500', 'startDate': '2018-03-01'})

print(result['pagination']['totalCount'])

API version 5 task create

# coding utf-8

import retailcrm


client = 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)

Documentation