e-invoice-api 0.33.0 → 0.35.0

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.
Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +31 -0
  3. data/LICENSE +201 -0
  4. data/README.md +18 -7
  5. data/SECURITY.md +6 -16
  6. data/lib/e_invoice_api/client.rb +16 -0
  7. data/lib/e_invoice_api/internal/transport/base_client.rb +43 -78
  8. data/lib/e_invoice_api/internal/transport/pooled_net_requester.rb +8 -8
  9. data/lib/e_invoice_api/internal/type/array_of.rb +12 -12
  10. data/lib/e_invoice_api/internal/type/base_model.rb +18 -18
  11. data/lib/e_invoice_api/internal/type/boolean.rb +6 -6
  12. data/lib/e_invoice_api/internal/type/converter.rb +24 -24
  13. data/lib/e_invoice_api/internal/type/enum.rb +6 -6
  14. data/lib/e_invoice_api/internal/type/file_input.rb +6 -6
  15. data/lib/e_invoice_api/internal/type/hash_of.rb +12 -12
  16. data/lib/e_invoice_api/internal/type/request_parameters.rb +1 -1
  17. data/lib/e_invoice_api/internal/type/union.rb +10 -10
  18. data/lib/e_invoice_api/internal/type/unknown.rb +6 -6
  19. data/lib/e_invoice_api/internal/util.rb +15 -57
  20. data/lib/e_invoice_api/models/conversion/document_create_from_pdf_task.rb +43 -0
  21. data/lib/e_invoice_api/models/conversion/pdf_create_params.rb +22 -0
  22. data/lib/e_invoice_api/models/conversion/pdf_result_params.rb +22 -0
  23. data/lib/e_invoice_api/models/conversion/pdf_retrieve_params.rb +22 -0
  24. data/lib/e_invoice_api/models/document_create.rb +203 -17
  25. data/lib/e_invoice_api/models/document_create_from_pdf_response.rb +153 -17
  26. data/lib/e_invoice_api/models/document_lifecycle_params.rb +20 -0
  27. data/lib/e_invoice_api/models/document_lifecycle_response.rb +134 -0
  28. data/lib/e_invoice_api/models/document_response.rb +161 -21
  29. data/lib/e_invoice_api/models/document_timeline_params.rb +20 -0
  30. data/lib/e_invoice_api/models/document_timeline_response.rb +71 -0
  31. data/lib/e_invoice_api/models/draft_list_params.rb +113 -0
  32. data/lib/e_invoice_api/models/inbound_email_response.rb +129 -0
  33. data/lib/e_invoice_api/models/mailbox_download_attachment_params.rb +26 -0
  34. data/lib/e_invoice_api/models/mailbox_list_params.rb +129 -0
  35. data/lib/e_invoice_api/models/mailbox_reprocess_params.rb +20 -0
  36. data/lib/e_invoice_api/models/mailbox_retrieve_params.rb +20 -0
  37. data/lib/e_invoice_api/models/me_retrieve_response.rb +8 -7
  38. data/lib/e_invoice_api/models/payment_detail_create.rb +8 -4
  39. data/lib/e_invoice_api/models/stats_retrieve_params.rb +55 -0
  40. data/lib/e_invoice_api/models/stats_retrieve_response.rb +141 -0
  41. data/lib/e_invoice_api/models/ubl_document_validation.rb +10 -1
  42. data/lib/e_invoice_api/models/unit_of_measure_code.rb +1349 -0
  43. data/lib/e_invoice_api/models/webhook_history_params.rb +20 -0
  44. data/lib/e_invoice_api/models/webhook_history_response.rb +17 -0
  45. data/lib/e_invoice_api/models/webhook_test_params.rb +37 -0
  46. data/lib/e_invoice_api/models/webhook_test_response.rb +35 -0
  47. data/lib/e_invoice_api/models.rb +24 -0
  48. data/lib/e_invoice_api/resources/conversion/pdf.rb +76 -0
  49. data/lib/e_invoice_api/resources/conversion.rb +18 -0
  50. data/lib/e_invoice_api/resources/documents/attachments.rb +11 -11
  51. data/lib/e_invoice_api/resources/documents/ubl.rb +4 -4
  52. data/lib/e_invoice_api/resources/documents.rb +130 -69
  53. data/lib/e_invoice_api/resources/drafts.rb +55 -0
  54. data/lib/e_invoice_api/resources/inbox.rb +20 -20
  55. data/lib/e_invoice_api/resources/lookup.rb +5 -5
  56. data/lib/e_invoice_api/resources/mailbox.rb +123 -0
  57. data/lib/e_invoice_api/resources/me.rb +1 -1
  58. data/lib/e_invoice_api/resources/outbox.rb +19 -19
  59. data/lib/e_invoice_api/resources/stats.rb +47 -0
  60. data/lib/e_invoice_api/resources/validate.rb +76 -56
  61. data/lib/e_invoice_api/resources/webhooks.rb +59 -14
  62. data/lib/e_invoice_api/version.rb +1 -1
  63. data/lib/e_invoice_api.rb +25 -1
  64. data/rbi/e_invoice_api/client.rbi +12 -0
  65. data/rbi/e_invoice_api/internal/transport/base_client.rbi +2 -10
  66. data/rbi/e_invoice_api/internal/util.rbi +0 -12
  67. data/rbi/e_invoice_api/models/conversion/document_create_from_pdf_task.rbi +108 -0
  68. data/rbi/e_invoice_api/models/conversion/pdf_create_params.rbi +43 -0
  69. data/rbi/e_invoice_api/models/conversion/pdf_result_params.rbi +40 -0
  70. data/rbi/e_invoice_api/models/conversion/pdf_retrieve_params.rbi +40 -0
  71. data/rbi/e_invoice_api/models/document_create.rbi +366 -15
  72. data/rbi/e_invoice_api/models/document_create_from_pdf_response.rbi +280 -15
  73. data/rbi/e_invoice_api/models/document_lifecycle_params.rbi +38 -0
  74. data/rbi/e_invoice_api/models/document_lifecycle_response.rbi +353 -0
  75. data/rbi/e_invoice_api/models/document_response.rbi +292 -19
  76. data/rbi/e_invoice_api/models/document_timeline_params.rbi +38 -0
  77. data/rbi/e_invoice_api/models/document_timeline_response.rbi +168 -0
  78. data/rbi/e_invoice_api/models/draft_list_params.rbi +194 -0
  79. data/rbi/e_invoice_api/models/inbound_email_response.rbi +189 -0
  80. data/rbi/e_invoice_api/models/mailbox_download_attachment_params.rbi +46 -0
  81. data/rbi/e_invoice_api/models/mailbox_list_params.rbi +218 -0
  82. data/rbi/e_invoice_api/models/mailbox_reprocess_params.rbi +41 -0
  83. data/rbi/e_invoice_api/models/mailbox_retrieve_params.rbi +41 -0
  84. data/rbi/e_invoice_api/models/me_retrieve_response.rbi +10 -8
  85. data/rbi/e_invoice_api/models/payment_detail_create.rbi +12 -4
  86. data/rbi/e_invoice_api/models/stats_retrieve_params.rbi +111 -0
  87. data/rbi/e_invoice_api/models/stats_retrieve_response.rbi +251 -0
  88. data/rbi/e_invoice_api/models/ubl_document_validation.rbi +11 -1
  89. data/rbi/e_invoice_api/models/unit_of_measure_code.rbi +1349 -0
  90. data/rbi/e_invoice_api/models/webhook_history_params.rbi +38 -0
  91. data/rbi/e_invoice_api/models/webhook_history_response.rbi +32 -0
  92. data/rbi/e_invoice_api/models/webhook_test_params.rbi +57 -0
  93. data/rbi/e_invoice_api/models/webhook_test_response.rbi +57 -0
  94. data/rbi/e_invoice_api/models.rbi +25 -0
  95. data/rbi/e_invoice_api/resources/conversion/pdf.rbi +44 -0
  96. data/rbi/e_invoice_api/resources/conversion.rbi +15 -0
  97. data/rbi/e_invoice_api/resources/documents.rbi +77 -5
  98. data/rbi/e_invoice_api/resources/drafts.rbi +55 -0
  99. data/rbi/e_invoice_api/resources/mailbox.rbi +93 -0
  100. data/rbi/e_invoice_api/resources/stats.rbi +38 -0
  101. data/rbi/e_invoice_api/resources/validate.rbi +52 -6
  102. data/rbi/e_invoice_api/resources/webhooks.rbi +29 -0
  103. data/sig/e_invoice_api/client.rbs +8 -0
  104. data/sig/e_invoice_api/internal/transport/base_client.rbs +1 -4
  105. data/sig/e_invoice_api/internal/util.rbs +0 -4
  106. data/sig/e_invoice_api/models/conversion/document_create_from_pdf_task.rbs +45 -0
  107. data/sig/e_invoice_api/models/conversion/pdf_create_params.rbs +26 -0
  108. data/sig/e_invoice_api/models/conversion/pdf_result_params.rbs +25 -0
  109. data/sig/e_invoice_api/models/conversion/pdf_retrieve_params.rbs +25 -0
  110. data/sig/e_invoice_api/models/document_create.rbs +139 -4
  111. data/sig/e_invoice_api/models/document_create_from_pdf_response.rbs +113 -4
  112. data/sig/e_invoice_api/models/document_lifecycle_params.rbs +23 -0
  113. data/sig/e_invoice_api/models/document_lifecycle_response.rbs +151 -0
  114. data/sig/e_invoice_api/models/document_response.rbs +113 -4
  115. data/sig/e_invoice_api/models/document_timeline_params.rbs +23 -0
  116. data/sig/e_invoice_api/models/document_timeline_response.rbs +84 -0
  117. data/sig/e_invoice_api/models/draft_list_params.rbs +112 -0
  118. data/sig/e_invoice_api/models/inbound_email_response.rbs +126 -0
  119. data/sig/e_invoice_api/models/mailbox_download_attachment_params.rbs +28 -0
  120. data/sig/e_invoice_api/models/mailbox_list_params.rbs +112 -0
  121. data/sig/e_invoice_api/models/mailbox_reprocess_params.rbs +24 -0
  122. data/sig/e_invoice_api/models/mailbox_retrieve_params.rbs +24 -0
  123. data/sig/e_invoice_api/models/stats_retrieve_params.rbs +48 -0
  124. data/sig/e_invoice_api/models/stats_retrieve_response.rbs +107 -0
  125. data/sig/e_invoice_api/models/unit_of_measure_code.rbs +2698 -0
  126. data/sig/e_invoice_api/models/webhook_history_params.rbs +23 -0
  127. data/sig/e_invoice_api/models/webhook_history_response.rbs +13 -0
  128. data/sig/e_invoice_api/models/webhook_test_params.rbs +32 -0
  129. data/sig/e_invoice_api/models/webhook_test_response.rbs +30 -0
  130. data/sig/e_invoice_api/models.rbs +24 -0
  131. data/sig/e_invoice_api/resources/conversion/pdf.rbs +24 -0
  132. data/sig/e_invoice_api/resources/conversion.rbs +9 -0
  133. data/sig/e_invoice_api/resources/documents.rbs +19 -0
  134. data/sig/e_invoice_api/resources/drafts.rbs +20 -0
  135. data/sig/e_invoice_api/resources/mailbox.rbs +36 -0
  136. data/sig/e_invoice_api/resources/stats.rbs +14 -0
  137. data/sig/e_invoice_api/resources/validate.rbs +9 -0
  138. data/sig/e_invoice_api/resources/webhooks.rbs +12 -0
  139. metadata +102 -7
