forked from TOMP-WG/TOMP-API
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTOMP-API-3-PRE-SALES.yaml
More file actions
473 lines (452 loc) · 18.1 KB
/
TOMP-API-3-PRE-SALES.yaml
File metadata and controls
473 lines (452 loc) · 18.1 KB
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
openapi: 3.1.0
info:
title: Transport Operator MaaS Provider API
description: "<h2>Context</h2>
<p>This API allows technical communication between Transport Operators (TO) and MaaS providers (MP, and other resellers), to fulfill a complete MaaS user journey<br>
For more information: <a href='https://github.com/TOMP-WG/TOMP-API/wiki/OpenAPI-entry-page'>TOMP-API wiki</a>, and <a href='https://github.com/TOMP-WG/TOMP-API/wiki/OpenAPI-code-convention'>Coding conventions</a>"
version: "2.0.0"
contact:
name: TOMP working group
url: https://github.com/TOMP-WG/TOMP-API
license:
name: Apache 2.0
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
x-modules:
- pre-sales
tags:
- name: pre sales
description: Module that can be used 'pre-sales'; in the pre-purchase state. Calling one of these endpoints,
will put the package in a pre-purchased state (might reserve resources). The package must be released
(when the intention of purchasing it is removed) or it expires.
The result of each of these endpoints (except for the release) must contain an expiry date in the header.
paths:
/processes/select-offers/execution:
post:
operationId: selectOffersRequest
summary: "Select offer(s) into a package"
parameters:
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/acceptLanguage"
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/authorization"
tags:
- pre sales
x-semantics:
- transmodel: TRAVEL PACKAGE CREATION QUERY
requestBody:
$ref: "#/components/requestBodies/selectOffersRequest"
responses:
"200":
$ref: "TOMP-API-1-CORE.yaml#/components/responses/packageResponse"
default:
$ref: "TOMP-API-1-CORE.yaml#/components/responses/errorResponse"
/collections/assets/items:
get:
operationId: requestAssets
summary: "Request available assets for a leg"
x-semantics:
- transmodel: TRAVEL PACKAGE SPOT AVAILABILITY QUERY
parameters:
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/acceptLanguage"
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/authorization"
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/limit"
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/offset"
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/bbox"
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/packageId"
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/legId"
tags:
- pre sales
responses:
"200":
$ref: "#/components/responses/assetsResponse"
default:
$ref: "TOMP-API-1-CORE.yaml#/components/responses/errorResponse"
/collections/ancillaries/items:
get:
operationId: requestAncillaries
summary: "Request available ancillaries for a leg"
parameters:
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/acceptLanguage"
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/authorization"
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/limit"
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/offset"
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/bbox"
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/packageId"
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/legId"
tags:
- pre sales
x-semantics:
- transmodel:TRAVEL PACKAGE ANCILLARY AVAILABILITY QUERY (?)
responses:
"200":
$ref: "#/components/responses/ancillariesResponse"
default:
$ref: "TOMP-API-1-CORE.yaml#/components/responses/errorResponse"
/processes/update-traveller/execution:
post:
operationId: updateTravellerRequest
parameters:
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/acceptLanguage"
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/authorization"
tags:
- pre sales
summary: update details of a traveller
x-semantics:
- transmodel: TRAVEL PACKAGE ALTERATION QUERY
requestBody:
$ref: "#/components/requestBodies/updateTravellerRequest"
responses:
"200":
$ref: "TOMP-API-1-CORE.yaml#/components/responses/packageResponse"
default:
$ref: "TOMP-API-1-CORE.yaml#/components/responses/errorResponse"
/processes/update-travel-specification/execution:
post:
operationId: updateTravelSpecificationRequest
parameters:
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/acceptLanguage"
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/authorization"
tags:
- pre sales
summary: update start/end location or start/end time
x-semantics:
- transmodel: TRAVEL PACKAGE ALTERATION QUERY
requestBody:
$ref: "#/components/requestBodies/updateTravelSpecificationRequest"
responses:
"200":
$ref: "TOMP-API-1-CORE.yaml#/components/responses/packageResponse"
default:
$ref: "TOMP-API-1-CORE.yaml#/components/responses/errorResponse"
/processes/assign-asset/execution:
post:
operationId: assignAssetRequest
parameters:
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/acceptLanguage"
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/authorization"
tags:
- pre sales
summary: Assign an asset to a package (and a leg). It could also replace another asset or remove one
x-semantics:
- transmodel: TRAVEL PACKAGE SPOT RESERVATION QUERY, TRAVEL PACKAGE SPOT CANCELLATION QUERY, TRAVEL PACKAGE ALTERATION QUERY
requestBody:
$ref: "#/components/requestBodies/assignAssetRequest"
responses:
"200":
$ref: "TOMP-API-1-CORE.yaml#/components/responses/packageResponse"
default:
$ref: "TOMP-API-1-CORE.yaml#/components/responses/errorResponse"
/processes/assign-ancillary/execution:
post:
operationId: assignAncillaryRequest
parameters:
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/acceptLanguage"
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/authorization"
tags:
- pre sales
summary: Assign an ancillary to a package (and a leg). It could also replace another ancillary or remove one
x-semantics:
- transmodel: TRAVEL PACKAGE ALTERATION QUERY
requestBody:
$ref: "#/components/requestBodies/assignAncillaryRequest"
responses:
"200":
$ref: "TOMP-API-1-CORE.yaml#/components/responses/packageResponse"
default:
$ref: "TOMP-API-1-CORE.yaml#/components/responses/errorResponse"
/processes/release-package/execution:
post:
operationId: releasePackageRequest
summary: "Release the complete package"
parameters:
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/acceptLanguage"
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/authorization"
tags:
- pre sales
requestBody:
$ref: "TOMP-API-1-CORE.yaml#/components/requestBodies/packageRequest"
responses:
"200":
$ref: "TOMP-API-1-CORE.yaml#/components/responses/packageResponse"
default:
$ref: "TOMP-API-1-CORE.yaml#/components/responses/errorResponse"
/processes/remove-offer/execution:
post:
operationId: removeOfferRequest
summary: "Remove an offer from the package"
parameters:
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/acceptLanguage"
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/authorization"
tags:
- pre sales
x-semantics:
- transmodel: TRAVEL PACKAGE ALTERATION QUERY
requestBody:
$ref: "#/components/requestBodies/removeOfferRequest"
responses:
"200":
$ref: "TOMP-API-1-CORE.yaml#/components/responses/packageResponse"
default:
$ref: "TOMP-API-1-CORE.yaml#/components/responses/errorResponse"
# remove traveller: start again with search-offers
components:
requestBodies:
selectOffersRequest:
x-semantics:
- transmodel: TRAVEL PACKAGE CREATION REQUEST
content:
application/json:
schema:
type: object
required:
- inputs
properties:
inputs:
type: object
properties:
offers:
type: array
items:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/offerReference"
updateTravellerRequest:
x-semantics:
- transmodel: TRAVEL PACKAGE ALTERATION REQUEST
content:
application/json:
schema:
type: object
required:
- inputs
properties:
inputs:
type: object
required:
- traveller
properties:
package:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/packageReference"
traveller:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/travellerReference"
age:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/shortInt"
description: Age of the traveller, may be approximate
fullName:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/normalString"
description: the name of the traveller, can be used to validate against ID cards
characteristics:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/travellerCharacteristics"
description: the COMPLETE set of entitlements, replaces the previous set of
entitlements of this traveller
updateTravelSpecificationRequest:
x-semantics:
- transmodel: TRAVEL PACKAGE ALTERATION REQUEST
content:
application/json:
schema:
type: object
required:
- inputs
properties:
inputs:
type: object
required:
- package
properties:
package:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/packageReference"
leg:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/legReference"
startTime:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/dateTime"
description: The intended departure time.
If left out and no endTime is set, the current time should be assumed.
If only the arrival time is specified, this is an implicit request for a guaranteed arrival at that time.
endTime:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/dateTime"
description: The intended arrival time, at the `to place`. When the **startTime** is not set, and **endTime** is set, it is an implicit request for an arrival time guarantee.
assignAssetRequest:
x-semantics:
- transmodel: TRAVEL PACKAGE SPOT RESERVATION REQUEST, TRAVEL PACKAGE SPOT CANCELLATION REQUEST, TRAVEL PACKAGE ALTERATION REQUEST
content:
application/json:
schema:
type: object
required:
- inputs
properties:
inputs:
type: object
required:
- package
- leg
- asset
description: this can be used to assign an asset (/seat) to a leg, by
using the field `asset`. If you want to replace an asset, fill the field
`replacesAsset` with the asset to replace and `asset` with the new one.
If you want to remove an assigned asset from a leg, fill `asset` with 'null' and
fill `replacesAsset` with the asset to remove.
properties:
package:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/packageReference"
leg:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/legReference"
asset:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/assetReference"
replacesAsset:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/assetReference"
assignAncillaryRequest:
x-semantics:
- transmodel: TRAVEL PACKAGE ALTERATION REQUEST
content:
application/json:
schema:
type: object
required:
- inputs
properties:
inputs:
type: object
required:
- package
- leg
description: this can be used to assign an ancillary to a leg, by
using the field `ancillary`. If you want to replace an ancillary, fill the field
`replacesAncillary` with the ancillary to replace and `ancillary` with the new one.
If you want to remove an assigned ancillary from a leg, fill `ancillary` with 'null' and
fill `replacesAncillary` with the ancillary to remove.
properties:
package:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/packageReference"
leg:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/legReference"
ancillary:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/ancillaryReference"
replacesAncillary:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/ancillaryReference"
removeOfferRequest:
x-semantics:
- transmodel: TRAVEL PACKAGE ALTERATION REQUEST, TRAVEL PACKAGE SPOT CANCELLATION REQUEST
content:
application/json:
schema:
type: object
required:
- inputs
properties:
inputs:
type: object
properties:
package:
description: reference to the package to remove the offer of
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/packageReference"
offer:
description: reference to the offer to remove from the specified package
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/offerReference"
responses:
assetsResponse:
x-semantics:
- transmodel: TRAVEL PACKAGE SPOT AVAILABILITY DELIVERY
description: a list of assets
headers:
Version:
$ref: "TOMP-API-1-CORE.yaml#/components/headers/version"
Content-Language:
$ref: "TOMP-API-1-CORE.yaml#/components/headers/contentLanguage"
Expires:
schema:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/httpDate"
required: true
content:
application/geo+json:
schema:
$ref: "#/components/schemas/assetCollection"
ancillariesResponse:
description: a list of ancillaries
x-semantics:
- transmodel: none
headers:
Version:
$ref: "TOMP-API-1-CORE.yaml#/components/headers/version"
Content-Language:
$ref: "TOMP-API-1-CORE.yaml#/components/headers/contentLanguage"
Expires:
schema:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/httpDate"
required: true
content:
application/geo+json:
schema:
$ref: "#/components/schemas/ancillaryCollection"
schemas:
assetCollection:
description: a list of available assets.
x-semantics:
- transmodel: VEHICLEs, SPOTs, PARKING BAYs, RECHARGING STATIONs
type: object
properties:
type:
type: string
pattern: "^(FeatureCollection)$"
features:
type: array
items:
allOf:
- $ref: "TOMP-API-1-CORE.yaml#/components/schemas/geojsonFeature"
- type: object
properties:
properties:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/asset"
properties:
type: object
additionalProperties: true
properties:
type:
type: string
pattern: "^(assetCollection)$"
numberMatched:
type: number
numberReturned:
type: number
links:
type: array
description:
actions that can be performed on this package, but also alternative (rel=alternative+1, alternative+2) offers or references to other resources
In case it is an alternative, specify clearly in the description what the financial consequences are.
items:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/link"
ancillaryCollection:
description: a list of available ancillaries.
x-semantics:
- transmodel: ANCILLARY PRODUCTs
type: object
properties:
type:
type: string
pattern: "^(FeatureCollection)$"
features:
type: array
items:
allOf:
- $ref: "TOMP-API-1-CORE.yaml#/components/schemas/geojsonFeature"
- type: object
properties:
properties:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/ancillary"
properties:
type: object
required:
- type
additionalProperties: true
properties:
type:
type: string
pattern: "^(ancillaryCollection)$"
numberMatched:
type: number
numberReturned:
type: number
links:
type: array
description:
actions that can be performed on this package, but also alternative (rel=alternative+1, alternative+2) offers or references to other resources
In case it is an alternative, specify clearly in the description what the financial consequences are.
items:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/link"