Metadata-Version: 2.4
Name: retailcrm
Version: 5.2.0
Summary: RetailCRM API client
Project-URL: Homepage, https://github.com/retailcrm/api-client-python
Project-URL: Issues, https://github.com/retailcrm/api-client-python/issues
Author-email: Alex Lushpai <lushpai@gmail.com>
Maintainer-email: Alex Lushpai <lushpai@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: api,ecom,retailcrm
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Other Environment
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Requires-Dist: coverage==4.5.4
Requires-Dist: hatchling>=1.26
Requires-Dist: multidimensional-urlencode==0.0.4
Requires-Dist: nose==1.3.7
Requires-Dist: pook==1.3.0
Requires-Dist: requests==2.32.4
Description-Content-Type: text/markdown

[![Build Status](https://github.com/retailcrm/api-client-python/workflows/ci/badge.svg)](https://github.com/retailcrm/api-client-python/actions)
[![Coverage](https://img.shields.io/codecov/c/gh/retailcrm/api-client-python/master.svg?logo=codecov&logoColor=white)](https://codecov.io/gh/retailcrm/api-client-python)
[![PyPI](https://img.shields.io/pypi/v/retailcrm.svg?logo=pypi&logoColor=white)](https://pypi.python.org/pypi/retailcrm)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/retailcrm.svg?logo=python&logoColor=white)](https://pypi.python.org/pypi/retailcrm)


RetailCRM python API client
===========================

This is Python RetailCRM API client. This library allows to use all available API versions.

## Install

```
pip3 install retailcrm
```

## Usage

#### API version 3 order create

```python
# coding utf-8

import retailcrm


client = retailcrm.v3('https://demo.retailcrm.pro', '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

```python
# coding utf-8

import retailcrm


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

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

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

#### API version 5 task create

```python
# coding utf-8

import retailcrm


client = retailcrm.v5('https://demo.retailcrm.pro', '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)
```