@@ -36,6 +36,11 @@ module EInvoiceAPI
36
36
  sig { returns(T.nilable(String)) }
37
37
  attr_accessor :billing_address_recipient
38
38
 
39
+ # The buyer reference (BT-10), e.g. a cost centre or accounting reference
40
+ # requested by the buyer
41
+ sig { returns(T.nilable(String)) }
42
+ attr_accessor :buyer_reference
43
+
39
44
  sig do
40
45
  returns(T.nilable(T::Array[EInvoiceAPI::DocumentResponse::Charge]))
41
46
  end
@@ -52,7 +57,8 @@ module EInvoiceAPI
52
57
  sig { returns(T.nilable(String)) }
53
58
  attr_accessor :customer_address
54
59
 
55
- # The recipient name at the customer address
60
+ # The recipient name at the customer address. Also the customer contact name
61
+ # (BT-56) in the UBL.
56
62
  sig { returns(T.nilable(String)) }
57
63
  attr_accessor :customer_address_recipient
58
64
 
@@ -77,6 +83,10 @@ module EInvoiceAPI
77
83
  sig { returns(T.nilable(String)) }
78
84
  attr_accessor :customer_peppol_id
79
85
 
86
+ # The telephone number of the customer contact (BT-57)
87
+ sig { returns(T.nilable(String)) }
88
+ attr_accessor :customer_phone
89
+
80
90
  # Customer tax ID. For Belgium this is the VAT number. Must include the country
