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
@@ -32,6 +32,11 @@ module EInvoiceAPI
32
32
  sig { returns(T.nilable(String)) }
33
33
  attr_accessor :billing_address_recipient
34
34
 
35
+ # The buyer reference (BT-10), e.g. a cost centre or accounting reference
36
+ # requested by the buyer
37
+ sig { returns(T.nilable(String)) }
38
+ attr_accessor :buyer_reference
39
+
35
40
  sig { returns(T.nilable(T::Array[EInvoiceAPI::DocumentCreate::Charge])) }
36
41
  attr_accessor :charges
37
42
 
@@ -46,7 +51,8 @@ module EInvoiceAPI
46
51
  sig { returns(T.nilable(String)) }
47
52
  attr_accessor :customer_address
48
53
 
49
- # The recipient name at the customer address
54
+ # The recipient name at the customer address. Also the customer contact name
55
+ # (BT-56) in the UBL.
50
56
  sig { returns(T.nilable(String)) }
51
57
  attr_accessor :customer_address_recipient
52
58
 
@@ -71,6 +77,10 @@ module EInvoiceAPI
71
77
  sig { returns(T.nilable(String)) }
72
78
  attr_accessor :customer_peppol_id
73
79
 
80
+ # The telephone number of the customer contact (BT-57)
81
+ sig { returns(T.nilable(String)) }
82
+ attr_accessor :customer_phone
83
+
74
84
  # Customer tax ID. For Belgium this is the VAT number. Must include the country
75
85
  # prefix
76
86
  sig { returns(T.nilable(String)) }
@@ -129,6 +139,15 @@ module EInvoiceAPI
129
139
  sig { returns(T.nilable(String)) }
130
140
  attr_accessor :payment_term
131
141
 
142
+ # The preceding invoice issue date (BT-26)
143
+ sig { returns(T.nilable(Date)) }
144
+ attr_accessor :preceding_invoice_date
145
+
146
+ # The preceding invoice reference (BT-25): the number of the invoice this document
147
+ # corrects, for example the invoice a credit note credits
148
+ sig { returns(T.nilable(String)) }
149
+ attr_accessor :preceding_invoice_id
150
+
132
151
  # The previous unpaid balance from prior invoices, if any. Must be positive and
133
152
  # rounded to maximum 2 decimals
134
153
  sig do
@@ -140,7 +159,7 @@ module EInvoiceAPI
140
159
  end
141
160
  attr_accessor :previous_unpaid_balance
142
161
 
143
- # The purchase order reference number
162
+ # The purchase order reference number (BT-13)
144
163
  sig { returns(T.nilable(String)) }
145
164
  attr_accessor :purchase_order
146
165
 
@@ -152,6 +171,21 @@ module EInvoiceAPI
152
171
  sig { returns(T.nilable(String)) }
153
172
  attr_accessor :remittance_address_recipient
154
173
 
174
+ # The amount added to the invoice total to round the amount for payment (BT-114),
175
+ # for example to whole kronor (amount_due = invoice_total + rounding_amount when
176
+ # nothing is prepaid). Can be negative. Between -5.00 and 5.00, rounded to maximum
177
+ # 2 decimals
178
+ sig do
179
+ returns(
180
+ T.nilable(EInvoiceAPI::DocumentCreate::RoundingAmount::Variants)
181
+ )
182
+ end
183
+ attr_accessor :rounding_amount
184
+
185
+ # The sales order reference (BT-14) assigned by the seller
186
+ sig { returns(T.nilable(String)) }
187
+ attr_accessor :sales_order
188
+
155
189
  # The address where services were performed or goods were delivered
156
190
  sig { returns(T.nilable(String)) }
157
191
  attr_accessor :service_address
@@ -172,7 +206,7 @@ module EInvoiceAPI
172
206
  sig { returns(T.nilable(String)) }
173
207
  attr_accessor :shipping_address
174
208
 
175
- # The recipient name at the shipping address
209
+ # The name of the deliver-to party (BT-70)
176
210
  sig { returns(T.nilable(String)) }
177
211
  attr_accessor :shipping_address_recipient
178
212
 
@@ -201,6 +235,12 @@ module EInvoiceAPI
201
235
  end
202
236
  attr_writer :tax_code
203
237
 
