Python client for retailCRM API
Go to file
2020-12-18 01:04:43 +03:00
.github/workflows Gh actions (#22) 2020-12-18 01:01:56 +03:00
retailcrm Gh actions (#22) 2020-12-18 01:01:56 +03: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 Update product name, cleanup annotations (#21) 2020-12-15 13:31:03 +03:00
README Update product name, cleanup annotations (#21) 2020-12-15 13:31:03 +03:00
README.md Update README.md 2020-12-18 01:04:43 +03:00
requirements.txt Downgrade setuptools 2020-08-20 20:43:09 +03:00
setup.py Gh actions (#22) 2020-12-18 01:01:56 +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

pip 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(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.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)