81
91
  # prefix
82
92
  sig { returns(T.nilable(String)) }
@@ -131,7 +141,16 @@ module EInvoiceAPI
131
141
  sig { returns(T.nilable(String)) }
132
142
  attr_accessor :payment_term
133
143
 
134
- # The purchase order reference number
144
+ # The preceding invoice issue date (BT-26)
145
+ sig { returns(T.nilable(Date)) }
146
+ attr_accessor :preceding_invoice_date
147
+
148
+ # The preceding invoice reference (BT-25): the number of the invoice this document
149
+ # corrects, for example the invoice a credit note credits
150
+ sig { returns(T.nilable(String)) }
151
+ attr_accessor :preceding_invoice_id
152
+
153
+ # The purchase order reference number (BT-13)
135
154
  sig { returns(T.nilable(String)) }
136
155
  attr_accessor :purchase_order
137
156
 
@@ -143,6 +162,17 @@ module EInvoiceAPI
143
162
  sig { returns(T.nilable(String)) }
144
163
  attr_accessor :remittance_address_recipient
145
164
 
165
+ # The amount added to the invoice total to round the amount for payment (BT-114),
166
+ # for example to whole kronor (amount_due = invoice_total + rounding_amount when
167
+ # nothing is prepaid). Can be negative. Between -5.00 and 5.00, rounded to maximum
168
+ # 2 decimals
169
+ sig { returns(T.nilable(String)) }
170
+ attr_accessor :rounding_amount
171
+
172
+ # The sales order reference (BT-14) assigned by the seller
173
+ sig { returns(T.nilable(String)) }
174
+ attr_accessor :sales_order
175
+
146
176
  # The address where services were performed or goods were delivered
147
177
  sig { returns(T.nilable(String)) }
148
178
  attr_accessor :service_address
@@ -163,7 +193,7 @@ module EInvoiceAPI
163
193
  sig { returns(T.nilable(String)) }
164
194
  attr_accessor :shipping_address
165
195
 
166
- # The recipient name at the shipping address
196
+ # The name of the deliver-to party (BT-70)
167
197
  sig { returns(T.nilable(String)) }
168
198
  attr_accessor :shipping_address_recipient
169
199
 
@@ -192,6 +222,12 @@ module EInvoiceAPI
192
222
  end
193
223
  attr_writer :tax_code
194
224
 
225
+ # The VAT accounting currency (BT-6, ISO 4217 currency code), when VAT is
226
+ # accounted in a currency other than the invoice currency. Must differ from
227
+ # currency and requires total_tax_in_tax_currency
228
+ sig { returns(T.nilable(String)) }
229
+ attr_accessor :tax_currency
230
+
195
231
  sig do
196
232
  returns(T.nilable(T::Array[EInvoiceAPI::DocumentResponse::TaxDetail]))
197
233
  end
@@ -208,6 +244,11 @@ module EInvoiceAPI
208
244
  sig { returns(T.nilable(String)) }
209
245
  attr_accessor :total_tax
210
246
 
247
+ # The total VAT amount in the VAT accounting currency tax_currency (BT-111). Does
248
+ # not add to invoice_total. Requires tax_currency. Rounded to maximum 2 decimals
249
+ sig { returns(T.nilable(String)) }
250
+ attr_accessor :total_tax_in_tax_currency
251
+
211
252
  # VATEX code list for VAT exemption reasons
212
253
  #
213
254
  # Agency: CEF Identifier: vatex