238
+ # The VAT accounting currency (BT-6, ISO 4217 currency code), when VAT is
239
+ # accounted in a currency other than the invoice currency. Must differ from
240
+ # currency and requires total_tax_in_tax_currency
241
+ sig { returns(T.nilable(String)) }
242
+ attr_accessor :tax_currency
243
+
204
244
  sig do
205
245
  returns(T.nilable(T::Array[EInvoiceAPI::DocumentCreate::TaxDetail]))
206
246
  end
@@ -221,13 +261,25 @@ module EInvoiceAPI
221
261
  end
222
262
  attr_accessor :total_tax
223
263
 
264
+ # The total VAT amount in the VAT accounting currency tax_currency (BT-111). Does
265
+ # not add to invoice_total. Requires tax_currency. Rounded to maximum 2 decimals
266
+ sig do
267
+ returns(
268
+ T.nilable(
269
+ EInvoiceAPI::DocumentCreate::TotalTaxInTaxCurrency::Variants
270
+ )
271
+ )
272
+ end
273
+ attr_accessor :total_tax_in_tax_currency
274
+
224
275
  # VATEX code list for VAT exemption reasons
225
276
  #
226
277
  # Agency: CEF Identifier: vatex
227
278
  sig { returns(T.nilable(EInvoiceAPI::DocumentCreate::Vatex::OrSymbol)) }
228
279
  attr_accessor :vatex
229
280
 
230
- # Textual explanation for VAT exemption
281
+ # VAT exemption reason text (BT-120). An exemption reason (vatex or vatex_note) is
282
+ # required for tax_code E, AE, K, G and O, and not allowed for S, Z, L and M
231
283
  sig { returns(T.nilable(String)) }
232
284
  attr_accessor :vatex_note
233
285
 
@@ -235,7 +287,8 @@ module EInvoiceAPI
235
287
  sig { returns(T.nilable(String)) }
236
288
  attr_accessor :vendor_address
237
289
 
238
- # The recipient name at the vendor address
290
+ # The recipient name at the vendor address. Also the vendor contact name (BT-41)
291
+ # in the UBL, required when vendor and customer are both in Germany (DE-R-005).
239
292
  sig { returns(T.nilable(String)) }
240
293
  attr_accessor :vendor_address_recipient
241
294
 
@@ -252,6 +305,12 @@ module EInvoiceAPI
252
305
  sig { returns(T.nilable(String)) }
253
306
  attr_accessor :vendor_name
254
307
 
308
+ # The telephone number of the vendor contact (BT-42). Required when vendor and
309
+ # customer are both in Germany (DE-R-006); it must then hold at least 3 digits
310
+ # (DE-R-027, a warning).
311
+ sig { returns(T.nilable(String)) }
312
+ attr_accessor :vendor_phone
313
+
255
314
  # Vendor tax ID. For Belgium this is the VAT number. Must include the country
256
315
  # prefix
257
316
  sig { returns(T.nilable(String)) }
@@ -267,6 +326,7 @@ module EInvoiceAPI
267
326
  T.nilable(T::Array[EInvoiceAPI::DocumentAttachmentCreate::OrHash]),
268
327
  billing_address: T.nilable(String),
269
328
  billing_address_recipient: T.nilable(String),
329
+ buyer_reference: T.nilable(String),
270
330
  charges:
271
331
  T.nilable(T::Array[EInvoiceAPI::DocumentCreate::Charge::OrHash]),
272
332
  currency: EInvoiceAPI::CurrencyCode::OrSymbol,
@@ -277,6 +337,7 @@ module EInvoiceAPI
277
337
  customer_id: T.nilable(String),
278
338
  customer_name: T.nilable(String),
279
339
  customer_peppol_id: T.nilable(String),
340
+ customer_phone: T.nilable(String),
280
341
  customer_tax_id: T.nilable(String),
281
342
  direction: EInvoiceAPI::DocumentDirection::OrSymbol,
282
343
  document_type: EInvoiceAPI::DocumentType::OrSymbol,
@@ -290,6 +351,8 @@ module EInvoiceAPI
290
351
  payment_details:
291
352
  T.nilable(T::Array[EInvoiceAPI::PaymentDetailCreate::OrHash]),
292
353
  payment_term: T.nilable(String),
354
+ preceding_invoice_date: T.nilable(Date),
355
+ preceding_invoice_id: T.nilable(String),
293
356
  previous_unpaid_balance:
