-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshared.json
717 lines (717 loc) · 23.2 KB
/
shared.json
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
{
"openapi" : "3.0.1",
"info" : {
"title" : "Shared API",
"description" : "Alpha version of the shared TSP connector specs to connect to SkedGo's platform.\nReturns information in GeoJSON",
"license" : {
"name" : "Apache 2.0 License",
"url" : "https://www.apache.org/licenses/LICENSE-2.0"
},
"version" : "1.0.0",
"x-logo" : {
"url" : "https://developer.tripgo.com/img/tripgo-api-logo-color.svg"
}
},
"paths" : {
"/coverage" : {
"get" : {
"tags" : [ "Shared" ],
"summary" : "All supported areas",
"description" : "All the coverage areas that this operator serves, including optionally (but highly recommended!) information on products and prices. Information about each area is returned as a GeoJSON Feature, within a single GeoJSON FeatureCollection.",
"operationId" : "coverage",
"parameters" : [ {
"name" : "x-access_key",
"in" : "header",
"schema" : {
"type" : "string"
}
} ],
"responses" : {
"200" : {
"description" : "Detailed information on the coverage of the provider.",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Coverage"
}
}
}
},
"403" : {
"description" : "This method requires an `x-access_key` and it is either missing or invalid, or the the credentials provided are not sufficient for access to the specified resource.",
"content" : {
"application/json" : {
"schema" : {
"type" : "error"
}
}
}
}
}
}
},
"/config" : {
"get" : {
"tags" : [ "Shared" ],
"summary" : "Endpoints available",
"description" : "All the endpoints implemented, with their corresponding URL",
"operationId" : "config",
"parameters" : [ {
"name" : "x-access_key",
"in" : "header",
"schema" : {
"type" : "string"
}
} ],
"responses" : {
"200" : {
"description" : "List of endpoints implemented.",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/EndpointsConfig"
}
}
}
},
"403" : {
"description" : "This method requires an `x-access_key` and it is either missing or invalid, or the the credentials provided are not sufficient for access to the specified resource.",
"content" : {
"application/json" : {
"schema" : {
"type" : "error"
}
}
}
}
}
}
},
"/provider" : {
"get" : {
"tags" : [ "Shared" ],
"summary" : "Information of the provider",
"description" : "Information about the provider, including company info and enabled endpoints",
"operationId" : "provider",
"parameters" : [ {
"name" : "x-access_key",
"in" : "header",
"schema" : {
"type" : "string"
}
} ],
"responses" : {
"200" : {
"description" : "Detailed information on provider",
"content" : {
"application/json" : {
"schema" : {
"$ref" : "#/components/schemas/Provider"
}
}
}
},
"403" : {
"description" : "This method requires an `x-access_key` and it is either missing or invalid, or the the credentials provided are not sufficient for access to the specified resource.",
"content" : {
"application/json" : {
"schema" : {
"type" : "error"
}
}
}
}
}
}
}
},
"components" : {
"schemas" : {
"BookingOption" : {
"type" : "object",
"properties" : {
"website" : {
"type" : "string"
},
"phone" : {
"type" : "string"
},
"deeplink" : {
"type" : "string"
},
"bookingRules" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/BookingRule"
}
}
},
"description" : "Options to book this particular product"
},
"CoverageArea" : {
"required" : [ "geometry", "id", "properties", "type" ],
"type" : "object",
"properties" : {
"geometry" : {
"$ref" : "#/components/schemas/MultiPolygon"
},
"id" : {
"type" : "string"
},
"properties" : {
"$ref" : "#/components/schemas/CoverageProperties"
},
"type" : {
"type" : "string",
"description" : "the feature type",
"enum" : [ "Feature" ]
}
}
},
"EndpointsConfig" : {
"required" : [ "endpoints" ],
"type" : "object",
"properties" : {
"endpoints" : {
"type" : "array",
"description" : "List of endpoints available",
"items" : {
"$ref" : "#/components/schemas/Endpoint"
}
}
}
},
"CoverageProperties" : {
"type" : "object",
"properties" : {
"products" : {
"type" : "array",
"description" : "List of products available",
"items" : {
"$ref" : "#/components/schemas/Product"
}
},
"pricingRules" : {
"type" : "array",
"description" : "List of pricing plans available",
"items" : {
"$ref" : "#/components/schemas/PricingRules"
}
},
"stops" : {
"$ref" : "#/components/schemas/DRTStops"
},
"virtualStopsRequireStopsNearby" : {
"type" : "boolean",
"description" : "Whether virtual stops require public stops nearby or not"
}
}
},
"ImageObject" : {
"required" : [ "contentUrl" ],
"type" : "object",
"properties" : {
"caption" : {
"type" : "string",
"description" : "The caption for this object"
},
"contentUrl" : {
"type" : "string",
"description" : "URL to download image, or image code for SkedGo icons"
},
"fileFormat" : {
"type" : "string",
"description" : "Media type of image, including remoteIcon and remoteDarkIcon for SkedGo"
},
"width" : {
"type" : "integer",
"description" : "Width in pixels",
"format" : "int32"
},
"height" : {
"type" : "integer",
"description" : "Height in pixels",
"format" : "int32"
}
},
"description" : "Image stored remotely"
},
"DRTStops" : {
"required" : [ "features", "type" ],
"type" : "object",
"properties" : {
"features" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/DRTStop"
}
},
"type" : {
"type" : "string",
"enum" : [ "FeatureCollection" ]
}
},
"description" : "List of DRT stops, if available"
},
"PricingRules" : {
"required" : [ "fare" ],
"type" : "object",
"properties" : {
"planId" : {
"type" : "string",
"description" : "a unique identifier for this plan in the system"
},
"url" : {
"type" : "string",
"description" : "a fully qualified URL where the customer can learn more about this particular scheme"
},
"name" : {
"type" : "string",
"description" : "name of this pricing scheme"
},
"fare" : {
"$ref" : "#/components/schemas/Fare"
},
"isTaxable" : {
"type" : "boolean"
},
"description" : {
"type" : "string",
"description" : "Text field describing the particular pricing plan in human readable terms."
}
},
"description" : "List of pricing plans available"
},
"RGBColor" : {
"required" : [ "blue", "green", "red" ],
"type" : "object",
"properties" : {
"red" : {
"maximum" : 255,
"minimum" : 0,
"type" : "integer",
"format" : "int32"
},
"blue" : {
"maximum" : 255,
"minimum" : 0,
"type" : "integer",
"format" : "int32"
},
"green" : {
"maximum" : 255,
"minimum" : 0,
"type" : "integer",
"format" : "int32"
}
}
},
"DRTStopProperties" : {
"type" : "object",
"properties" : {
"id" : {
"type" : "string",
"description" : "id of the stop"
},
"name" : {
"type" : "string",
"description" : "name of the stop"
},
"area_id" : {
"type" : "string",
"description" : "area id"
}
}
},
"Product" : {
"required" : [ "id", "planId", "title" ],
"type" : "object",
"properties" : {
"title" : {
"type" : "string",
"description" : "Human-friendly string to describe this product."
},
"id" : {
"type" : "string",
"description" : "unique id of the produce for this provider"
},
"bookingOption" : {
"$ref" : "#/components/schemas/BookingOption"
},
"planId" : {
"type" : "string",
"description" : "pricing rules or plan identifier (deprecated)"
},
"defaultPlanId" : {
"type" : "string",
"description" : "default pricing rules or plan identifier"
},
"planIds" : {
"type" : "array",
"description" : "list of pricing rules or plan identifiers available for this product",
"items" : {
"type" : "string",
"description" : "list of pricing rules or plan identifiers available for this product"
}
}
},
"description" : "List of products available"
},
"Coverage" : {
"required" : [ "features", "type" ],
"type" : "object",
"properties" : {
"features" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/CoverageArea"
}
},
"type" : {
"type" : "string",
"enum" : [ "FeatureCollection" ]
}
}
},
"Scale" : {
"type" : "object",
"properties" : {
"from" : {
"type" : "integer",
"format" : "int32"
},
"to" : {
"type" : "integer",
"format" : "int32"
},
"type" : {
"type" : "string",
"enum" : [ "KM", "MILE", "HOUR", "MINUTE", "WEEKDAY" ]
},
"proportional" : {
"type" : "boolean"
}
}
},
"Point" : {
"required" : [ "type" ],
"type" : "object",
"properties" : {
"type" : {
"type" : "string",
"description" : "the geometry type",
"enum" : [ "Point", "POINT" ]
},
"coordinates" : {
"type" : "array",
"description" : "A single (X, Y) or (longitude, latitude) coordinate pair.",
"items" : {
"type" : "number",
"description" : "A single (X, Y) or (longitude, latitude) coordinate pair.",
"format" : "double"
}
}
},
"description" : "GeoJSON Point geometry"
},
"FarePart" : {
"type" : "object",
"properties" : {
"name" : {
"type" : "string",
"description" : "name of this pricing part"
},
"amount" : {
"type" : "number",
"format" : "float"
},
"currencyCode" : {
"type" : "string"
},
"taxRate" : {
"type" : "integer",
"format" : "int32"
},
"type" : {
"type" : "string",
"enum" : [ "FIXED", "FLEX", "MAX", "MIN" ]
},
"unitType" : {
"type" : "string",
"enum" : [ "KM", "SECOND", "MINUTE", "HOUR", "MILE", "PERCENTAGE" ]
},
"units" : {
"type" : "number",
"description" : "the number of km, seconds etc in the `per` part. In the first example of the description this should be 2.0",
"format" : "float"
},
"scales" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/Scale"
}
}
},
"description" : "this describes a part of the fare (or discount).It contains a for instance the startup costs (fixed) or the flex part (e.g. 1.25 EUR per 2.0 MILES).The amount is tax included. In case of discounts, the values are negative.With 'MAX' you can specify e.g. a maximum of 15 euro per day. Percentage is mainly added for discounts.The `scale` properties create the ability to communicate scales(e.g. the first 4 kilometers you've to pay EUR 0.35 per kilometer, the kilometers 4 until 8 EUR 0.50 and above it EUR 0.80 per kilometer)."
},
"Fare" : {
"type" : "object",
"properties" : {
"estimated" : {
"type" : "boolean"
},
"description" : {
"type" : "string"
},
"bookingFee" : {
"type" : "number",
"description" : "Fee for booking in advance",
"format" : "float"
},
"waitingMaxSpeed" : {
"type" : "integer",
"description" : "Wait time charged while the vehicle is stopped or slowed to less than X KM per hour",
"format" : "int32"
},
"parts" : {
"type" : "array",
"description" : "this describes a part of the fare (or discount).It contains a for instance the startup costs (fixed) or the flex part (e.g. 1.25 EUR per 2.0 MILES).The amount is tax included. In case of discounts, the values are negative.With 'MAX' you can specify e.g. a maximum of 15 euro per day. Percentage is mainly added for discounts.The `scale` properties create the ability to communicate scales(e.g. the first 4 kilometers you've to pay EUR 0.35 per kilometer, the kilometers 4 until 8 EUR 0.50 and above it EUR 0.80 per kilometer).",
"items" : {
"$ref" : "#/components/schemas/FarePart"
}
}
},
"description" : "the total fare is the sum of all parts, except for the 'MAX' farePart. This one describes the maximum price for the complete leg.\nestimated: is this fare an estimation?"
},
"AppInfo" : {
"type" : "object",
"properties" : {
"name" : {
"type" : "string"
},
"appURLiOS" : {
"type" : "string"
},
"appURLAndroid" : {
"type" : "string"
},
"deepLinkPattern" : {
"type" : "string",
"description" : "Will be used when booking is available, if we need need to add any of the enabled params.Deep link pattern, including the following placeholders between <>: fromLat, fromLng, fromAddress, toLat, toLng, toAddress, productId"
},
"deepLink" : {
"type" : "string",
"description" : "Will be user to open the app, any time, and also for bookings if deepLinkPattern is not present"
}
}
},
"Provider" : {
"required" : [ "companyInfo", "modesEnabled" ],
"type" : "object",
"properties" : {
"companyInfo" : {
"$ref" : "#/components/schemas/CompanyInfo"
},
"modesEnabled" : {
"type" : "array",
"description" : "modes enabled for this provider",
"items" : {
"type" : "string",
"description" : "modes enabled for this provider",
"enum" : [ "pt_pub, ps_tax, ps_tnc, ps_shu, cy_bic-s, me_car-s, me_car-r, me_car-p" ]
},
"enum" : [ "pt_pub, ps_tax, ps_tnc, ps_shu, cy_bic-s, me_car-s, me_car-r, me_car-p" ]
},
"preferGenericMode" : {
"type" : "boolean",
"description" : "Whether is preferred to use the generic mode over the specific one",
"default" : false
},
"defaultVehicleType" : {
"$ref" : "#/components/schemas/ShareVehicleType"
},
"combined" : {
"type" : "boolean",
"description" : "Whether this provider is a combination of two (for Feonix)",
"default" : false
},
"userPhoneRequired" : {
"type" : "boolean",
"description" : "Whether the phone number is required to create a user",
"default" : false
},
"quoteDefaultDurationInSeconds" : {
"type" : "integer",
"description" : "Whether the quote has a default duration before it expires, in seconds",
"format" : "int32"
},
"billingEnabled" : {
"type" : "boolean",
"description" : "Whether the provider has enabled in app payment",
"default" : false
},
"stripePublishableApiKey" : {
"type" : "string",
"description" : "if billing is enabled, and the provider has it's own stripe account, this is the key that FEs need to contact stripe for that account",
"default" : "null"
}
}
},
"ShareVehicleType" : {
"required" : [ "formFactor", "propulsionType" ],
"type" : "object",
"properties" : {
"formFactor" : {
"type" : "string",
"description" : "The vehicle's general form factor following GBFS 2.1 standard",
"enum" : [ "BICYCLE,CAR,MOPED,SCOOTER,OTHER" ]
},
"propulsionType" : {
"type" : "string",
"description" : "The primary propulsion type of the vehicle following GBFS 2.1 standard",
"enum" : [ "HUMAN,ELECTRIC_ASSIST,ELECTRIC,COMBUSTION" ]
}
},
"description" : "Default vehicle type, as fallback for the cases where there is no specific information available"
},
"DRTStop" : {
"required" : [ "geometry", "id", "properties", "type" ],
"type" : "object",
"properties" : {
"geometry" : {
"$ref" : "#/components/schemas/Point"
},
"id" : {
"type" : "string"
},
"properties" : {
"$ref" : "#/components/schemas/DRTStopProperties"
},
"type" : {
"type" : "string",
"description" : "the feature type",
"enum" : [ "Feature" ]
}
}
},
"Endpoint" : {
"required" : [ "name", "url" ],
"type" : "object",
"properties" : {
"name" : {
"type" : "string",
"description" : "Key identifying the type of endpoint this is",
"enum" : [ "provider", "coverage", "estimatePrice", "estimateTime", "stationInformation", "stationStatus", "freeBikeStatus", "info", "bikeLanes", "createBooking", "updateBookingStatus", "getBooking" ]
},
"url" : {
"type" : "string",
"description" : "URL for the endpoint, it can be absolute or relative"
}
},
"description" : "List of endpoints available"
},
"MultiPolygon" : {
"required" : [ "type" ],
"type" : "object",
"properties" : {
"type" : {
"type" : "string",
"description" : "the geometry type",
"enum" : [ "MultiPolygon", "MULTIPOLYGON" ]
},
"coordinates" : {
"type" : "array",
"items" : {
"type" : "array",
"items" : {
"type" : "array",
"items" : {
"type" : "array",
"items" : {
"type" : "number",
"format" : "double"
}
}
}
}
}
},
"description" : "GeoJSON MultiPolygon geometry"
},
"BookingRule" : {
"type" : "object",
"properties" : {
"weekdays" : {
"type" : "string",
"description" : "weekdays following cron-like format. valid values are 'MON-TUE', 'WED', 'MON-SUN"
},
"prebooking" : {
"$ref" : "#/components/schemas/PreBookingRule"
},
"workingHours" : {
"type" : "array",
"description" : "working hours, currently only supports hour scale type",
"items" : {
"$ref" : "#/components/schemas/Scale"
}
}
}
},
"CompanyInfo" : {
"required" : [ "name" ],
"type" : "object",
"properties" : {
"name" : {
"type" : "string"
},
"address" : {
"type" : "string"
},
"phone" : {
"type" : "string"
},
"website" : {
"type" : "string"
},
"logos" : {
"type" : "array",
"items" : {
"$ref" : "#/components/schemas/ImageObject"
}
},
"color" : {
"$ref" : "#/components/schemas/RGBColor"
},
"appInfo" : {
"$ref" : "#/components/schemas/AppInfo"
}
}
},
"PreBookingRule" : {
"type" : "object",
"properties" : {
"minHoursBefore" : {
"type" : "integer",
"description" : "minimum hours before booking time",
"format" : "int32"
},
"minWeekdayBefore" : {
"type" : "string",
"description" : "minimum week day before booking time, goes along minTimeDayBefore"
},
"minTimeDayBefore" : {
"type" : "integer",
"description" : "minimum hour of the day before booking time, goes along with minWeekdayBefore",
"format" : "int32"
},
"maxDaysBefore" : {
"type" : "integer",
"description" : "maximum days of pre booking",
"format" : "int32"
}
},
"description" : "pre booking rule"
}
}
}
}