@fleetless/contracts 7.0.0-next.1 → 7.1.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -9,6 +9,19 @@ version.
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ### Added
13
+
14
+ - `GET /api/billing/documents`, `GET /api/billing/documents/:id` and
15
+ `GET /api/billing/documents/:id/file`: a read-only view of the org's
16
+ finalized Lexware billing documents (invoices, credit notes, down-payment
17
+ invoices and bookkeeping vouchers), with the e-invoice profile (`NONE`,
18
+ `EN16931`/ZUGFeRD, `XRechnung`) and the files each document offers. The
19
+ list is complete or an error, never truncated. New error code
20
+ `billing_documents_unavailable` for a Lexware answer this cloud cannot
21
+ turn into a complete, trustworthy response.
22
+
23
+ ## [7.0.0] — 2026-10-18
24
+
12
25
  ### Changed
13
26
 
14
27
  - **Breaking:** new paid purchases require company billing details. Other EU
@@ -10166,6 +10166,155 @@
10166
10166
  "description": "Rendered once, with `pdfkit`, when the invoice is issued, and stored as bytes — an issued invoice never changes, so this always answers the same PDF for the same id. `404 not_found` for an unknown id or one from another org."
10167
10167
  }
10168
10168
  },
10169
+ "/api/billing/documents": {
10170
+ "get": {
10171
+ "operationId": "get_api_billing_documents",
10172
+ "summary": "Lists the org's finalized Lexware billing documents.",
10173
+ "tags": [
10174
+ "billing"
10175
+ ],
10176
+ "security": [
10177
+ {
10178
+ "developerSession": []
10179
+ }
10180
+ ],
10181
+ "parameters": [],
10182
+ "responses": {
10183
+ "200": {
10184
+ "description": "Success.",
10185
+ "content": {
10186
+ "application/json": {
10187
+ "schema": {
10188
+ "$ref": "#/components/schemas/billing-document-list"
10189
+ }
10190
+ }
10191
+ }
10192
+ },
10193
+ "default": {
10194
+ "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `tier_required`, `billing_documents_unavailable`, `rate_limited`.",
10195
+ "content": {
10196
+ "application/json": {
10197
+ "schema": {
10198
+ "$ref": "#/components/schemas/api-error"
10199
+ }
10200
+ }
10201
+ }
10202
+ }
10203
+ },
10204
+ "description": "Cloud resolves the org's own Lexware contact itself; the contact is never client supplied. The list is complete (every page) or an error — never a truncated page a caller could mistake for the whole thing: more than 10,000 documents answers 503 list_limit_exceeded. A draft, a quotation, an order confirmation, a delivery note or a purchase voucher never appears; a voided document does. `complete: false` with `unsupported_count` set means a document of an unsupported type or status was skipped rather than listed. `available: false` when this cloud has no Lexware configured, its Lexware account failed the account check, or the org has no Lexware contact — then `documents` is always `[]`."
10205
+ }
10206
+ },
10207
+ "/api/billing/documents/{id}": {
10208
+ "get": {
10209
+ "operationId": "get_api_billing_documents_id",
10210
+ "summary": "Reads one billing document, with its e-invoice profile and available files.",
10211
+ "tags": [
10212
+ "billing"
10213
+ ],
10214
+ "security": [
10215
+ {
10216
+ "developerSession": []
10217
+ }
10218
+ ],
10219
+ "parameters": [
10220
+ {
10221
+ "name": "id",
10222
+ "in": "path",
10223
+ "required": true,
10224
+ "description": "The Lexware voucher id from the document list.",
10225
+ "schema": {
10226
+ "type": "string"
10227
+ }
10228
+ }
10229
+ ],
10230
+ "responses": {
10231
+ "200": {
10232
+ "description": "Success.",
10233
+ "content": {
10234
+ "application/json": {
10235
+ "schema": {
10236
+ "$ref": "#/components/schemas/billing-document-detail"
10237
+ }
10238
+ }
10239
+ }
10240
+ },
10241
+ "default": {
10242
+ "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `tier_required`, `billing_documents_unavailable`, `rate_limited`, `not_found`.",
10243
+ "content": {
10244
+ "application/json": {
10245
+ "schema": {
10246
+ "$ref": "#/components/schemas/api-error"
10247
+ }
10248
+ }
10249
+ }
10250
+ }
10251
+ },
10252
+ "description": "`404 not_found` for an id from another organization or a guessed id — indistinguishable from an unknown one. `NONE` is a plain PDF and not an e-invoice; `EN16931` (ZUGFeRD) is a PDF with the e-invoice embedded in it; `XRechnung` is an XML e-invoice with a PDF that is only a preview. `electronic_document_profile` is `null` for a bookkeeping voucher — it has none. A fresh list must still contain the id. `502 billing_documents_unavailable` with reason `unsupported_document` for an e-invoice profile this cloud does not know."
10253
+ }
10254
+ },
10255
+ "/api/billing/documents/{id}/file": {
10256
+ "get": {
10257
+ "operationId": "get_api_billing_documents_id_file",
10258
+ "summary": "Downloads one billing document's file.",
10259
+ "tags": [
10260
+ "billing"
10261
+ ],
10262
+ "security": [
10263
+ {
10264
+ "developerSession": []
10265
+ }
10266
+ ],
10267
+ "parameters": [
10268
+ {
10269
+ "name": "id",
10270
+ "in": "path",
10271
+ "required": true,
10272
+ "description": "The Lexware voucher id from the document list.",
10273
+ "schema": {
10274
+ "type": "string"
10275
+ }
10276
+ },
10277
+ {
10278
+ "name": "format",
10279
+ "in": "query",
10280
+ "required": false,
10281
+ "schema": {
10282
+ "default": "pdf",
10283
+ "description": "The file format to read. `xml` answers `404` unless the document is `XRechnung`.",
10284
+ "type": "string",
10285
+ "enum": [
10286
+ "pdf",
10287
+ "xml"
10288
+ ]
10289
+ }
10290
+ }
10291
+ ],
10292
+ "responses": {
10293
+ "200": {
10294
+ "description": "Success.",
10295
+ "content": {
10296
+ "application/pdf": {
10297
+ "schema": {
10298
+ "type": "string",
10299
+ "format": "binary"
10300
+ }
10301
+ }
10302
+ }
10303
+ },
10304
+ "default": {
10305
+ "description": "An error envelope. Codes this route is known to answer: `unauthorized`, `token_expired`, `token_revoked`, `tier_required`, `billing_documents_unavailable`, `rate_limited`, `not_found`, `validation_error`.",
10306
+ "content": {
10307
+ "application/json": {
10308
+ "schema": {
10309
+ "$ref": "#/components/schemas/api-error"
10310
+ }
10311
+ }
10312
+ }
10313
+ }
10314
+ },
10315
+ "description": "`format=xml` answers `application/xml` for an `XRechnung` document only; every other document answers 404 for `format=xml`, because it has no XML to serve — a NONE document is a plain PDF and not an e-invoice, so it never has one either. `Cache-Control: no-store`; the bytes are streamed from Lexware and never persisted on this cloud's own side. 404 for a document of another organization or a guessed id — indistinguishable from an unknown one. A fresh list must still contain the id, and the org's Lexware contact is rechecked at file time, not only when the document was first listed. `502 billing_documents_unavailable` with reason `unsupported_document` when Lexware answers something that is not the document itself."
10316
+ }
10317
+ },
10169
10318
  "/api/billing/invoices/{id}/pay": {
10170
10319
  "post": {
10171
10320
  "operationId": "post_api_billing_invoices_id_pay",
@@ -15038,6 +15187,247 @@
15038
15187
  },
15039
15188
  "additionalProperties": false
15040
15189
  },
