-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathKSeF-batch.yaml
289 lines (289 loc) · 8.12 KB
/
KSeF-batch.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
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
openapi: 3.0.1
info:
contact:
email: info.ksef@mf.gov.pl
name: Info
url: https://ksef.mf.gov.pl
description: Krajowy System e-Faktur
title: KSeF
version: 2.0.0
externalDocs:
description: Dokumentacja
url: https://www.gov.pl/web/kas/krajowy-system-e-faktur
servers:
- description: Środowisko produkcyjne
url: https://ksef.mf.gov.pl/api
variables: {}
- description: Środowisko demonstracyjne
url: https://ksef-demo.mf.gov.pl/api
variables: {}
- description: Środowisko testowe
url: https://ksef-test.mf.gov.pl/api
variables: {}
tags:
- description: Krajowy System e-Faktur
externalDocs:
description: Krajowy System e-Faktur
url: https://ksef.mf.gov.pl
name: KSeF
paths:
/batch/Finish:
post:
description: Finalizacja wysyłki wsadowej paczki faktur
operationId: batch.finish
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/FinishRequest'
required: true
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/FinishResponse'
description: Finalizacja wysyłki wsadowej paczki faktur poprawna
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
description: Nieprawidłowe wywołanie
summary: Wysyłka wsadowa paczki faktur do KSeF - finalizacja
tags:
- Wysyłka wsadowa
/batch/Init:
post:
description: Inicjalizacja wysyłki wsadowej paczki faktur. Podpisany dokument
http://ksef.mf.gov.pl/schema/gtw/svc/batch/init/request/2021/10/01/0001/InitRequest
operationId: batch.init
requestBody:
content:
application/octet-stream:
schema:
type: string
format: binary
required: true
responses:
"201":
content:
application/json:
schema:
$ref: '#/components/schemas/InitResponse'
description: Inicjalizacja wysyłki wsadowej paczki faktur poprawna
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
description: Nieprawidłowe wywołanie
summary: Wysyłka wsadowa paczki faktur do KSeF - inicjalizacja
tags:
- Wysyłka wsadowa
/batch/Upload/{ReferenceNumber}/{PartName}:
put:
description: Załadowanie zaszyfrowanych części paczki
operationId: batch.upload
parameters:
- in: path
name: ReferenceNumber
required: true
schema:
type: string
- in: path
name: PartName
required: true
schema:
type: string
requestBody:
content:
application/octet-stream:
schema:
type: string
format: binary
description: Zaszyfrowana część paczki kluczem symetrycznym zadeklarowanym
w dokumencie Init
required: true
responses:
"201":
content:
application/json:
schema:
$ref: '#/components/schemas/UploadResponse'
description: Załadowanie części paczki poprawne
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/ExceptionResponse'
description: Nieprawidłowe wywołanie
summary: Wysyłka wsadowa paczki faktur do KSeF - załadowanie części paczki
tags:
- Wysyłka wsadowa
components:
schemas:
ExceptionDetailType:
type: object
properties:
exceptionCode:
type: integer
format: int32
minimum: 0
exceptionDescription:
type: string
maxLength: 256
minLength: 1
required:
- exceptionCode
- exceptionDescription
ExceptionResponse:
type: object
properties:
exception:
$ref: '#/components/schemas/ExceptionType'
required:
- exception
ExceptionType:
type: object
properties:
exceptionDetailList:
type: array
items:
$ref: '#/components/schemas/ExceptionDetailType'
maxItems: 100
minItems: 1
referenceNumber:
type: string
pattern: "(20[2-9][0-9]|2[1-9][0-9]{2}|[3-9][0-9]{3})(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])-([0-9A-Z]{2})-([0-9A-F]{10})-([0-9A-F]{10})-([0-9A-F]{2})"
serviceCode:
type: string
maxLength: 64
minLength: 1
serviceCtx:
type: string
maxLength: 64
minLength: 1
serviceName:
type: string
maxLength: 64
minLength: 1
timestamp:
type: string
format: date-time
required:
- exceptionDetailList
- serviceCode
- serviceCtx
- serviceName
- timestamp
FinishRequest:
type: object
properties:
referenceNumber:
type: string
pattern: "(20[2-9][0-9]|2[1-9][0-9]{2}|[3-9][0-9]{3})(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])-([0-9A-Z]{2})-([0-9A-F]{10})-([0-9A-F]{10})-([0-9A-F]{2})"
required:
- referenceNumber
FinishResponse:
type: object
properties:
referenceNumber:
type: string
pattern: "(20[2-9][0-9]|2[1-9][0-9]{2}|[3-9][0-9]{3})(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])-([0-9A-Z]{2})-([0-9A-F]{10})-([0-9A-F]{10})-([0-9A-F]{2})"
timestamp:
type: string
format: date-time
required:
- referenceNumber
- timestamp
HeaderEntryType:
type: object
properties:
key:
type: string
maxLength: 64
minLength: 1
value:
type: string
maxLength: 128
minLength: 1
required:
- key
- value
InitResponse:
type: object
properties:
packageSignature:
$ref: '#/components/schemas/PackageSignatureInitResponseType'
referenceNumber:
type: string
pattern: "(20[2-9][0-9]|2[1-9][0-9]{2}|[3-9][0-9]{3})(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])-([0-9A-Z]{2})-([0-9A-F]{10})-([0-9A-F]{10})-([0-9A-F]{2})"
timestamp:
type: string
format: date-time
required:
- packageSignature
- referenceNumber
- timestamp
PackagePartSignatureInitResponseType:
type: object
properties:
headerEntryList:
type: array
items:
$ref: '#/components/schemas/HeaderEntryType'
maxItems: 100
minItems: 1
uniqueItems: true
method:
type: string
enum:
- POST
- PUT
ordinalNumber:
type: integer
format: int32
minimum: 0
partFileName:
type: string
pattern: "[a-zA-Z0-9_\\.\\-]{5,100}"
url:
type: string
maxLength: 512
minLength: 1
pattern: "http[s]?:\\/{2}([0-9a-z][0-9a-z_-]*\\.)+[0-9a-z][0-9a-z_-]*(([0-9a-zA-Z][0-9a-zA-Z_-]*\\\
.?)*\\/?)*"
required:
- method
- ordinalNumber
- partFileName
- url
PackageSignatureInitResponseType:
type: object
properties:
packageName:
type: string
pattern: "[a-zA-Z0-9_\\.\\-]{5,100}"
packagePartSignatureList:
type: array
items:
$ref: '#/components/schemas/PackagePartSignatureInitResponseType'
maxItems: 100
minItems: 1
uniqueItems: true
required:
- packageName
- packagePartSignatureList
UploadResponse:
type: object
properties:
referenceNumber:
type: string
pattern: "(20[2-9][0-9]|2[1-9][0-9]{2}|[3-9][0-9]{3})(0[1-9]|1[0-2])(0[1-9]|[1-2][0-9]|3[0-1])-([0-9A-Z]{2})-([0-9A-F]{10})-([0-9A-F]{10})-([0-9A-F]{2})"
timestamp:
type: string
format: date-time
required:
- referenceNumber
- timestamp