@@ -216,7 +257,8 @@ module EInvoiceAPI
216
257
  end
217
258
  attr_accessor :vatex
218
259
 
219
- # Textual explanation for VAT exemption
260
+ # VAT exemption reason text (BT-120). An exemption reason (vatex or vatex_note) is
261
+ # required for tax_code E, AE, K, G and O, and not allowed for S, Z, L and M
220
262
  sig { returns(T.nilable(String)) }
221
263
  attr_accessor :vatex_note
222
264
 
@@ -224,7 +266,8 @@ module EInvoiceAPI
224
266
  sig { returns(T.nilable(String)) }
225
267
  attr_accessor :vendor_address
226
268
 
227
- # The recipient name at the vendor address
269
+ # The recipient name at the vendor address. Also the vendor contact name (BT-41)
270
+ # in the UBL, required when vendor and customer are both in Germany (DE-R-005).
228
271
  sig { returns(T.nilable(String)) }
229
272
  attr_accessor :vendor_address_recipient
230
273
 
@@ -241,6 +284,12 @@ module EInvoiceAPI
241
284
  sig { returns(T.nilable(String)) }
242
285
  attr_accessor :vendor_name
243
286
 
287
+ # The telephone number of the vendor contact (BT-42). Required when vendor and
288
+ # customer are both in Germany (DE-R-006); it must then hold at least 3 digits
289
+ # (DE-R-027, a warning).
290
+ sig { returns(T.nilable(String)) }
291
+ attr_accessor :vendor_phone
292
+
244
293
  # Vendor tax ID. For Belgium this is the VAT number. Must include the country
245
294
  # prefix
246
295
  sig { returns(T.nilable(String)) }
@@ -261,6 +310,7 @@ module EInvoiceAPI
261
310
  ),
262
311
  billing_address: T.nilable(String),
263
312
  billing_address_recipient: T.nilable(String),
313
+ buyer_reference: T.nilable(String),
264
314
  charges:
265
315
  T.nilable(T::Array[EInvoiceAPI::DocumentResponse::Charge::OrHash]),
266
316
  currency: EInvoiceAPI::CurrencyCode::OrSymbol,
@@ -271,6 +321,7 @@ module EInvoiceAPI
271
321
  customer_id: T.nilable(String),
272
322
  customer_name: T.nilable(String),
273
323
  customer_peppol_id: T.nilable(String),
324
+ customer_phone: T.nilable(String),
274
325
  customer_tax_id: T.nilable(String),
275
326
  direction: EInvoiceAPI::DocumentDirection::OrSymbol,
276
327
  document_type: EInvoiceAPI::DocumentType::OrSymbol,
@@ -286,9 +337,13 @@ module EInvoiceAPI
286
337
  T::Array[EInvoiceAPI::DocumentResponse::PaymentDetail::OrHash]
287
338
  ),
288
339
  payment_term: T.nilable(String),
340
+ preceding_invoice_date: T.nilable(Date),
341
+ preceding_invoice_id: T.nilable(String),
289
342
  purchase_order: T.nilable(String),
290
343
  remittance_address: T.nilable(String),
291
344
  remittance_address_recipient: T.nilable(String),
345
+ rounding_amount: T.nilable(String),
346
+ sales_order: T.nilable(String),
292
347
  service_address: T.nilable(String),
293
348
  service_address_recipient: T.nilable(String),
294
349
  service_end_date: T.nilable(Date),
@@ -298,12 +353,14 @@ module EInvoiceAPI
298
353
  state: EInvoiceAPI::DocumentState::OrSymbol,
299
354
  subtotal: T.nilable(String),
300
355
  tax_code: EInvoiceAPI::DocumentResponse::TaxCode::OrSymbol,
356
+ tax_currency: T.nilable(String),
301
357
  tax_details:
302
358
  T.nilable(
303
359
  T::Array[EInvoiceAPI::DocumentResponse::TaxDetail::OrHash]
304
360
  ),
305
361
  total_discount: T.nilable(String),
306
362
  total_tax: T.nilable(String),
363
+ total_tax_in_tax_currency: T.nilable(String),
307
364
  vatex: T.nilable(EInvoiceAPI::DocumentResponse::Vatex::OrSymbol),
308
365
  vatex_note: T.nilable(String),
309
366
  vendor_address: T.nilable(String),
@@ -311,6 +368,7 @@ module EInvoiceAPI
311
368
  vendor_company_id: T.nilable(String),
312
369
  vendor_email: T.nilable(String),
313
370
  vendor_name: T.nilable(String),
371
+ vendor_phone: T.nilable(String),
314
372
  vendor_tax_id: T.nilable(String)
315
373
  ).returns(T.attached_class)
316
374
  end
@@ -325,12 +383,16 @@ module EInvoiceAPI
325
383
  billing_address: nil,
326
384
  # The recipient name at the billing address
327
385
  billing_address_recipient: nil,
386
+ # The buyer reference (BT-10), e.g. a cost centre or accounting reference
387
+ # requested by the buyer
388
+ buyer_reference: nil,
328
389
  charges: nil,
329
390
  # Currency of the invoice (ISO 4217 currency code)
330
391
  currency: nil,
331
392
  # The address of the customer/buyer
332
393
  customer_address: nil,
333
- # The recipient name at the customer address
394
+ # The recipient name at the customer address. Also the customer contact name
395
+ # (BT-56) in the UBL.
334
396
  customer_address_recipient: nil,
335
397
  # Customer company ID. For Belgium this is the CBE number or their EUID (European