15190
+ "billing-document-detail": {
15191
+ "type": "object",
15192
+ "properties": {
15193
+ "id": {
15194
+ "type": "string",
15195
+ "format": "uuid",
15196
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
15197
+ "description": "The Lexware voucher id. Opaque; read the document or its file by this id, never a locally invented one."
15198
+ },
15199
+ "kind": {
15200
+ "type": "string",
15201
+ "enum": [
15202
+ "invoice",
15203
+ "credit_note",
15204
+ "down_payment_invoice",
15205
+ "bookkeeping_invoice",
15206
+ "bookkeeping_credit_note"
15207
+ ],
15208
+ "description": "The document's kind."
15209
+ },
15210
+ "status": {
15211
+ "type": "string",
15212
+ "enum": [
15213
+ "open",
15214
+ "overdue",
15215
+ "paid",
15216
+ "paidoff",
15217
+ "voided",
15218
+ "transferred",
15219
+ "sepadebit"
15220
+ ],
15221
+ "description": "The document's own status."
15222
+ },
15223
+ "number": {
15224
+ "anyOf": [
15225
+ {
15226
+ "type": "string"
15227
+ },
15228
+ {
15229
+ "type": "null"
15230
+ }
15231
+ ],
15232
+ "description": "The Lexware voucher number, for display only — never a key to read by. `null` for a voucher Lexware has not numbered."
15233
+ },
15234
+ "document_date": {
15235
+ "type": "string",
15236
+ "format": "date-time",
15237
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
15238
+ "description": "The date printed on the document."
15239
+ },
15240
+ "currency": {
15241
+ "type": "string",
15242
+ "const": "EUR",
15243
+ "description": "Every Lexware voucher this reads is EUR; nothing here reads a foreign-currency voucher."
15244
+ },
15245
+ "gross_cents": {
15246
+ "type": "integer",
15247
+ "minimum": -9007199254740991,
15248
+ "maximum": 9007199254740991,
15249
+ "description": "The gross amount, in integer cents, signed by `kind` and never by the sign Lexware itself reports: `credit_note` and `bookkeeping_credit_note` are zero or negative, every other kind is zero or positive."
15250
+ },
15251
+ "file": {
15252
+ "type": "string",
15253
+ "enum": [
15254
+ "available",
15255
+ "unavailable"
15256
+ ],
15257
+ "description": "Whether Lexware holds a file for this document at all."
15258
+ },
15259
+ "electronic_document_profile": {
15260
+ "anyOf": [
15261
+ {
15262
+ "type": "string",
15263
+ "enum": [
15264
+ "NONE",
15265
+ "EN16931",
15266
+ "XRechnung"
15267
+ ]
15268
+ },
15269
+ {
15270
+ "type": "null"
15271
+ }
15272
+ ],
15273
+ "description": "The e-invoice profile, or `null` for a bookkeeping voucher — it has none."
15274
+ },
15275
+ "formats": {
15276
+ "type": "array",
15277
+ "items": {
15278
+ "type": "object",
15279
+ "properties": {
15280
+ "format": {
15281
+ "type": "string",
15282
+ "enum": [
15283
+ "pdf",
15284
+ "xml"
15285
+ ]
15286
+ },
15287
+ "role": {
15288
+ "type": "string",
15289
+ "enum": [
15290
+ "e_invoice",
15291
+ "preview",
15292
+ "document"
15293
+ ]
15294
+ }
15295
+ },
15296
+ "required": [
15297
+ "format",
15298
+ "role"
15299
+ ],
15300
+ "additionalProperties": false
15301
+ },
15302
+ "description": "`NONE`: `[{ format: \"pdf\", role: \"document\" }]`. `EN16931`: `[{ format: \"pdf\", role: \"e_invoice\" }]`. `XRechnung`: `[{ format: \"xml\", role: \"e_invoice\" }, { format: \"pdf\", role: \"preview\" }]`. `null` profile: `[{ format: \"pdf\", role: \"document\" }]` when `file` is `available`, otherwise `[]`."
15303
+ }
15304
+ },
15305
+ "required": [
15306
+ "id",
15307
+ "kind",
15308
+ "status",
15309
+ "number",
15310
+ "document_date",
15311
+ "currency",
15312
+ "gross_cents",
15313
+ "file",
15314
+ "electronic_document_profile",
15315
+ "formats"
15316
+ ],
15317
+ "additionalProperties": false
15318
+ },
15319
+ "billing-document-list": {
15320
+ "type": "object",
15321
+ "properties": {
15322
+ "available": {
15323
+ "type": "boolean",
15324
+ "description": "Whether this cloud can list Lexware documents at all for this org — `false` when this cloud has no Lexware configured, its Lexware account failed the account check, or the org has no Lexware contact."
15325
+ },
15326
+ "complete": {
15327
+ "type": "boolean",
15328
+ "description": "`false` when a document of an unsupported type or status was skipped rather than listed, counted in `unsupported_count`."
15329
+ },
15330
+ "unsupported_count": {
15331
+ "type": "integer",
15332
+ "minimum": 0,
15333
+ "maximum": 9007199254740991,
15334
+ "description": "How many documents of an unsupported type or status were skipped; `complete` is `false` whenever this is above zero."
15335
+ },
15336
+ "documents": {
15337
+ "type": "array",
15338
+ "items": {
15339
+ "type": "object",
15340
+ "properties": {
15341
+ "id": {
15342
+ "type": "string",
15343
+ "format": "uuid",
15344
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
15345
+ "description": "The Lexware voucher id. Opaque; read the document or its file by this id, never a locally invented one."
15346
+ },
15347
+ "kind": {
15348
+ "type": "string",
15349
+ "enum": [
15350
+ "invoice",
15351
+ "credit_note",
15352
+ "down_payment_invoice",
15353
+ "bookkeeping_invoice",
15354
+ "bookkeeping_credit_note"
15355
+ ],
15356
+ "description": "The document's kind."
15357
+ },
15358
+ "status": {
15359
+ "type": "string",
15360
+ "enum": [
15361
+ "open",
15362
+ "overdue",
15363
+ "paid",
15364
+ "paidoff",
15365
+ "voided",
15366
+ "transferred",
15367
+ "sepadebit"
15368
+ ],
15369
+ "description": "The document's own status."
15370
+ },
15371
+ "number": {
15372
+ "anyOf": [
15373
+ {
15374
+ "type": "string"
15375
+ },
15376
+ {
15377
+ "type": "null"
15378
+ }
15379
+ ],
15380
+ "description": "The Lexware voucher number, for display only — never a key to read by. `null` for a voucher Lexware has not numbered."
15381
+ },
15382
+ "document_date": {
15383
+ "type": "string",
15384
+ "format": "date-time",
15385
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
15386
+ "description": "The date printed on the document."
15387
+ },
15388
+ "currency": {
15389
+ "type": "string",
15390
+ "const": "EUR",
15391
+ "description": "Every Lexware voucher this reads is EUR; nothing here reads a foreign-currency voucher."
15392
+ },
15393
+ "gross_cents": {
15394
+ "type": "integer",
15395
+ "minimum": -9007199254740991,
15396
+ "maximum": 9007199254740991,
15397
+ "description": "The gross amount, in integer cents, signed by `kind` and never by the sign Lexware itself reports: `credit_note` and `bookkeeping_credit_note` are zero or negative, every other kind is zero or positive."
15398
+ },
15399
+ "file": {
15400
+ "type": "string",
15401
+ "enum": [
15402
+ "available",
15403
+ "unavailable"
15404
+ ],
15405
+ "description": "Whether Lexware holds a file for this document at all."
15406
+ }
15407
+ },
15408
+ "required": [
15409
+ "id",
15410
+ "kind",
15411
+ "status",
15412
+ "number",
15413
+ "document_date",
15414
+ "currency",
15415
+ "gross_cents",
15416
+ "file"
15417
+ ],
15418
+ "additionalProperties": false
15419
+ },
15420
+ "description": "Every supported document this org has, complete or not — never a truncated page."
15421
+ }
15422
+ },
15423
+ "required": [
15424
+ "available",
15425
+ "complete",
15426
+ "unsupported_count",
15427
+ "documents"
15428
+ ],
15429
+ "additionalProperties": false
15430
+ },
15041
15431
  "billing-view": {
15042
15432
  "type": "object",
15043
15433
  "properties": {
@@ -6829,6 +6829,95 @@
6829
6829
  "transport": "http",
6830
6830
  "notes": "Rendered once, with `pdfkit`, when the invoice is issued, and stored as bytes — an issued invoice never changes, so this always answers the same PDF for the same id. `404 not_found` for an unknown id or one from another org."
6831
6831
  },
6832
+ {
6833
+ "method": "GET",
6834
+ "path": "/api/billing/documents",
6835
+ "section": "billing",
6836
+ "summary": "Lists the org's finalized Lexware billing documents.",
6837
+ "audience": "developer",
6838
+ "auth": "developer",
6839
+ "rateLimited": true,
6840
+ "ownerTier": true,
6841
+ "status": 200,
6842
+ "params": [],
6843
+ "query": null,
6844
+ "request": null,
6845
+ "response": "billing-document-list",
6846
+ "errors": [
6847
+ "unauthorized",
6848
+ "token_expired",
6849
+ "token_revoked",
6850
+ "tier_required",
6851
+ "billing_documents_unavailable",
6852
+ "rate_limited"
6853
+ ],
6854
+ "transport": "http",
6855
+ "notes": "Cloud resolves the org's own Lexware contact itself; the contact is never client supplied. The list is complete (every page) or an error — never a truncated page a caller could mistake for the whole thing: more than 10,000 documents answers 503 list_limit_exceeded. A draft, a quotation, an order confirmation, a delivery note or a purchase voucher never appears; a voided document does. `complete: false` with `unsupported_count` set means a document of an unsupported type or status was skipped rather than listed. `available: false` when this cloud has no Lexware configured, its Lexware account failed the account check, or the org has no Lexware contact — then `documents` is always `[]`."
6856
+ },
6857
+ {
6858
+ "method": "GET",
6859
+ "path": "/api/billing/documents/:id",
6860
+ "section": "billing",
6861
+ "summary": "Reads one billing document, with its e-invoice profile and available files.",
6862
+ "audience": "developer",
6863
+ "auth": "developer",
6864
+ "rateLimited": true,
6865
+ "ownerTier": true,
6866
+ "status": 200,
6867
+ "params": [
6868
+ {
6869
+ "name": "id",
6870
+ "description": "The Lexware voucher id from the document list."
6871
+ }
6872
+ ],
6873
+ "query": null,
6874
+ "request": null,
6875
+ "response": "billing-document-detail",
6876
+ "errors": [
6877
+ "unauthorized",
6878
+ "token_expired",
6879
+ "token_revoked",
6880
+ "tier_required",
6881
+ "billing_documents_unavailable",
6882
+ "rate_limited",
6883
+ "not_found"
6884
+ ],
6885
+ "transport": "http",
6886
+ "notes": "`404 not_found` for an id from another organization or a guessed id — indistinguishable from an unknown one. `NONE` is a plain PDF and not an e-invoice; `EN16931` (ZUGFeRD) is a PDF with the e-invoice embedded in it; `XRechnung` is an XML e-invoice with a PDF that is only a preview. `electronic_document_profile` is `null` for a bookkeeping voucher — it has none. A fresh list must still contain the id. `502 billing_documents_unavailable` with reason `unsupported_document` for an e-invoice profile this cloud does not know."
6887
+ },
6888
+ {
6889
+ "method": "GET",
6890
+ "path": "/api/billing/documents/:id/file",
6891
+ "section": "billing",
6892
+ "summary": "Downloads one billing document's file.",
6893
+ "audience": "developer",
6894
+ "auth": "developer",
6895
+ "rateLimited": true,
6896
+ "ownerTier": true,
6897
+ "status": 200,
6898
+ "params": [
6899
+ {
6900
+ "name": "id",
6901
+ "description": "The Lexware voucher id from the document list."
6902
+ }
6903
+ ],
6904
+ "query": "billing-document-file-query",
6905
+ "request": null,
6906
+ "response": null,
6907
+ "contentType": "application/pdf",
6908
+ "errors": [
6909
+ "unauthorized",
6910
+ "token_expired",
6911
+ "token_revoked",
6912
+ "tier_required",
6913
+ "billing_documents_unavailable",
6914
+ "rate_limited",
6915
+ "not_found",
6916
+ "validation_error"
6917
+ ],
6918
+ "transport": "http",
6919
+ "notes": "`format=xml` answers `application/xml` for an `XRechnung` document only; every other document answers 404 for `format=xml`, because it has no XML to serve — a NONE document is a plain PDF and not an e-invoice, so it never has one either. `Cache-Control: no-store`; the bytes are streamed from Lexware and never persisted on this cloud's own side. 404 for a document of another organization or a guessed id — indistinguishable from an unknown one. A fresh list must still contain the id, and the org's Lexware contact is rechecked at file time, not only when the document was first listed. `502 billing_documents_unavailable` with reason `unsupported_document` when Lexware answers something that is not the document itself."
6920
+ },
6832
6921
  {
6833
6922
  "method": "POST",
6834
6923
  "path": "/api/billing/invoices/:id/pay",
@@ -0,0 +1,130 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "id": {
6
+ "type": "string",
7
+ "format": "uuid",
8
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
9
+ "description": "The Lexware voucher id. Opaque; read the document or its file by this id, never a locally invented one."
10
+ },
11
+ "kind": {
12
+ "type": "string",
13
+ "enum": [
14
+ "invoice",
15
+ "credit_note",
16
+ "down_payment_invoice",
17
+ "bookkeeping_invoice",
18
+ "bookkeeping_credit_note"
19
+ ],
20
+ "description": "The document's kind."
21
+ },
22
+ "status": {
23
+ "type": "string",
24
+ "enum": [
25
+ "open",
26
+ "overdue",
27
+ "paid",
28
+ "paidoff",
29
+ "voided",
30
+ "transferred",
31
+ "sepadebit"
32
+ ],
33
+ "description": "The document's own status."
34
+ },
35
+ "number": {
36
+ "anyOf": [
37
+ {
38
+ "type": "string"
39
+ },
40
+ {
41
+ "type": "null"
42
+ }
43
+ ],
44
+ "description": "The Lexware voucher number, for display only — never a key to read by. `null` for a voucher Lexware has not numbered."
45
+ },
46
+ "document_date": {
47
+ "type": "string",
48
+ "format": "date-time",
49
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
50
+ "description": "The date printed on the document."
51
+ },
52
+ "currency": {
53
+ "type": "string",
54
+ "const": "EUR",
55
+ "description": "Every Lexware voucher this reads is EUR; nothing here reads a foreign-currency voucher."
56
+ },
57
+ "gross_cents": {
58
+ "type": "integer",
59
+ "minimum": -9007199254740991,
60
+ "maximum": 9007199254740991,
61
+ "description": "The gross amount, in integer cents, signed by `kind` and never by the sign Lexware itself reports: `credit_note` and `bookkeeping_credit_note` are zero or negative, every other kind is zero or positive."
62
+ },
63
+ "file": {
64
+ "type": "string",
65
+ "enum": [
66
+ "available",
67
+ "unavailable"
68
+ ],
69
+ "description": "Whether Lexware holds a file for this document at all."
70
+ },
71
+ "electronic_document_profile": {
72
+ "anyOf": [
73
+ {
74
+ "type": "string",
75
+ "enum": [
76
+ "NONE",
77
+ "EN16931",
78
+ "XRechnung"
79
+ ]
80
+ },
81
+ {
82
+ "type": "null"
83
+ }
84
+ ],
85
+ "description": "The e-invoice profile, or `null` for a bookkeeping voucher — it has none."
86
+ },
87
+ "formats": {
88
+ "type": "array",
89
+ "items": {
90
+ "type": "object",
91
+ "properties": {
92
+ "format": {
93
+ "type": "string",
94
+ "enum": [
95
+ "pdf",
96
+ "xml"
97
+ ]
98
+ },
99
+ "role": {
100
+ "type": "string",
101
+ "enum": [
102
+ "e_invoice",
103
+ "preview",
104
+ "document"
105
+ ]
106
+ }
107
+ },
108
+ "required": [
109
+ "format",
110
+ "role"
111
+ ],
112
+ "additionalProperties": false
113
+ },
114
+ "description": "`NONE`: `[{ format: \"pdf\", role: \"document\" }]`. `EN16931`: `[{ format: \"pdf\", role: \"e_invoice\" }]`. `XRechnung`: `[{ format: \"xml\", role: \"e_invoice\" }, { format: \"pdf\", role: \"preview\" }]`. `null` profile: `[{ format: \"pdf\", role: \"document\" }]` when `file` is `available`, otherwise `[]`."
115
+ }
116
+ },
117
+ "required": [
118
+ "id",
119
+ "kind",
120
+ "status",
121
+ "number",
122
+ "document_date",
123
+ "currency",
124
+ "gross_cents",
125
+ "file",
126
+ "electronic_document_profile",
127
+ "formats"
128
+ ],
129
+ "additionalProperties": false
130
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "type": "object",
4
+ "properties": {
5
+ "format": {
6
+ "default": "pdf",
7
+ "description": "The file format to read. `xml` answers `404` unless the document is `XRechnung`.",
8
+ "type": "string",
9
+ "enum": [
10
+ "pdf",
11
+ "xml"
12
+ ]
13
+ }
14
+ },
15
+ "additionalProperties": false
16
+ }