retailcrm-api 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8dde151bd0186a658636908dd4cb0adcc3ee1fc2967abf2fc1955484d3117705
|
|
4
|
+
data.tar.gz: e0cd7089d194309e27d6e38545a25f40d516b7991a32be8e635419b295ad5f85
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 486385708f734c3b632bc7d3225ff51359ec05af1a0c76236392b3681c8bffba615f9a14a6c078dc94eff29a380f7508dec26bf9dab2f52f1aae87b64b299af3
|
|
7
|
+
data.tar.gz: 0b1d82a2e4ec9059bfce5e5ad89840158054682866b36832fde7fdbd377be886f2ecbebbaee0af919c21b19fd97b205ff17d0cbfac6c5035e6684e5778eb1d2c
|
data/README.markdown
CHANGED
|
@@ -1,8 +1,212 @@
|
|
|
1
1
|
# RetailCRM API
|
|
2
2
|
|
|
3
|
-
API wrapper для RetailCRM
|
|
3
|
+
API wrapper для RetailCRM API v5
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
# Оглавление
|
|
7
|
+
0. [Установка](#install)
|
|
8
|
+
1. [Использование Rails](#using_rails)
|
|
9
|
+
2. [Использование Ruby](#using_ruby)
|
|
10
|
+
3. [Debug Logging](#debug_logging)
|
|
11
|
+
4. [Custom logger](#custom_logger)
|
|
12
|
+
1. [Расходы](#costs)
|
|
13
|
+
1. [Получение списка расходов, удовлетворяющих заданному фильтру](#get--api-v5-costs)
|
|
14
|
+
2. [Создание расхода](#post--api-v5-costs-create)
|
|
15
|
+
3. [Пакетное удаление расходов](#post--api-v5-costs-delete)
|
|
16
|
+
4. [Пакетная загрузка расходов](#post--api-v5-costs-upload)
|
|
17
|
+
5. [Получение информации о расходе](#get--api-v5-costs-id)
|
|
18
|
+
6. [Редактирование расхода](#post--api-v5-costs-id-edit)
|
|
19
|
+
7. [Удаление расхода](#custom-fields)
|
|
20
|
+
2. [Пользовательские поля](#custom-fields)
|
|
21
|
+
1. [Получение списка пользовательских полей, удовлетворяющих заданному фильтру](#get--api-v5-custom-fields)
|
|
22
|
+
2. [Получение списка справочников, удовлетворяющих заданному фильтру](#get--api-v5-custom-fields-dictionaries)
|
|
23
|
+
3. [Создание справочника](#post--api-v5-custom-fields-dictionaries-create)
|
|
24
|
+
4. [Получение информации о справочнике](#get--api-v5-custom-fields-dictionaries-code)
|
|
25
|
+
5. [Редактирование справочика](#post--api-v5-custom-fields-dictionaries-code-edit)
|
|
26
|
+
6. [Создание пользовательского поля](#post--api-v5-custom-fields-entity-create)
|
|
27
|
+
7. [Получение информации о пользовательском поле](#get--api-v5-custom-fields-entity-code)
|
|
28
|
+
8. [Редактирование пользовательского поля](#post--api-v5-custom-fields-entity-code-edit)
|
|
29
|
+
3. [Клиенты](#customers)
|
|
30
|
+
1. [Получение списка клиентов, удовлетворяющих заданному фильтру](#get--api-v5-customers)
|
|
31
|
+
2. [Объединение клиентов](#post--api-v5-customers-combine)
|
|
32
|
+
3. [Создание клиента](#post--api-v5-customers-create)
|
|
33
|
+
4. [Массовая запись внешних ID клиентов](#post--api-v5-customers-fix-external-ids)
|
|
34
|
+
5. [Получение истории изменения клиентов](#get--api-v5-customers-history)
|
|
35
|
+
6. [Получение заметок](#get--api-v5-customers-notes)
|
|
36
|
+
7. [Создание заметки](#post--api-v5-customers-notes-create)
|
|
37
|
+
8. [Удаление заметки](#post--api-v5-customers-notes-id-delete)
|
|
38
|
+
9. [Пакетная загрузка клиентов](#post--api-v5-customers-upload)
|
|
39
|
+
10. [Получение информации о клиенте](#get--api-v5-customers-externalId")
|
|
40
|
+
11. [Редактирование клиента](#post--api-v5-customers-externalId-edit)
|
|
41
|
+
4. [Корпоративные клиенты](#customers-corporate)
|
|
42
|
+
1. [Получение списка корпоративных клиентов, удовлетворяющих заданному фильтру](#get--api-v5-customers-corporate)
|
|
43
|
+
2. [Объединение корпоративных клиентов](#post--api-v5-customers-corporate-combine)
|
|
44
|
+
3. [Создание корпоративного клиента](#post--api-v5-customers-corporate-create)
|
|
45
|
+
4. [Массовая запись внешних ID корпоративных клиентов](#post--api-v5-customers-corporate-fix-external-ids)
|
|
46
|
+
5. [Получение истории изменения корпоративных клиентов](#get--api-v5-customers-corporate-history)
|
|
47
|
+
6. [Получение заметок](#get--api-v5-customers-corporate-notes)
|
|
48
|
+
7. [Создание заметки](#post--api-v5-customers-corporate-notes-create)
|
|
49
|
+
8. [Удаление заметки](post--api-v5-customers-corporate-notes-id-delete)
|
|
50
|
+
9. [Пакетная загрузка корпоративных клиентов](#post--api-v5-customers-corporate-upload)
|
|
51
|
+
10. [Получение информации о корпоративном клиенте](#get--api-v5-customers-corporate-externalId)
|
|
52
|
+
11. [Список адресов корпоративного клиента](#get--api-v5-customers-corporate-externalId-addresses)
|
|
53
|
+
12. [Создание адреса для корпоративного клиента](#post--api-v5-customers-corporate-externalId-addresses-create)
|
|
54
|
+
13. [Редактирование адреса корпоративного клиента](#post--api-v5-customers-corporate-externalId-addresses-entityExternalId-edit)
|
|
55
|
+
14. [Список компаний корпоративного клиента](#get--api-v5-customers-corporate-externalId-companies)
|
|
56
|
+
15. [Создание компании для корпоративного клиента](#post--api-v5-customers-corporate-externalId-companies-create)
|
|
57
|
+
16. [Редактирование компании корпоративного клиента](#post--api-v5-customers-corporate-externalId-companies-entityExternalId-edit)
|
|
58
|
+
17. [Список контактных лиц корпоративного клиента](#get--api-v5-customers-corporate-externalId-contacts)
|
|
59
|
+
18. [Создание связи корпоративного клиента с контактным лицом](#post--api-v5-customers-corporate-externalId-contacts-create)
|
|
60
|
+
19. [Редактирование связи корпоративного клиента с контактным лицом](#post--api-v5-customers-corporate-externalId-contacts-entityExternalId-edit)
|
|
61
|
+
20. [Редактирование корпоративного клиента](#post--api-v5-customers-corporate-externalId-edit)
|
|
62
|
+
5. [Доставки](#delivery)
|
|
63
|
+
1. [Расчёт стоимости доставки](#post--api-v5-delivery-calculate)
|
|
64
|
+
2. [Обновление статусов доставки](#post--api-v5-delivery-generic-subcode-tracking)
|
|
65
|
+
3. [Получение списка отгрузок в службы доставки](#get--api-v5-delivery-shipments)
|
|
66
|
+
4. [Создание отгрузки](#post--api-v5-delivery-shipments-create)
|
|
67
|
+
5. [Получение информации об отгрузке](#get--api-v5-delivery-shipments-id)
|
|
68
|
+
6. [Редактироване отгрузки](#post--api-v5-delivery-shipments-id-edit)
|
|
69
|
+
7. [Запрос на получение данных для автокомплит поля](#callback_get--integrationModule_integrations__delivery__actions__autocomplete_)
|
|
70
|
+
8. [Расчет стоимости доставки](#callback_post--integrationModule_integrations__delivery__actions__calculate_)
|
|
71
|
+
9. [Удаление заявки на доставку](#callback_post--integrationModule_integrations__delivery__actions__delete_)
|
|
72
|
+
10. [Получение данных доставки](#callback_get--integrationModule_integrations__delivery__actions__get_)
|
|
73
|
+
11. [Печатные формы службы доставки](#callback_post--integrationModule_integrations__delivery__actions__print_)
|
|
74
|
+
12. [Создание и редактирование доставки](#callback_post--integrationModule_integrations__delivery__actions__save_)
|
|
75
|
+
13. [Удаление заявки на отгрузку](#callback_post--integrationModule_integrations__delivery__actions__shipmentDelete_)
|
|
76
|
+
14. [Список терминалов приема посылок](#callback_get--integrationModule_integrations__delivery__actions__shipmentPointList_)
|
|
77
|
+
15. [Создание и редактирование отгрузки](#callback_post--integrationModule_integrations__delivery__actions__shipmentSave_)
|
|
78
|
+
16. [Список тарифов](#callback_get--integrationModule_integrations__delivery__actions__tariffList_)
|
|
79
|
+
6. [Файлы](#files)
|
|
80
|
+
1. [Получение списка файлов, удовлетворяющих заданному фильтру](#get--api-v5-files)
|
|
81
|
+
2. [Загрузка файла на сервер](#post--api-v5-files-upload)
|
|
82
|
+
3. [Получение информации о файле](#get--api-v5-files-id)
|
|
83
|
+
4. [Удаление файла](#post--api-v5-files-id-delet)
|
|
84
|
+
5. [Скачивание файла](#get--api-v5-files-id-download)
|
|
85
|
+
6. [Редактирование файла](#post--api-v5-files-id-edit)
|
|
86
|
+
7. [Интеграция](#integration)
|
|
87
|
+
1. [Получение интеграционного модуля](#get--api-v5-integration-modules-code)
|
|
88
|
+
2. [Создание/редактирование интеграционного модуля](#post--api-v5-integration-modules-code-edit)
|
|
89
|
+
3. [Уведомление об изменении статуса активности или заморозки модуля](#callback_post--integrationModule_actions__activity_)
|
|
90
|
+
8. [Лояльность](#loyalty)
|
|
91
|
+
1. [Добавление клиента в программу лояльности](#post--api-v5-loyalty-account-create)
|
|
92
|
+
2. [Получение информации об участии в программе лояльности](#get--api-v5-loyalty-account-id)
|
|
93
|
+
3. [Активация участия в программе лояльности](#post--api-v5-loyalty-account-id-activate)
|
|
94
|
+
4. [Начисление бонусов участию в программе лояльности](#post--api-v5-loyalty-account-id-bonus-credit)
|
|
95
|
+
5. [История бонусного счета](#get--api-v5-loyalty-account-id-bonus-operations)
|
|
96
|
+
6. [Редактирование участия в программе лояльности](#post--api-v5-loyalty-account-id-edit)
|
|
97
|
+
7. [Список участий в программе лояльности](#get--api-v5-loyalty-accounts)
|
|
98
|
+
8. [Расчёт максимальной скидки](#post--api-v5-loyalty-calculate)
|
|
99
|
+
9. [Список программ лояльности](#get--api-v5-loyalty-loyalties)
|
|
100
|
+
10. [Получение информации о программе лояльности](#get--api-v5-loyalty-loyalties-id)
|
|
101
|
+
9. [Заказы](#orders)
|
|
102
|
+
1. [Получение списка заказов, удовлетворяющих заданному фильтру](#get--api-v5-orders)
|
|
103
|
+
2. [Объединение заказов](#post--api-v5-orders-combine)
|
|
104
|
+
3. [Создание заказа](#post--api-v5-orders-create)
|
|
105
|
+
4. [Массовая запись внешних ID заказов](#post--api-v5-orders-fix-external-ids)
|
|
106
|
+
5. [Получение истории изменений заказов](#get--api-v5-orders-history)
|
|
107
|
+
6. [Создание связи между заказами](#post--api-v5-orders-links-create)
|
|
108
|
+
7. [Применение бонусов по программе лояльности](#post--api-v5-orders-loyalty-apply)
|
|
109
|
+
8. [Отмена бонусных операций по программе лояльности](#post--api-v5-orders-loyalty-cancel-bonus-operations)
|
|
110
|
+
9. [Добавление платежа](#post--api-v5-orders-payments-create)
|
|
111
|
+
10. [Удаление платежа](#post--api-v5-orders-payments-id-delete)
|
|
112
|
+
11. [Редактирование платежа](#post--api-v5-orders-payments-id-edit)
|
|
113
|
+
12. [Получение списка статусов заказов](#get--api-v5-orders-statuses)
|
|
114
|
+
13. [Пакетная загрузка заказов](#post--api-v5-orders-upload)
|
|
115
|
+
14. [Получение информации о заказе](#get--api-v5-orders-externalId)
|
|
116
|
+
15. [Редактирование заказа](#post--api-v5-orders-externalId-edit)
|
|
117
|
+
10. [Комплектация заказов](#orders_packs)
|
|
118
|
+
1. [Получение списка паков, удовлетворяющих заданному фильтру](#get--api-v5-orders-packs)
|
|
119
|
+
2. [Создание пака](#post--api-v5-orders-packs-create)
|
|
120
|
+
3. [Получение истории комплектации заказа](#get--api-v5-orders-packs-history)
|
|
121
|
+
4. [Получение информации о паке](#get--api-v5-orders-packs-id)
|
|
122
|
+
5. [Удаление пака](#post--api-v5-orders-packs-id-delete)
|
|
123
|
+
6. [Редактирование пака](#post--api-v5-orders-packs-id-edit)
|
|
124
|
+
11. [Платежи](#payment)
|
|
125
|
+
1. [Проверка инвойса](#post--api-v5-payment-check)
|
|
126
|
+
2. [Создание инвойса](#post--api-v5-payment-create-invoice)
|
|
127
|
+
3. [Изменение инвойса](#post--api-v5-payment-update-invoice)
|
|
128
|
+
4. [Подтверждение оплаты](#callback_post--integrationModule_integrations__payment__actions__approve_)
|
|
129
|
+
5. [Отмена оплаты](#callback_post--integrationModule_integrations__payment__actions__cancel_)
|
|
130
|
+
6. [Создание оплаты](#callback_post--integrationModule_integrations__payment__actions__create_)
|
|
131
|
+
7. [Возврат](#callback_post--integrationModule_integrations__payment__actions__refund_)
|
|
132
|
+
12. [Рекомендации](#recommendation)
|
|
133
|
+
1. [Запрос рекомендуемых товаров](#callback_get--integrationModule_integrations__recommendation__actions__recommendation_)
|
|
134
|
+
13. [Справочники](#reference)
|
|
135
|
+
1. [Получение списка групп расходов](#get--api-v5-reference-cost-groups)
|
|
136
|
+
2. [Редактирование группы расходов](#post--api-v5-reference-cost-groups-code-edit)
|
|
137
|
+
3. [Получение списка статей расходов](#get--api-v5-reference-cost-items)
|
|
138
|
+
4. [Редактирование статьи расходов](#post--api-v5-reference-cost-items-code-edit)
|
|
139
|
+
5. [Получение списка кодов доступных стран](#get--api-v5-reference-countries)
|
|
140
|
+
6. [Получение списка курьеров](#get--api-v5-reference-couriers)
|
|
141
|
+
7. [Создание курьера](#post--api-v5-reference-couriers-create)
|
|
142
|
+
8. [Редактирование курьера](#post--api-v5-reference-couriers-id-edit)
|
|
143
|
+
9. [Получение списка служб доставки](#get--api-v5-reference-delivery-services)
|
|
144
|
+
10. [Создание/редактирование службы доставки](#post--api-v5-reference-delivery-services-code-edit)
|
|
145
|
+
11. [Получение списка типов доставки](#get--api-v5-reference-delivery-types)
|
|
146
|
+
12. [Создание/редактирование типа доставки](#post--api-v5-reference-delivery-types-code-edit)
|
|
147
|
+
13. [Получение списка юридических лиц](#get--api-v5-reference-legal-entities)
|
|
148
|
+
14. [Создание/редактирование юридического лица](#post--api-v5-reference-legal-entities-code-edit)
|
|
149
|
+
15. [Получение списка MessageGateway каналов](#get--api-v5-reference-mg-channels)
|
|
150
|
+
16. [Получение списка способов оформления заказов](#get--api-v5-reference-order-methods)
|
|
151
|
+
17. [Создание/редактирование способа оформления заказа](#post--api-v5-reference-order-methods-code-edit)
|
|
152
|
+
18. [Получение списка типов заказов](#get--api-v5-reference-order-types)
|
|
153
|
+
19. [Создание/редактирование типа заказа](#post--api-v5-reference-order-types-code-edit)
|
|
154
|
+
20. [Получение списка статусов оплаты](#get--api-v5-reference-payment-statuses)
|
|
155
|
+
21. [Создание/редактирование статусов оплаты](#post--api-v5-reference-payment-statuses-code-edit)
|
|
156
|
+
22. [Получение списка типов оплаты](#get--api-v5-reference-payment-types)
|
|
157
|
+
23. [Создание/редактирование типа оплаты](#post--api-v5-reference-payment-types-code-edit)
|
|
158
|
+
24. [Получение списка типов цен](#get--api-v5-reference-price-types)
|
|
159
|
+
25. [Создание/редактирование типа цены](#post--api-v5-reference-price-types-code-edit)
|
|
160
|
+
26. [Получение списка статусов товаров в заказе](#get--api-v5-reference-product-statuses)
|
|
161
|
+
27. [Создание/редактирование статуса товара в заказе](#post--api-v5-reference-product-statuses-code-edit)
|
|
162
|
+
28. [Получение списка магазинов](#get--api-v5-reference-sites)
|
|
163
|
+
29. [Создание/редактирование магазина](#post--api-v5-reference-sites-code-edit)
|
|
164
|
+
30. [Получение списка групп статусов заказа](#get--api-v5-reference-status-groups)
|
|
165
|
+
31. [Получение списка статусов заказа](#get--api-v5-reference-statuses)
|
|
166
|
+
32. [Создание/редактирование статуса заказа](#post--api-v5-reference-statuses-code-edit)
|
|
167
|
+
33. [Получение списка складов](#get--api-v5-reference-stores)
|
|
168
|
+
34. [Создание/редактирование сведений о складе](#post--api-v5-reference-stores-code-edit)
|
|
169
|
+
35. [Получение списка единиц измерений](#get--api-v5-reference-units)
|
|
170
|
+
36. [Создание/редактирование единицы измерения](#post--api-v5-reference-units-code-edit)
|
|
171
|
+
14. [Сегменты](#segments)
|
|
172
|
+
1. [Получение списка пользовательских сегментов](#get--api-v5-segments)
|
|
173
|
+
15. [Настройки](#settings)
|
|
174
|
+
1. [Получение настроек системы](#get--api-v5-settings)
|
|
175
|
+
16. [Склад](#store)
|
|
176
|
+
1. [Получение остатков и закупочных цен](#get--api-v5-store-inventories)
|
|
177
|
+
2. [Обновление остатков и закупочных цен](#post--api-v5-store-inventories-upload)
|
|
178
|
+
3. [Обновление цен торговых предложений](#post--api-v5-store-prices-upload)
|
|
179
|
+
4. [Получение списка групп товаров, удовлетворяющих заданному фильтру](#get--api-v5-store-product-groups)
|
|
180
|
+
5. [Получение списка товаров с торговыми предложениями, удовлетворяющих заданному фильтру](#get--api-v5-store-products)
|
|
181
|
+
6. [Получение списка свойств товаров, удовлетворяющих заданному фильтру](#get--api-v5-store-products-properties)
|
|
182
|
+
7. [Обновление остатков и закупочных цен](#callback_post--integrationModule_integrations__store__actions__inventoriesUpload_)
|
|
183
|
+
8. [Актуализация остатков после обращения к складской системе](#callback_post--integrationModule_integrations__store__actions__reserve_)
|
|
184
|
+
17. [Задачи](#tasks)
|
|
185
|
+
1. [Получение списка задач](#get--api-v5-tasks)
|
|
186
|
+
2. [Создание задачи](#post--api-v5-tasks-create)
|
|
187
|
+
3. [Получение информации о задаче](#get--api-v5-tasks-id)
|
|
188
|
+
4. [Редактирование задачи](#post--api-v5-tasks-id-edit)
|
|
189
|
+
18. [Телефония](#telephony)
|
|
190
|
+
1. [События звонка](#post--api-v5-telephony-call-event)
|
|
191
|
+
2. [Загрузка телефонных звонков](#post--api-v5-telephony-calls-upload)
|
|
192
|
+
3. [Получение ответственного менеджера](#get--api-v5-telephony-manager)
|
|
193
|
+
4. [Оповещение о смене статуса](#callback_get--integrationModule_integrations__telephony__changeUserStatusUrl_)
|
|
194
|
+
5. [Инициация звонка](#callback_get--integrationModule_integrations__telephony__makeCallUrl_)
|
|
195
|
+
6. [Переход в личный кабинет](#callback_post--integrationModule_integrations__telephony__personalAccountUrl_)
|
|
196
|
+
7. [Прослушивание звонка](#callback_get--recordUrl)
|
|
197
|
+
19. [Пользователи](#users)
|
|
198
|
+
1. [Получение списка групп пользователей](#get--api-v5-user-groups)
|
|
199
|
+
2. [Получение списка пользователей, удовлетворяющих заданному фильтру](#get--api-v5-users)
|
|
200
|
+
3. [Получение информации о пользователе](#get--api-v5-users-id)
|
|
201
|
+
4. [Смена статуса пользователя](#post--api-v5-users-id-status)
|
|
202
|
+
20. [Верификация](#verification)
|
|
203
|
+
1. [Подтверждение верификации](#post--api-v5-verification-sms-confirm)
|
|
204
|
+
2. [Проверка статуса верификации](#get--api-v5-verification-sms-checkId-status)
|
|
205
|
+
21. [Статистика](#get--api-v5-statistic)
|
|
206
|
+
1. [Обновление статистики](#get--api-v5-statistic-update")
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
# <a name="install"></a> Установка
|
|
6
210
|
|
|
7
211
|
## Ruby
|
|
8
212
|
$ gem install retailcrm-api
|
|
@@ -16,13 +220,13 @@ API wrapper для RetailCRM
|
|
|
16
220
|
rails g retailcrm_api:install
|
|
17
221
|
## Требования
|
|
18
222
|
|
|
19
|
-
Необходимо получить api key https://
|
|
223
|
+
Необходимо получить api key https://demo.retailcrm.ru/admin/api-keys
|
|
20
224
|
|
|
21
|
-
## Использование Rails
|
|
225
|
+
## <a name="using_rails"></a> Использование Rails
|
|
22
226
|
|
|
23
227
|
В файл `config/retailcrm_api.yml` вставьте ваши данные
|
|
24
228
|
|
|
25
|
-
## Использование Ruby
|
|
229
|
+
## <a name="using_ruby"></a> Использование Ruby
|
|
26
230
|
|
|
27
231
|
Сначала создайте экземпляр объекта `RetailcrmApi::Request`:
|
|
28
232
|
|
|
@@ -42,7 +246,7 @@ RetailcrmApi::Request.debug = false
|
|
|
42
246
|
|
|
43
247
|
Либо в файле `config/initializers/retailcrm_api.rb` для Rails.
|
|
44
248
|
|
|
45
|
-
## Debug Logging
|
|
249
|
+
## <a name="debug_logging"></a> Debug Logging
|
|
46
250
|
|
|
47
251
|
Измените `debug: true` чтобы включить логирование в STDOUT.
|
|
48
252
|
|
|
@@ -50,7 +254,7 @@ RetailcrmApi::Request.debug = false
|
|
|
50
254
|
retailcrm = RetailcrmApi::Request.new(api_key: "your_api_key", debug: true)
|
|
51
255
|
```
|
|
52
256
|
|
|
53
|
-
### Custom logger
|
|
257
|
+
### <a name="custom_logger"></a> Custom logger
|
|
54
258
|
|
|
55
259
|
`Logger.new` используется по умолчанию, но вы можете изменить на свой:
|
|
56
260
|
|
|
@@ -64,11 +268,10 @@ retailcrm = RetailcrmApi::Request.new(api_key: "your_api_key", debug: true, logg
|
|
|
64
268
|
RetailcrmApi::Request.logger = MyLogger.new
|
|
65
269
|
```
|
|
66
270
|
|
|
67
|
-
# Примеры
|
|
271
|
+
# <a name="examples"></a> Примеры
|
|
272
|
+
## <a name="costs"></a> Расходы
|
|
68
273
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
### [Получение списка расходов, удовлетворяющих заданному фильтру](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-costs)
|
|
274
|
+
### <a name="get--api-v5-costs"></a> [Получение списка расходов, удовлетворяющих заданному фильтру](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-costs)
|
|
72
275
|
```ruby
|
|
73
276
|
params = {
|
|
74
277
|
filter: {
|
|
@@ -78,21 +281,21 @@ params = {
|
|
|
78
281
|
RetailcrmApi::Request.costs.retrieve(params: params).body
|
|
79
282
|
# => {:success=>true, :pagination=>{:limit=>20, :totalCount=>296, :currentPage=>1, :totalPageCount=>15}, :costs=>[{:id=>296, :dateFrom=>"2021-07-29", :dateTo=>"2021-07-29", :summ=>13996, :costItem=>"products-purchase-price", :createdAt=>"2021-07-29 00:34:35", :order=>{:id=>36, :number=>"36C"}, :sites=>["b12-skillum-ru"]}]}
|
|
80
283
|
```
|
|
81
|
-
### [Создание расхода](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-costs-create)
|
|
284
|
+
### <a name="post--api-v5-costs-create"></a> [Создание расхода](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-costs-create)
|
|
82
285
|
```ruby
|
|
83
286
|
body = {
|
|
84
287
|
site: "deppa-ru",
|
|
85
288
|
cost: {
|
|
86
289
|
summ: 100,
|
|
87
290
|
costItem: "office-expenses",
|
|
88
|
-
dateFrom: (DateTime.now - 1.day).strftime("%Y-%m-%d"),
|
|
89
|
-
dateTo: DateTime.now.strftime("%Y-%m-%d")
|
|
291
|
+
dateFrom: (DateTime.now - 1.day).strftime("%Y-%m-%d %H:%M:%S"),
|
|
292
|
+
dateTo: DateTime.now.strftime("%Y-%m-%d %H:%M:%S")
|
|
90
293
|
}
|
|
91
294
|
}
|
|
92
295
|
RetailcrmApi::Request.costs.create(body: body).body
|
|
93
296
|
# => {:success=>true, :id=>297}
|
|
94
297
|
```
|
|
95
|
-
### [Пакетное удаление расходов](https://docs.retailcrm.ru/Developers/APIhttps://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-costs-delete)
|
|
298
|
+
### <a name="post--api-v5-costs-delete"></a> [Пакетное удаление расходов](https://docs.retailcrm.ru/Developers/APIhttps://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-costs-delete)
|
|
96
299
|
```ruby
|
|
97
300
|
body = {
|
|
98
301
|
ids: [297]
|
|
@@ -100,7 +303,7 @@ body = {
|
|
|
100
303
|
RetailcrmApi::Request.costs.create(body: body, suffix: "delete").body
|
|
101
304
|
# => {:success=>true, :count=>1, :notRemovedIds=>[]}
|
|
102
305
|
```
|
|
103
|
-
### [Пакетная загрузка расходов](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-costs-upload)
|
|
306
|
+
### <a name="post--api-v5-costs-upload"></a> [Пакетная загрузка расходов](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-costs-upload)
|
|
104
307
|
```ruby
|
|
105
308
|
body = {
|
|
106
309
|
costs: [
|
|
@@ -108,41 +311,41 @@ body = {
|
|
|
108
311
|
sites: ["deppa-ru"],
|
|
109
312
|
summ: 100,
|
|
110
313
|
costItem: "office-expenses",
|
|
111
|
-
dateFrom: (DateTime.now - 1.day).strftime("%Y-%m-%d"),
|
|
112
|
-
dateTo: DateTime.now.strftime("%Y-%m-%d")
|
|
314
|
+
dateFrom: (DateTime.now - 1.day).strftime("%Y-%m-%d %H:%M:%S"),
|
|
315
|
+
dateTo: DateTime.now.strftime("%Y-%m-%d %H:%M:%S")
|
|
113
316
|
}
|
|
114
317
|
]
|
|
115
318
|
}
|
|
116
319
|
RetailcrmApi::Request.costs.create(body: body, suffix: "upload").body
|
|
117
320
|
# => {:success=>true, :uploadedCosts=>[298]}
|
|
118
321
|
```
|
|
119
|
-
### [Получение информации о расходе](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-costs-id)
|
|
322
|
+
### <a name="get--api-v5-costs-id"></a> [Получение информации о расходе](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-costs-id)
|
|
120
323
|
```ruby
|
|
121
324
|
RetailcrmApi::Request.costs(298).retrieve.body
|
|
122
325
|
# => {:success=>true, :cost=>{:id=>298, :dateFrom=>"2021-08-02", :dateTo=>"2021-08-03", :summ=>100, :costItem=>"office-expenses", :createdAt=>"2021-08-03 22:12:34", :sites=>["deppa-ru"]}}
|
|
123
326
|
```
|
|
124
|
-
### [Редактирование расхода](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-costs-id-edit)
|
|
327
|
+
### <a name="post--api-v5-costs-id-edit"></a> [Редактирование расхода](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-costs-id-edit)
|
|
125
328
|
```ruby
|
|
126
329
|
body = {
|
|
127
330
|
site: "deppa-ru",
|
|
128
331
|
cost: {
|
|
129
332
|
summ: 200,
|
|
130
333
|
costItem: "office-expenses",
|
|
131
|
-
dateFrom: (DateTime.now - 1.day).strftime("%Y-%m-%d"),
|
|
132
|
-
dateTo: DateTime.now.strftime("%Y-%m-%d")
|
|
334
|
+
dateFrom: (DateTime.now - 1.day).strftime("%Y-%m-%d %H:%M:%S"),
|
|
335
|
+
dateTo: DateTime.now.strftime("%Y-%m-%d %H:%M:%S")
|
|
133
336
|
}
|
|
134
337
|
}
|
|
135
338
|
RetailcrmApi::Request.costs(298).update(body: body).body
|
|
136
339
|
# => {:success=>true, :id=>298}
|
|
137
340
|
```
|
|
138
|
-
### [Удаление расхода](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-costs-id-delete)
|
|
341
|
+
### <a name="custom-fields"></a> [Удаление расхода](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-costs-id-delete)
|
|
139
342
|
```ruby
|
|
140
343
|
RetailcrmApi::Request.costs(298).delete.body
|
|
141
344
|
# => {:success=>true}
|
|
142
345
|
```
|
|
143
346
|
|
|
144
|
-
## Пользовательские поля
|
|
145
|
-
### [Получение списка пользовательских полей, удовлетворяющих заданному фильтру](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-custom-fields)
|
|
347
|
+
## <a name="custom-fields"></a> Пользовательские поля
|
|
348
|
+
### <a name="get--api-v5-custom-fields"></a> [Получение списка пользовательских полей, удовлетворяющих заданному фильтру](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-custom-fields)
|
|
146
349
|
```ruby
|
|
147
350
|
params = {
|
|
148
351
|
filter: {
|
|
@@ -152,9 +355,88 @@ params = {
|
|
|
152
355
|
RetailcrmApi::Request.custom_fields.retrieve(params: params).body
|
|
153
356
|
# =>{:success=>true, :pagination=>{:limit=>20, :totalCount=>0, :currentPage=>1, :totalPageCount=>0}, :customFields=>[]}
|
|
154
357
|
```
|
|
358
|
+
### <a name="get--api-v5-custom-fields-dictionaries"></a> [Получение списка справочников, удовлетворяющих заданному фильтру](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-custom-fields-dictionaries)
|
|
359
|
+
```ruby
|
|
360
|
+
params = {
|
|
361
|
+
limit: 100,
|
|
362
|
+
filter: {
|
|
363
|
+
name: "test"
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
RetailcrmApi::Request.custom_fields.dictionaries.retrieve(params: params).body
|
|
367
|
+
# => {:success=>true, :pagination=>{:limit=>100, :totalCount=>0, :currentPage=>1, :totalPageCount=>0}, :customDictionaries=>[]}
|
|
368
|
+
```
|
|
369
|
+
### <a name="post--api-v5-custom-fields-dictionaries-create"></a> [Создание справочника](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-custom-fields-dictionaries-create)
|
|
370
|
+
```ruby
|
|
371
|
+
body = {
|
|
372
|
+
customDictionary: {
|
|
373
|
+
code: "test_custom",
|
|
374
|
+
name: "test custom",
|
|
375
|
+
elements: [
|
|
376
|
+
{
|
|
377
|
+
name: "Тест",
|
|
378
|
+
code: "test"
|
|
379
|
+
}
|
|
380
|
+
]
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
RetailcrmApi::Request.custom_fields.dictionaries.create(body: body).body
|
|
384
|
+
# => {:success=>true, :code=>"test_custom"}
|
|
385
|
+
```
|
|
386
|
+
### <a name="get--api-v5-custom-fields-dictionaries-code"></a> [Получение информации о справочнике](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-custom-fields-dictionaries-code)
|
|
387
|
+
```ruby
|
|
388
|
+
RetailcrmApi::Request.custom_fields.dictionaries("test_custom").retrieve.body
|
|
389
|
+
# => {:success=>true, :customDictionary=>{:name=>"test custom", :code=>"test_custom", :elements=>[{:name=>"Тест", :code=>"test", :ordering=>50}]}}
|
|
390
|
+
```
|
|
391
|
+
### <a name="post--api-v5-custom-fields-dictionaries-code-edit"></a> [Редактирование справочика](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-custom-fields-dictionaries-code-edit)
|
|
392
|
+
```ruby
|
|
393
|
+
body = {
|
|
394
|
+
customDictionary: {
|
|
395
|
+
name: "test custom update",
|
|
396
|
+
elements: [
|
|
397
|
+
{
|
|
398
|
+
name: "Тест update",
|
|
399
|
+
code: "test"
|
|
400
|
+
}
|
|
401
|
+
]
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
RetailcrmApi::Request.custom_fields.dictionaries("test_custom").update(body: body).body
|
|
405
|
+
# => {:success=>true, :code=>"test_custom"}
|
|
406
|
+
```
|
|
407
|
+
### <a name="post--api-v5-custom-fields-entity-create"></a> [Создание пользовательского поля](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-custom-fields-entity-create)
|
|
408
|
+
```ruby
|
|
409
|
+
entity = ["order", "customer", "customer_corporate", "company"].sample
|
|
410
|
+
body = {
|
|
411
|
+
customField: {
|
|
412
|
+
name: "Тест",
|
|
413
|
+
code: "test",
|
|
414
|
+
type: "string"
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
RetailcrmApi::Request.custom_fields(entity).create(body: body).body
|
|
418
|
+
# => {:success=>true, :code=>"test"}
|
|
419
|
+
```
|
|
420
|
+
### <a name="get--api-v5-custom-fields-entity-code"></a> [Получение информации о пользовательском поле](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-custom-fields-entity-code)
|
|
421
|
+
```ruby
|
|
422
|
+
RetailcrmApi::Request.custom_fields(entity, "test").retrieve.body
|
|
423
|
+
# => {:success=>true, :customField=>{:name=>"Тест", :code=>"test", :required=>false, :inFilter=>true, :inList=>true, :inGroupActions=>false, :type=>"string", :entity=>"customer", :ordering=>50, :viewMode=>"editable"}}
|
|
424
|
+
```
|
|
425
|
+
### <a name="post--api-v5-custom-fields-entity-code-edit"></a> [Редактирование пользовательского поля](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-custom-fields-entity-code-edit)
|
|
426
|
+
```ruby
|
|
427
|
+
body = {
|
|
428
|
+
customField: {
|
|
429
|
+
name: "Тест update",
|
|
430
|
+
code: "test",
|
|
431
|
+
type: "boolean"
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
RetailcrmApi::Request.custom_fields(entity, "test").update(body: body).body
|
|
435
|
+
# => {:success=>true, :code=>"test"}
|
|
436
|
+
```
|
|
155
437
|
|
|
156
|
-
## Клиенты
|
|
157
|
-
### [Получение списка клиентов, удовлетворяющих заданному фильтру](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-customers)
|
|
438
|
+
## <a name="customers"></a> Клиенты
|
|
439
|
+
### <a name="get--api-v5-customers"></a> [Получение списка клиентов, удовлетворяющих заданному фильтру](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-customers)
|
|
158
440
|
```ruby
|
|
159
441
|
params = {
|
|
160
442
|
limit: 100,
|
|
@@ -165,59 +447,589 @@ params = {
|
|
|
165
447
|
RetailcrmApi::Request.customers.retrieve(params: params).body
|
|
166
448
|
#=> {:success=>true, :pagination=>{:limit=>100, :totalCount=>0, :currentPage=>1, :totalPageCount=>0}, :customers=>[]}
|
|
167
449
|
```
|
|
168
|
-
### [
|
|
450
|
+
### <a name="post--api-v5-customers-combine"></a> [Объединение клиентов](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-customers-combine)
|
|
169
451
|
```ruby
|
|
170
452
|
body = {
|
|
171
|
-
|
|
453
|
+
resultCustomer: {
|
|
454
|
+
id: 58
|
|
455
|
+
},
|
|
456
|
+
customers: [
|
|
457
|
+
{
|
|
458
|
+
id: 57
|
|
459
|
+
}
|
|
460
|
+
]
|
|
461
|
+
}
|
|
462
|
+
RetailcrmApi::Request.customers.create(body: body, suffix: "combine").body
|
|
463
|
+
#=> {:success=>true}
|
|
464
|
+
```
|
|
465
|
+
### <a name="post--api-v5-customers-create"></a> [Создание клиента](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-customers-create)
|
|
466
|
+
```ruby
|
|
467
|
+
body = {
|
|
468
|
+
site: "deppa-ru",
|
|
172
469
|
customer: {
|
|
173
|
-
externalId:
|
|
174
|
-
|
|
175
|
-
|
|
470
|
+
externalId: 333,
|
|
471
|
+
vip: true,
|
|
472
|
+
firstName: "Павел",
|
|
473
|
+
lastName: "Осетров"
|
|
176
474
|
}
|
|
177
475
|
}
|
|
178
476
|
RetailcrmApi::Request.customers.create(body: body).body
|
|
179
|
-
#=> {:success=>true, :id=>
|
|
477
|
+
#=> {:success=>true, :id=>59}
|
|
478
|
+
```
|
|
479
|
+
### <a name="post--api-v5-customers-fix-external-ids"></a> [Массовая запись внешних ID клиентов](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-customers-fix-external-ids)
|
|
480
|
+
```ruby
|
|
481
|
+
body = {
|
|
482
|
+
customers: [
|
|
483
|
+
{
|
|
484
|
+
id: 59,
|
|
485
|
+
externalId: 555
|
|
486
|
+
}
|
|
487
|
+
]
|
|
488
|
+
}
|
|
489
|
+
RetailcrmApi::Request.customers.create(body: body, suffix: "fix-external-ids").body
|
|
490
|
+
#=> {:success=>true}
|
|
491
|
+
```
|
|
492
|
+
### <a name="get--api-v5-customers-history"></a> [Получение истории изменения клиентов](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-customers-history)
|
|
493
|
+
```ruby
|
|
494
|
+
params = {
|
|
495
|
+
filter: {
|
|
496
|
+
customerId: 59
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
RetailcrmApi::Request.customers.history.retrieve(params: params).body
|
|
500
|
+
#=> {:success=>true, :generatedAt=>"2021-08-04 13:31:04", :history=>[{:id=>276, :createdAt=>"2021-08-04 13:24:26", :created=>true, :source=>"api", :field=>"id", :apiKey=>{:current=>true}, :oldValue=>nil, :newValue=>59, :customer=>{:type=>"customer", :id=>59, :externalId=>"333", :isContact=>false, :createdAt=>"2021-08-04 13:24:26", :vip=>true, :bad=>false, :site=>"deppa-ru", :contragent=>{:contragentType=>"individual"}, :marginSumm=>0, :totalSumm=>0, :averageSumm=>0, :ordersCount=>0, :customFields=>[], :personalDiscount=>0, :cumulativeDiscount=>0, :segments=>[], :firstName=>"Павел", :lastName=>"Осетров", :presumableSex=>"male"}}, {:id=>277, :createdAt=>"2021-08-04 13:28:46", :source=>"api", :field=>"external_id", :apiKey=>{:current=>true}, :oldValue=>"333", :newValue=>"555", :customer=>{:id=>59, :externalId=>"555", :site=>"deppa-ru"}}], :pagination=>{:limit=>100, :totalCount=>2, :currentPage=>1, :totalPageCount=>1}}
|
|
501
|
+
```
|
|
502
|
+
### <a name="get--api-v5-customers-notes"></a> [Получение заметок](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-customers-notes)
|
|
503
|
+
```ruby
|
|
504
|
+
params = {
|
|
505
|
+
filter: {
|
|
506
|
+
customerIds: [59]
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
RetailcrmApi::Request.customers.notes.retrieve(params: params).body
|
|
510
|
+
#=> {:success=>true, :pagination=>{:limit=>20, :totalCount=>0, :currentPage=>1, :totalPageCount=>0}, :notes=>[]}
|
|
180
511
|
```
|
|
181
|
-
### [
|
|
512
|
+
### <a name="post--api-v5-customers-notes-create"></a> [Создание заметки](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-customers-notes-create)
|
|
513
|
+
```ruby
|
|
514
|
+
body = {
|
|
515
|
+
site: "deppa-ru",
|
|
516
|
+
note: {
|
|
517
|
+
text: "Просит скидки",
|
|
518
|
+
customer: {
|
|
519
|
+
id: 59
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
RetailcrmApi::Request.customers.notes.create(body: body).body
|
|
524
|
+
#=> {:success=>true, :id=>44}
|
|
525
|
+
```
|
|
526
|
+
### <a name="post--api-v5-customers-notes-id-delete"></a> [Удаление заметки](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-customers-notes-id-delete)
|
|
527
|
+
```ruby
|
|
528
|
+
RetailcrmApi::Request.customers.notes(44).delete.body
|
|
529
|
+
#=> {:success=>true}
|
|
530
|
+
```
|
|
531
|
+
### <a name="post--api-v5-customers-upload"></a> [Пакетная загрузка клиентов](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-customers-upload)
|
|
182
532
|
```ruby
|
|
183
533
|
body = {
|
|
184
|
-
site: 'deppa-ru',
|
|
185
534
|
customers: [
|
|
186
535
|
{
|
|
187
|
-
externalId:
|
|
188
|
-
|
|
189
|
-
|
|
536
|
+
externalId: 999,
|
|
537
|
+
vip: true,
|
|
538
|
+
firstName: "Юкихиро",
|
|
539
|
+
lastName: "Мацумото"
|
|
190
540
|
},
|
|
191
541
|
{
|
|
192
|
-
externalId:
|
|
193
|
-
|
|
194
|
-
|
|
542
|
+
externalId: 666,
|
|
543
|
+
bad: true,
|
|
544
|
+
firstName: "Расмус",
|
|
545
|
+
lastName: "Лердорф"
|
|
195
546
|
}
|
|
196
547
|
]
|
|
197
548
|
}
|
|
198
549
|
RetailcrmApi::Request.customers.create(body: body, suffix: "upload").body
|
|
550
|
+
#=> {:success=>true, :uploadedCustomers=>[{:id=>60, :externalId=>"999"}, {:id=>61, :externalId=>"666"}]}
|
|
199
551
|
```
|
|
200
|
-
|
|
201
|
-
## Корпоративные клиенты
|
|
202
|
-
### [Получение списка корпоративных клиентов, удовлетворяющих заданному фильтру](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-customers-corporate)
|
|
552
|
+
### <a name="get--api-v5-customers-externalId"></a> [Получение информации о клиенте](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-customers-externalId)
|
|
203
553
|
```ruby
|
|
204
|
-
|
|
205
|
-
|
|
554
|
+
params = {
|
|
555
|
+
by: "id"
|
|
556
|
+
}
|
|
557
|
+
RetailcrmApi::Request.customers(60).retrieve(params: params).body
|
|
558
|
+
#=> {:success=>true, :customer=>{:type=>"customer", :id=>60, :externalId=>"999", :isContact=>false, :createdAt=>"2021-08-04 13:41:05", :vip=>true, :bad=>false, :site=>"deppa-ru", :contragent=>{:contragentType=>"individual"}, :tags=>[], :marginSumm=>0, :totalSumm=>0, :averageSumm=>0, :ordersCount=>0, :customFields=>[], :personalDiscount=>0, :segments=>[{:id=>20, :code=>"nizkiy-sredniy-chek", :name=>"Низкий средний чек", :createdAt=>"2021-07-29 00:34:14", :isDynamic=>true, :customersCount=>4, :active=>true}, {:id=>31, :code=>"pol-ne-ukazan", :name=>"Пол не указан", :createdAt=>"2021-07-29 00:34:15", :isDynamic=>true, :customersCount=>4, :active=>true}, {:id=>26, :code=>"bez-otmen", :name=>"Без отмен", :createdAt=>"2021-07-29 00:34:15", :isDynamic=>true, :customersCount=>4, :active=>true}], :firstName=>"Юкихиро", :lastName=>"Мацумото", :presumableSex=>"female", :phones=>[]}}
|
|
206
559
|
```
|
|
207
|
-
|
|
208
|
-
|
|
560
|
+
### <a name="post--api-v5-customers-externalId-edit"></a> [Редактирование клиента](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-customers-externalId-edit)
|
|
561
|
+
```ruby
|
|
562
|
+
body = {
|
|
563
|
+
site: "deppa-ru",
|
|
564
|
+
customer: {
|
|
565
|
+
isContact: true
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
params = {
|
|
569
|
+
by: "id"
|
|
570
|
+
}
|
|
571
|
+
RetailcrmApi::Request.customers(61).update(body: body, params: params).body
|
|
572
|
+
#=> {:success=>true, :id=>61}
|
|
573
|
+
```
|
|
574
|
+
## <a name="customers-corporate"></a> Корпоративные клиенты
|
|
575
|
+
### <a name="get--api-v5-customers-corporate"></a> [Получение списка корпоративных клиентов, удовлетворяющих заданному фильтру](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-customers-corporate)
|
|
576
|
+
```ruby
|
|
577
|
+
params = {
|
|
578
|
+
limit: 100,
|
|
579
|
+
filter: {
|
|
580
|
+
vip: "1"
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
RetailcrmApi::Request.customers_corporate.retrieve(params: params).body
|
|
584
|
+
#=> {:success=>true, :pagination=>{:limit=>100, :totalCount=>0, :currentPage=>1, :totalPageCount=>0}, :customersCorporate=>[]}
|
|
585
|
+
```
|
|
586
|
+
### <a name="post--api-v5-customers-corporate-combine"></a> [Объединение корпоративных клиентов](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-customers-corporate-combine)
|
|
587
|
+
```ruby
|
|
588
|
+
body = {
|
|
589
|
+
resultCustomer: {
|
|
590
|
+
id: 63
|
|
591
|
+
},
|
|
592
|
+
customers: [
|
|
593
|
+
{
|
|
594
|
+
id: 64
|
|
595
|
+
}
|
|
596
|
+
]
|
|
597
|
+
}
|
|
598
|
+
RetailcrmApi::Request.customers_corporate.create(body: body, suffix: "combine").body
|
|
599
|
+
#=> {:success=>true}
|
|
600
|
+
```
|
|
601
|
+
### <a name="post--api-v5-customers-corporate-create"></a> [Создание корпоративного клиента](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-customers-corporate-create)
|
|
602
|
+
```ruby
|
|
603
|
+
body = {
|
|
604
|
+
customerCorporate: {
|
|
605
|
+
externalId: 333,
|
|
606
|
+
vip: true,
|
|
607
|
+
nickName: "dhh"
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
RetailcrmApi::Request.customers_corporate.create(body: body).body
|
|
611
|
+
#=> {:success=>true, :id=>62}
|
|
612
|
+
```
|
|
613
|
+
### <a name="post--api-v5-customers-corporate-fix-external-ids"></a> [Массовая запись внешних ID корпоративных клиентов](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-customers-corporate-fix-external-ids)
|
|
209
614
|
```ruby
|
|
210
615
|
body = {
|
|
211
|
-
site: 'deppa-ru"',
|
|
212
616
|
customersCorporate: [
|
|
213
617
|
{
|
|
214
|
-
|
|
215
|
-
|
|
618
|
+
id: 63,
|
|
619
|
+
externalId: 12
|
|
216
620
|
},
|
|
217
621
|
{
|
|
218
|
-
|
|
219
|
-
|
|
622
|
+
id: 62,
|
|
623
|
+
externalId: 13
|
|
220
624
|
}
|
|
221
625
|
]
|
|
222
626
|
}
|
|
627
|
+
RetailcrmApi::Request.customers_corporate.create(body: body, suffix: "fix-external-ids").body
|
|
628
|
+
#=> {:success=>true}
|
|
629
|
+
```
|
|
630
|
+
### <a name="get--api-v5-customers-corporate-history"></a> [Получение истории изменения корпоративных клиентов](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-customers-corporate-history)
|
|
631
|
+
```ruby
|
|
632
|
+
params = {
|
|
633
|
+
filter: {
|
|
634
|
+
customerId: 63
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
RetailcrmApi::Request.customers_corporate.history.retrieve(params: params).body
|
|
638
|
+
#=> {:success=>true, :generatedAt=>"2021-08-04 20:04:14", :history=>[{:id=>9, :createdAt=>"2021-08-04 19:58:50", :created=>true, :source=>"api", :field=>"id", :apiKey=>{:current=>true}, :oldValue=>nil, :newValue=>63, :customer=>{:type=>"customer_corporate", :id=>63, :externalId=>"44", :nickName=>"ryzhikov", :createdAt=>"2021-08-04 19:58:50", :vip=>false, :bad=>true, :site=>"deppa-ru", :marginSumm=>0, :totalSumm=>0, :averageSumm=>0, :ordersCount=>0, :customFields=>[], :personalDiscount=>0, :cumulativeDiscount=>0}}, {:id=>12, :createdAt=>"2021-08-04 20:03:15", :source=>"api", :field=>"external_id", :apiKey=>{:current=>true}, :oldValue=>"44", :newValue=>"12", :customer=>{:id=>63, :externalId=>"12", :site=>"deppa-ru"}}], :pagination=>{:limit=>100, :totalCount=>2, :currentPage=>1, :totalPageCount=>1}}
|
|
639
|
+
```
|
|
640
|
+
### <a name="get--api-v5-customers-corporate-notes"></a> [Получение заметок](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-customers-corporate-notes)
|
|
641
|
+
```ruby
|
|
642
|
+
params = {
|
|
643
|
+
filter: {
|
|
644
|
+
customerIds: [63]
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
RetailcrmApi::Request.customers_corporate.notes.retrieve(params: params).body
|
|
648
|
+
#=> {:success=>true, :pagination=>{:limit=>20, :totalCount=>0, :currentPage=>1, :totalPageCount=>0}, :notes=>[]}
|
|
649
|
+
```
|
|
650
|
+
### <a name="post--api-v5-customers-corporate-notes-create"></a> [Создание заметки](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-customers-corporate-notes-create)
|
|
651
|
+
```ruby
|
|
652
|
+
body = {
|
|
653
|
+
site: "deppa-ru",
|
|
654
|
+
note: {
|
|
655
|
+
text: "Very bad",
|
|
656
|
+
customer: {
|
|
657
|
+
id: 63
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
RetailcrmApi::Request.customers_corporate.notes.create(body: body).body
|
|
662
|
+
#=> {:success=>true, :id=>45}
|
|
663
|
+
```
|
|
664
|
+
### <a name="post--api-v5-customers-corporate-notes-id-delete"></a> [Удаление заметки](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-customers-corporate-notes-id-delete)
|
|
665
|
+
```ruby
|
|
666
|
+
RetailcrmApi::Request.customers_corporate.notes(45).delete.body
|
|
667
|
+
#=> {:success=>true}
|
|
668
|
+
```
|
|
669
|
+
### <a name="post--api-v5-customers-corporate-upload"></a> [Пакетная загрузка корпоративных клиентов](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-customers-corporate-upload)
|
|
670
|
+
```ruby
|
|
671
|
+
body = {
|
|
672
|
+
customersCorporate: [
|
|
673
|
+
{
|
|
674
|
+
externalId: 44,
|
|
675
|
+
bad: true,
|
|
676
|
+
nickName: "ryzhikov"
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
externalId: 22,
|
|
680
|
+
bad: true,
|
|
681
|
+
nickName: "buytaert"
|
|
682
|
+
}
|
|
683
|
+
]
|
|
684
|
+
}
|
|
685
|
+
RetailcrmApi::Request.customers_corporate.create(body: body, suffix: "upload").body
|
|
686
|
+
#=> {:success=>true, :uploadedCustomers=>[{:id=>63, :externalId=>"44"}, {:id=>64, :externalId=>"22"}]}
|
|
687
|
+
```
|
|
688
|
+
### <a name="get--api-v5-customers-corporate-externalId"></a> [Получение информации о корпоративном клиенте](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-customers-corporate-externalId)
|
|
689
|
+
```ruby
|
|
690
|
+
params = {
|
|
691
|
+
by: "externalId"
|
|
692
|
+
}
|
|
693
|
+
RetailcrmApi::Request.customers_corporate(12).retrieve(params: params).body
|
|
694
|
+
#=> {:success=>true, :customerCorporate=>{:type=>"customer_corporate", :id=>63, :externalId=>"12", :nickName=>"ryzhikov", :createdAt=>"2021-08-04 19:58:50", :vip=>false, :bad=>true, :site=>"deppa-ru", :tags=>[], :marginSumm=>0, :totalSumm=>0, :averageSumm=>0, :ordersCount=>0, :customFields=>[], :personalDiscount=>0}}
|
|
695
|
+
```
|
|
696
|
+
### <a name="get--api-v5-customers-corporate-externalId-addresses"></a> [Список адресов корпоративного клиента](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-customers-corporate-externalId-addresses)
|
|
697
|
+
```ruby
|
|
698
|
+
params = {
|
|
699
|
+
by: "id"
|
|
700
|
+
}
|
|
701
|
+
RetailcrmApi::Request.customers_corporate(63).addresses.retrieve(params: params).body
|
|
702
|
+
#=> {:success=>true, :addresses=>[], :pagination=>{:limit=>20, :totalCount=>0, :currentPage=>1, :totalPageCount=>0}}
|
|
703
|
+
```
|
|
704
|
+
### <a name="post--api-v5-customers-corporate-externalId-addresses-create"></a> [Создание адреса для корпоративного клиента](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-customers-corporate-externalId-addresses-create)
|
|
705
|
+
```ruby
|
|
706
|
+
params = {
|
|
707
|
+
by: "id"
|
|
708
|
+
}
|
|
709
|
+
body = {
|
|
710
|
+
site: "deppa-ru",
|
|
711
|
+
address: {
|
|
712
|
+
city: "Санкт-Петербург"
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
RetailcrmApi::Request.customers_corporate(63).addresses.create(params: params, body: body).body
|
|
716
|
+
#=> {:success=>true, :id=>42}
|
|
717
|
+
```
|
|
718
|
+
### <a name="post--api-v5-customers-corporate-externalId-addresses-entityExternalId-edit"></a> [Редактирование адреса корпоративного клиента](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-customers-corporate-externalId-addresses-entityExternalId-edit)
|
|
719
|
+
```ruby
|
|
720
|
+
params = {
|
|
721
|
+
by: "id",
|
|
722
|
+
entityBy: "id"
|
|
723
|
+
}
|
|
724
|
+
body = {
|
|
725
|
+
site: "deppa-ru",
|
|
726
|
+
address: {
|
|
727
|
+
city: "Вятка"
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
RetailcrmApi::Request.customers_corporate(63).addresses(42).update(params: params, body: body).body
|
|
731
|
+
#=> {:success=>true, :id=>42}
|
|
732
|
+
```
|
|
733
|
+
### <a name="get--api-v5-customers-corporate-externalId-companies"></a> [Список компаний корпоративного клиента](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-customers-corporate-externalId-companies)
|
|
734
|
+
```ruby
|
|
735
|
+
params = {
|
|
736
|
+
by: "id"
|
|
737
|
+
}
|
|
738
|
+
RetailcrmApi::Request.customers_corporate(63).companies.retrieve(params: params).body
|
|
739
|
+
#=> {:success=>true, :companies=>[], :pagination=>{:limit=>20, :totalCount=>0, :currentPage=>1, :totalPageCount=>0}}
|
|
740
|
+
```
|
|
741
|
+
### <a name="post--api-v5-customers-corporate-externalId-companies-create"></a> [Создание компании для корпоративного клиента](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-customers-corporate-externalId-companies-create)
|
|
742
|
+
```ruby
|
|
743
|
+
params = {
|
|
744
|
+
by: "id"
|
|
745
|
+
}
|
|
746
|
+
body = {
|
|
747
|
+
site: "deppa-ru",
|
|
748
|
+
company: {
|
|
749
|
+
name: "DEPPA",
|
|
750
|
+
site: "https://deppa.ru"
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
RetailcrmApi::Request.customers_corporate(62).companies.create(params: params, body: body).body
|
|
754
|
+
#=> {:success=>true, :id=>16}
|
|
755
|
+
```
|
|
756
|
+
### <a name="post--api-v5-customers-corporate-externalId-companies-entityExternalId-edit"></a> [Редактирование компании корпоративного клиента](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-customers-corporate-externalId-companies-entityExternalId-edit)
|
|
757
|
+
```ruby
|
|
758
|
+
params = {
|
|
759
|
+
by: "id",
|
|
760
|
+
entityBy: "id"
|
|
761
|
+
}
|
|
762
|
+
body = {
|
|
763
|
+
site: "deppa-ru",
|
|
764
|
+
company: {
|
|
765
|
+
isMain: true
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
RetailcrmApi::Request.customers_corporate(62).companies(16).update(params: params, body: body).body
|
|
769
|
+
#=> {:success=>true, :id=>16}
|
|
770
|
+
```
|
|
771
|
+
### <a name="get--api-v5-customers-corporate-externalId-contacts"></a> [Список контактных лиц корпоративного клиента](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-customers-corporate-externalId-contacts)
|
|
772
|
+
```ruby
|
|
773
|
+
params = {
|
|
774
|
+
by: "id"
|
|
775
|
+
}
|
|
776
|
+
RetailcrmApi::Request.customers_corporate(62).contacts.retrieve(params: params).body
|
|
777
|
+
#=> {:success=>true, :contacts=>[], :pagination=>{:limit=>20, :totalCount=>0, :currentPage=>1, :totalPageCount=>0}}
|
|
778
|
+
```
|
|
779
|
+
### <a name="post--api-v5-customers-corporate-externalId-contacts-create"></a> [Создание связи корпоративного клиента с контактным лицом](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-customers-corporate-externalId-contacts-create)
|
|
780
|
+
```ruby
|
|
781
|
+
params = {
|
|
782
|
+
by: "id"
|
|
783
|
+
}
|
|
784
|
+
body = {
|
|
785
|
+
site: "deppa-ru",
|
|
786
|
+
contact: {
|
|
787
|
+
isMain: true,
|
|
788
|
+
customer: {
|
|
789
|
+
externalId: "555"
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
RetailcrmApi::Request.customers_corporate(62).contacts.create(params: params, body: body).body
|
|
794
|
+
#=> {:success=>true, :id=>16}
|
|
795
|
+
```
|
|
796
|
+
### <a name="post--api-v5-customers-corporate-externalId-contacts-entityExternalId-edit"></a> [Редактирование связи корпоративного клиента с контактным лицом](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-customers-corporate-externalId-contacts-entityExternalId-edit)
|
|
797
|
+
```ruby
|
|
798
|
+
params = {
|
|
799
|
+
by: "id",
|
|
800
|
+
entityBy: "externalId"
|
|
801
|
+
}
|
|
802
|
+
body = {
|
|
803
|
+
site: "deppa-ru",
|
|
804
|
+
contact: {
|
|
805
|
+
isMain: false
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
RetailcrmApi::Request.customers_corporate(62).contacts("555").update(params: params, body: body).body
|
|
809
|
+
#=> {:success=>true, :id=>16}
|
|
810
|
+
```
|
|
811
|
+
### <a name="post--api-v5-customers-corporate-externalId-edit"></a> [Редактирование корпоративного клиента](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-customers-corporate-externalId-edit)
|
|
812
|
+
```ruby
|
|
813
|
+
params = {
|
|
814
|
+
by: "id"
|
|
815
|
+
}
|
|
816
|
+
body = {
|
|
817
|
+
site: "deppa-ru",
|
|
818
|
+
customerCorporate: {
|
|
819
|
+
personalDiscount: 99.9
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
RetailcrmApi::Request.customers_corporate(62).update(params: params, body: body).body
|
|
823
|
+
#=> {:success=>true, :id=>62}
|
|
824
|
+
```
|
|
825
|
+
## <a name="delivery"></a> Доставки
|
|
826
|
+
### <a name="post--api-v5-delivery-calculate"></a> [Расчёт стоимости доставки](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-delivery-calculate)
|
|
827
|
+
```ruby
|
|
828
|
+
body = {
|
|
829
|
+
deliveryTypeCodes: ["courier", "self-delivery", "russian-post", ""],
|
|
830
|
+
order: {
|
|
831
|
+
weight: 1,
|
|
832
|
+
length: 10,
|
|
833
|
+
width: 10,
|
|
834
|
+
height: 10
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
RetailcrmApi::Request.delivery.create(body: body, suffix: "calculate").body
|
|
838
|
+
#=> {:success=>true, :calculations=>[{:code=>"courier", :available=>true, :cost=>300}, {:code=>"self-delivery", :available=>true, :cost=>0}, {:code=>"russian-post", :available=>true, :cost=>0}, {:code=>"ems", :available=>true, :cost=>0}]}
|
|
839
|
+
```
|
|
840
|
+
### <a name="post--api-v5-delivery-generic-subcode-tracking"></a> [Обновление статусов доставки](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-delivery-generic-subcode-tracking)
|
|
841
|
+
### <a name="get--api-v5-delivery-shipments"></a> [Получение списка отгрузок в службы доставки](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-delivery-shipments)
|
|
842
|
+
### <a name="post--api-v5-delivery-shipments-create"></a> [Создание отгрузки](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-delivery-shipments-create)
|
|
843
|
+
### <a name="get--api-v5-delivery-shipments-id"></a> [Получение информации об отгрузке](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-delivery-shipments-id)
|
|
844
|
+
### <a name="post--api-v5-delivery-shipments-id-edit"></a> [Редактироване отгрузки](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-delivery-shipments-id-edit)
|
|
845
|
+
### <a name="callback_get--integrationModule_integrations__delivery__actions__autocomplete_"></a> [Запрос на получение данных для автокомплит поля](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#callback_get--integrationModule_integrations__delivery__actions__autocomplete_)
|
|
846
|
+
### <a name="callback_post--integrationModule_integrations__delivery__actions__calculate_"></a> [Расчет стоимости доставки](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#callback_post--integrationModule_integrations__delivery__actions__calculate_)
|
|
847
|
+
### <a name="callback_post--integrationModule_integrations__delivery__actions__delete_"></a> [Удаление заявки на доставку](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#callback_post--integrationModule_integrations__delivery__actions__delete_)
|
|
848
|
+
### <a name="callback_get--integrationModule_integrations__delivery__actions__get_"></a> [Получение данных доставки](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#callback_get--integrationModule_integrations__delivery__actions__get_)
|
|
849
|
+
### <a name="callback_post--integrationModule_integrations__delivery__actions__print_"></a> [Печатные формы службы доставки](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#callback_post--integrationModule_integrations__delivery__actions__print_)
|
|
850
|
+
### <a name="callback_post--integrationModule_integrations__delivery__actions__save_"></a> [Создание и редактирование доставки](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#callback_post--integrationModule_integrations__delivery__actions__save_)
|
|
851
|
+
### <a name="callback_post--integrationModule_integrations__delivery__actions__shipmentDelete_"></a> [Удаление заявки на отгрузку](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#callback_post--integrationModule_integrations__delivery__actions__shipmentDelete_)
|
|
852
|
+
### <a name="callback_get--integrationModule_integrations__delivery__actions__shipmentPointList_"></a> [Список терминалов приема посылок](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#callback_get--integrationModule_integrations__delivery__actions__shipmentPointList_)
|
|
853
|
+
### <a name="callback_post--integrationModule_integrations__delivery__actions__shipmentSave_"></a> [Создание и редактирование отгрузки](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#callback_post--integrationModule_integrations__delivery__actions__shipmentSave_)
|
|
854
|
+
### <a name="callback_get--integrationModule_integrations__delivery__actions__tariffList_"></a> [Список тарифов](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#callback_get--integrationModule_integrations__delivery__actions__tariffList_)
|
|
855
|
+
## <a name="files"></a> Файлы
|
|
856
|
+
### <a name="get--api-v5-files"></a> [Получение списка файлов, удовлетворяющих заданному фильтру](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-files)
|
|
857
|
+
### <a name="post--api-v5-files-upload"></a> [Загрузка файла на сервер](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-files-upload)
|
|
858
|
+
### <a name="get--api-v5-files-id"></a> [Получение информации о файле](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-files-id)
|
|
859
|
+
### <a name="post--api-v5-files-id-delete"></a> [Удаление файла](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-files-id-delete)
|
|
860
|
+
### <a name="get--api-v5-files-id-download"></a> [Скачивание файла](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-files-id-download)
|
|
861
|
+
### <a name="post--api-v5-files-id-edit"></a> [Редактирование файла](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-files-id-edit)
|
|
862
|
+
## <a name="integration"></a> Интеграция
|
|
863
|
+
### <a name="get--api-v5-integration-modules-code"></a> [Получение интеграционного модуля](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-integration-modules-code)
|
|
864
|
+
### <a name="post--api-v5-integration-modules-code-edit"></a> [Создание/редактирование интеграционного модуля](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-integration-modules-code-edit)
|
|
865
|
+
### <a name="callback_post--integrationModule_actions__activity_"></a> [Уведомление об изменении статуса активности или заморозки модуля](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#callback_post--integrationModule_actions__activity_)
|
|
866
|
+
## <a name="loyalty"></a> Лояльность
|
|
867
|
+
### <a name="post--api-v5-loyalty-account-create"></a> [Добавление клиента в программу лояльности](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-loyalty-account-create)
|
|
868
|
+
### <a name="get--api-v5-loyalty-account-id"></a> [Получение информации об участии в программе лояльности](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-loyalty-account-id)
|
|
869
|
+
### <a name="post--api-v5-loyalty-account-id-activate"></a> [Активация участия в программе лояльности](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-loyalty-account-id-activate)
|
|
870
|
+
### <a name="post--api-v5-loyalty-account-id-bonus-credit"></a> [Начисление бонусов участию в программе лояльности](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-loyalty-account-id-bonus-credit)
|
|
871
|
+
### <a name="get--api-v5-loyalty-account-id-bonus-operations"></a> [История бонусного счета](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-loyalty-account-id-bonus-operations)
|
|
872
|
+
### <a name="post--api-v5-loyalty-account-id-edit"></a> [Редактирование участия в программе лояльности](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-loyalty-account-id-edit)
|
|
873
|
+
### <a name="get--api-v5-loyalty-accounts"></a> [Список участий в программе лояльности](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-loyalty-accounts)
|
|
874
|
+
### <a name="post--api-v5-loyalty-calculate"></a> [Расчёт максимальной скидки](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-loyalty-calculate)
|
|
875
|
+
### <a name="get--api-v5-loyalty-loyalties"></a> [Список программ лояльности](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-loyalty-loyalties)
|
|
876
|
+
### <a name="get--api-v5-loyalty-loyalties-id"></a> [Получение информации о программе лояльности](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-loyalty-loyalties-id)
|
|
877
|
+
## <a name="orders"></a> Заказы
|
|
878
|
+
### <a name="get--api-v5-orders"></a> [Получение списка заказов, удовлетворяющих заданному фильтру](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-orders)
|
|
879
|
+
```ruby
|
|
880
|
+
params = {
|
|
881
|
+
limit: 100,
|
|
882
|
+
filter: {
|
|
883
|
+
countries: ["BY","KZ","RU","UA"]
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
RetailcrmApi::Request.orders.retrieve(params: params).body
|
|
887
|
+
#=> {:success=>true, :pagination=>{:limit=>100, :totalCount=>0, :currentPage=>1, :totalPageCount=>0}, :orders=>[]}
|
|
888
|
+
```
|
|
889
|
+
### <a name="post--api-v5-orders-combine"></a> [Объединение заказов](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-orders-combine)
|
|
890
|
+
### <a name="post--api-v5-orders-create"></a> [Создание заказа](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-orders-create)
|
|
891
|
+
```ruby
|
|
892
|
+
body = {
|
|
893
|
+
site: "deppa-ru",
|
|
894
|
+
order: {
|
|
895
|
+
:externalId => 171,
|
|
896
|
+
:number => '171',
|
|
897
|
+
:email => 'test@example.com',
|
|
898
|
+
:createdAt => '2014-10-28 19:31:10',
|
|
899
|
+
:discountPercent => 10,
|
|
900
|
+
:firstName => 'Юкихиро',
|
|
901
|
+
:lastName => 'Мацумото',
|
|
902
|
+
:customer => {
|
|
903
|
+
:externalId => 999,
|
|
904
|
+
:firstName => "Юкихиро",
|
|
905
|
+
:lastName => 'Мацумото',
|
|
906
|
+
:phones => [{ :number => '+79000000000' }],
|
|
907
|
+
},
|
|
908
|
+
:delivery => {
|
|
909
|
+
:code => 'courier',
|
|
910
|
+
:cost => 500,
|
|
911
|
+
:address => {:text => 'г. Санкт-Петербург, ул. Профессора Попова, д.376'}
|
|
912
|
+
},
|
|
913
|
+
:items => [
|
|
914
|
+
{
|
|
915
|
+
:productId => 170,
|
|
916
|
+
:initialPrice => 500,
|
|
917
|
+
:quantity => 2
|
|
918
|
+
},
|
|
919
|
+
{
|
|
920
|
+
:productId => 175,
|
|
921
|
+
:initialPrice => 1300,
|
|
922
|
+
:quantity => 1
|
|
923
|
+
}
|
|
924
|
+
]
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
RetailcrmApi::Request.orders.create(body: body).body
|
|
928
|
+
#=> {:success=>true, :id=>41, :order=>{:slug=>41, :bonusesCreditTotal=>0, :bonusesChargeTotal=>0, :id=>41, :number=>"171", :externalId=>"171", :orderType=>"eshop-individual", :orderMethod=>"shopping-cart", :privilegeType=>"none", :createdAt=>"2014-10-28 19:31:10", :statusUpdatedAt=>"2021-08-05 08:22:04", :summ=>2300, :totalSumm=>2800, :prepaySum=>0, :purchaseSumm=>0, :markDatetime=>"2021-08-05 08:22:04", :lastName=>"Мацумото", :firstName=>"Юкихиро", :email=>"test@example.com", :call=>false, :expired=>false, :customer=>{:type=>"customer", :id=>60, :externalId=>"999", :isContact=>false, :createdAt=>"2021-08-04 13:41:05", :vip=>true, :bad=>false, :site=>"deppa-ru", :contragent=>{:contragentType=>"individual"}, :tags=>[], :marginSumm=>0, :totalSumm=>0, :averageSumm=>0, :ordersCount=>0, :costSumm=>0, :customFields=>[], :personalDiscount=>0, :address=>{:id=>43, :text=>"г. Санкт-Петербург, ул. Профессора Попова, д.376"}, :segments=>[{:id=>20, :code=>"nizkiy-sredniy-chek", :name=>"Низкий средний чек", :createdAt=>"2021-07-29 00:34:14", :isDynamic=>true, :customersCount=>4, :active=>true}, {:id=>31, :code=>"pol-ne-ukazan", :name=>"Пол не указан", :createdAt=>"2021-07-29 00:34:15", :isDynamic=>true, :customersCount=>4, :active=>true}, {:id=>26, :code=>"bez-otmen", :name=>"Без отмен", :createdAt=>"2021-07-29 00:34:15", :isDynamic=>true, :customersCount=>4, :active=>true}], :firstName=>"Юкихиро", :lastName=>"Мацумото", :presumableSex=>"female", :email=>"test@example.com", :phones=>[]}, :contact=>{:type=>"customer", :id=>60, :externalId=>"999", :isContact=>false, :createdAt=>"2021-08-04 13:41:05", :vip=>true, :bad=>false, :site=>"deppa-ru", :contragent=>{:contragentType=>"individual"}, :tags=>[], :marginSumm=>0, :totalSumm=>0, :averageSumm=>0, :ordersCount=>0, :costSumm=>0, :customFields=>[], :personalDiscount=>0, :address=>{:id=>43, :text=>"г. Санкт-Петербург, ул. Профессора Попова, д.376"}, :segments=>[{:id=>20, :code=>"nizkiy-sredniy-chek", :name=>"Низкий средний чек", :createdAt=>"2021-07-29 00:34:14", :isDynamic=>true, :customersCount=>4, :active=>true}, {:id=>31, :code=>"pol-ne-ukazan", :name=>"Пол не указан", :createdAt=>"2021-07-29 00:34:15", :isDynamic=>true, :customersCount=>4, :active=>true}, {:id=>26, :code=>"bez-otmen", :name=>"Без отмен", :createdAt=>"2021-07-29 00:34:15", :isDynamic=>true, :customersCount=>4, :active=>true}], :firstName=>"Юкихиро", :lastName=>"Мацумото", :presumableSex=>"female", :email=>"test@example.com", :phones=>[]}, :contragent=>{:contragentType=>"individual"}, :delivery=>{:code=>"courier", :cost=>500, :netCost=>0, :address=>{:text=>"г. Санкт-Петербург, ул. Профессора Попова, д.376"}}, :site=>"deppa-ru", :status=>"new", :items=>[{:bonusesChargeTotal=>0, :bonusesCreditTotal=>0, :markingCodes=>[], :discounts=>[], :id=>109, :initialPrice=>500, :discountTotal=>0, :prices=>[{:price=>500, :quantity=>2}], :createdAt=>"2014-10-28 19:31:10", :quantity=>2, :status=>"new", :offer=>{:displayName=>"noname", :id=>76, :xmlId=>"4f9c8bc6-7e40-47ee-a90b-c8936ffbf7fb", :name=>"noname", :unit=>{:code=>"pc", :name=>"Штука", :sym=>"шт."}}, :properties=>[], :purchasePrice=>0}, {:bonusesChargeTotal=>0, :bonusesCreditTotal=>0, :markingCodes=>[], :discounts=>[], :id=>110, :initialPrice=>1300, :discountTotal=>0, :prices=>[{:price=>1300, :quantity=>1}], :createdAt=>"2014-10-28 19:31:10", :quantity=>1, :status=>"new", :offer=>{:displayName=>"noname", :id=>77, :xmlId=>"d9b45af3-2f24-49f5-b2b9-e7f5c7362ca9", :name=>"noname", :unit=>{:code=>"pc", :name=>"Штука", :sym=>"шт."}}, :properties=>[], :purchasePrice=>0}], :payments=>[], :fromApi=>true, :shipped=>false, :customFields=>[]}}
|
|
929
|
+
```
|
|
930
|
+
### <a name="post--api-v5-orders-fix-external-ids"></a> [Массовая запись внешних ID заказов](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-orders-fix-external-ids)
|
|
931
|
+
### <a name="get--api-v5-orders-history"></a> [Получение истории изменений заказов](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-orders-history)
|
|
932
|
+
### <a name="post--api-v5-orders-links-create"></a> [Создание связи между заказами](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-orders-links-create)
|
|
933
|
+
### <a name="post--api-v5-orders-loyalty-apply"></a> [Применение бонусов по программе лояльности](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-orders-loyalty-apply)
|
|
934
|
+
### <a name="post--api-v5-orders-loyalty-cancel-bonus-operations"></a> [Отмена бонусных операций по программе лояльности](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-orders-loyalty-cancel-bonus-operations)
|
|
935
|
+
### <a name="post--api-v5-orders-payments-create"></a> [Добавление платежа](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-orders-payments-create)
|
|
936
|
+
### <a name="post--api-v5-orders-payments-id-delete"></a> [Удаление платежа](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-orders-payments-id-delete)
|
|
937
|
+
### <a name="post--api-v5-orders-payments-id-edit"></a> [Редактирование платежа](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-orders-payments-id-edit)
|
|
938
|
+
### <a name="get--api-v5-orders-statuses"></a> [Получение списка статусов заказов](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-orders-statuses)
|
|
939
|
+
### <a name="post--api-v5-orders-upload"></a> [Пакетная загрузка заказов](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-orders-upload)
|
|
940
|
+
### <a name="get--api-v5-orders-externalId"></a> [Получение информации о заказе](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-orders-externalId)
|
|
941
|
+
### <a name="post--api-v5-orders-externalId-edit"></a> [Редактирование заказа](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-orders-externalId-edit)
|
|
942
|
+
## <a name="orders_packs"></a> Комплектация заказов
|
|
943
|
+
### <a name="get--api-v5-orders-packs"></a> [Получение списка паков, удовлетворяющих заданному фильтру](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-orders-packs)
|
|
944
|
+
### <a name="post--api-v5-orders-packs-create"></a> [Создание пака](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-orders-packs-create)
|
|
945
|
+
### <a name="get--api-v5-orders-packs-history"></a> [Получение истории комплектации заказа](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-orders-packs-history)
|
|
946
|
+
### <a name="get--api-v5-orders-packs-id"></a> [Получение информации о паке](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-orders-packs-id)
|
|
947
|
+
### <a name="post--api-v5-orders-packs-id-delete"></a> [Удаление пака](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-orders-packs-id-delete)
|
|
948
|
+
### <a name="post--api-v5-orders-packs-id-edit"></a> [Редактирование пака](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-orders-packs-id-edit)
|
|
949
|
+
## <a name="payment"></a> Платежи
|
|
950
|
+
### <a name="post--api-v5-payment-check"></a> [Проверка инвойса](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-payment-check)
|
|
951
|
+
### <a name="post--api-v5-payment-create-invoice"></a> [Создание инвойса](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-payment-create-invoice)
|
|
952
|
+
### <a name="post--api-v5-payment-update-invoice"></a> [Изменение инвойса](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-payment-update-invoice)
|
|
953
|
+
### <a name="callback_post--integrationModule_integrations__payment__actions__approve_"></a> [Подтверждение оплаты](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#callback_post--integrationModule_integrations__payment__actions__approve_)
|
|
954
|
+
### <a name="callback_post--integrationModule_integrations__payment__actions__cancel_"></a> [Отмена оплаты](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#callback_post--integrationModule_integrations__payment__actions__cancel_)
|
|
955
|
+
### <a name="callback_post--integrationModule_integrations__payment__actions__create_"></a> [Создание оплаты](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#callback_post--integrationModule_integrations__payment__actions__create_)
|
|
956
|
+
### <a name="callback_post--integrationModule_integrations__payment__actions__refund_"></a> [Возврат](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#callback_post--integrationModule_integrations__payment__actions__refund_)
|
|
957
|
+
## <a name="recommendation"></a> Рекомендации
|
|
958
|
+
### <a name="callback_get--integrationModule_integrations__recommendation__actions__recommendation_"></a> [Запрос рекомендуемых товаров](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#callback_get--integrationModule_integrations__recommendation__actions__recommendation_)
|
|
959
|
+
## <a name="reference"></a> Справочники
|
|
960
|
+
### <a name="get--api-v5-reference-cost-groups"></a> [Получение списка групп расходов](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-reference-cost-groups)
|
|
961
|
+
### <a name="post--api-v5-reference-cost-groups-code-edit"></a> [Редактирование группы расходов](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-reference-cost-groups-code-edit)
|
|
962
|
+
### <a name="get--api-v5-reference-cost-items"></a> [Получение списка статей расходов](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-reference-cost-items)
|
|
963
|
+
### <a name="post--api-v5-reference-cost-items-code-edit"></a> [Редактирование статьи расходов](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-reference-cost-items-code-edit)
|
|
964
|
+
### <a name="get--api-v5-reference-countries"></a> [Получение списка кодов доступных стран](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-reference-countries)
|
|
965
|
+
### <a name="get--api-v5-reference-couriers"></a> [Получение списка курьеров](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-reference-couriers)
|
|
966
|
+
### <a name="post--api-v5-reference-couriers-create"></a> [Создание курьера](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-reference-couriers-create)
|
|
967
|
+
### <a name="post--api-v5-reference-couriers-id-edit"></a> [Редактирование курьера](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-reference-couriers-id-edit)
|
|
968
|
+
### <a name="get--api-v5-reference-delivery-services"></a> [Получение списка служб доставки](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-reference-delivery-services)
|
|
969
|
+
### <a name="post--api-v5-reference-delivery-services-code-edit"></a> [Создание/редактирование службы доставки](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-reference-delivery-services-code-edit)
|
|
970
|
+
### <a name="get--api-v5-reference-delivery-types"></a> [Получение списка типов доставки](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-reference-delivery-types)
|
|
971
|
+
### <a name="post--api-v5-reference-delivery-types-code-edit"></a> [Создание/редактирование типа доставки](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-reference-delivery-types-code-edit)
|
|
972
|
+
### <a name="get--api-v5-reference-legal-entities"></a> [Получение списка юридических лиц](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-reference-legal-entities)
|
|
973
|
+
### <a name="post--api-v5-reference-legal-entities-code-edit"></a> [Создание/редактирование юридического лица](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-reference-legal-entities-code-edit)
|
|
974
|
+
### <a name="get--api-v5-reference-mg-channels"></a> [Получение списка MessageGateway каналов](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-reference-mg-channels)
|
|
975
|
+
### <a name="get--api-v5-reference-order-methods"></a> [Получение списка способов оформления заказов](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-reference-order-methods)
|
|
976
|
+
### <a name="post--api-v5-reference-order-methods-code-edit"></a> [Создание/редактирование способа оформления заказа](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-reference-order-methods-code-edit)
|
|
977
|
+
### <a name="get--api-v5-reference-order-types"></a> [Получение списка типов заказов](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-reference-order-types)
|
|
978
|
+
### <a name="post--api-v5-reference-order-types-code-edit"></a> [Создание/редактирование типа заказа](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-reference-order-types-code-edit)
|
|
979
|
+
### <a name="get--api-v5-reference-payment-statuses"></a> [Получение списка статусов оплаты](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-reference-payment-statuses)
|
|
980
|
+
### <a name="post--api-v5-reference-payment-statuses-code-edit"></a> [Создание/редактирование статусов оплаты](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-reference-payment-statuses-code-edit)
|
|
981
|
+
### <a name="get--api-v5-reference-payment-types"></a> [Получение списка типов оплаты](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-reference-payment-types)
|
|
982
|
+
### <a name="post--api-v5-reference-payment-types-code-edit"></a> [Создание/редактирование типа оплаты](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-reference-payment-types-code-edit)
|
|
983
|
+
### <a name="get--api-v5-reference-price-types"></a> [Получение списка типов цен](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-reference-price-types)
|
|
984
|
+
### <a name="post--api-v5-reference-price-types-code-edit"></a> [Создание/редактирование типа цены](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-reference-price-types-code-edit)
|
|
985
|
+
### <a name="get--api-v5-reference-product-statuses"></a> [Получение списка статусов товаров в заказе](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-reference-product-statuses)
|
|
986
|
+
### <a name="post--api-v5-reference-product-statuses-code-edit"></a> [Создание/редактирование статуса товара в заказе](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-reference-product-statuses-code-edit)
|
|
987
|
+
### <a name="get--api-v5-reference-sites"></a> [Получение списка магазинов](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-reference-sites)
|
|
988
|
+
### <a name="post--api-v5-reference-sites-code-edit"></a> [Создание/редактирование магазина](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-reference-sites-code-edit)
|
|
989
|
+
### <a name="get--api-v5-reference-status-groups"></a> [Получение списка групп статусов заказа](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-reference-status-groups)
|
|
990
|
+
### <a name="get--api-v5-reference-statuses"></a> [Получение списка статусов заказа](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-reference-statuses)
|
|
991
|
+
### <a name="post--api-v5-reference-statuses-code-edit"></a> [Создание/редактирование статуса заказа](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-reference-statuses-code-edit)
|
|
992
|
+
### <a name="get--api-v5-reference-stores"></a> [Получение списка складов](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-reference-stores)
|
|
993
|
+
### <a name="post--api-v5-reference-stores-code-edit"></a> [Создание/редактирование сведений о складе](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-reference-stores-code-edit)
|
|
994
|
+
### <a name="get--api-v5-reference-units"></a> [Получение списка единиц измерений](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-reference-units)
|
|
995
|
+
### <a name="post--api-v5-reference-units-code-edit"></a> [Создание/редактирование единицы измерения](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-reference-units-code-edit)
|
|
996
|
+
## <a name="segments"></a> Сегменты
|
|
997
|
+
### <a name="get--api-v5-segments"></a> [Получение списка пользовательских сегментов](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-segments)
|
|
998
|
+
## <a name="settings"></a> Настройки
|
|
999
|
+
### <a name="get--api-v5-settings"></a> [Получение настроек системы](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-settings)
|
|
1000
|
+
## <a name="store"></a> Склад
|
|
1001
|
+
### <a name="get--api-v5-store-inventories"></a> [Получение остатков и закупочных цен](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-store-inventories)
|
|
1002
|
+
### <a name="post--api-v5-store-inventories-upload"></a> [Обновление остатков и закупочных цен](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-store-inventories-upload)
|
|
1003
|
+
### <a name="post--api-v5-store-prices-upload"></a> [Обновление цен торговых предложений](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-store-prices-upload)
|
|
1004
|
+
### <a name="get--api-v5-store-product-groups"></a> [Получение списка групп товаров, удовлетворяющих заданному фильтру](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-store-product-groups)
|
|
1005
|
+
### <a name="get--api-v5-store-products"></a> [Получение списка товаров с торговыми предложениями, удовлетворяющих заданному фильтру](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-store-products)
|
|
1006
|
+
### <a name="get--api-v5-store-products-properties"></a> [Получение списка свойств товаров, удовлетворяющих заданному фильтру](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-store-products-properties)
|
|
1007
|
+
### <a name="callback_post--integrationModule_integrations__store__actions__inventoriesUpload_"></a> [Обновление остатков и закупочных цен](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#callback_post--integrationModule_integrations__store__actions__inventoriesUpload_)
|
|
1008
|
+
### <a name="callback_post--integrationModule_integrations__store__actions__reserve_"></a> [Актуализация остатков после обращения к складской системе](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#callback_post--integrationModule_integrations__store__actions__reserve_)
|
|
1009
|
+
## <a name="tasks"></a> Задачи
|
|
1010
|
+
### <a name="get--api-v5-tasks"></a> [Получение списка задач](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-tasks)
|
|
1011
|
+
### <a name="post--api-v5-tasks-create"></a> [Создание задачи](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-tasks-create)
|
|
1012
|
+
### <a name="get--api-v5-tasks-id"></a> [Получение информации о задаче](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-tasks-id)
|
|
1013
|
+
### <a name="post--api-v5-tasks-id-edit"></a> [Редактирование задачи](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-tasks-id-edit)
|
|
1014
|
+
## <a name="telephony"></a> Телефония
|
|
1015
|
+
### <a name="post--api-v5-telephony-call-event"></a> [События звонка](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-telephony-call-event)
|
|
1016
|
+
### <a name="post--api-v5-telephony-calls-upload"></a> [Загрузка телефонных звонков](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-telephony-calls-upload)
|
|
1017
|
+
### <a name="get--api-v5-telephony-manager"></a> [Получение ответственного менеджера](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-telephony-manager)
|
|
1018
|
+
### <a name="callback_get--integrationModule_integrations__telephony__changeUserStatusUrl_"></a> [Оповещение о смене статуса](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#callback_get--integrationModule_integrations__telephony__changeUserStatusUrl_)
|
|
1019
|
+
### <a name="callback_get--integrationModule_integrations__telephony__makeCallUrl_"></a> [Инициация звонка](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#callback_get--integrationModule_integrations__telephony__makeCallUrl_)
|
|
1020
|
+
### <a name="callback_post--integrationModule_integrations__telephony__personalAccountUrl_"></a> [Переход в личный кабинет](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#callback_post--integrationModule_integrations__telephony__personalAccountUrl_)
|
|
1021
|
+
### <a name="callback_get--recordUrl"></a> [Прослушивание звонка](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#callback_get--recordUrl)
|
|
1022
|
+
## <a name="users"></a> Пользователи
|
|
1023
|
+
### <a name="get--api-v5-user-groups"></a> [Получение списка групп пользователей](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-user-groups)
|
|
1024
|
+
### <a name="get--api-v5-users"></a> [Получение списка пользователей, удовлетворяющих заданному фильтру](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-users)
|
|
1025
|
+
### <a name="get--api-v5-users-id"></a> [Получение информации о пользователе](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-users-id)
|
|
1026
|
+
### <a name="post--api-v5-users-id-status"></a> [Смена статуса пользователя](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-users-id-status)
|
|
1027
|
+
## <a name="verification"></a> Верификация
|
|
1028
|
+
### <a name="post--api-v5-verification-sms-confirm"></a> [Подтверждение верификации](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#post--api-v5-verification-sms-confirm)
|
|
1029
|
+
### <a name="get--api-v5-verification-sms-checkId-status"></a> [Проверка статуса верификации](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-verification-sms-checkId-status)
|
|
1030
|
+
## <a name="get--api-v5-statistic"></a> Статистика
|
|
1031
|
+
### <a name="get--api-v5-statistic-update"></a> [Обновление статистики](https://docs.retailcrm.ru/Developers/API/APIVersions/APIv5#get--api-v5-statistic-update)
|
|
1032
|
+
```ruby
|
|
1033
|
+
RetailcrmApi::Request.statistic("update").retrieve.body
|
|
1034
|
+
#=> {:success=>true}
|
|
223
1035
|
```
|
|
@@ -111,7 +111,7 @@ module RetailcrmApi
|
|
|
111
111
|
request.headers['User-Agent'] = "RetailCrmApi/#{RetailcrmApi::VERSION} Ruby gem"
|
|
112
112
|
request.headers.merge!(headers) if headers
|
|
113
113
|
if body
|
|
114
|
-
body.each { |k, v| body[k] = MultiJson.dump(v) }
|
|
114
|
+
body.each { |k, v| body[k] = MultiJson.dump(v) if [Array, Hash].include?(v.class) }
|
|
115
115
|
request.body = URI.encode_www_form(body)
|
|
116
116
|
end
|
|
117
117
|
request.options.timeout = self.timeout
|