336
398
  # Unique Identifier) number. In the Netherlands this is the KVK number.
@@ -343,6 +405,8 @@ module EInvoiceAPI
343
405
  customer_name: nil,
344
406
  # Customer Peppol ID
345
407
  customer_peppol_id: nil,
408
+ # The telephone number of the customer contact (BT-57)
409
+ customer_phone: nil,
346
410
  # Customer tax ID. For Belgium this is the VAT number. Must include the country
347
411
  # prefix
348
412
  customer_tax_id: nil,
@@ -365,12 +429,24 @@ module EInvoiceAPI
365
429
  payment_details: nil,
366
430
  # The payment terms (e.g., 'Net 30', 'Due on receipt', '2/10 Net 30')
367
431
  payment_term: nil,
368
- # The purchase order reference number
432
+ # The preceding invoice issue date (BT-26)
433
+ preceding_invoice_date: nil,
434
+ # The preceding invoice reference (BT-25): the number of the invoice this document
435
+ # corrects, for example the invoice a credit note credits
436
+ preceding_invoice_id: nil,
437
+ # The purchase order reference number (BT-13)
369
438
  purchase_order: nil,
370
439
  # The address where payment should be sent or remitted to
371
440
  remittance_address: nil,
372
441
  # The recipient name at the remittance address
373
442
  remittance_address_recipient: nil,
443
+ # The amount added to the invoice total to round the amount for payment (BT-114),
444
+ # for example to whole kronor (amount_due = invoice_total + rounding_amount when
445
+ # nothing is prepaid). Can be negative. Between -5.00 and 5.00, rounded to maximum
446
+ # 2 decimals
447
+ rounding_amount: nil,
448
+ # The sales order reference (BT-14) assigned by the seller
449
+ sales_order: nil,
374
450
  # The address where services were performed or goods were delivered
375
451
  service_address: nil,
376
452
  # The recipient name at the service address
@@ -381,7 +457,7 @@ module EInvoiceAPI
381
457
  service_start_date: nil,
382
458
  # The shipping/delivery address
383
459
  shipping_address: nil,
384
- # The recipient name at the shipping address
460
+ # The name of the deliver-to party (BT-70)
385
461
  shipping_address_recipient: nil,
386
462
  # The current state of the document: DRAFT, TRANSIT, FAILED, SENT, or RECEIVED
387
463
  state: nil,
@@ -392,6 +468,10 @@ module EInvoiceAPI
392
468
  # Tax category code of the invoice (e.g., S for standard rate, Z for zero rate, E
393
469
  # for exempt)
394
470
  tax_code: nil,
471
+ # The VAT accounting currency (BT-6, ISO 4217 currency code), when VAT is
472
+ # accounted in a currency other than the invoice currency. Must differ from
473
+ # currency and requires total_tax_in_tax_currency
474
+ tax_currency: nil,
395
475
  tax_details: nil,
396
476
  # The net financial discount/charge of the invoice (non-VAT charges minus non-VAT
397
477
  # allowances). Can be positive (net charge), negative (net discount), or zero.
@@ -400,15 +480,20 @@ module EInvoiceAPI
400
480
  # The total tax amount of the invoice. Must be positive and rounded to maximum 2
401
481
  # decimals
402
482
  total_tax: nil,
483
+ # The total VAT amount in the VAT accounting currency tax_currency (BT-111). Does
484
+ # not add to invoice_total. Requires tax_currency. Rounded to maximum 2 decimals
485
+ total_tax_in_tax_currency: nil,
403
486
  # VATEX code list for VAT exemption reasons
404
487
  #
405
488
  # Agency: CEF Identifier: vatex
406
489
  vatex: nil,
407
- # Textual explanation for VAT exemption
490
+ # VAT exemption reason text (BT-120). An exemption reason (vatex or vatex_note) is
491
+ # required for tax_code E, AE, K, G and O, and not allowed for S, Z, L and M
408
492
  vatex_note: nil,
409
493
  # The address of the vendor/seller
410
494
  vendor_address: nil,
411
- # The recipient name at the vendor address
495
+ # The recipient name at the vendor address. Also the vendor contact name (BT-41)
496
+ # in the UBL, required when vendor and customer are both in Germany (DE-R-005).
412
497
  vendor_address_recipient: nil,
413
498
  # Vendor company ID. For Belgium this is the CBE number or their EUID (European
414
499
  # Unique Identifier) number. In the Netherlands this is the KVK number.
@@ -417,6 +502,10 @@ module EInvoiceAPI
417
502
  vendor_email: nil,
418
503
  # The name of the vendor/seller/supplier
419
504
  vendor_name: nil,
505
+ # The telephone number of the vendor contact (BT-42). Required when vendor and
506
+ # customer are both in Germany (DE-R-006); it must then hold at least 3 digits
507
+ # (DE-R-027, a warning).
508
+ vendor_phone: nil,
420
509
  # Vendor tax ID. For Belgium this is the VAT number. Must include the country
421
510
  # prefix
422
511
  vendor_tax_id: nil
@@ -435,6 +524,7 @@ module EInvoiceAPI
435
524
  T.nilable(T::Array[EInvoiceAPI::Documents::DocumentAttachment]),
436
525
  billing_address: T.nilable(String),
437
526
  billing_address_recipient: T.nilable(String),
527
+ buyer_reference: T.nilable(String),
438
528
  charges: T.nilable(T::Array[EInvoiceAPI::DocumentResponse::Charge]),
439
529
  currency: EInvoiceAPI::CurrencyCode::TaggedSymbol,
440
530
  customer_address: T.nilable(String),
