Python client for retailCRM API
Go to file
dependabot[bot] bd3998f823
Bump requests from 2.21.0 to 2.31.0 (#35)
Bumps [requests](https://github.com/psf/requests) from 2.21.0 to 2.31.0.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.21.0...v2.31.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-16 18:23:07 +03:00
.github/workflows Update python version (#34) 2024-01-16 18:04:27 +03:00
retailcrm Fix Base.parameters. Now they will refresh after making a requests 2021-03-17 21:58:34 +04:00
tests Gh actions (#22) 2020-12-18 01:01:56 +03:00
.gitignore Gh actions (#22) 2020-12-18 01:01:56 +03:00
LICENSE minor bump 2021-09-08 16:28:10 +03:00
README minor bump 2021-09-08 16:28:10 +03:00
README.md Bug fix 2022-04-20 23:17:44 +03:00
requirements.txt Bump requests from 2.21.0 to 2.31.0 (#35) 2024-01-16 18:23:07 +03:00
setup.py Update python version (#34) 2024-01-16 18:04:27 +03:00

Build Status Coverage PyPI PyPI - Python Version

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

# 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

# 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

# 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)