294
357
  T.nilable(
295
358
  EInvoiceAPI::DocumentCreate::PreviousUnpaidBalance::Variants
@@ -297,6 +360,9 @@ module EInvoiceAPI
297
360
  purchase_order: T.nilable(String),
298
361
  remittance_address: T.nilable(String),
299
362
  remittance_address_recipient: T.nilable(String),
363
+ rounding_amount:
364
+ T.nilable(EInvoiceAPI::DocumentCreate::RoundingAmount::Variants),
365
+ sales_order: T.nilable(String),
300
366
  service_address: T.nilable(String),
301
367
  service_address_recipient: T.nilable(String),
302
368
  service_end_date: T.nilable(Date),
@@ -306,11 +372,16 @@ module EInvoiceAPI
306
372
  state: EInvoiceAPI::DocumentState::OrSymbol,
307
373
  subtotal: T.nilable(EInvoiceAPI::DocumentCreate::Subtotal::Variants),
308
374
  tax_code: EInvoiceAPI::DocumentCreate::TaxCode::OrSymbol,
375
+ tax_currency: T.nilable(String),
309
376
  tax_details:
310
377
  T.nilable(T::Array[EInvoiceAPI::DocumentCreate::TaxDetail::OrHash]),
311
378
  total_discount:
312
379
  T.nilable(EInvoiceAPI::DocumentCreate::TotalDiscount::Variants),
313
380
  total_tax: T.nilable(EInvoiceAPI::DocumentCreate::TotalTax::Variants),
381
+ total_tax_in_tax_currency:
382
+ T.nilable(
383
+ EInvoiceAPI::DocumentCreate::TotalTaxInTaxCurrency::Variants
384
+ ),
314
385
  vatex: T.nilable(EInvoiceAPI::DocumentCreate::Vatex::OrSymbol),
315
386
  vatex_note: T.nilable(String),
316
387
  vendor_address: T.nilable(String),
@@ -318,6 +389,7 @@ module EInvoiceAPI
318
389
  vendor_company_id: T.nilable(String),
319
390
  vendor_email: T.nilable(String),
320
391
  vendor_name: T.nilable(String),
392
+ vendor_phone: T.nilable(String),
321
393
  vendor_tax_id: T.nilable(String)
322
394
  ).returns(T.attached_class)
323
395
  end
@@ -330,12 +402,16 @@ module EInvoiceAPI
330
402
  billing_address: nil,
331
403
  # The recipient name at the billing address
332
404
  billing_address_recipient: nil,
405
+ # The buyer reference (BT-10), e.g. a cost centre or accounting reference
406
+ # requested by the buyer
407
+ buyer_reference: nil,
333
408
  charges: nil,
334
409
  # Currency of the invoice (ISO 4217 currency code)
335
410
  currency: nil,
336
411
  # The address of the customer/buyer
337
412
  customer_address: nil,
338
- # The recipient name at the customer address
413
+ # The recipient name at the customer address. Also the customer contact name
414
+ # (BT-56) in the UBL.
339
415
  customer_address_recipient: nil,
340
416
  # Customer company ID. For Belgium this is the CBE number or their EUID (European
341
417
  # Unique Identifier) number. In the Netherlands this is the KVK number.
@@ -348,6 +424,8 @@ module EInvoiceAPI
348
424
  customer_name: nil,
349
425
  # Customer Peppol ID
350
426
  customer_peppol_id: nil,
427
+ # The telephone number of the customer contact (BT-57)
428
+ customer_phone: nil,
351
429
  # Customer tax ID. For Belgium this is the VAT number. Must include the country
352
430
  # prefix
353
431
  customer_tax_id: nil,
@@ -371,15 +449,27 @@ module EInvoiceAPI
371
449
  payment_details: nil,
372
450
  # The payment terms (e.g., 'Net 30', 'Due on receipt', '2/10 Net 30')
373
451
  payment_term: nil,
452
+ # The preceding invoice issue date (BT-26)
453
+ preceding_invoice_date: nil,
454
+ # The preceding invoice reference (BT-25): the number of the invoice this document
455
+ # corrects, for example the invoice a credit note credits
456
+ preceding_invoice_id: nil,
374
457
  # The previous unpaid balance from prior invoices, if any. Must be positive and
375
458
  # rounded to maximum 2 decimals
376
459
  previous_unpaid_balance: nil,
377
- # The purchase order reference number
460
+ # The purchase order reference number (BT-13)
378
461
  purchase_order: nil,
379
462
  # The address where payment should be sent or remitted to