@@ -444,6 +534,7 @@ module EInvoiceAPI
444
534
  customer_id: T.nilable(String),
445
535
  customer_name: T.nilable(String),
446
536
  customer_peppol_id: T.nilable(String),
537
+ customer_phone: T.nilable(String),
447
538
  customer_tax_id: T.nilable(String),
448
539
  direction: EInvoiceAPI::DocumentDirection::TaggedSymbol,
449
540
  document_type: EInvoiceAPI::DocumentType::TaggedSymbol,
@@ -456,9 +547,13 @@ module EInvoiceAPI
456
547
  payment_details:
457
548
  T.nilable(T::Array[EInvoiceAPI::DocumentResponse::PaymentDetail]),
458
549
  payment_term: T.nilable(String),
550
+ preceding_invoice_date: T.nilable(Date),
551
+ preceding_invoice_id: T.nilable(String),
459
552
  purchase_order: T.nilable(String),
460
553
  remittance_address: T.nilable(String),
461
554
  remittance_address_recipient: T.nilable(String),
555
+ rounding_amount: T.nilable(String),
556
+ sales_order: T.nilable(String),
462
557
  service_address: T.nilable(String),
463
558
  service_address_recipient: T.nilable(String),
464
559
  service_end_date: T.nilable(Date),
@@ -468,10 +563,12 @@ module EInvoiceAPI
468
563
  state: EInvoiceAPI::DocumentState::TaggedSymbol,
469
564
  subtotal: T.nilable(String),
470
565
  tax_code: EInvoiceAPI::DocumentResponse::TaxCode::TaggedSymbol,
566
+ tax_currency: T.nilable(String),
471
567
  tax_details:
472
568
  T.nilable(T::Array[EInvoiceAPI::DocumentResponse::TaxDetail]),
473
569
  total_discount: T.nilable(String),
474
570
  total_tax: T.nilable(String),
571
+ total_tax_in_tax_currency: T.nilable(String),
475
572
  vatex:
476
573
  T.nilable(EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol),
477
574
  vatex_note: T.nilable(String),
@@ -480,6 +577,7 @@ module EInvoiceAPI
480
577
  vendor_company_id: T.nilable(String),
481
578
  vendor_email: T.nilable(String),
482
579
  vendor_name: T.nilable(String),
580
+ vendor_phone: T.nilable(String),
483
581
  vendor_tax_id: T.nilable(String)
484
582
  }
485
583
  )
@@ -1923,10 +2021,14 @@ module EInvoiceAPI
1923
2021
  sig { returns(T.nilable(T::Array[EInvoiceAPI::Charge])) }
1924
2022
  attr_accessor :charges
1925
2023
 
1926
- sig { returns(NilClass) }
2024
+ sig { returns(T.nilable(Date)) }
1927
2025
  attr_accessor :date
1928
2026
 
1929
- # The description of the line item.
2027
+ # The description of the line item (BT-154). Doubles as the item name when `name`
2028
+ # is omitted, so a posted line item needs a `name` or a `description`. On a
2029
+ # received document it holds the item description, or the item name (BT-153) when
2030
+ # the document has no item description; CII documents with both combine them as
2031
+ # `name: description`.
1930
2032
  sig { returns(T.nilable(String)) }
1931
2033
  attr_accessor :description
1932
2034
 
@@ -1940,6 +2042,22 @@ module EInvoiceAPI
1940
2042
  end
1941
2043
  attr_accessor :item_attributes
1942
2044
 
2045
+ # The item name (BT-153), for example the product name. Written to
2046
+ # cac:Item/cbc:Name. When omitted or blank, `description` (BT-154) is used as the
2047
+ # item name. A posted line item needs a `name` or a `description`; a line item
2048
+ # with neither is rejected with 422.
2049
+ sig { returns(T.nilable(String)) }
2050
+ attr_accessor :name
2051
+
2052
+ # The item price base quantity (BT-149). The number of item units to which the
2053
+ # unit price applies, for example 100 when the unit price is a price for each 100
2054
+ # units. Must be greater than 0. Defaults to 1.
2055
+ sig { returns(T.nilable(String)) }
2056
+ attr_reader :price_base_quantity
2057
+
2058
+ sig { params(price_base_quantity: String).void }
2059
+ attr_writer :price_base_quantity
2060
+
1943
2061
  # The product code of the line item.
1944
2062
  sig { returns(T.nilable(String)) }
1945
2063
  attr_accessor :product_code
@@ -1973,7 +2091,7 @@ module EInvoiceAPI
1973
2091
  allowances: T.nilable(T::Array[EInvoiceAPI::Allowance::OrHash]),
1974
2092
  amount: T.nilable(String),
1975
2093
  charges: T.nilable(T::Array[EInvoiceAPI::Charge::OrHash]),
1976
- date: NilClass,
2094
+ date: T.nilable(Date),
1977
2095
  description: T.nilable(String),
1978
2096
  item_attributes:
1979
2097
  T.nilable(
@@ -1981,6 +2099,8 @@ module EInvoiceAPI
1981
2099
  EInvoiceAPI::DocumentResponse::Item::ItemAttribute::OrHash
1982
2100
  ]
1983
2101
  ),
2102
+ name: T.nilable(String),
2103
+ price_base_quantity: String,
1984
2104
  product_code: T.nilable(String),
1985
2105
  quantity: T.nilable(String),
1986
2106
  tax: T.nilable(String),
@@ -2000,10 +2120,23 @@ module EInvoiceAPI
2000
2120
  # The charges of the line item.
2001
2121
  charges: nil,
