This repository has been archived by the owner on Jan 17, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathopenapi.yaml
141 lines (141 loc) · 3.5 KB
/
openapi.yaml
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
openapi: 3.0.1
info:
title: Orders service API
version: 0.1.0
tags:
- name: orders
- name: webhook
paths:
/orders:
get:
description: Returns all orders from the system.
tags:
- orders
responses:
'200':
description: Orders retrieved succesfully.
content:
application/json:
schema:
$ref: '#/components/schemas/OrderList'
'500':
description: Internal server error.
post:
description: Creates a new order in the system. Duplicates are not allowed.
tags:
- orders
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Order'
responses:
'201':
description: Order created succesfully.
'400':
description: Bad request.
'409':
description: Order ID conflict.
'500':
description: Internal server error.
delete:
description: Delete an orders collection.
tags:
- orders
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Order'
responses:
'200':
description: Collection cleared succesfully.
'500':
description: Internal server error.
/orders/{id}:
get:
description: Returns an order with specified ID.
tags:
- orders
parameters:
- name: id
in: path
required: true
description: ID of the order
schema:
type: string
responses:
'200':
description: Orders retrieved succesfully.
content:
application/json:
schema:
$ref: '#/components/schemas/OrderList'
'404':
description: Order not found.
'500':
description: Internal server error.
delete:
description: Deletes an order with specified ID.
tags:
- orders
parameters:
- name: id
in: path
required: true
description: ID of the order
schema:
type: string
responses:
'200':
description: Order deleted succesfully.
'404':
description: Order not found.
'500':
description: Internal server error.
/:
post:
description: Handle order event
tags:
- webhook
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OrderEvent'
responses:
'200':
description: Order event handled successfully.
'400':
description: Bad request.
'409':
description: Order ID conflict.
'500':
description: Internal Server error.
components:
schemas:
Order:
type: object
properties:
orderCode:
type: string
example: "123456789"
description: ID of the order
consignmentCode:
type: string
example: "123456789"
description: ID of the order consignment code
consignmentStatus:
type: string
example: "PICKUP_COMPLETE"
description: Order consignment status
required:
- orderCode
- consignmentCode
- consignmentStatus
OrderList:
type: array
items:
$ref: '#/components/schemas/Order'
OrderEvent:
$ref: '#/components/schemas/Order'