380
463
  remittance_address: nil,
381
464
  # The recipient name at the remittance address
382
465
  remittance_address_recipient: nil,
466
+ # The amount added to the invoice total to round the amount for payment (BT-114),
467
+ # for example to whole kronor (amount_due = invoice_total + rounding_amount when
468
+ # nothing is prepaid). Can be negative. Between -5.00 and 5.00, rounded to maximum
469
+ # 2 decimals
470
+ rounding_amount: nil,
471
+ # The sales order reference (BT-14) assigned by the seller
472
+ sales_order: nil,
383
473
  # The address where services were performed or goods were delivered
384
474
  service_address: nil,
385
475
  # The recipient name at the service address
@@ -390,7 +480,7 @@ module EInvoiceAPI
390
480
  service_start_date: nil,
391
481
  # The shipping/delivery address
392
482
  shipping_address: nil,
393
- # The recipient name at the shipping address
483
+ # The name of the deliver-to party (BT-70)
394
484
  shipping_address_recipient: nil,
395
485
  # The current state of the document: DRAFT, TRANSIT, FAILED, SENT, or RECEIVED
396
486
  state: nil,
@@ -401,6 +491,10 @@ module EInvoiceAPI
401
491
  # Tax category code of the invoice (e.g., S for standard rate, Z for zero rate, E
402
492
  # for exempt)
403
493
  tax_code: nil,
494
+ # The VAT accounting currency (BT-6, ISO 4217 currency code), when VAT is
495
+ # accounted in a currency other than the invoice currency. Must differ from
496
+ # currency and requires total_tax_in_tax_currency
497
+ tax_currency: nil,
404
498
  tax_details: nil,
405
499
  # The net financial discount/charge of the invoice (non-VAT charges minus non-VAT
406
500
  # allowances). Can be positive (net charge), negative (net discount), or zero.
@@ -409,15 +503,20 @@ module EInvoiceAPI
409
503
  # The total tax amount of the invoice. Must be positive and rounded to maximum 2
410
504
  # decimals
411
505
  total_tax: nil,
506
+ # The total VAT amount in the VAT accounting currency tax_currency (BT-111). Does
507
+ # not add to invoice_total. Requires tax_currency. Rounded to maximum 2 decimals
508
+ total_tax_in_tax_currency: nil,
412
509
  # VATEX code list for VAT exemption reasons
413
510
  #
414
511
  # Agency: CEF Identifier: vatex
415
512
  vatex: nil,
416
- # Textual explanation for VAT exemption
513
+ # VAT exemption reason text (BT-120). An exemption reason (vatex or vatex_note) is
514
+ # required for tax_code E, AE, K, G and O, and not allowed for S, Z, L and M
417
515
  vatex_note: nil,
418
516
  # The address of the vendor/seller
419
517
  vendor_address: nil,
420
- # The recipient name at the vendor address
518
+ # The recipient name at the vendor address. Also the vendor contact name (BT-41)
519
+ # in the UBL, required when vendor and customer are both in Germany (DE-R-005).
421
520
  vendor_address_recipient: nil,
422
521
  # Vendor company ID. For Belgium this is the CBE number or their EUID (European
423
522
  # Unique Identifier) number. In the Netherlands this is the KVK number.
@@ -426,6 +525,10 @@ module EInvoiceAPI
426
525
  vendor_email: nil,
427
526
  # The name of the vendor/seller/supplier
428
527
  vendor_name: nil,
528
+ # The telephone number of the vendor contact (BT-42). Required when vendor and
529
+ # customer are both in Germany (DE-R-006); it must then hold at least 3 digits
530
+ # (DE-R-027, a warning).
531
+ vendor_phone: nil,
429
532
  # Vendor tax ID. For Belgium this is the VAT number. Must include the country
430
533
  # prefix
431
534
  vendor_tax_id: nil
@@ -443,6 +546,7 @@ module EInvoiceAPI
443
546
  T.nilable(T::Array[EInvoiceAPI::DocumentAttachmentCreate]),
444
547
  billing_address: T.nilable(String),
445
548
  billing_address_recipient: T.nilable(String),
549
+ buyer_reference: T.nilable(String),
446
550
  charges: T.nilable(T::Array[EInvoiceAPI::DocumentCreate::Charge]),
447
551
  currency: EInvoiceAPI::CurrencyCode::OrSymbol,
448
552
  customer_address: T.nilable(String),