2002
2122
  date: nil,
2003
- # The description of the line item.
2123
+ # The description of the line item (BT-154). Doubles as the item name when `name`
2124
+ # is omitted, so a posted line item needs a `name` or a `description`. On a
2125
+ # received document it holds the item description, or the item name (BT-153) when
2126
+ # the document has no item description; CII documents with both combine them as
2127
+ # `name: description`.
2004
2128
  description: nil,
2005
2129
  # Item-level attributes (BG-32) from cac:AdditionalItemProperty.
2006
2130
  item_attributes: nil,
2131
+ # The item name (BT-153), for example the product name. Written to
2132
+ # cac:Item/cbc:Name. When omitted or blank, `description` (BT-154) is used as the
2133
+ # item name. A posted line item needs a `name` or a `description`; a line item
2134
+ # with neither is rejected with 422.
2135
+ name: nil,
2136
+ # The item price base quantity (BT-149). The number of item units to which the
2137
+ # unit price applies, for example 100 when the unit price is a price for each 100
2138
+ # units. Must be greater than 0. Defaults to 1.
2139
+ price_base_quantity: nil,
2007
2140
  # The product code of the line item.
2008
2141
  product_code: nil,
2009
2142
  # The quantity of items (goods or services) that is the subject of the line item.
@@ -2029,12 +2162,14 @@ module EInvoiceAPI
2029
2162
  allowances: T.nilable(T::Array[EInvoiceAPI::Allowance]),
2030
2163
  amount: T.nilable(String),
2031
2164
  charges: T.nilable(T::Array[EInvoiceAPI::Charge]),
2032
- date: NilClass,
2165
+ date: T.nilable(Date),
2033
2166
  description: T.nilable(String),
2034
2167
  item_attributes:
2035
2168
  T.nilable(
2036
2169
  T::Array[EInvoiceAPI::DocumentResponse::Item::ItemAttribute]
2037
2170
  ),
2171
+ name: T.nilable(String),
2172
+ price_base_quantity: String,
2038
2173
  product_code: T.nilable(String),
2039
2174
  quantity: T.nilable(String),
2040
2175
  tax: T.nilable(String),
@@ -2094,7 +2229,9 @@ module EInvoiceAPI
2094
2229
  )
2095
2230
  end
2096
2231
 
2097
- # Bank account number (for non-IBAN accounts)
2232
+ # Bank account number (for non-IBAN accounts). With `swift` `SE:BANKGIRO` or
2233
+ # `SE:PLUSGIRO`, the bankgiro or plusgiro number, with `iban` left empty; spaces
2234
+ # and hyphens are removed.
2098
2235
  sig { returns(T.nilable(String)) }
2099
2236
  attr_accessor :bank_account_number
2100
2237
 
@@ -2107,7 +2244,9 @@ module EInvoiceAPI
2107
2244
  sig { returns(T.nilable(String)) }
2108
2245
  attr_accessor :payment_reference
2109
2246
 
2110
- # SWIFT/BIC code of the bank
2247
+ # The payment service provider identifier (BT-86): the BIC of the payee's bank, or
2248
+ # `SE:BANKGIRO` / `SE:PLUSGIRO` when `bank_account_number` is a Swedish bankgiro
2249
+ # or plusgiro number.
2111
2250
  sig { returns(T.nilable(String)) }
2112
2251
  attr_accessor :swift
2113
2252
 
@@ -2120,14 +2259,18 @@ module EInvoiceAPI
2120
2259
  ).returns(T.attached_class)
2121
2260
  end
2122
2261
  def self.new(
2123
- # Bank account number (for non-IBAN accounts)
2262
+ # Bank account number (for non-IBAN accounts). With `swift` `SE:BANKGIRO` or
2263
+ # `SE:PLUSGIRO`, the bankgiro or plusgiro number, with `iban` left empty; spaces
2264
+ # and hyphens are removed.
2124
2265
  bank_account_number: nil,
2125
2266
  # International Bank Account Number for payment transfers
2126
2267
  iban: nil,
2127
2268
  # Structured payment reference or communication (e.g., structured communication
2128
2269
  # for Belgian bank transfers)
2129
2270
  payment_reference: nil,
2130
- # SWIFT/BIC code of the bank
2271
+ # The payment service provider identifier (BT-86): the BIC of the payee's bank, or
2272
+ # `SE:BANKGIRO` / `SE:PLUSGIRO` when `bank_account_number` is a Swedish bankgiro
2273
+ # or plusgiro number.
2131
2274
  swift: nil
2132
2275
  )
2133
2276
  end
@@ -2319,6 +2462,11 @@ module EInvoiceAPI
2319
2462
  :"VATEX-EU-132-1Q",
2320
2463
  EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2321
2464
  )
2465
+ VATEX_EU_135_1 =
2466
+ T.let(
2467
+ :"VATEX-EU-135-1",
2468
+ EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2469
+ )
2322
2470
  VATEX_EU_143 =
2323
2471
  T.let(
2324
2472
  :"VATEX-EU-143",
@@ -2474,6 +2622,11 @@ module EInvoiceAPI
2474
2622
  :"VATEX-EU-151-1E",
2475
2623
  EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2476
2624
  )
2625
+ VATEX_EU_153 =
2626
+ T.let(
2627
+ :"VATEX-EU-153",
2628
+ EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2629
+ )
2477
2630
  VATEX_EU_159 =
2478
2631
  T.let(
2479
2632
  :"VATEX-EU-159",
@@ -2524,6 +2677,126 @@ module EInvoiceAPI
2524
2677
  :"VATEX-EU-J",
2525
2678
  EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2526
2679
  )
