forked from TOMP-WG/TOMP-API
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTOMP-API-8-CUSTOMER.yaml
More file actions
140 lines (134 loc) · 5.69 KB
/
TOMP-API-8-CUSTOMER.yaml
File metadata and controls
140 lines (134 loc) · 5.69 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
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:
- customer management
tags:
- name: customer management
description: the <u>CUSTOMER MANAGEMENT MODULE</u> contains the functionality to explicitly manage the customer account on the TO side .
paths:
/collections/customers/items:
parameters:
- $ref: "TOMP-API-1-CORE.yaml#/components/parameters/acceptLanguage"
post:
summary: "Create a TO CUSTOMER ACCOUNT for the customer"
operationId: createCustomer
description: creates a CUSTOMER ACCOUNT that can be later used for purchase of a trip
tags:
- customer management
requestBody:
content:
application/json:
schema:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/customer"
responses:
"201":
description: a new customer is created.
$ref: "#/components/responses/customerResponse"
"200":
description: this IS NOT THE DEFAULT response. Only to return if the customer already existed on the TO side,
based on email address, phone number or other supplied details.
$ref: "#/components/responses/customerResponse"
default:
$ref: "TOMP-API-1-CORE.yaml#/components/responses/errorResponse"
/collections/customers/items/{customerId}:
parameters:
- name: customerId
in: path
required: true
schema:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/customerReference"
get:
summary: "Get the customer account from the TO system"
tags:
- customer management
operationId: getCustomer
responses:
"200":
$ref: "#/components/responses/customerResponse"
default:
$ref: "TOMP-API-1-CORE.yaml#/components/responses/errorResponse"
patch:
summary: "Update the CUSTOMER ACCOUNT on the TO system"
description: updates the defined fields of the CUSTOMER ACCOUNT.<br>
tags:
- customer management
operationId: updateCustomer
requestBody:
content:
application/merge-patch+json:
schema:
description: Patch object for Customer resource as defined by https://datatracker.ietf.org/doc/html/rfc7396
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/customer"
responses:
"200":
$ref: "#/components/responses/customerResponse"
default:
$ref: "TOMP-API-1-CORE.yaml#/components/responses/errorResponse"
delete:
summary: "Delete the CUSTOMER ACCOUNT from the TO system."
description: The timeline of deletion of the customer account depends on the TO processes, it could be instant, weeks or months.
tags:
- customer management
operationId: deleteCustomer
responses:
"200":
description: CUSTOMER ACCOUNT deleted successfully
default:
$ref: "TOMP-API-1-CORE.yaml#/components/responses/errorResponse"
components:
responses:
customerResponse:
description: Customer Account
x-semantics:
- transmodel: none
headers:
Content-Language:
$ref: "TOMP-API-1-CORE.yaml#/components/headers/contentLanguage"
Version:
$ref: "TOMP-API-1-CORE.yaml#/components/headers/version"
content:
application/json:
schema:
$ref: "#/components/schemas/customerAccount"
schemas:
customerAccount:
x-semantics:
- transmodel: CUSTOMER ACCOUNT
description: A registration of the TRANSPORT CUSTOMER with an ACCOUNT PROVIDER to obtain travel services.
type: object
properties:
id:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/customerReference"
customer:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/customer"
creationDate:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/dateTime"
description: The date in which the CUSTOMER ACCOUNT has been created
modificationDate:
$ref: "TOMP-API-1-CORE.yaml#/components/schemas/dateTime"
description: Last modification date of CUSTOMER ACCOUNT.
status:
$ref: "#/components/schemas/customerAccountStatus"
description: The status of the CUSTOMER ACCOUNT
customerAccountStatus:
x-semantics:
- transmodel: CUSTOMER ACCOUNT . status
type: string
description: status of a CUSTOMER ACCOUNT<br>
_CREATED_ the customer account has been created but is not ready to create a purchase yet<br>
_TO_PENDING_VALIDATION_ the customer account is pending a verification of identity and properties by the TO. No purchases can be made in this step<br>
_OTP_REQUIRED_ the TO has sent an OTP to the customer's phone or email address and is expecting it to activate the account. No purchases can be made in this step<br>
_ACTIVE_ the customer account is active and can continue to purchase offers<br>
_BLOCKED_ the customer account has been blocked by the TO and can no longer use this TO<br>
enum: [ CREATED, TO_PENDING_VALIDATION, ACTIVE, BLOCKED ]