@@ -452,6 +556,7 @@ module EInvoiceAPI
452
556
  customer_id: T.nilable(String),
453
557
  customer_name: T.nilable(String),
454
558
  customer_peppol_id: T.nilable(String),
559
+ customer_phone: T.nilable(String),
455
560
  customer_tax_id: T.nilable(String),
456
561
  direction: EInvoiceAPI::DocumentDirection::OrSymbol,
457
562
  document_type: EInvoiceAPI::DocumentType::OrSymbol,
@@ -465,6 +570,8 @@ module EInvoiceAPI
465
570
  payment_details:
466
571
  T.nilable(T::Array[EInvoiceAPI::PaymentDetailCreate]),
467
572
  payment_term: T.nilable(String),
573
+ preceding_invoice_date: T.nilable(Date),
574
+ preceding_invoice_id: T.nilable(String),
468
575
  previous_unpaid_balance:
469
576
  T.nilable(
470
577
  EInvoiceAPI::DocumentCreate::PreviousUnpaidBalance::Variants
@@ -472,6 +579,9 @@ module EInvoiceAPI
472
579
  purchase_order: T.nilable(String),
473
580
  remittance_address: T.nilable(String),
474
581
  remittance_address_recipient: T.nilable(String),
582
+ rounding_amount:
583
+ T.nilable(EInvoiceAPI::DocumentCreate::RoundingAmount::Variants),
584
+ sales_order: T.nilable(String),
475
585
  service_address: T.nilable(String),
476
586
  service_address_recipient: T.nilable(String),
477
587
  service_end_date: T.nilable(Date),
@@ -482,12 +592,17 @@ module EInvoiceAPI
482
592
  subtotal:
483
593
  T.nilable(EInvoiceAPI::DocumentCreate::Subtotal::Variants),
484
594
  tax_code: EInvoiceAPI::DocumentCreate::TaxCode::OrSymbol,
595
+ tax_currency: T.nilable(String),
485
596
  tax_details:
486
597
  T.nilable(T::Array[EInvoiceAPI::DocumentCreate::TaxDetail]),
487
598
  total_discount:
488
599
  T.nilable(EInvoiceAPI::DocumentCreate::TotalDiscount::Variants),
489
600
  total_tax:
490
601
  T.nilable(EInvoiceAPI::DocumentCreate::TotalTax::Variants),
602
+ total_tax_in_tax_currency:
603
+ T.nilable(
604
+ EInvoiceAPI::DocumentCreate::TotalTaxInTaxCurrency::Variants
605
+ ),
491
606
  vatex: T.nilable(EInvoiceAPI::DocumentCreate::Vatex::OrSymbol),
492
607
  vatex_note: T.nilable(String),
493
608
  vendor_address: T.nilable(String),
@@ -495,6 +610,7 @@ module EInvoiceAPI
495
610
  vendor_company_id: T.nilable(String),
496
611
  vendor_email: T.nilable(String),
497
612
  vendor_name: T.nilable(String),
613
+ vendor_phone: T.nilable(String),
498
614
  vendor_tax_id: T.nilable(String)
499
615
  }
500
616
  )
@@ -2188,10 +2304,14 @@ module EInvoiceAPI
2188
2304
  end
2189
2305
  attr_accessor :charges
2190
2306
 
2191
- sig { returns(NilClass) }
2307
+ sig { returns(T.nilable(Date)) }
2192
2308
  attr_accessor :date
2193
2309
 
2194
- # The description of the line item.
2310
+ # The description of the line item (BT-154). Doubles as the item name when `name`
2311
+ # is omitted, so a posted line item needs a `name` or a `description`. On a
2312
+ # received document it holds the item description, or the item name (BT-153) when
2313
+ # the document has no item description; CII documents with both combine them as
2314
+ # `name: description`.
2195
2315
  sig { returns(T.nilable(String)) }
2196
2316
  attr_accessor :description
2197
2317
 
@@ -2205,6 +2325,33 @@ module EInvoiceAPI
2205
2325
  end
2206
2326
  attr_accessor :item_attributes
2207
2327
 
