-
Notifications
You must be signed in to change notification settings - Fork 5
/
apiary.apib
2979 lines (2871 loc) · 109 KB
/
apiary.apib
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
HOST: http://insales.ru/
--- insales.ru test API ---
--
Аккаунт
--
Получение информации о аккаунте
GET /admin/account.json
< 200
< Content-Type: application/json; charset=utf-8
< API-Usage-Limit: 2/500
{
"blocked": false,
"city": "Москва",
"contact_phone": null,
"country": "RU",
"enable_cart_discounts": false,
"enable_client_discounts": false,
"enable_group_discounts": false,
"enable_order_discounts": false,
"hide_items_out_of_stock": false,
"id": 12345,
"inviter_id": null,
"notification_email": null,
"organization": null,
"paid_till": "2009-03-02",
"sms_notification_phone": null,
"state": "г Москва",
"subdomain": "shop-test",
"email": "[email protected]",
"icq": null,
"phone": "+71234567890",
"title": "Название магазина",
"minimum_items_price": null,
"stock_currency_exchange_rate": "30.0",
"client_cookies_whitelist": null,
"main_host": "shop-test.myinsales.ru",
"main_host_protocol": "http",
"next_order_number": 1006,
"time_zone": "Moscow",
"owner": {
"created_at": "2013-02-18 00:20:01 +0400",
"email": "[email protected]",
"id": 12345,
"name": "Иван"
}
}
--
Категории на складе
--
Получение списка категорий
GET /admin/categories.json
< 200
< Content-Type: application/json; charset=utf-8
< API-Usage-Limit: 2/500
<?xml version="1.0" encoding="UTF-8"?>
<categories type="array">
<category>
<id type="integer">28429</id>
<parent-id type="integer" nil="true"/>
<title>Склад</title>
<position type="integer">1</position>
<created-at type="timestamp">2009-10-22 19:41:19 +0400</created-at>
<updated-at type="timestamp">2009-11-05 15:00:11 +0300</updated-at>
</category>
<category>
<id type="integer">32142</id>
<parent-id type="integer">28429</parent-id>
<title>Мужская одежда</title>
<position type="integer">2</position>
<created-at type="timestamp">2009-11-19 14:06:31 +0300</created-at>
<updated-at type="timestamp">2009-11-19 14:06:36 +0300</updated-at>
</category>
<category>
<id type="integer">28479</id>
<parent-id type="integer">28429</parent-id>
<title>Женская одежда</title>
<position type="integer">1</position>
<created-at type="timestamp">2009-10-23 19:47:24 +0400</created-at>
<updated-at type="timestamp">2009-10-23 19:47:24 +0400</updated-at>
</category>
<category>
<id type="integer">28480</id>
<parent-id type="integer">28429</parent-id>
<title>Платья</title>
<position type="integer">1</position>
<created-at type="timestamp">2009-10-23 19:47:24 +0400</created-at>
<updated-at type="timestamp">2009-10-23 19:47:24 +0400</updated-at>
</category>
</categories>
Получение информации о категории
GET /admin/categories/32142.json
< 200
< Content-Type: application/json; charset=utf-8
< API-Usage-Limit: 2/500
<?xml version="1.0" encoding="UTF-8"?>
<category>
<id type="integer">32142</id>
<parent-id type="integer">28429</parent-id>
<title>Мужская одежда</title>
<position type="integer">2</position>
<created-at type="timestamp">2009-11-19 14:06:31 +0300</created-at>
<updated-at type="timestamp">2009-11-19 14:06:36 +0300</updated-at>
</category>
Добавление новой категории
POST /admin/categories.json
> Content-Type: application/json
<?xml version="1.0" encoding="UTF-8"?>
<category>
<parent-id type="integer">28429</parent-id>
<title>Мужская одежда</title>
</category>
< 200
< Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<category>
<id type="integer">32142</id>
<parent-id type="integer">28429</parent-id>
<title>Мужская одежда</title>
<position type="integer">2</position>
<created-at type="timestamp">2009-11-19 14:06:31 +0300</created-at>
<updated-at type="timestamp">2009-11-19 14:06:36 +0300</updated-at>
</category>
Редактирование категории
PUT /admin/categories/32142.json
> Content-Type: application/json
<?xml version="1.0" encoding="UTF-8"?>
<category>
<id type="integer">32142</id>
<title>Одежда</title>
</category>
< 200
< Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<category>
<id type="integer">32142</id>
<parent-id type="integer">28429</parent-id>
<title>Одежда</title>
<position type="integer">2</position>
<created-at type="timestamp">2009-11-19 14:06:31 +0300</created-at>
<updated-at type="timestamp">2009-11-19 14:06:36 +0300</updated-at>
</category>
Удаление категории
DELETE /admin/categories/32142.json
< 200
--
Товары
--
Получение списка товаров
GET /admin/products.json?category_id=478
< 200
< Content-Type: application/json; charset=utf-8
< API-Usage-Limit: 2/500
<?xml version="1.0" encoding="UTF-8"?>
<products type="array">
<product>
<category-id type="integer">478</category-id>
<created-at type="timestamp">2009-06-04 14:22:34 +0400</created-at>
<id type="integer">41658</id>
<is-hidden type="boolean">false</is-hidden>
<updated-at type="timestamp">2010-07-14 13:40:01 +0400</updated-at>
<title>Van Gogh Ruled Peach Notebook</title>
<description><p><span style="font-family: 'Times New Roman'; font-size: 16px;"> </span></p></description>
<short-description>Алая записная книжка "Ван Гог" в линейку</short-description>
<permalink>Van-Gogh-Ruled-Rose-Notebook</permalink>
<html-title nil="true"/>
<meta-keywords nil="true"/>
<meta-description nil="true"/>
<characteristics type="array">
<characteristic>
<id type="integer">328</id>
<position type="integer">1</position>
<property-id type="integer">106</property-id>
<title>в линейку</title>
<permalink>rulled</permalink>
</characteristic>
</characteristics>
<properties type="array">
<property>
<id type="integer">106</id>
<position type="integer">1</position>
<title>Бумага</title>
<permalink>bumaga</permalink>
</property>
</properties>
<option-names type="array"/>
<images type="array">
<image>
<created-at type="timestamp">2009-06-04 14:22:34 +0400</created-at>
<id type="integer">24690</id>
<position type="integer">1</position>
<url>http://static.insales.ru/images/products/24690/thumb/vangogh-red.jpg</url>
<title nil="true"/>
</image>
</images>
<variants type="array">
<variant>
<cost-price type="decimal">487.0</cost-price>
<created-at type="timestamp">2009-06-04 14:22:34 +0400</created-at>
<id type="integer">48136</id>
<old-price type="decimal" nil="true"/>
<price type="decimal">740.0</price>
<product-id type="integer">41658</product-id>
<quantity type="integer" nil="true"/>
<sku>QP021MVEN-r</sku>
<updated-at type="timestamp">2010-07-16 13:20:04 +0400</updated-at>
<title nil="true"/>
<option-values type="array"/>
</variant>
</variants>
</product>
<product>
<category-id type="integer">478</category-id>
<created-at type="timestamp">2009-04-10 00:00:05 +0400</created-at>
<id type="integer">15757</id>
<is-hidden type="boolean">false</is-hidden>
<updated-at type="timestamp">2009-12-08 14:58:34 +0300</updated-at>
<title>Van Gogh Sketchbook Peach</title>
<description nil="true" />
<short-description>Персиковая записная книжка "Ван Гог" для рисунков</short-description>
<permalink>Van-Gogh-Sketchbook-Peach</permalink>
<html-title nil="true"/>
<meta-keywords nil="true"/>
<meta-description nil="true"/>
<characteristics type="array">
<characteristic>
<id type="integer">328</id>
<position type="integer">1</position>
<property-id type="integer">106</property-id>
<title>в линейку</title>
<permalink>rulled</permalink>
</characteristic>
</characteristics>
<properties type="array">
<property>
<id type="integer">106</id>
<position type="integer">1</position>
<title>Бумага</title>
<permalink>bumaga</permalink>
</property>
</properties>
<option-names type="array"/>
<images type="array">
<image>
<created-at type="timestamp">2009-04-10 00:00:05 +0400</created-at>
<id type="integer">13886</id>
<position type="integer">1</position>
<url>http://static.insales.ru/images/products/13886/thumb/vangogh-orange.jpg</url>
<title nil="true"/>
</image>
</images>
<variants type="array">
<variant>
<cost-price type="decimal">487.0</cost-price>
<created-at type="timestamp">2009-04-10 00:00:05 +0400</created-at>
<id type="integer">16638</id>
<old-price type="decimal" nil="true"/>
<price type="decimal">740.0</price>
<product-id type="integer">15757</product-id>
<quantity type="integer">0</quantity>
<sku>QP023MVEN-o</sku>
<updated-at type="timestamp">2010-07-16 13:20:05 +0400</updated-at>
<title nil="true"/>
<option-values type="array"/>
</variant>
</variants>
</product>
</products>
Получение информации о товаре
GET /admin/products/41658.json
< 200
< Content-Type: application/json; charset=utf-8
< API-Usage-Limit: 2/500
<?xml version="1.0" encoding="UTF-8"?>
<product>
<category-id type="integer">478</category-id>
<created-at type="timestamp">2009-06-04 14:22:34 +0400</created-at>
<id type="integer">41658</id>
<is-hidden type="boolean">false</is-hidden>
<updated-at type="timestamp">2010-07-14 13:40:01 +0400</updated-at>
<title>Van Gogh Ruled Peach Notebook</title>
<description><p><span style="font-family: 'Times New Roman'; font-size: 16px;"> </span></p></description>
<short-description>Алая записная книжка "Ван Гог" в линейку</short-description>
<permalink>Van-Gogh-Ruled-Rose-Notebook</permalink>
<html-title nil="true"/>
<meta-keywords nil="true"/>
<meta-description nil="true"/>
<characteristics type="array">
<characteristic>
<id type="integer">328</id>
<position type="integer">1</position>
<property-id type="integer">106</property-id>
<title>в линейку</title>
<permalink>rulled</permalink>
</characteristic>
</characteristics>
<properties type="array">
<property>
<id type="integer">106</id>
<position type="integer">1</position>
<title>Бумага</title>
<permalink>bumaga</permalink>
</property>
</properties>
<option-names type="array"/>
<images type="array">
<image>
<created-at type="timestamp">2009-06-04 14:22:34 +0400</created-at>
<id type="integer">24690</id>
<position type="integer">1</position>
<url>http://static.insales.ru/images/products/24690/thumb/vangogh-red.jpg</url>
<title nil="true"/>
</image>
</images>
<variants type="array">
<variant>
<cost-price type="decimal">487.0</cost-price>
<created-at type="timestamp">2009-06-04 14:22:34 +0400</created-at>
<id type="integer">48136</id>
<old-price type="decimal" nil="true"/>
<price type="decimal">740.0</price>
<product-id type="integer">41658</product-id>
<quantity type="integer" nil="true"/>
<sku>QP021MVEN-r</sku>
<updated-at type="timestamp">2010-07-16 13:20:04 +0400</updated-at>
<title nil="true"/>
<option-values type="array"/>
</variant>
</variants>
</product>
--
Добавление товара
--
Добавление товара с параметрами
POST /admin/products.json
> Content-Type: application/json
<?xml version="1.0" encoding="UTF-8"?>
<product>
<category-id type="integer">478</category-id>
<title>Van Gogh Ruled Peach Notebook</title>
<description><p><span style="font-family: 'Times New Roman'; font-size: 16px;"> </span></p></description>
<short-description>Алая записная книжка "Ван Гог" в линейку</short-description>
<properties-attributes type="array">
<properties-attribute>
<title>Бумага</title>
<value>в линейку</value>
</properties-attribute>
</properties-attributes>
<variants-attributes type="array">
<variant>
<sku>QP021MVEN-r</sku>
<quantity type="integer" nil="true"/>
<price type="decimal">740.0</price>
<cost-price type="decimal">487.0</cost-price>
<old-price type="decimal" nil="true"/>
</variant>
</variants-attributes>
</product>
< 200
< Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<product>
<category-id type="integer">478</category-id>
<created-at type="timestamp">2009-06-04 14:22:34 +0400</created-at>
<id type="integer">41658</id>
<is-hidden type="boolean">false</is-hidden>
<updated-at type="timestamp">2010-07-14 13:40:01 +0400</updated-at>
<title>Van Gogh Ruled Peach Notebook</title>
<description><p><span style="font-family: 'Times New Roman'; font-size: 16px;"> </span></p></description>
<short-description>Алая записная книжка "Ван Гог" в линейку</short-description>
<permalink>Van-Gogh-Ruled-Rose-Notebook</permalink>
<html-title nil="true"/>
<meta-keywords nil="true"/>
<meta-description nil="true"/>
<characteristics type="array">
<characteristic>
<id type="integer">328</id>
<position type="integer">1</position>
<property-id type="integer">106</property-id>
<title>в линейку</title>
<permalink>rulled</permalink>
</characteristic>
</characteristics>
<properties type="array">
<property>
<id type="integer">106</id>
<position type="integer">1</position>
<title>Бумага</title>
<permalink>bumaga</permalink>
</property>
</properties>
<option-names type="array"/>
<images type="array" />
<variants type="array">
<variant>
<cost-price type="decimal">487.0</cost-price>
<created-at type="timestamp">2009-06-04 14:22:34 +0400</created-at>
<id type="integer">48136</id>
<old-price type="decimal" nil="true"/>
<price type="decimal">740.0</price>
<product-id type="integer">41658</product-id>
<quantity type="integer" nil="true"/>
<sku>QP021MVEN-r</sku>
<updated-at type="timestamp">2010-07-16 13:20:04 +0400</updated-at>
<title nil="true"/>
<option-values type="array"/>
</variant>
</variants>
</product>
Добавление товара со свойствами
POST /admin/products.json
> Content-Type: application/json
<?xml version="1.0" encoding="UTF-8"?>
<product>
<category-id type="integer">478</category-id>
<is-hidden type="boolean">false</is-hidden>
<title>Модная майка</title>
<options type="array">
<option>
<title>Размер</title>
<value>XL</value>
</option>
<option>
<title>Цвет</title>
<value>белый</value>
</option>
</options>
<variants-attributes type="array">
<variant>
<cost-price type="decimal">487.0</cost-price>
<old-price type="decimal">1000</old-price>
<price type="decimal">740.0</price>
<quantity type="integer">10</quantity>
</variant>
</variants-attributes>
</product>
< 200
< Content-Type: application/json
<?xml version="1.0" encoding="UTF-8"?>
<product>
<id type="integer">41658</id>
<category-id type="integer">478</category-id>
<created-at type="timestamp">2009-06-04 14:22:34 +0400</created-at>
<is-hidden type="boolean">false</is-hidden>
<updated-at type="timestamp">2010-07-14 13:40:01 +0400</updated-at>
<title>Майка</title>
<description nil="true">
<short-description nil="true">
<permalink>Majka</permalink>
<html-title nil="true"/>
<meta-keywords nil="true"/>
<meta-description nil="true"/>
<characteristics type="array"/>
<properties type="array"/>
<option-names type="array">
<option-name>
<id type="integer">1171</id>
<position type="integer">1</position>
<title>Размер</title>
</option-name>
<option-name>
<id type="integer">1172</id>
<position type="integer">2</position>
<title>Цвет</title>
</option-name>
</option-names>
<images type="array" />
<variants type="array">
<variant>
<id type="integer">48136</id>
<product-id type="integer">41658</product-id>
<cost-price type="decimal">487.0</cost-price>
<old-price type="decimal">1000</old-price>
<price type="decimal">740.0</price>
<quantity type="integer">10</quantity>
<sku nil="true" />
<title>XL/белый</title>
<created-at type="timestamp">2009-06-04 14:22:34 +0400</created-at>
<updated-at type="timestamp">2010-07-16 13:20:04 +0400</updated-at>
<option-values type="array">
<option-value>
<id type="integer">5649</id>
<option-name-id type="integer">1171</option-name-id>
<position type="integer">1</position>
<value>XL</value>
</option-value>
<option-value>
<id type="integer">5650</id>
<option-name-id type="integer">1172</option-name-id>
<position type="integer">1</position>
<value>белый</value>
</option-value>
</option-values>
</variant>
</variants>
</product>
Добавление товара с несколькими модификациями
PUT /admin/products/478.json
> Content-Type: application/json
<?xml version="1.0" encoding="UTF-8"?>
<product>
<id type="integer">478</category-id>
<variants-attributes type="array">
<variant>
<cost-price type="decimal">487.0</cost-price>
<old-price type="decimal">1000</old-price>
<price type="decimal">740.0</price>
<quantity type="integer">10</quantity>
<options>
<option>
<option-name-id type="integer">202088</option-name-id>
<value>value 1</value>
</option>
</options>
</variant>
<variant>
<cost-price type="decimal">600.0</cost-price>
<old-price type="decimal">1100</old-price>
<price type="decimal">800.0</price>
<quantity type="integer">2</quantity>
<options>
<option>
<option-name-id type="integer">202088</option-name-id>
<value>value 2</value>
</option>
</options>
</variant>
</variants-attributes>
</product>
< 200
--
Редактирование товара
--
Изменение наименования товара
PUT /admin/products/41658.json
> Content-Type: application/json
<?xml version="1.0" encoding="UTF-8"?>
<product>
<id type="integer">41658</id>
<title>Van Gogh Ruled Peach Notebook</title>
</product>
< 200
Изменение параметров товара
PUT /admin/products/41658.json
> Content-Type: application/json
<?xml version="1.0" encoding="UTF-8"?>
<product>
<id type="integer">41658</id>
<properties-attributes type="array">
<properties-attribute>
<title>Бумага</title>
<value>в линейку</value>
</properties-attribute>
</properties-attributes>
</product>
< 200
Удаление товара
DELETE /admin/products/41658.json
< 200
--
Изображения товара
--
Получение всех изображений
GET /admin/products/2336153/images.json
< 200
< Content-Type: application/json; charset=utf-8
< API-Usage-Limit: 2/500
<?xml version="1.0" encoding="UTF-8"?>
<images type="array">
<image>
<id type="integer">1489191</id>
<product-id type="integer">2336153</product-id>
<position type="integer">1</position>
<original-url>http://static.insales.ru/images/products/1/6439/1489191/yhst-71326348041790_2147_5697670.jpg</original-url>
<title nil="true"/>
<created-at type="timestamp">2011-04-04 15:48:33 +0400</created-at>
</image>
<image>
<id type="integer">1489187</id>
<product-id type="integer">2336153</product-id>
<position type="integer">2</position>
<original-url>http://static.insales.ru/images/products/1/6435/1489187/yhst-71326348041790_2147_5571401.jpg</original-url>
<title nil="true"/>
<created-at type="timestamp">2011-04-04 15:48:27 +0400</created-at>
</image>
</images>
Получение изображения
GET /admin/products/2336153/images/1489191.json
< 200
< Content-Type: application/json; charset=utf-8
< API-Usage-Limit: 2/500
<?xml version="1.0" encoding="UTF-8"?>
<image>
<id type="integer">1489191</id>
<product-id type="integer">2336153</product-id>
<position type="integer">1</position>
<original-url>http://static.insales.ru/images/products/1/6439/1489191/yhst-71326348041790_2147_5697670.jpg</original-url>
<title nil="true"/>
<created-at type="timestamp">2011-04-04 15:48:33 +0400</created-at>
</image>
--
Добавление изображения
--
Добавлении изображения выложенного в интернет
POST /admin/products/2336153/images.json
> Content-Type: application/json
<?xml version="1.0" encoding="UTF-8"?>
<image>
<title>ImageTile</title>
<filename>myimage.jpg</filename>
<src>http://some-hosting.ru/some_image.jpg</src>
</image>
< 200
< Content-Type: application/json; charset=utf-8
< API-Usage-Limit: 2/500
<?xml version="1.0" encoding="UTF-8"?>
<image>
<id type="integer">1489191</id>
<product-id type="integer">2336153</product-id>
<position type="integer">1</position>
<original-url>http://static.insales.ru/images/products/1/6439/1489191/some_image.jpg</original-url>
<title>ImageTile</title>
<created-at type="timestamp">2011-04-04 15:48:33 +0400</created-at>
</image>
Передача изображения в теле запроса
POST /admin/products/2336153/images.json
> Content-Type: application/json
<?xml version="1.0" encoding="UTF-8"?>
<image>
<title>ImageTile</title>
<filename>myimage.jpg</filename>
<attachment>
/9j/4AAQSkZJRgABAQEAAQABAAD/2wBDAAkGBwgHBgkIBwgKCgkLDRYPDQwMDRsUFRAWIB0i
IiAdHx8kKDQsJCYxJx8fLT0tMTU3Ojo6Iys/RD84QzQ5Ojf/2wBDAQoKCg0MDRoPDxo3JR8l
Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzf/wAAR
CABrAJYDAREAAhEBAxEB/8QAHAABAAMBAQEBAQAAAAAAAAAAAAEGBwUEAgMI/8QAPBAAAAUD
AgQDBAcGBwAAAAAAAAECAwQFBhEHEiExQVETYXEUgZHBIiMyN1KhsQgVFzRidRYzQlR0lOH/
xAAaAQEAAwEBAQAAAAAAAAAAAAAAAwQFBgIB/8QAJhEBAAICAQQDAAEFAAAAAAAAAAECAwQR
BRIhMQYTIlEUMkGBsf/aAAwDAQACEQMRAD8A3EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAEAAAAD4JH0AAAAAAAAAAAAAEZAMgGQDID4cWlCFLWokpSWTMzwR
EPkzEe32ImZ4iFGreplNhuKZprapziTwayPa2R+vUVcm3WniPLoNL49n2I7sn5hw2NS6ut0j
XFieGZ/ZIlEePXIhnctEc8NK3xnFEeLzy0WgVdqs05uW0W1R8HEZ4oV2FvFljLXlyu3rW1ss
0s6eRMrGQDIBkAyAZAMgGQDIBkAyAgAAAABlep9bqFTrDVp0RLji1ES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zcLinqlSWHHlc3m8oWfmZpxkBnl22bM09p67is2sTWWoq0m/Cfc3IUkzx
7+fI/iA1a3qmVZoUCpkjZ7Uwh00fhMy4l8QFVuy3KnUdRLYrESOlcKASvaHDWRGnPlzMA1Qt
uqXC9b6qWylwoc8nnzUsk7U5Ljx5gL51AV6/qXLrNn1SnU9BOSZDO1tJqIiM8l1MBNq0dyJZ
lOpFVZTvbhpYfbzuLlgyyPkxEx5eqXms90M1remlbpc85NvLVIaSrc0aHNjrfl5+opW17RPN
HUa/V8GXH2bDzvQdRag17I6VQNsywZG4SSMvM+o+cZvUvcZOmY/1HCx2Ppo5T5rVSrq21OtH
uajIPJJV0NR9TLsJMWvNZ7rKG/1eMtZx4vEfy72pdnKu6jtIhvlHqUNzxorquW7qRn0zw49y
IW2Cr0S6NSKeymHULNTPkILb7U1IJKXPM8ZL9AHCuqzL4upUSs1ZpkpbUhCWKaw4kksM81KN
RnxPJF3+QDSr7tRm77eXTXXfAeSonY72M+G4RcD9OZAPPYrN1sxZUG8CiPpZJKI8lo8m8nBk
e78uhcwFVVaV1WPV5UyxSYnUqUve5TH1YNB/0mZ/A8/EB6/8Uakyy8KNZMeM4ZY8WRJI0kff
GSAWSoUCdcVjLpFwPtpqMhj611j7KHSPJGXkR4AUyjVHUe04LVKlW03WmIxbGZLMgiM0FyI+
p/AB8VqJfuoTTdLnUpmgUhSyVIUt0luLIjzjufpggGqUyEzTafGgxU7WYzSWkEf4UlggHrwA
YAAAAARgAwAkAARgAwAkAwAYARgBICMAGAEgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAgBIAAAAAAAAAAAAAAAAAAAAAAgB//2Q==
</attachment>
</image>
< 200
< Content-Type: application/json; charset=utf-8
< API-Usage-Limit: 2/500
<?xml version="1.0" encoding="UTF-8"?>
<image>
<id type="integer">1489191</id>
<product-id type="integer">2336153</product-id>
<position type="integer">1</position>
<original-url>http://static.insales.ru/images/products/1/6439/1489191/myimage.jpg</original-url>
<title>ImageTile</title>
<created-at type="timestamp">2011-04-04 15:48:33 +0400</created-at>
</image>
Изменение изображения
PUT /admin/products/2336153/images/1489191.json
> Content-Type: application/json
<?xml version="1.0" encoding="UTF-8"?>
<image>
<position type="integer">5</position>
<title>Other ImageTile</title>
</image>
< 200
Удаление изображения
DELETE /admin/products/2336153/images/1489191.json
< 200
--
Модификации товара
--
Получение всех модификаций товара
GET /admin/products/1157664/variants.json
< 200
< Content-Type: application/json; charset=utf-8
< API-Usage-Limit: 2/500
<?xml version="1.0" encoding="UTF-8"?>
<variants type="array">
<variant>
<id type="integer">1157664</id>
<product-id type="integer">182183</product-id>
<cost-price type="decimal" nil="true"/>
<old-price type="decimal" nil="true"/>
<price type="decimal">440.0</price>
<quantity type="integer" nil="true"/>
<sku nil="true"/>
<created-at type="timestamp">2010-07-03 20:04:28 +0400</created-at>
<updated-at type="timestamp">2010-07-03 20:04:28 +0400</updated-at>
<option-values type="array">
<option-value>
<id type="integer">8093</id>
<option-name-id type="integer">1576</option-name-id>
<position type="integer">3</position>
<title>Черный</title>
</option-value>
<option-value>
<id type="integer">8092</id>
<option-name-id type="integer">1575</option-name-id>
<position type="integer">24</position>
<title>96</title>
</option-value>
</option-values>
</variant>
<variant>
<id type="integer">1157665</id>
<product-id type="integer">182183</product-id>
<cost-price type="decimal" nil="true"/>
<old-price type="decimal" nil="true"/>
<price type="decimal">440.0</price>
<quantity type="integer" nil="true"/>
<sku nil="true"/>
<created-at type="timestamp">2010-07-03 20:04:39 +0400</created-at>
<updated-at type="timestamp">2010-07-03 20:04:39 +0400</updated-at>
<option-values type="array">
<option-value>
<id type="integer">7941</id>
<option-name-id type="integer">1576</option-name-id>
<position type="integer">2</position>
<title>Белый</title>
</option-value>
<option-value>
<id type="integer">8094</id>
<option-name-id type="integer">1575</option-name-id>
<position type="integer">25</position>
<title>100</title>
</option-value>
</option-values>
</variant>
<variant>
<id type="integer">1157666</id>
<product-id type="integer">182183</product-id>
<cost-price type="decimal" nil="true"/>
<old-price type="decimal" nil="true"/>
<price type="decimal">440.0</price>
<quantity type="integer" nil="true"/>
<sku nil="true"/>
<created-at type="timestamp">2010-07-03 20:04:39 +0400</created-at>
<updated-at type="timestamp">2010-07-03 20:04:39 +0400</updated-at>
<option-values type="array">
<option-value>
<id type="integer">8093</id>
<option-name-id type="integer">1576</option-name-id>
<position type="integer">3</position>
<title>Черный</title>
</option-value>
<option-value>
<id type="integer">8094</id>
<option-name-id type="integer">1575</option-name-id>
<position type="integer">25</position>
<title>100</title>
</option-value>
</option-values>
</variant>
</variants>
Получение модификации
GET /admin/products/182183/variants/1157664.json
< 200
< Content-Type: application/json; charset=utf-8
< API-Usage-Limit: 2/500
<?xml version="1.0" encoding="UTF-8"?>
<variant>
<id type="integer">1157664</id>
<product-id type="integer">182183</product-id>
<cost-price type="decimal" nil="true"/>
<old-price type="decimal" nil="true"/>
<price type="decimal">440.0</price>
<quantity type="integer" nil="true"/>
<sku nil="true"/>
<created-at type="timestamp">2010-07-03 20:04:28 +0400</created-at>
<updated-at type="timestamp">2010-07-03 20:04:28 +0400</updated-at>
<option-values type="array">
<option-value>
<id type="integer">8093</id>
<option-name-id type="integer">1576</option-name-id>
<position type="integer">3</position>
<title>Черный</title>
</option-value>
<option-value>
<id type="integer">8092</id>
<option-name-id type="integer">1575</option-name-id>
<position type="integer">24</position>
<title>96</title>
</option-value>
</option-values>
</variant>
Добавление модификации
POST /admin/products/182183/variants.json
> Content-Type: application/json
<?xml version="1.0" encoding="UTF-8"?>
<variant>
<price type="decimal">440.0</price>
<options type="array">
<option>
<option-name-id type="integer">1576</option-name-id>
<value>Черный</value>
</option>
<option>
<option-name-id type="integer">1575</option-name-id>
<value>96</value>
</option>
</options>
</variant>
< 200
< Content-Type: application/json; charset=utf-8
< API-Usage-Limit: 2/500
<?xml version="1.0" encoding="UTF-8"?>
<variant>
<id type="integer">1157664</id>
<product-id type="integer">182183</product-id>
<cost-price type="decimal" nil="true"/>
<old-price type="decimal" nil="true"/>
<price type="decimal">440.0</price>
<quantity type="integer" nil="true"/>
<sku nil="true"/>
<created-at type="timestamp">2010-07-03 20:04:28 +0400</created-at>
<updated-at type="timestamp">2010-07-03 20:04:28 +0400</updated-at>
<option-values type="array">
<option-value>
<id type="integer">8093</id>
<option-name-id type="integer">1576</option-name-id>
<position type="integer">3</position>
<title>Черный</title>
</option-value>
<option-value>
<id type="integer">8092</id>
<option-name-id type="integer">1575</option-name-id>
<position type="integer">24</position>
<title>96</title>
</option-value>
</option-values>
</variant>
Изменение модификации
PUT /admin/products/182183/variants/1157664.json
> Content-Type: application/json
<?xml version="1.0" encoding="UTF-8"?>
<variant>
<id type="integer">1157664</id>
<price type="decimal">440.0</price>
</variant>
< 200
< Content-Type: application/xml
<?xml version="1.0" encoding="UTF-8"?>
<variant>
<id type="integer">1157664</id>
<product-id type="integer">182183</product-id>
<cost-price type="decimal" nil="true"/>
<old-price type="decimal" nil="true"/>
<price type="decimal">440.0</price>
<quantity type="integer" nil="true"/>
<sku nil="true"/>
<created-at type="timestamp">2010-07-03 20:04:28 +0400</created-at>
<updated-at type="timestamp">2010-07-03 20:04:28 +0400</updated-at>
<option-values type="array">
<option-value>
<id type="integer">8093</id>
<option-name-id type="integer">1576</option-name-id>
<position type="integer">3</position>
<title>Черный</title>
</option-value>
<option-value>
<id type="integer">8092</id>
<option-name-id type="integer">1575</option-name-id>
<position type="integer">24</position>
<title>96</title>
</option-value>
</option-values>
</variant>
Удаление модификации
DELETE /admin/products/182183/variants/1157664.json
< 200
Групповое обновление модификаций
PUT /admin/products/variants_group_update.json
> Content-Type: application/json
<?xml version="1.0" encoding="UTF-8"?>
<variants type="array">
<variant>
<id type="integer">1</id>
<price type="decimal">110.0</price>
<quantity type="integer">2</quantity>
</variant>
<variant>
<id type="integer">2</id>
<price type="decimal">200.0</price>
<quantity type="integer">3</quantity>
</variant>
</variants>
< 200
< Content-Type: application/json; charset=utf-8
< API-Usage-Limit: 2/500
<?xml version="1.0" encoding="UTF-8"?>
<objects type="array">
<object>
<id type="integer">1</id>
<status>ok</status>
</object>
<object>
<id type="integer">2</id>
<status>ok</status>
</object>
</objects>
--
Свойства товара
--
Получение списка свойств
GET /admin/option_names.json
< 200
< Content-Type: application/json; charset=utf-8
< API-Usage-Limit: 2/500
<?xml version="1.0" encoding="UTF-8"?>
<option-names type="array">
<option-name>
<id type="integer">1093</id>
<title>Модификация</title>
<position type="integer">1</position>
</option-name>
<option-name>
<id type="integer">1575</id>
<title>Размер</title>
<position type="integer">2</position>
</option-name>
<option-name>