pyiikocloudapi
pyiikocloudapi copied to clipboard
Python iiko cloud api сервис
pyiikocloudapi - python iikoCloud API сервис

Установка
Пользуем pip:
pip install pyiikocloudapi
Зависимости
requests
pydantic
Начиная с версии 0.0.20
requests
pydantic>=2.9.2
Как использовать
Все названия методов соответствуют названию в ссылке (смотрите документацию iiko Transport).
Пример названия метода:
- /api/1/auth/ -
access_token - /api/1/order/create -
order_create
Если вам нужно чтобы ответ был в dict то либо
api = IikoTransport(api_login, return_dict=True)
# Либо
api.return_dict = True
Example
from pyiikocloudapi import IikoTransport
from pyiikocloudapi.models import CouriersModel
# инициализация класса
api = IikoTransport(api_login)
# получаем организации получить из можно api.organizations_ids: dict or api.organizations_ids_models: OrganizationsModel
api.organizations()
# получаю список курьеров организации
couriers: CouriersModel = api.couriers(api.organizations_ids)
Каждый метод проверяет время жизни маркера доступа, если время жизни маркера прошло то будет автоматически запрошен заново.
Время жизни маркера доступа равно ~60 минутам.
###Доп. инфа iiko Transport(iiko Cloud API) по словам разработчиков это по сути горячие хранилище без доступа к данным БД
sourceKey это "Источник заказа" из настроек в iikoWeb
Реализованные методы iiko Transport(iiko Cloud API)
- Authorization
- Notifications
- Organizations
- Terminal groups
- Dictionaries
- Menu
- Operations
- Deliveries: Create and update
- [x] Create delivery.
- [ ] Update order problem.
- [x] Update delivery status.
- [ ] Update order courier.
- [ ] Add order items.
- [ ] Close order.
- [ ] Cancel delivery order.
- [ ] Change time when client wants the order to be delivered.
- [ ] Change order's delivery point information.
- [ ] Change order's delivery type.
- [ ] Change order's payments.
- [ ] Change delivery comment.
- [ ] Print delivery bill.
- [x] Confirm delivery.
- [x] Cancel delivery confirmation.
- [ ] Assign/change the order operator.
- [ ] WebHook notification about delivery order update. Webhook ???
- [ ] WebHook notification about delivery order saving error. Webhook ???
- Deliveries: Retrieve
- [x] Retrieve orders by IDs.
- [x] Retrieve list of orders by statuses and dates.
- [ ] Retrieve list of orders changed from the time revision was passed.
- [ ] Retrieve list of orders by telephone number, dates and revision.
- [x] Search orders by search text and additional filters (date, problem, statuses and other).
- Addresses
- [x] Regions.
- [x] Cities.
- [x] Streets by city.
- Delivery restrictions
- Employees
- [ ] Method of obtaining drivers' coordinates history.
- [x] Returns list of all employees which are delivery drivers in specified restaurants.
- [ ] Returns list of all employees which are delivery drivers in specified restaurants, and checks whether each employee has passed role.
- [ ] Returns list of all active (courier session is opened) courier's locations which are delivery drivers in specified restaurant and are clocked in on specified delivery terminal.
- [ ] Returns list of all active (courier session is opened) courier's locations which are delivery drivers in specified restaurants.
- [ ] Returns employee info.
- wMarketing sources
- Drafts
- Orders
- [x] Create order.
- [ ] Retrieve orders by IDs.
- [ ] Retrieve orders by tables.
- [ ] Add order items.
- [ ] Close order.
- [ ] Change table order's payments.
- [ ] Init orders, created in the front.
- [ ] WebHook notification about table order update. Webhook ???
- [ ] WebHook notification about table order saving error. Webhook ???
- Banquets/reserves
- [ ] Returns all organizations of current account (determined by Authorization request header) for which banquet/reserve booking are available.
- [ ] Returns all terminal groups of specified organizations, for which banquet/reserve booking are available.
- [ ] Returns all restaurant sections of specified terminal groups, for which banquet/reserve booking are available.
- [ ] Returns all banquets/reserves for passed restaurant sections.
- [ ] Create banquet/reserve.
- [ ] Retrieve banquets/reserves statuses by IDs.
- [ ] WebHook notification about reserve update. Webhook ???
- [ ] WebHook notification about reserve saving error. Webhook ???
- Discounts and promotions
- [ ] Calculate discounts and other loyalty items for an order.
- [ ] Get all organization's manual conditions.
- [ ] Get all loyalty programs for organization.
- [x] Get information about the specified coupon.
- [x] Get a list of coupon series in which there are not deleted and not activated coupons.
- [ ] Get list of non-activated coupons.
- Customers
- [x] Get customer info by specified criterion.
- [x] Create or update customer info by id or phone or card track.
- [x] Add new customer for program.
- [x] Add new card for customer.
- [x] Delete existing card for customer.
- [x] Hold customer's money in loyalty program. Payment will be process on POS during processing of an order.
- [x] Refill customer balance.
- [x] Withdraw customer balance.
- ....