2328
+ # The item name (BT-153), for example the product name. Written to
2329
+ # cac:Item/cbc:Name. When omitted or blank, `description` (BT-154) is used as the
2330
+ # item name. A posted line item needs a `name` or a `description`; a line item
2331
+ # with neither is rejected with 422.
2332
+ sig { returns(T.nilable(String)) }
2333
+ attr_accessor :name
2334
+
2335
+ # The item price base quantity (BT-149). The number of item units to which the
2336
+ # unit price applies, for example 100 when the unit price is a price for each 100
2337
+ # units. Must be greater than 0. Defaults to 1.
2338
+ sig do
2339
+ returns(
2340
+ T.nilable(
2341
+ EInvoiceAPI::DocumentCreate::Item::PriceBaseQuantity::Variants
2342
+ )
2343
+ )
2344
+ end
2345
+ attr_reader :price_base_quantity
2346
+
2347
+ sig do
2348
+ params(
2349
+ price_base_quantity:
2350
+ EInvoiceAPI::DocumentCreate::Item::PriceBaseQuantity::Variants
2351
+ ).void
2352
+ end
2353
+ attr_writer :price_base_quantity
2354
+
2208
2355
  # The product code of the line item.
2209
2356
  sig { returns(T.nilable(String)) }
2210
2357
  attr_accessor :product_code
@@ -2259,7 +2406,7 @@ module EInvoiceAPI
2259
2406
  T.nilable(
2260
2407
  T::Array[EInvoiceAPI::DocumentCreate::Item::Charge::OrHash]
2261
2408
  ),
2262
- date: NilClass,
2409
+ date: T.nilable(Date),
2263
2410
  description: T.nilable(String),
2264
2411
  item_attributes:
2265
2412
  T.nilable(
@@ -2267,6 +2414,9 @@ module EInvoiceAPI
2267
2414
  EInvoiceAPI::DocumentCreate::Item::ItemAttribute::OrHash
2268
2415
  ]
2269
2416
  ),
2417
+ name: T.nilable(String),
2418
+ price_base_quantity:
2419
+ EInvoiceAPI::DocumentCreate::Item::PriceBaseQuantity::Variants,
2270
2420
  product_code: T.nilable(String),
2271
2421
  quantity:
2272
2422
  T.nilable(EInvoiceAPI::DocumentCreate::Item::Quantity::Variants),
@@ -2289,10 +2439,23 @@ module EInvoiceAPI
2289
2439
  # The charges of the line item.
2290
2440
  charges: nil,
2291
2441
  date: nil,
2292
- # The description of the line item.
2442
+ # The description of the line item (BT-154). Doubles as the item name when `name`
2443
+ # is omitted, so a posted line item needs a `name` or a `description`. On a
2444
+ # received document it holds the item description, or the item name (BT-153) when
2445
+ # the document has no item description; CII documents with both combine them as
2446
+ # `name: description`.
2293
2447
  description: nil,
2294
2448
  # Item-level attributes (BG-32) from cac:AdditionalItemProperty.
2295
2449
  item_attributes: nil,
2450
+ # The item name (BT-153), for example the product name. Written to
2451
+ # cac:Item/cbc:Name. When omitted or blank, `description` (BT-154) is used as the
2452
+ # item name. A posted line item needs a `name` or a `description`; a line item
2453
+ # with neither is rejected with 422.
2454
+ name: nil,
2455
+ # The item price base quantity (BT-149). The number of item units to which the
2456
+ # unit price applies, for example 100 when the unit price is a price for each 100
2457
+ # units. Must be greater than 0. Defaults to 1.
2458
+ price_base_quantity: nil,
2296
2459
  # The product code of the line item.
2297
2460
  product_code: nil,
2298
2461
  # The quantity of items (goods or services) that is the subject of the line item.
@@ -2323,12 +2486,15 @@ module EInvoiceAPI
2323
2486
  T.nilable(EInvoiceAPI::DocumentCreate::Item::Amount::Variants),
2324
2487
  charges:
2325
2488
  T.nilable(T::Array[EInvoiceAPI::DocumentCreate::Item::Charge]),
2326
- date: NilClass,
2489
+ date: T.nilable(Date),
2327
2490
  description: T.nilable(String),
2328
2491
  item_attributes:
2329
2492
  T.nilable(
2330
2493
  T::Array[EInvoiceAPI::DocumentCreate::Item::ItemAttribute]
2331
2494
  ),
2495
+ name: T.nilable(String),
2496
+ price_base_quantity:
2497
+ EInvoiceAPI::DocumentCreate::Item::PriceBaseQuantity::Variants,
2332
2498
  product_code: T.nilable(String),
2333
2499
  quantity:
