-
Notifications
You must be signed in to change notification settings - Fork 2
/
apiary.apib
7066 lines (5798 loc) · 243 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
FORMAT: 1A9
HOST: https://api.mergado.com
# Mergado
The Mergado API is based on REST principles. The request/response format is JSON. This documentation is a part of [Mergado Docs](https://mergado.github.io/docs/intro/the-basics.html).
## Changelog
### 11. 9. 2024
#### Added
* `invoicing_validity_date`, `avatars`, and `phone` fields to the `/users/` and `/users/{id}/` endpoints, these endpoints are now also accessible with offline tokens
* **POST** method for `/products/{id}/` endpoint to set the `is_dirty` field
### 24. 7. 2024
#### Added
* `in_testing_mode` field in `/shops/{id}/projects/` and `/projects/{id}/` endpoints
#### Removed
* `created_at` field in `/projects/{id}/products/`, `/products/{id}/` and `/queries/{id}/products/` endpoints
### 25. 1. 2024
#### Added
* `values_to_extract` parameter for `/queries/{id}/products/` endpoint
### 10. 10. 2023
#### Added
* `values_to_extract` parameter for `projects/{id}/products/` endpoint
### 14. 9. 2022
#### Added
* Endpoint `/formats/{format_id}`
* Endpoint `/formats/{format_id}/specification`
#### Changed
* Versioning
* Endpoint `/projects/{id}/elements`
* Endpoint `/elements/{id}`
* Endpoint `/projects/{id}/products`
* Endpoint `/products/{id}`
* Endpoint `/queries/{id}/products`
## Requests
The recommended encoding of all requests is UTF-8. Requests must be made over **HTTPS** and
all endpoints start with `https://api.mergado.com/`. Note that almost all API endpoints
require [OAuth 2.0 authentication](https://tools.ietf.org/html/rfc6749).
### Allowed HTTPs requests
| Method | Description |
|--------|----------------------------------------------|
| GET | Retrieves a resource or a list of resources. |
| POST | Creates or updates a resource. |
| PATCH | Updates a resource. |
| DELETE | Deletes a resource. |
### Additional GET parameters
| Parameter | Example | Description |
|------------------------------|--------------------------------------------------------------------------|-------------|
| **fields** | `?fields=uri,shop.id` | Only fields `uri` and `id` nested in `shop` will be returned in the given example. It works also for arrays of results - filter is applied to all their items, one by one. |
| **limit**, **offset** | `?limit=5&offset=2` | Works for arrays only. It is for paging the results. In the example, 2 results from the beginning are skipped and only 5 following items are returned. The default limit for every array result is 10 items. |
| **date** | `?date=2015-12-24` | Works only for some special endpoints. In the example, it will return results corresponding only to Christmas Eve in 2015.
| **filter** | `?filter=[{"field": "to", "op": ">=", "value": "2021-08-08T13:00:00"}]` | Filters the result. Parameter accepts a valid JSON list with at least one filter. Returned objects meet conditions for all filters. Supported operators are: `=`, `!=`, `<=`, `>=`, `<`, `>`, `~` (regexp), `in`. Only numbers and timestamps in ISO 8601 format can be ordinally compared. Missing values in timestamps will be supplemented by the lowest possible values, eg `"2015-12-24"` equals `"2015-12-24T00:00:00+00:00"`. Checks for `null` values is possible with `=` and `!=`. For other operators the comparison with `null` will always fail. Only non-nested fields are expected. |
| **order_by** | `?order_by=validator,-verdict` | Orders the result in ascending or descending order. |
| filter_by | `?filter_by={"item_id__in":["123456789"]}` | **!! DEPRECATED !!** Used only for Feed Audit and Statistics. Filters the result. You can also append field name with `__in`, i.e. filter results by enumerating all values of a field, for example `item_id__in` expects list of possible ITEM_IDs. |
| **values_to_extract** | `?values_to_extract=["ITEM_ID", "PARAM | PARAM_NAME", "Variable"]`| The functionality is limited to the `List Products` endpoint. You can specify a list of element paths or variable names for which the endpoint will return a list of values in a new field called `extracted_values`. |
#### Encoding
All special characters in additional GET parameter values must be URL-encoded (also known as percent-encoding).
### Typical Server Responses
| Code | Status | Description |
|------|--------------------|-------------|
| 200 | OK | The request was successful (some API calls may return 201 instead). In case of arrays, `total_results` or `after` is returned as part of the envelope (together with `limit` and `offset`). It corresponds to the total amount of resources that match the request. |
| 201 | Created | The request was successful and a resource was created. |
| 204 | No Content | The request was successful but there is no representation to return (that is, the response is empty). |
| 400 | Bad Request | The request could not be understood or was missing required parameters. |
| 401 | Unauthorized | Authentication failed or user does not have permissions for the requested operation. |
| 403 | Forbidden | Access denied. |
| 404 | Not Found | Resource was not found. |
| 405 | Method Not Allowed | Requested method is not supported for the specified resource. |
| 409 | Conflict | Resource already exists and could not be created. |
## OAuth 2.0
To access Mergado API, clients (e.g. an application) are required to authenticate with
[OAuth 2.0](https://tools.ietf.org/html/rfc6749). Each application is required to have
its OAuth credentials which can be obtained from the Mergado
[developers center](https://developers.mergado.com) (during registeration of your application,
a client ID and a secret key is assigned to your application).
* [Basics of OAuth 2.0 in Mergado Apps](http://mergado.github.io/docs/api/authorization.html)
* [List of all OAuth scopes](http://mergado.github.io/docs/api/oauth-scopes.html)
### Online and offline access tokens
Mergado API distinguishes between situations where your Mergado platform app accesses API **on behalf of some specific Mergado user** and where the app is accessing API **on behalf of the app itself**.
Access tokens bound to some specific user ID are called ***online*** tokens. Access tokens bound only to the app itself are called ***offline*** tokens.
## Versioning
Versioning is implemented using the `use-mergado-api-version` header. The valid syntax is:
`use-mergado-api-version`: "YYYY-MM-DD", eg. `use-mergado-api-version`: "2022-01-19".
For any endpoint,
* in case of a date X is specified in the `use-mergado-api-version` header, and
* there exists only one endpoint version, then the default endpoint version will be used,
* there exist endpoint versions valid until dates A and B, and the newest version C, and A < B < X < C holds, then the newest version of the endpoint C will be used,
* there exist only endpoint versions valid until the dates A and B, and A < B < X holds (i.e. there is no newest version), then the error 404 will be returned,
* in case of there is no date specified in the `use-mergado-api-version` header, the endpoint valid on 2020-09-07 will be used.
Note that all request and response examples match the latest version.
# Group Base
Various API resources that don't require any authentication.
## Info [/]
### Show API Version [GET]
Returns date for a current default API implementation that is used when `use-mergado-api-version` header is not provided (see Versioning for more).
+ Response 200
+ Headers
Content-Type: application/json
+ Body
{
"version_for": "2022-01-19"
}
## Maintenance [/maintenance]
### Show maintenance info [GET]
Returns information about maintenance.
+ Response 200
+ Headers
Content-Type: application/json
+ Body
{
"data": [
{
"from": "2018-08-08T13:00:00+00:00",
"to": "2018-08-08T13:30:00+00:00",
"type": "scheduled_maintenance",
},
{
"from": "2018-07-26T13:00:00+00:00",
"to": "2018-07-26T13:15:00+00:00",
"type": "scheduled_maintenance",
},
],
"limit": 10,
"offset": 0,
"total_results": 2
}
## XML Formats [/formats/]
Formats represent XML feeds and their specification supported by Mergado.
### List Supported Formats [GET]
Returns a list of IDs of all supported XML feed's formats.
+ Response 200
+ Headers
Content-Type: application/json
+ Body
[
"heureka.cz",
"hledejceny.cz",
"hyperzbozi.cz",
"srovname.cz",
"zbozi.cz",
"heureka.cz-kosik",
"heureka.sk",
"najnakup.sk",
"pricemania.sk"
]
### Get Format [GET /formats/{format_id}]
Returns requested format by its ID.
**Oauth2 Scope:** project.read or shop.read or user.formats.read
+ Parameters
+ format_id (string) - format ID.
+ Response 200
+ Headers
Content-Type: application/json
+ Body
[
"id": "heureka.cz",
"country": "cz",
"name": "Heureka.cz [cz]",
"ga_sources":[
"heureka.cz",
"seznamzbozi.cz",
"srovnanicen.cz",
"nejlepsiceny.cz"
],
"is_importable": true,
"is_exportable": true
]
### Get Format Specification [GET /formats/{format_id}/specification]
Returns requested format specification by its format ID.
**Warning:** Format specifications could be changed to be up to date with the newest versions provided by the format authors.
**Oauth2 Scope:** project.read or shop.read or user.formats.read
+ Parameters
+ format_id (string) - format ID.
+ Response 200
+ Headers
Content-Type: application/json
+ Body
[
"id": "xml.Heureka",
"file_format": "xml",
"global_schema":{
"SHOP":{
"semantic": "root"
"mergado_xml":[
"CHANNEL"
],
"children":{
"SHOPITEM":{
"mergado_xml":[
"ITEM"
]
}
}
}
"item_schema":{
"ITEM_ID_DEPRECATED":{
"is_depracated": true
"is_unique":true
"semantic": "item_id"
"mergado_xml":[
"ITEM_ID"
]
}
"ITEM_ID":{
"is_unique":true
"semantic": "item_id"
"mergado_xml":[
"ITEM_ID"
]
}
"PRODUCTNAME":{
"is_unique":true
"semantic": "name_exact"
"mergado_xml":[
"NAME_EXACT"
]
}
"URL":{
"is_unique":true
"semantic": "url"
"mergado_xml":[
"URL"
]
}
"PRODUCT":{
"is_unique":true
"semantic": "name_commercial"
"mergado_xml":[
"NAME_COMMERCIAL"
]
}
"EAN":{
"is_unique":true
"semantic": "ean"
"mergado_xml":[
"EAN"
]
}
"DESCRIPTION":{
"semantic": "description"
"mergado_xml":[
"DESCRIPTION"
]
}
"IMGURL":{
"is_unique":true
"semantic": "image"
"mergado_xml":[
"IMAGE"
]
}
"IMGURL_ALTERNATIVE":{
"semantic": "image_alternative"
"mergado_xml":[
"IMAGE_ALTERNATIVE"
]
}
"VIDEO_URL":{
"semantic": "video"
"mergado_xml":[
"VIDEO"
]
}
"PRICE_VAT":{
"semantic": "price_vat"
"mergado_xml":[
"PRICE_VAT"
]
}
"VAT":{
"semantic": "vat"
"mergado_xml":[
"VAT"
]
}
"ITEM_TYPE":{
"semantic": "item_type"
}
"PARAM":{
"semantic": "param"
"mergado_xml":[
"PARAM"
]
"children":{
"PARAM_NAME":{
"semantic": "param_name"
"mergado_xml":[
"NAME"
]
}
"VAL":{
"semantic": "param_value"
"mergado_xml":[
"VALUE"
]
}
}
}
"MANUFACTURER":{
"semantic": "brand"
"mergado_xml":[
"BRAND"
]
}
"CATEGORYTEXT":{
"semantic": "category"
"mergado_xml":[
"CATEGORY"
]
}
"ISBN":{
"is_unique":true
"semantic": "isbn"
"mergado_xml":[
"ISBN"
]
}
"HEUREKA_CPC":{
"semantic": "cpc"
"mergado_xml":[
"CPC"
]
}
"DELIVERY_DATE":{
"semantic": "delivery_days"
"mergado_xml":[
"DELIVERY_DAYS"
]
}
"DELIVERY":{
"semantic": "delivery"
"mergado_xml":[
"DELIVERY"
]
"children":{
"DELIVERY_ID":{
"semantic": "delivery_id"
"mergado_xml":[
"ID"
]
}
"DELIVERY_PRICE":{
"semantic": "delivery_price"
"mergado_xml":[
"PRICE"
]
}
"DELIVERY_PRICE_COD":{
"semantic": "delivery_price_cod"
"mergado_xml":[
"PRICE_COD"
]
}
}
}
"ITEMGROUP_ID":{
"semantic": "itemgroup_id"
"mergado_xml":[
"ITEMGROUP_ID"
]
}
"ACCESSORY":{
"semantic": "accessory"
"mergado_xml":[
"ACCESSORY"
]
}
"DUES":{
"semantic": "dues"
"mergado_xml":[
"DUES"
]
}
"GIFT":{
"semantic": "benefit"
"mergado_xml":[
"BENEFIT"
]
"children":{
"ID":{
"is_attribute":true
"semantic": "gift_id"
}
}
}
"EXTENDED_WARRANTY":{
"semantic": "extended_warranty_wrapper"
"children":{
"VAL":{
"semantic": "warranty"
"mergado_xml":[
"WARRANTY"
]
}
"DESC":{
"semantic": "extended_warranty_description"
}
}
}
"SPECIAL_SERVICE":{
"semantic": "benefit"
"mergado_xml":[
"BENEFIT"
]
}
"SALES_VOUCHER":{
"semantic": "voucher"
"children":{
"CODE":{
"semantic": "voucher_code"
}
"DESC":{
"semantic": "voucher_description"
}
}
}
}
]
## Tariffs [/tariffs/]
Lists tariffs available for users.
### List Available Tariffs [GET]
Returns available tariffs which are automatically chosen for each eshop.
+ Response 200
+ Headers
Content-Type: application/json
+ Body
{
"limit": 10,
"data": [
{
"id": "2",
"name": "Basic",
"price_czk": 286,
"price_eur": 11,
"price_pln": 49,
"price_usd": 12,
"price_gbp": 9
},
{
"id": "3",
"name": "Standard",
"price_czk": 586,
"price_eur": 22,
"price_pln": 99,
"price_usd": 22,
"price_gbp": 19
},
{
"id": "4",
"name": "Advanced",
"price_czk": 1286,
"price_eur": 49,
"price_pln": 219,
"price_usd": 52,
"price_gbp": 49
},
{
"id": "6",
"name": "Special 300",
"price_czk": 1786,
"price_eur": 70,
"price_pln": 299,
"price_usd": 72,
"price_gbp": 59
},
{
"id": "7",
"name": "Special 400",
"price_czk": 2286,
"price_eur": 89,
"price_pln": 379,
"price_usd": 92,
"price_gbp": 75
},
{
"id": "8",
"name": "Special 500",
"price_czk": 2768,
"price_pln": 459,
"price_eur": 108,
"price_usd": 112,
"price_gbp": 89
},
{
"id": "9",
"name": "Special 600",
"price_czk": 3286,
"price_eur": 129,
"price_pln": 549,
"price_usd": 132,
"price_gbp": 105
}
],
"offset": 0,
"total_results": 8
}
### Get Tariff [GET /tariffs/{id}/{?fields}]
Returns requested tariff by its ID.
+ Parameters
+ id (string) - Tariff ID.
+ Response 200
+ Headers
Content-Type: application/json
+ Body
{
"id": "3",
"name": "Standard",
"price_czk": 586,
"price_eur": 22,
"price_pln": 99,
"price_usd": 22,
"price_gbp": 19
}
## Rule Definitions [/rules/definitions/{?limit,offset,fields,filter}]
Definition of rules so that developers can see which rules expect what data.
+ Attributes
+ type (string) - Unique name of the rule.
+ relationship (enum[string]) - Whether the rule accepts an object
(dictionary) as an argument or a list of objects.
+ members
+ 1:1
+ 1:N
+ fields - List of fields the rule accepts during instantiation.
### List Defined Rules [GET]
Returns definitions of all rules and required data for their instantiation.
+ Response 200
+ Headers
Content-Type: application/json
+ Body
{
"data": [
{
"type": "format_converter",
"relationship": "1:1",
"fields": []
},
{
"type": "rewriting",
"relationship": "1:1",
"fields": [
{
"name": "new_content",
"required": true,
"type": "STRING"
}
]
},
{
"type": "replacing",
"relationship": "1:1",
"fields": [
{
"name": "search",
"required": true,
"type": "STRING"
},
{
"name": "replacement",
"required": true,
"type": "STRING"
},
{
"name": "regex",
"required": true,
"type": "BOOLEAN"
},
{
"name": "case_sensitive",
"required": true,
"type": "BOOLEAN"
}
]
}
],
"limit": 10,
"total_results": 3,
"offset": 0
}
# Group Me
Information about yourself - current client accessing the API _(identified by access token)_.
## User [GET /me/{?fields}]
**Access with ONLINE token only.**
Returns currently authenticated user.
**OAuth2 Scope:** user.read
+ Request
+ Headers
Content-Type: application/json
+ Response 200
+ Headers
Content-Type: application/json
+ Body
{
"id": "6",
"first_name": "Lorem",
"last_name": "Ipsum",
"name": "Lorem Ipsum",
"username": "loremipsum",
"email": "[email protected]",
"city": "Brno",
"company": "Mergado",
"country": "cz",
"dic": "00000000",
"ico": "00000000",
"fakturoid_id": null,
"invoice_months": 1,
"last_access": "2016-03-21T16:32:32+00:00",
"locale": "cs_CZ",
"postcode": "61200",
"registered_at": "2015-11-03T16:08:17+00:00",
"street": "Palackého 123/456",
"timezone": "Europe/Prague",
"timezone_offset": null,
"send_summary": false
}
## App [/me/app/]
Information about currently authenticated Mergado platform app.
### List enabled instances [GET /me/app/enabled/{?fields}]
**Access with OFFLINE token only.**
Returns list of entities _(user, shop, project, based on your app type)_ where your Mergado platform app was enabled at least once. The list is sorted from the newest entries to the oldest ones.
+ Request
+ Headers
Content-Type: application/json
+ Response 200
+ Headers
Content-Type: application/json
+ Body
{
"data": [
{
"entity_id": 100,
"is_enabled": true,
"free_until": "2021-11-05",
"paid_until": "2021-12-07"
},
{
"entity_id": 101,
"is_enabled": true,
"free_until": "2021-06-05",
"paid_until": "2021-08-06"
},
{
"entity_id": 200,
"is_enabled": false,
"free_until": "2021-02-05",
"paid_until": "2021-04-03"
}
],
"offset": 0,
"limit": 10,
"total_results": 3
}
#### Get app history for entity [GET /me/app/enabled/{entity_id}]
**Access with OFFLINE token only.**
Returns history of enabled/disabled state of your app for a specific entity ID.
+ Parameters
+ entity_id (int) - Entity ID *(user, shop, project, based on your app type)*.
+ Request
+ Headers
Content-Type: application/json
+ Response 200
+ Headers
Content-Type: application/json
+ Body
{
"data": [
{
"enabled_at": "2020-11-05T09:08:19+00:00",
"enabled_by_user_id": 1003,
"disabled_at": null,
"disabled_by_user_id": null
},
{
"enabled_at": "2020-11-05T09:08:19+00:00",
"enabled_by_user_id": 1001,
"disabled_at": "2021-02-16T12:43:26+00:00",
"disabled_by_user_id": 1003
}
],
"offset": 0,
"limit": 10,
"total_results": 1
}
# Group Core
## Apps [/apps/{?limit,offset,fields,filter}]
Applications in Mergado.
+ Attributes
+ title (string) - Application's title.
+ type (enum[string]) - Scope of application. Application type can be user, eshop or project.
+ Members
+ user
+ eshop
+ project
+ creation_date (string) - Datetime when application was created.
+ trial_period (number) - How many days is application for free.
+ forum_url (string) - Application has it's own forum page.
+ latest_release_date (string) - Datetime of application latest release.
### Get App by Name [GET /apps/{id}/{?fields}]
Returns application for given application name.
+ Parameters
+ id (string) - Application name.
+ Request
+ Headers
Content-Type: application/json
+ Response 200
+ Headers
Content-Type: application/json
+ Body
{
"creation_date": "2016-11-02T09:12:09+00:00",
"forum_url": "logbook",
"latest_release_date": "2016-11-02T09:12:10+00:00",
"title": "Log Book Application",
"trial_period": 10,
"type": "project"
}
### List Apps [GET]
Lists all applications in Mergado.
+ Request
+ Headers
Content-Type: application/json
+ Response 200
+ Headers
Content-Type: application/json
+ Body
{
"data": [
{
"creation_date": "2016-11-02T09:12:09+00:00",
"forum_url": "bidding-fox",
"latest_release_date": "2016-11-02T09:12:10+00:00",
"title": "Bidding Fox",
"trial_period": 10,
"type": "project"
}
],
"limit": 10,
"total_results": 1,
"offset": 0
}
## Billing [/users/{id}/billing/]
Billing is need for automatically billing via Fakturoid.
+ Attributes
+ user_id (string) - User identification number.
+ currency (string) - Currency of all services and applications.
+ total_current_price (number) - Price which will appear in invoice.
+ total_retail_price (number) - Standart price of services or applications.
+ services (object) - Informations about paymants of shops.
+ currency (string) - Currency of all services.
+ total_current_price (number) - Price which will appear in invoice of all shops.
+ total_retail_price (number) - Standart price of all services.
+ shops (array) - All shops for billing.
+ (object)
+ shop_id (string) - Shop identification number.
+ current_price (number) - Price of shop on invoice.
+ retail_price (number) - Standard price of shop.
+ in_trial_until (number) - Until how long is eshop in trial.
+ is_prepaid_until (number) - Until how long is eshop prepaid.
+ apps (object) - Informations about payments of applications.
+ currency (string) - Currency of all applications.
+ total_current_price (number) - Price will appear in invoice of all applications.
+ total_retail_price (number) - Standard price of all applications.
+ apps (array) - All applications for billing.
+ (object)
+ app_name (string) - Application name.
+ instance_id (number) - Instance of application.
+ current_price (number) - Price of application on invoice.
+ retail_price (number) - Standard price of application.
+ in_trial_until (string) - Until how long is application in trial.
+ is_prepaid_until (string) - Until how long is application prepaid.
+ entity_type (enum[string]) - What is type of application.
+ Members
+ user
+ shop
+ project
+ entity_id (number) - ID of the entity which application is bound to. Entity can be user or eshop or project.
+ is_old (boolean) - If application is new od old.
### Get User Billing [GET /users/{id}/billing/]
Returns whole billing details for given user.
**OAuth2 Scope:** user.billing.read
+ Parameters
+ id (string) - User ID.
+ Response 200
+ Headers
Content-Type: application/json
+ Body
{
"user_id": "1",
"apps": {
"currency": "CZK",
"total_current_price": 999.4,
"total_retail_price": 888.5,
"apps": [
{
"app_name": "application_name",
"instance_id": 1,
"current_price": 777.1,
"retail_price": 666.2,
"in_trial_until": "2017-00-15",
"is_prepaid_until": "2017-04-20",
"app_type": "user",
"subject_id": 1,
"is_old": true
}
]
},
"services": {
"currency": "CZK",
"total_current_price": 999.4,
"total_retail_price": 888.5,
"shops": [
{
"current_price": 678.9,
"in_trial_until": "1970-01-01",
"is_prepaid_until": "2017-04-20",
"retail_price": 56.7,
"shop_id": "3"
}
]
},
"currency": "CZK",
"total_current_price": 1234.5,
"total_retail_price": 1234.5
}
## Users [/users/{?limit,offset,fields,filter}]
Users with an account in Mergado.
+ Attributes
+ id (string) - User's ID.
+ first_name (string) - User's first name.
+ last_name (string) - User's last name.
+ name (string) - User's full name.
+ username (string) - User's login.
+ email (string) - User's email address.
+ phone (string, optional) - User's phone number.
+ city (string, optional) - User's city.
+ company (string, optional) - User's company.