1. Wiki
  2. API
  3. Получение информации по сделке

Получение информации по сделке

URL метода

GET/POST offers/get/

Например:
https://(ваша компания).stocrm.ru/api/external/v1/offers/get/?SID=666_abcdefgh

Параметр:
Параметр Тип  Описание
OFFER_ID int С помощью этого параметра указывается номер сделки, из которой будет получена вся содержимая информация (о товарах, работах)

https://(ваша компания).stocrm.ru/api/external/v1/offers/get?SID=666_abcdefgh&OFFER_ID=2163

Пример полученных данных:

1    {
2      "RESPONSE": {
3        "OFFER": {
4          "HODL_ID": 48,
5          "CUSTOMER_ID": 52,
6          "OFFER_ID": 2163,
7          "CONTACT_ID": 71,
8          "SOURCE": "USER",
9          "SOURCE_ID": -1,
10         "SEGMENT_ID": false,
11         "STATUS_ID": 6,
12         "STATUS_REASON": false,
13         "STATUS_COMMENT": false,
14         "STATUS_DATE": 1561664721,
15         "STATUS_UPDATE": 1561664802,
16         "COMMENT": "Клиент сказал что оплатит позже",
17         "CREATOR_ID": 14,
18         "DATE_CREATE": 1561664721,
19         "UPDATER_ID": 14,
20         "DATE_UPDATE": 1561664721,
21         "RESPONSIBLE_ID": 14,
22         "CAR_PROFILE_ID": 35,
23         "PAYMENT_STATUS": "NONE",
24         "FIRST_COMPLETE_STATUS_DATE": 1561664802,
25         "FIRST_COMPLETE_PAY_DATE": false,
26         "REFUND_ORDERS": 0,
27         "NORMAL_ORDERS": 1,
28         "REQUIRES": {
29           "3803": {
30             "REQUIRE_ID": 3803,
31             "HODL_ID": 1,
32             "OFFER_ID": 1163,
33             "BRAND": "LUKOIL",
34             "SKU": "LOO128850",
35             "TITLE": "Масло Lukoil бочка 50л",
36             "LOCK": "Y",
37             "LOCK_DATE": "2019-06-27 19:46:38",
38             "LOCK_USER_ID": 14,
39             "IS_RECOMMENDATION": "N"
40           }
41         },
42         "ORDERS": {
43           "3803": {
44             "3850": {
45               "ORDER_ID": 3850,
46               "HODL_ID": 48,
47               "OFFER_ID": 2163,
48               "REQUIRE_ID": 3803,
49               "VERSION": 2,
50               "FORMATTED_STOCK": {
51                 "MS": {
52                   "KEY": "MARKUP",
53                   "MARKUP": 80,
54                   "RESULT": true,
55                   "RULE_ID": 34
56                 },
57                 "SKU": "LOO128850",
58                 "TAX": "0.00",
59                 "UID": "15d379511da07779af6e71bd5f3272b7",
60                 "NAME": "Масло Lukoil бочка 50л",
61                 "BRAND": "LUKOIL",
62                 "PRICE": 0.45,
63                 "SOLID": "N",
64                 "AMOUNT": 1,
65                 "IS_FULL": "1",
66                 "STOCK_ID": "1",
67                 "MAX_VOLUME": "50000",
68                 "MIN_VOLUME": "10",
69                 "PRICE_SUPP": 0.25,
70                 "STOCK_TYPE": "STO_STOCK",
71                 "IS_RESERVED": false,
72                 "PRICE_W_TAX": "12500.00",
73                 "SUPPLIER_ID": 5,
74                 "WAREHOUSE_ID": "1",
75                 "SUPPLIER_NAME": "Локальный склад",
76                 "CURRENT_VOLUME": "50000",
77                 "DELIVERY_HOURS": 0,
78                 "ORIGINAL_PRICE": 22500,
79                 "PRICE_SUPP_HUM": "0.25",
80                 "SUPPLIERS_INFO": false,
81                 "WAREHOUSE_NAME": "Склад 1",
82                 "REQUESTED_VOLUME": false,
83                 "RESERVES_OFFER_ID": false,
84                 "STOCKS_IDS_SYSTEM": [
85                   1
86                 ],
87                 "MEASUREMENT_UNIT_ID": "4",
88                 "MEASUREMENT_UNIT_NAME": "Мм"
89               },
90               "MARKUP_CURRENT": 80,
91               "QUANTITY_CURRENT": 5000,
92               "DISCOUNT_CURRENT": 0,
93               "QUANTITY_IDS": false,
94               "ORDER_SUM": 2250,
95               "ACTIVE": "Y",
96               "CUSTOM_BRAND": "LUKOIL",
97               "CUSTOM_SKU": "LOO128850",
98               "STOCK_TYPE": "STO_STOCK",
99               "NO_ROUND": "N",
100              "IS_REFUND": "N",
101              "PURCHASE": false,
102              "IS_RECOMMENDATION": "N",
103              "PURCHASE_STATUS": "Закупка не производилась",
104              "MARKUP_MIN": 0,
105              "MARKUP_MAX": 1000,
106              "MARKUP_STEP": 1,
107              "DISCOUNT_MIN": 0,
108              "DISCOUNT_MAX": 75,
109              "DISCOUNT_STEP": 1,
110              "QUANTITY_MIN": "10",
111              "QUANTITY_MAX": "50000",
112              "QUANTITY_STEP": "10",
113              "ORDER_STATUS": "WH_DOCUMENTS_OK",
114              "ORDER_LOST": "ERROR",
115              "MS": {
116                "RESULT": true,
117                "MARKUP": 80,
118                "RULE_ID": 34,
119                "KEY": "MARKUP"
120              },
121              "PRICE_POSITION": "0.25",
122              "PRICE_POSITION_ON_MARKUP": 0.45,
123              "PRICE_POSITION_ON_MARKUP_AND_DISCOUNT": 0.45,
124              "PRICE_POSITION_FINAL": 0.45,
125              "UID": "15d375523da01189af6e08bd5f3672b7",
126              "PRK": "LUKOILUNDERSCORELOO128850"
127            }
128          }
129        },
130        "SUMMARY": {
131          "all_orders_count": 1,
132          "orders_summ": 2250,
133          "works_count": 2,
134          "works_summ": 40093.2,
135          "total_summ": 42343.2,
136          "orders_count": 1,
137          "hours": 51.6
138        },
139        "CAR": false,
140        "SUB_STATUS": {
141          "GROUP_ID": 1,
142          "GROUP_NAME": "Статусы наличия",
143          "SUB_STATUS_ID": 8,
144          "SUB_STATUS_NAME": "Выдано клиенту",
145          "FRONT_SORT": 700,
146          "FRONT_COLOR": "black",
147          "SET_USER": "N"
148        },
149        "WORKS": {
150          "WORKS": {
151            "938": {
152              "WORK_ID": 938,
153              "OFFER_ID": 2163,
154              "CUSTOMER_ID": 52,
155              "TYPE": "NORMAL",
156              "DESCRIPTION": false,
157              "WORKING_HOUR": "1.000",
158              "DISCOUNT": "1.000000",
159              "WORK_COMPLETENESS_ID": 4,
160              "PRICE_OF_HOUR": "777.00",
161              "SUM": "777.0000",
162              "SUM_WO_HOURS": "777.0000000000",
163              "id_car_modification": false,
164              "WORK_OBJECT_ID": 358,
165              "WORK_ACTION_ID": 60,
166              "WORK_COEFFICIENT_ID": false,
167              "WORK_PLACE_BIT": [
168                512
169              ],
170              "WORK_OBJECT_COUNT_ID": 1,
171              "DATE_CREATE": "2019-06-27 19:45:33",
172              "DATE_UPDATE": "2019-06-27 19:45:33",
173              "CREATOR_ID": 14,
174              "UPDATER_ID": 14,
175              "DISCOUNT_PERCENT": "0.000000",
176              "WORK_ACTION_NAME": "Проверка",
177              "WORK_OBJECT_NAME": "Колесо",
178              "WORK_OBJECT_INFLECT_FLAG": "Y",
179              "WORK_OBJECT_INFLECT_CASE": "rod",
180              "WORK_OBJECT_INFLECT_AS_MULTIPLE": "N",
181              "WORK_OBJECT_COUNT": "1.0",
182              "PERFORMERS": false,
183              "TITLE": "проверка колеса",
184              "DOCUMENT_TITLE": "проверка колеса"
185            },
186            "939": {
187              "WORK_ID": 939,
188              "OFFER_ID": 2163,
189              "CUSTOMER_ID": 48,
190              "TYPE": "NORMAL",
191              "DESCRIPTION": false,
192              "WORKING_HOUR": "50.600",
193              "DISCOUNT": "1.000000",
194              "WORK_COMPLETENESS_ID": 4,
195              "PRICE_OF_HOUR": "777.00",
196              "SUM": "39316.2000",
197              "SUM_WO_HOURS": "777.0000000000",
198              "id_car_modification": false,
199              "WORK_OBJECT_ID": 402,
200              "WORK_ACTION_ID": 1,
201              "WORK_COEFFICIENT_ID": false,
202              "WORK_PLACE_BIT": [
203                512
204              ],
205              "WORK_OBJECT_COUNT_ID": 1,
206              "DATE_CREATE": "2019-06-27 19:45:33",
207              "DATE_UPDATE": "2019-06-27 19:45:33",
208              "CREATOR_ID": 14,
209              "UPDATER_ID": 14,
210              "DISCOUNT_PERCENT": "0.000000",
211              "WORK_ACTION_NAME": "Замена",
212              "WORK_OBJECT_NAME": "Рулевая колонка",
213              "WORK_OBJECT_INFLECT_FLAG": "Y",
214              "WORK_OBJECT_INFLECT_CASE": "rod",
215              "WORK_OBJECT_INFLECT_AS_MULTIPLE": "N",
216              "WORK_OBJECT_COUNT": "1.0",
217              "PERFORMERS": false,
218              "TITLE": "замена рулевой колонки",
219              "DOCUMENT_TITLE": "замена рулевой колонки"
220            }
221          },
222          "SUM": 40093.2,
223          "HOURS": 51.6
224        },
225        "VERSION": 2,
226        "AVAILABLE_STATUSES": {
227          "2": {
228            "STATUS_ID": 2,
229            "TITLE": "Заказ-наряд",
230            "LEADS_SORT": 500,
231            "LEADS_BASE": "Y",
232            "SORT": 50
233          },
234          "7": {
235            "STATUS_ID": 7,
236            "TITLE": "Клиентский возврат",
237            "LEADS_SORT": 900,
238            "LEADS_BASE": "N",
239            "SORT": 90,
240            "GROUP": {
241              "NAME": "Причина возврата",
242              "CHILDS": {
243                "41": {
244                  "NAME": "Брак",
245                  "DEFAULT": false,
246                  "NEED_COMMENT": "Y",
247                  "NEED_DATE": false,
248                  "VALUE": 41
249                },
250                "43": {
251                  "NAME": "Не подошло",
252                  "DEFAULT": false,
253                  "NEED_COMMENT": "Y",
254                  "NEED_DATE": false,
255                  "VALUE": 43
256                },
257                "45": {
258                  "NAME": "Не потребовалось",
259                  "DEFAULT": false,
260                  "NEED_COMMENT": false,
261                  "NEED_DATE": false,
262                  "VALUE": 45
263                }
264              }
265            }
266          },
267          "6": {
268            "STATUS_ID": 6,
269            "TITLE": "Успешно реализованный",
270            "LEADS_SORT": 800,
271            "LEADS_BASE": "Y",
272            "SORT": 60
273          }
274        },
275        "DELIVERY": false
276      },
277      "CONTACT": {
278        "CONTACT_ID": 71,
279        "TITLE": "Ягин Виталий Георгиевич",
280        "FIRSTNAME": "Виталий",
281        "SURNAME": "Ягин",
282        "MIDDLENAME": "Георгиевич",
283        "CREATOR_ID": false,
284        "UPDATER_ID": 14,
285        "DOB": "1992-02-16",
286        "DATE_CREATE": "2019-03-12 11:52:47",
287        "DATE_UPDATE": "2019-06-21 14:40:24",
288        "OPENER_ID": false,
289        "HODL_ID": 1,
290        "SEGMENT_ID": 2,
291        "DISCOUNT": 0,
292        "KIND_ID": 3,
293        "CONTACT_SUBSCRIPTION_VARIANT_ID": 2,
294        "CREATOR_FIRST_NAME": false,
295        "CREATOR_LAST_NAME": false,
296        "CREATOR_MIDDLE_NAME": false,
297        "UPDATER_FIRST_NAME": "Иван",
298        "UPDATER_LAST_NAME": "Петров",
299        "UPDATER_MIDDLE_NAME": "Сергеевич",
300        "CREATOR_NAME": false,
301        "UPDATER_NAME": "Петров Иван Сергеевич",
302        "DATE_CREATE_TIMESTAMP": 1552380767,
303        "DATE_UPDATE_TIMESTAMP": 1561117224,
304        "MAIN_PHONE": "79999999999",
305        "MAIN_EMAIL": "isp7991@google.com",
306        "MAIN_ADDRESS": false,
307        "SEGMENTS": {
308          "2": 2
309        },
310        "PROPERTIES": {
311          "1": {
312            "ITEMS": {
313              "98": {
314                "ID": 98,
315                "PROP_TYPE_ID": 1,
316                "VALUE": "79999999999",
317                "MAIN": "Y",
318                "ADDON": false
319              }
320            },
321            "INFO": {
322              "PROP_TYPE_ID": 1,
323              "NAME": "Телефон",
324              "ACTIVE": "Y",
325              "MAIN": 98
326            }
327          },
328          "2": {
329            "ITEMS": {
330              "4233": {
331                "ID": 4233,
332                "PROP_TYPE_ID": 2,
333                "VALUE": "isp7991@google.com",
334                "MAIN": "Y",
335                "ADDON": false
336              }
337            },
338            "INFO": {
339              "PROP_TYPE_ID": 2,
340              "NAME": "E-Mail",
341              "ACTIVE": "Y",
342              "MAIN": 4233
343            }
344          }
345        }
346      }
347    },
348    "MESSAGE": "ok",
349    "CODE": 200
350  }

Статья с перечнем функций

Обновлено Июнь 28, 2019

Related Articles