2334
2500
  T.nilable(
@@ -4064,6 +4230,25 @@ module EInvoiceAPI
4064
4230
  end
4065
4231
  end
4066
4232
 
4233
+ # The item price base quantity (BT-149). The number of item units to which the
4234
+ # unit price applies, for example 100 when the unit price is a price for each 100
4235
+ # units. Must be greater than 0. Defaults to 1.
4236
+ module PriceBaseQuantity
4237
+ extend EInvoiceAPI::Internal::Type::Union
4238
+
4239
+ Variants = T.type_alias { T.any(Float, String) }
4240
+
4241
+ sig do
4242
+ override.returns(
4243
+ T::Array[
4244
+ EInvoiceAPI::DocumentCreate::Item::PriceBaseQuantity::Variants
4245
+ ]
4246
+ )
4247
+ end
4248
+ def self.variants
4249
+ end
4250
+ end
4251
+
4067
4252
  # The quantity of items (goods or services) that is the subject of the line item.
4068
4253
  # Must be rounded to maximum 4 decimals. Can be negative for credit notes or
4069
4254
  # corrections.
@@ -4147,6 +4332,24 @@ module EInvoiceAPI
4147
4332
  end
4148
4333
  end
4149
4334
 
4335
+ # The amount added to the invoice total to round the amount for payment (BT-114),
4336
+ # for example to whole kronor (amount_due = invoice_total + rounding_amount when
4337
+ # nothing is prepaid). Can be negative. Between -5.00 and 5.00, rounded to maximum
4338
+ # 2 decimals
4339
+ module RoundingAmount
4340
+ extend EInvoiceAPI::Internal::Type::Union
4341
+
4342
+ Variants = T.type_alias { T.any(Float, String) }
4343
+
4344
+ sig do
4345
+ override.returns(
4346
+ T::Array[EInvoiceAPI::DocumentCreate::RoundingAmount::Variants]
4347
+ )
4348
+ end
4349
+ def self.variants
4350
+ end
4351
+ end
4352
+
4150
4353
  # The taxable base of the invoice. Should be the sum of all line items -
4151
4354
  # allowances (for example commercial discounts) + charges with impact on VAT. Must
4152
4355
  # be positive and rounded to maximum 2 decimals
@@ -4294,6 +4497,24 @@ module EInvoiceAPI
4294
4497
  end
4295
4498
  end
4296
4499
 
4500
+ # The total VAT amount in the VAT accounting currency tax_currency (BT-111). Does
4501
+ # not add to invoice_total. Requires tax_currency. Rounded to maximum 2 decimals
4502
+ module TotalTaxInTaxCurrency
4503
+ extend EInvoiceAPI::Internal::Type::Union
4504
+
4505
+ Variants = T.type_alias { T.any(Float, String) }
4506
+
4507
+ sig do
4508
+ override.returns(
4509
+ T::Array[
4510
+ EInvoiceAPI::DocumentCreate::TotalTaxInTaxCurrency::Variants
4511
+ ]
4512
+ )
4513
+ end
4514
+ def self.variants
4515
+ end
4516
+ end
4517
+
4297
4518
  # VATEX code list for VAT exemption reasons
4298
4519
  #
4299
4520
  # Agency: CEF Identifier: vatex
@@ -4399,6 +4620,11 @@ module EInvoiceAPI
4399
4620
  :"VATEX-EU-132-1Q",
4400
4621
  EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4401
4622
  )
4623
+ VATEX_EU_135_1 =
4624
+ T.let(
4625
+ :"VATEX-EU-135-1",
4626
+ EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4627
+ )
4402
4628
  VATEX_EU_143 =
4403
4629
  T.let(
4404
4630
  :"VATEX-EU-143",
@@ -4554,6 +4780,11 @@ module EInvoiceAPI
4554
4780
  :"VATEX-EU-151-1E",
4555
4781
  EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4556
4782
  )
4783
+ VATEX_EU_153 =
4784
+ T.let(
4785
+ :"VATEX-EU-153",
4786
+ EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4787
+ )
4557
4788
  VATEX_EU_159 =