2680
+ VATEX_FR_298_SEXDECIESA =
2681
+ T.let(
2682
+ :"VATEX-FR-298SEXDECIESA",
2683
+ EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2684
+ )
2685
+ VATEX_FR_AE =
2686
+ T.let(
2687
+ :"VATEX-FR-AE",
2688
+ EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2689
+ )
2690
+ VATEX_FR_CGI261_1 =
2691
+ T.let(
2692
+ :"VATEX-FR-CGI261-1",
2693
+ EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2694
+ )
2695
+ VATEX_FR_CGI261_2 =
2696
+ T.let(
2697
+ :"VATEX-FR-CGI261-2",
2698
+ EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2699
+ )
2700
+ VATEX_FR_CGI261_3 =
2701
+ T.let(
2702
+ :"VATEX-FR-CGI261-3",
2703
+ EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2704
+ )
2705
+ VATEX_FR_CGI261_4 =
2706
+ T.let(
2707
+ :"VATEX-FR-CGI261-4",
2708
+ EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2709
+ )
2710
+ VATEX_FR_CGI261_5 =
2711
+ T.let(
2712
+ :"VATEX-FR-CGI261-5",
2713
+ EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2714
+ )
2715
+ VATEX_FR_CGI261_7 =
2716
+ T.let(
2717
+ :"VATEX-FR-CGI261-7",
2718
+ EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2719
+ )
2720
+ VATEX_FR_CGI261_8 =
2721
+ T.let(
2722
+ :"VATEX-FR-CGI261-8",
2723
+ EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2724
+ )
2725
+ VATEX_FR_CGI261A =
2726
+ T.let(
2727
+ :"VATEX-FR-CGI261A",
2728
+ EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2729
+ )
2730
+ VATEX_FR_CGI261B =
2731
+ T.let(
2732
+ :"VATEX-FR-CGI261B",
2733
+ EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2734
+ )
2735
+ VATEX_FR_CGI261C_1 =
2736
+ T.let(
2737
+ :"VATEX-FR-CGI261C-1",
2738
+ EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2739
+ )
2740
+ VATEX_FR_CGI261C_2 =
2741
+ T.let(
2742
+ :"VATEX-FR-CGI261C-2",
2743
+ EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2744
+ )
2745
+ VATEX_FR_CGI261C_3 =
2746
+ T.let(
2747
+ :"VATEX-FR-CGI261C-3",
2748
+ EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2749
+ )
2750
+ VATEX_FR_CGI261D_1 =
2751
+ T.let(
2752
+ :"VATEX-FR-CGI261D-1",
2753
+ EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2754
+ )
2755
+ VATEX_FR_CGI261D_1_BIS =
2756
+ T.let(
2757
+ :"VATEX-FR-CGI261D-1BIS",
2758
+ EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2759
+ )
2760
+ VATEX_FR_CGI261D_2 =
2761
+ T.let(
2762
+ :"VATEX-FR-CGI261D-2",
2763
+ EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2764
+ )
2765
+ VATEX_FR_CGI261D_3 =
2766
+ T.let(
2767
+ :"VATEX-FR-CGI261D-3",
2768
+ EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2769
+ )
2770
+ VATEX_FR_CGI261D_4 =
2771
+ T.let(
2772
+ :"VATEX-FR-CGI261D-4",
2773
+ EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2774
+ )
2775
+ VATEX_FR_CGI261E_1 =
2776
+ T.let(
2777
+ :"VATEX-FR-CGI261E-1",
2778
+ EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2779
+ )
2780
+ VATEX_FR_CGI261E_2 =
2781
+ T.let(
2782
+ :"VATEX-FR-CGI261E-2",
2783
+ EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2784
+ )
2785
+ VATEX_FR_CGI275 =
2786
+ T.let(
2787
+ :"VATEX-FR-CGI275",
2788
+ EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2789
+ )
2790
+ VATEX_FR_CGI277A =
2791
+ T.let(
2792
+ :"VATEX-FR-CGI277A",
2793
+ EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2794
+ )
2795
+ VATEX_FR_CGI295 =
2796
+ T.let(
2797
+ :"VATEX-FR-CGI295",
2798
+ EInvoiceAPI::DocumentResponse::Vatex::TaggedSymbol
2799
+ )
2527
2800
  VATEX_FR_FRANCHISE =
2528
2801
  T.let(
2529
2802
  :"VATEX-FR-FRANCHISE",
@@ -0,0 +1,38 @@
1
+ # typed: strong
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ class DocumentTimelineParams < EInvoiceAPI::Internal::Type::BaseModel
6
+ extend EInvoiceAPI::Internal::Type::RequestParameters::Converter
7
+ include EInvoiceAPI::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(
12
+ EInvoiceAPI::DocumentTimelineParams,
13
+ EInvoiceAPI::Internal::AnyHash
14
+ )
15
+ end
16
+
17
+ sig { returns(String) }
18
+ attr_accessor :document_id
19
+
20
+ sig do
21
+ params(
22
+ document_id: String,
23
+ request_options: EInvoiceAPI::RequestOptions::OrHash
24
+ ).returns(T.attached_class)
25
+ end
26
+ def self.new(document_id:, request_options: {})
27
+ end
28
+
29
+ sig do
30
+ override.returns(
31
+ { document_id: String, request_options: EInvoiceAPI::RequestOptions }
32
+ )
33
+ end
34
+ def to_hash
35
+ end
36
+ end
37
+ end
38
+ end