4558
4789
  T.let(
4559
4790
  :"VATEX-EU-159",
@@ -4586,6 +4817,126 @@ module EInvoiceAPI
4586
4817
  T.let(:"VATEX-EU-O", EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol)
4587
4818
  VATEX_EU_J =
4588
4819
  T.let(:"VATEX-EU-J", EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol)
4820
+ VATEX_FR_298_SEXDECIESA =
4821
+ T.let(
4822
+ :"VATEX-FR-298SEXDECIESA",
4823
+ EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4824
+ )
4825
+ VATEX_FR_AE =
4826
+ T.let(
4827
+ :"VATEX-FR-AE",
4828
+ EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4829
+ )
4830
+ VATEX_FR_CGI261_1 =
4831
+ T.let(
4832
+ :"VATEX-FR-CGI261-1",
4833
+ EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4834
+ )
4835
+ VATEX_FR_CGI261_2 =
4836
+ T.let(
4837
+ :"VATEX-FR-CGI261-2",
4838
+ EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4839
+ )
4840
+ VATEX_FR_CGI261_3 =
4841
+ T.let(
4842
+ :"VATEX-FR-CGI261-3",
4843
+ EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4844
+ )
4845
+ VATEX_FR_CGI261_4 =
4846
+ T.let(
4847
+ :"VATEX-FR-CGI261-4",
4848
+ EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4849
+ )
4850
+ VATEX_FR_CGI261_5 =
4851
+ T.let(
4852
+ :"VATEX-FR-CGI261-5",
4853
+ EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4854
+ )
4855
+ VATEX_FR_CGI261_7 =
4856
+ T.let(
4857
+ :"VATEX-FR-CGI261-7",
4858
+ EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4859
+ )
4860
+ VATEX_FR_CGI261_8 =
4861
+ T.let(
4862
+ :"VATEX-FR-CGI261-8",
4863
+ EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4864
+ )
4865
+ VATEX_FR_CGI261A =
4866
+ T.let(
4867
+ :"VATEX-FR-CGI261A",
4868
+ EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4869
+ )
4870
+ VATEX_FR_CGI261B =
4871
+ T.let(
4872
+ :"VATEX-FR-CGI261B",
4873
+ EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4874
+ )
4875
+ VATEX_FR_CGI261C_1 =
4876
+ T.let(
4877
+ :"VATEX-FR-CGI261C-1",
4878
+ EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4879
+ )
4880
+ VATEX_FR_CGI261C_2 =
4881
+ T.let(
4882
+ :"VATEX-FR-CGI261C-2",
4883
+ EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4884
+ )
4885
+ VATEX_FR_CGI261C_3 =
4886
+ T.let(
4887
+ :"VATEX-FR-CGI261C-3",
4888
+ EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4889
+ )
4890
+ VATEX_FR_CGI261D_1 =
4891
+ T.let(
4892
+ :"VATEX-FR-CGI261D-1",
4893
+ EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4894
+ )
4895
+ VATEX_FR_CGI261D_1_BIS =
4896
+ T.let(
4897
+ :"VATEX-FR-CGI261D-1BIS",
4898
+ EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4899
+ )
4900
+ VATEX_FR_CGI261D_2 =
4901
+ T.let(
4902
+ :"VATEX-FR-CGI261D-2",
4903
+ EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4904
+ )
4905
+ VATEX_FR_CGI261D_3 =
4906
+ T.let(
4907
+ :"VATEX-FR-CGI261D-3",
4908
+ EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4909
+ )
4910
+ VATEX_FR_CGI261D_4 =
4911
+ T.let(
4912
+ :"VATEX-FR-CGI261D-4",
4913
+ EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4914
+ )
4915
+ VATEX_FR_CGI261E_1 =
4916
+ T.let(
4917
+ :"VATEX-FR-CGI261E-1",
4918
+ EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4919
+ )
4920
+ VATEX_FR_CGI261E_2 =
4921
+ T.let(
4922
+ :"VATEX-FR-CGI261E-2",
4923
+ EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4924
+ )
4925
+ VATEX_FR_CGI275 =
4926
+ T.let(
4927
+ :"VATEX-FR-CGI275",
4928
+ EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4929
+ )
4930
+ VATEX_FR_CGI277A =
4931
+ T.let(
4932
+ :"VATEX-FR-CGI277A",
4933
+ EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4934
+ )
4935
+ VATEX_FR_CGI295 =
4936
+ T.let(
4937
+ :"VATEX-FR-CGI295",
4938
+ EInvoiceAPI::DocumentCreate::Vatex::TaggedSymbol
4939
+ )
4589
4940
  VATEX_FR_FRANCHISE =
4590
4941
  T.let(
4591
4942
  :"VATEX-FR-FRANCHISE",