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
@@ -34,6 +34,13 @@ module EInvoiceAPI
34
34
  # @return [String, nil]
35
35
  optional :billing_address_recipient, String, nil?: true
36
36
 
37
+ # @!attribute buyer_reference
38
+ # The buyer reference (BT-10), e.g. a cost centre or accounting reference
39
+ # requested by the buyer
40
+ #
41
+ # @return [String, nil]
42
+ optional :buyer_reference, String, nil?: true
43
+
37
44
  # @!attribute charges
38
45
  #
39
46
  # @return [Array<EInvoiceAPI::Models::Charge>, nil]
@@ -52,7 +59,8 @@ module EInvoiceAPI
52
59
  optional :customer_address, String, nil?: true
53
60
 
54
61
  # @!attribute customer_address_recipient
55
- # The recipient name at the customer address
62
+ # The recipient name at the customer address. Also the customer contact name
63
+ # (BT-56) in the UBL.
56
64
  #
57
65
  # @return [String, nil]
58
66
  optional :customer_address_recipient, String, nil?: true
@@ -88,6 +96,12 @@ module EInvoiceAPI
88
96
  # @return [String, nil]
89
97
  optional :customer_peppol_id, String, nil?: true
90
98
 
99
+ # @!attribute customer_phone
100
+ # The telephone number of the customer contact (BT-57)
101
+ #
102
+ # @return [String, nil]
103
+ optional :customer_phone, String, nil?: true
104
+
91
105
  # @!attribute customer_tax_id
92
106
  # Customer tax ID. For Belgium this is the VAT number. Must include the country
93
107
  # prefix
@@ -170,8 +184,21 @@ module EInvoiceAPI
170
184
  # @return [String, nil]
171
185
  optional :payment_term, String, nil?: true
172
186
 
187
+ # @!attribute preceding_invoice_date
188
+ # The preceding invoice issue date (BT-26)
189
+ #
190
+ # @return [Date, nil]
191
+ optional :preceding_invoice_date, Date, nil?: true
192
+
193
+ # @!attribute preceding_invoice_id
194
+ # The preceding invoice reference (BT-25): the number of the invoice this document
195
+ # corrects, for example the invoice a credit note credits
196
+ #
197
+ # @return [String, nil]
198
+ optional :preceding_invoice_id, String, nil?: true
199
+
173
200
  # @!attribute purchase_order
174
- # The purchase order reference number
201
+ # The purchase order reference number (BT-13)
175
202
  #
176
203
  # @return [String, nil]
177
204
  optional :purchase_order, String, nil?: true
@@ -188,6 +215,21 @@ module EInvoiceAPI
188
215
  # @return [String, nil]
189
216
  optional :remittance_address_recipient, String, nil?: true
190
217
 
218
+ # @!attribute rounding_amount
219
+ # The amount added to the invoice total to round the amount for payment (BT-114),
220
+ # for example to whole kronor (amount_due = invoice_total + rounding_amount when
221
+ # nothing is prepaid). Can be negative. Between -5.00 and 5.00, rounded to maximum
222
+ # 2 decimals
223
+ #
224
+ # @return [String, nil]
225
+ optional :rounding_amount, String, nil?: true
226
+
227
+ # @!attribute sales_order
228
+ # The sales order reference (BT-14) assigned by the seller
229
+ #
230
+ # @return [String, nil]
231
+ optional :sales_order, String, nil?: true
232
+
191
233
  # @!attribute service_address
192
234
  # The address where services were performed or goods were delivered
193
235
  #
@@ -219,7 +261,7 @@ module EInvoiceAPI
219
261
  optional :shipping_address, String, nil?: true
220
262
 
221
263
  # @!attribute shipping_address_recipient
222
- # The recipient name at the shipping address
264
+ # The name of the deliver-to party (BT-70)
223
265
  #
224
266
  # @return [String, nil]
225
267
  optional :shipping_address_recipient, String, nil?: true
@@ -251,6 +293,14 @@ module EInvoiceAPI
251
293
  # @return [Symbol, EInvoiceAPI::Models::DocumentCreateFromPdfResponse::TaxCode, nil]
252
294
  optional :tax_code, enum: -> { EInvoiceAPI::Models::DocumentCreateFromPdfResponse::TaxCode }
253
295
 
296
+ # @!attribute tax_currency
297
+ # The VAT accounting currency (BT-6, ISO 4217 currency code), when VAT is
298
+ # accounted in a currency other than the invoice currency. Must differ from
299
+ # currency and requires total_tax_in_tax_currency
300
+ #
301
+ # @return [String, nil]
302
+ optional :tax_currency, String, nil?: true
303
+
254
304
  # @!attribute tax_details
255
305
  #
256
306
  # @return [Array<EInvoiceAPI::Models::DocumentCreateFromPdfResponse::TaxDetail>, nil]
@@ -273,6 +323,13 @@ module EInvoiceAPI
273
323
  # @return [String, nil]
274
324
  optional :total_tax, String, nil?: true
275
325
 
326
+ # @!attribute total_tax_in_tax_currency
327
+ # The total VAT amount in the VAT accounting currency tax_currency (BT-111). Does
328
+ # not add to invoice_total. Requires tax_currency. Rounded to maximum 2 decimals
329
+ #
330
+ # @return [String, nil]
331
+ optional :total_tax_in_tax_currency, String, nil?: true
332
+
276
333
  # @!attribute ubl_document
277
334
  # The UBL document as an XML string
278
335
  #
@@ -288,7 +345,8 @@ module EInvoiceAPI
288
345
  optional :vatex, enum: -> { EInvoiceAPI::Models::DocumentCreateFromPdfResponse::Vatex }, nil?: true
289
346
 
290
347
  # @!attribute vatex_note
291
- # Textual explanation for VAT exemption
348
+ # VAT exemption reason text (BT-120). An exemption reason (vatex or vatex_note) is
349
+ # required for tax_code E, AE, K, G and O, and not allowed for S, Z, L and M
292
350
  #
293
351
  # @return [String, nil]
294
352
  optional :vatex_note, String, nil?: true
@@ -300,7 +358,8 @@ module EInvoiceAPI
300
358
  optional :vendor_address, String, nil?: true
301
359
 
302
360
  # @!attribute vendor_address_recipient
303
- # The recipient name at the vendor address
361
+ # The recipient name at the vendor address. Also the vendor contact name (BT-41)
362
+ # in the UBL, required when vendor and customer are both in Germany (DE-R-005).
304
363
  #
305
364
  # @return [String, nil]
306
365
  optional :vendor_address_recipient, String, nil?: true
@@ -324,6 +383,14 @@ module EInvoiceAPI
324
383
  # @return [String, nil]
325
384
  optional :vendor_name, String, nil?: true
326
385
 
386
+ # @!attribute vendor_phone
387
+ # The telephone number of the vendor contact (BT-42). Required when vendor and
388
+ # customer are both in Germany (DE-R-006); it must then hold at least 3 digits
389
+ # (DE-R-027, a warning).
390
+ #
391
+ # @return [String, nil]
392
+ optional :vendor_phone, String, nil?: true
393
+
327
394
  # @!attribute vendor_tax_id
328
395
  # Vendor tax ID. For Belgium this is the VAT number. Must include the country
329
396
  # prefix
@@ -331,7 +398,7 @@ module EInvoiceAPI
331
398
  # @return [String, nil]
332
399
  optional :vendor_tax_id, String, nil?: true
333
400
 
334
- # @!method initialize(allowances: nil, amount_due: nil, attachments: nil, billing_address: nil, billing_address_recipient: nil, charges: nil, currency: nil, customer_address: nil, customer_address_recipient: nil, customer_company_id: nil, customer_email: nil, customer_id: nil, customer_name: nil, customer_peppol_id: nil, customer_tax_id: nil, direction: nil, document_type: nil, due_date: nil, error_message: nil, error_type: nil, invoice_date: nil, invoice_id: nil, invoice_total: nil, items: nil, note: nil, payment_details: nil, payment_term: nil, purchase_order: nil, remittance_address: nil, remittance_address_recipient: nil, service_address: nil, service_address_recipient: nil, service_end_date: nil, service_start_date: nil, shipping_address: nil, shipping_address_recipient: nil, state: nil, subtotal: nil, success: nil, tax_code: nil, tax_details: nil, total_discount: nil, total_tax: nil, ubl_document: nil, vatex: nil, vatex_note: nil, vendor_address: nil, vendor_address_recipient: nil, vendor_company_id: nil, vendor_email: nil, vendor_name: nil, vendor_tax_id: nil)
401
+ # @!method initialize(allowances: nil, amount_due: nil, attachments: nil, billing_address: nil, billing_address_recipient: nil, buyer_reference: nil, charges: nil, currency: nil, customer_address: nil, customer_address_recipient: nil, customer_company_id: nil, customer_email: nil, customer_id: nil, customer_name: nil, customer_peppol_id: nil, customer_phone: nil, customer_tax_id: nil, direction: nil, document_type: nil, due_date: nil, error_message: nil, error_type: nil, invoice_date: nil, invoice_id: nil, invoice_total: nil, items: nil, note: nil, payment_details: nil, payment_term: nil, preceding_invoice_date: nil, preceding_invoice_id: nil, purchase_order: nil, remittance_address: nil, remittance_address_recipient: nil, rounding_amount: nil, sales_order: nil, service_address: nil, service_address_recipient: nil, service_end_date: nil, service_start_date: nil, shipping_address: nil, shipping_address_recipient: nil, state: nil, subtotal: nil, success: nil, tax_code: nil, tax_currency: nil, tax_details: nil, total_discount: nil, total_tax: nil, total_tax_in_tax_currency: nil, ubl_document: nil, vatex: nil, vatex_note: nil, vendor_address: nil, vendor_address_recipient: nil, vendor_company_id: nil, vendor_email: nil, vendor_name: nil, vendor_phone: nil, vendor_tax_id: nil)
335
402
  # Some parameter documentations has been truncated, see
336
403
  # {EInvoiceAPI::Models::DocumentCreateFromPdfResponse} for more details.
337
404
  #
@@ -345,13 +412,15 @@ module EInvoiceAPI
345
412
  #
346
413
  # @param billing_address_recipient [String, nil] The recipient name at the billing address
347
414
  #
415
+ # @param buyer_reference [String, nil] The buyer reference (BT-10), e.g. a cost centre or accounting reference requeste
416
+ #
348
417
  # @param charges [Array<EInvoiceAPI::Models::Charge>, nil]
349
418
  #
350
419
  # @param currency [Symbol, EInvoiceAPI::Models::CurrencyCode] Currency of the invoice (ISO 4217 currency code)
351
420
  #
352
421
  # @param customer_address [String, nil] The address of the customer/buyer
353
422
  #
354
- # @param customer_address_recipient [String, nil] The recipient name at the customer address
423
+ # @param customer_address_recipient [String, nil] The recipient name at the customer address. Also the customer contact name (BT-5
355
424
  #
356
425
  # @param customer_company_id [String, nil] Customer company ID. For Belgium this is the CBE number or their EUID (European
357
426
  #
@@ -363,6 +432,8 @@ module EInvoiceAPI
363
432
  #
364
433
  # @param customer_peppol_id [String, nil] Customer Peppol ID
365
434
  #
435
+ # @param customer_phone [String, nil] The telephone number of the customer contact (BT-57)
436
+ #
366
437
  # @param customer_tax_id [String, nil] Customer tax ID. For Belgium this is the VAT number. Must include the country pr
367
438
  #
368
439
  # @param direction [Symbol, EInvoiceAPI::Models::DocumentDirection] The direction of the document: INBOUND (purchases) or OUTBOUND (sales)
@@ -389,12 +460,20 @@ module EInvoiceAPI
389
460
  #
390
461
  # @param payment_term [String, nil] The payment terms (e.g., 'Net 30', 'Due on receipt', '2/10 Net 30')
391
462
  #
392
- # @param purchase_order [String, nil] The purchase order reference number
463
+ # @param preceding_invoice_date [Date, nil] The preceding invoice issue date (BT-26)
464
+ #
465
+ # @param preceding_invoice_id [String, nil] The preceding invoice reference (BT-25): the number of the invoice this document
466
+ #
467
+ # @param purchase_order [String, nil] The purchase order reference number (BT-13)
393
468
  #
394
469
  # @param remittance_address [String, nil] The address where payment should be sent or remitted to
395
470
  #
396
471
  # @param remittance_address_recipient [String, nil] The recipient name at the remittance address
397
472
  #
473
+ # @param rounding_amount [String, nil] The amount added to the invoice total to round the amount for payment (BT-114),
474
+ #
475
+ # @param sales_order [String, nil] The sales order reference (BT-14) assigned by the seller
476
+ #
398
477
  # @param service_address [String, nil] The address where services were performed or goods were delivered
399
478
  #
400
479
  # @param service_address_recipient [String, nil] The recipient name at the service address
@@ -405,7 +484,7 @@ module EInvoiceAPI
405
484
  #
406
485
  # @param shipping_address [String, nil] The shipping/delivery address
407
486
  #
408
- # @param shipping_address_recipient [String, nil] The recipient name at the shipping address
487
+ # @param shipping_address_recipient [String, nil] The name of the deliver-to party (BT-70)
409
488
  #
410
489
  # @param state [Symbol, EInvoiceAPI::Models::DocumentState] The current state of the document: DRAFT, TRANSIT, FAILED, SENT, or RECEIVED
411
490
  #
@@ -415,21 +494,25 @@ module EInvoiceAPI
415
494
  #
416
495
  # @param tax_code [Symbol, EInvoiceAPI::Models::DocumentCreateFromPdfResponse::TaxCode] Tax category code of the invoice (e.g., S for standard rate, Z for zero rate, E
417
496
  #
497
+ # @param tax_currency [String, nil] The VAT accounting currency (BT-6, ISO 4217 currency code), when VAT is accounte
498
+ #
418
499
  # @param tax_details [Array<EInvoiceAPI::Models::DocumentCreateFromPdfResponse::TaxDetail>, nil]
419
500
  #
420
501
  # @param total_discount [String, nil] The net financial discount/charge of the invoice (non-VAT charges minus non-VAT
421
502
  #
422
503
  # @param total_tax [String, nil] The total tax amount of the invoice. Must be positive and rounded to maximum 2 d
423
504
  #
505
+ # @param total_tax_in_tax_currency [String, nil] The total VAT amount in the VAT accounting currency tax_currency (BT-111). Does
506
+ #
424
507
  # @param ubl_document [String, nil] The UBL document as an XML string
425
508
  #
426
509
  # @param vatex [Symbol, EInvoiceAPI::Models::DocumentCreateFromPdfResponse::Vatex, nil] VATEX code list for VAT exemption reasons
427
510
  #
428
- # @param vatex_note [String, nil] Textual explanation for VAT exemption
511
+ # @param vatex_note [String, nil] VAT exemption reason text (BT-120). An exemption reason (vatex or vatex_note) is
429
512
  #
430
513
  # @param vendor_address [String, nil] The address of the vendor/seller
431
514
  #
432
- # @param vendor_address_recipient [String, nil] The recipient name at the vendor address
515
+ # @param vendor_address_recipient [String, nil] The recipient name at the vendor address. Also the vendor contact name (BT-41) i
433
516
  #
434
517
  # @param vendor_company_id [String, nil] Vendor company ID. For Belgium this is the CBE number or their EUID (European Un
435
518
  #
@@ -437,6 +520,8 @@ module EInvoiceAPI
437
520
  #
438
521
  # @param vendor_name [String, nil] The name of the vendor/seller/supplier
439
522
  #
523
+ # @param vendor_phone [String, nil] The telephone number of the vendor contact (BT-42). Required when vendor and cus
524
+ #
440
525
  # @param vendor_tax_id [String, nil] Vendor tax ID. For Belgium this is the VAT number. Must include the country pref
441
526
 
442
527
  class Item < EInvoiceAPI::Internal::Type::BaseModel
@@ -463,11 +548,15 @@ module EInvoiceAPI
463
548
 
464
549
  # @!attribute date
465
550
  #
466
- # @return [nil]
467
- optional :date, NilClass
551
+ # @return [Date, nil]
552
+ optional :date, Date, nil?: true
468
553
 
469
554
  # @!attribute description
470
- # The description of the line item.
555
+ # The description of the line item (BT-154). Doubles as the item name when `name`
556
+ # is omitted, so a posted line item needs a `name` or a `description`. On a
557
+ # received document it holds the item description, or the item name (BT-153) when
558
+ # the document has no item description; CII documents with both combine them as
559
+ # `name: description`.
471
560
  #
472
561
  # @return [String, nil]
473
562
  optional :description, String, nil?: true
@@ -480,6 +569,23 @@ module EInvoiceAPI
480
569
  -> { EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::Models::DocumentCreateFromPdfResponse::Item::ItemAttribute] },
481
570
  nil?: true
482
571
 
572
+ # @!attribute name
573
+ # The item name (BT-153), for example the product name. Written to
574
+ # cac:Item/cbc:Name. When omitted or blank, `description` (BT-154) is used as the
575
+ # item name. A posted line item needs a `name` or a `description`; a line item
576
+ # with neither is rejected with 422.
577
+ #
578
+ # @return [String, nil]
579
+ optional :name, String, nil?: true
580
+
581
+ # @!attribute price_base_quantity
582
+ # The item price base quantity (BT-149). The number of item units to which the
583
+ # unit price applies, for example 100 when the unit price is a price for each 100
584
+ # units. Must be greater than 0. Defaults to 1.
585
+ #
586
+ # @return [String, nil]
587
+ optional :price_base_quantity, String
588
+
483
589
  # @!attribute product_code
484
590
  # The product code of the line item.
485
591
  #
@@ -520,7 +626,7 @@ module EInvoiceAPI
520
626
  # @return [String, nil]
521
627
  optional :unit_price, String, nil?: true
522
628
 
523
- # @!method initialize(allowances: nil, amount: nil, charges: nil, date: nil, description: nil, item_attributes: nil, product_code: nil, quantity: nil, tax: nil, tax_rate: nil, unit: nil, unit_price: nil)
629
+ # @!method initialize(allowances: nil, amount: nil, charges: nil, date: nil, description: nil, item_attributes: nil, name: nil, price_base_quantity: nil, product_code: nil, quantity: nil, tax: nil, tax_rate: nil, unit: nil, unit_price: nil)
524
630
  # Some parameter documentations has been truncated, see
525
631
  # {EInvoiceAPI::Models::DocumentCreateFromPdfResponse::Item} for more details.
526
632
  #
@@ -530,12 +636,16 @@ module EInvoiceAPI
530
636
  #
531
637
  # @param charges [Array<EInvoiceAPI::Models::Charge>, nil] The charges of the line item.
532
638
  #
533
- # @param date [nil]
639
+ # @param date [Date, nil]
534
640
  #
535
- # @param description [String, nil] The description of the line item.
641
+ # @param description [String, nil] The description of the line item (BT-154). Doubles as the item name when `name`
536
642
  #
537
643
  # @param item_attributes [Array<EInvoiceAPI::Models::DocumentCreateFromPdfResponse::Item::ItemAttribute>, nil] Item-level attributes (BG-32) from cac:AdditionalItemProperty.
538
644
  #
645
+ # @param name [String, nil] The item name (BT-153), for example the product name. Written to cac:Item/cbc:Na
646
+ #
647
+ # @param price_base_quantity [String] The item price base quantity (BT-149). The number of item units to which the uni
648
+ #
539
649
  # @param product_code [String, nil] The product code of the line item.
540
650
  #
541
651
  # @param quantity [String, nil] The quantity of items (goods or services) that is the subject of the line item.
@@ -639,6 +749,7 @@ module EInvoiceAPI
639
749
  VATEX_EU_132_1_O = :"VATEX-EU-132-1O"
640
750
  VATEX_EU_132_1_P = :"VATEX-EU-132-1P"
641
751
  VATEX_EU_132_1_Q = :"VATEX-EU-132-1Q"
752
+ VATEX_EU_135_1 = :"VATEX-EU-135-1"
642
753
  VATEX_EU_143 = :"VATEX-EU-143"
643
754
  VATEX_EU_143_1_A = :"VATEX-EU-143-1A"
644
755
  VATEX_EU_143_1_B = :"VATEX-EU-143-1B"
@@ -670,6 +781,7 @@ module EInvoiceAPI
670
781
  VATEX_EU_151_1_C = :"VATEX-EU-151-1C"
671
782
  VATEX_EU_151_1_D = :"VATEX-EU-151-1D"
672
783
  VATEX_EU_151_1_E = :"VATEX-EU-151-1E"
784
+ VATEX_EU_153 = :"VATEX-EU-153"
673
785
  VATEX_EU_159 = :"VATEX-EU-159"
674
786
  VATEX_EU_309 = :"VATEX-EU-309"
675
787
  VATEX_EU_AE = :"VATEX-EU-AE"
@@ -680,6 +792,30 @@ module EInvoiceAPI
680
792
  VATEX_EU_IC = :"VATEX-EU-IC"
681
793
  VATEX_EU_O = :"VATEX-EU-O"
682
794
  VATEX_EU_J = :"VATEX-EU-J"
795
+ VATEX_FR_298_SEXDECIESA = :"VATEX-FR-298SEXDECIESA"
796
+ VATEX_FR_AE = :"VATEX-FR-AE"
797
+ VATEX_FR_CGI261_1 = :"VATEX-FR-CGI261-1"
798
+ VATEX_FR_CGI261_2 = :"VATEX-FR-CGI261-2"
799
+ VATEX_FR_CGI261_3 = :"VATEX-FR-CGI261-3"
800
+ VATEX_FR_CGI261_4 = :"VATEX-FR-CGI261-4"
801
+ VATEX_FR_CGI261_5 = :"VATEX-FR-CGI261-5"
802
+ VATEX_FR_CGI261_7 = :"VATEX-FR-CGI261-7"
803
+ VATEX_FR_CGI261_8 = :"VATEX-FR-CGI261-8"
804
+ VATEX_FR_CGI261A = :"VATEX-FR-CGI261A"
805
+ VATEX_FR_CGI261B = :"VATEX-FR-CGI261B"
806
+ VATEX_FR_CGI261C_1 = :"VATEX-FR-CGI261C-1"
807
+ VATEX_FR_CGI261C_2 = :"VATEX-FR-CGI261C-2"
808
+ VATEX_FR_CGI261C_3 = :"VATEX-FR-CGI261C-3"
809
+ VATEX_FR_CGI261D_1 = :"VATEX-FR-CGI261D-1"
810
+ VATEX_FR_CGI261D_1_BIS = :"VATEX-FR-CGI261D-1BIS"
811
+ VATEX_FR_CGI261D_2 = :"VATEX-FR-CGI261D-2"
812
+ VATEX_FR_CGI261D_3 = :"VATEX-FR-CGI261D-3"
813
+ VATEX_FR_CGI261D_4 = :"VATEX-FR-CGI261D-4"
814
+ VATEX_FR_CGI261E_1 = :"VATEX-FR-CGI261E-1"
815
+ VATEX_FR_CGI261E_2 = :"VATEX-FR-CGI261E-2"
816
+ VATEX_FR_CGI275 = :"VATEX-FR-CGI275"
817
+ VATEX_FR_CGI277A = :"VATEX-FR-CGI277A"
818
+ VATEX_FR_CGI295 = :"VATEX-FR-CGI295"
683
819
  VATEX_FR_FRANCHISE = :"VATEX-FR-FRANCHISE"
684
820
  VATEX_FR_CNWVAT = :"VATEX-FR-CNWVAT"
685
821
 
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ # @see EInvoiceAPI::Resources::Documents#lifecycle
6
+ class DocumentLifecycleParams < EInvoiceAPI::Internal::Type::BaseModel
7
+ extend EInvoiceAPI::Internal::Type::RequestParameters::Converter
8
+ include EInvoiceAPI::Internal::Type::RequestParameters
9
+
10
+ # @!attribute document_id
11
+ #
12
+ # @return [String]
13
+ required :document_id, String
14
+
15
+ # @!method initialize(document_id:, request_options: {})
16
+ # @param document_id [String]
17
+ # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}]
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,134 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EInvoiceAPI
4
+ module Models
5
+ # @see EInvoiceAPI::Resources::Documents#lifecycle
6
+ class DocumentLifecycleResponse < EInvoiceAPI::Internal::Type::BaseModel
7
+ # @!attribute document_id
8
+ #
9
+ # @return [String]
10
+ required :document_id, String
11
+
12
+ # @!attribute events
13
+ #
14
+ # @return [Array<EInvoiceAPI::Models::DocumentLifecycleResponse::Event>]
15
+ required :events,
16
+ -> { EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::Models::DocumentLifecycleResponse::Event] }
17
+
18
+ # @!method initialize(document_id:, events:)
19
+ # @param document_id [String]
20
+ # @param events [Array<EInvoiceAPI::Models::DocumentLifecycleResponse::Event>]
21
+
22
+ class Event < EInvoiceAPI::Internal::Type::BaseModel
23
+ # @!attribute canonical_status
24
+ #
25
+ # @return [Symbol, EInvoiceAPI::Models::DocumentLifecycleResponse::Event::CanonicalStatus, nil]
26
+ required :canonical_status,
27
+ enum: -> { EInvoiceAPI::Models::DocumentLifecycleResponse::Event::CanonicalStatus },
28
+ nil?: true
29
+
30
+ # @!attribute direction
31
+ #
32
+ # @return [Symbol, EInvoiceAPI::Models::DocumentLifecycleResponse::Event::Direction]
33
+ required :direction, enum: -> { EInvoiceAPI::Models::DocumentLifecycleResponse::Event::Direction }
34
+
35
+ # @!attribute level
36
+ #
37
+ # @return [Symbol, EInvoiceAPI::Models::DocumentLifecycleResponse::Event::Level]
38
+ required :level, enum: -> { EInvoiceAPI::Models::DocumentLifecycleResponse::Event::Level }
39
+
40
+ # @!attribute native_code
41
+ #
42
+ # @return [String, nil]
43
+ required :native_code, String, nil?: true
44
+
45
+ # @!attribute occurred_at
46
+ #
47
+ # @return [Time]
48
+ required :occurred_at, Time
49
+
50
+ # @!attribute reason
51
+ #
52
+ # @return [String, nil]
53
+ required :reason, String, nil?: true
54
+
55
+ # @!attribute reason_code
56
+ #
57
+ # @return [String, nil]
58
+ required :reason_code, String, nil?: true
59
+
60
+ # @!attribute source
61
+ #
62
+ # @return [Symbol, EInvoiceAPI::Models::DocumentLifecycleResponse::Event::Source]
63
+ required :source, enum: -> { EInvoiceAPI::Models::DocumentLifecycleResponse::Event::Source }
64
+
65
+ # @!method initialize(canonical_status:, direction:, level:, native_code:, occurred_at:, reason:, reason_code:, source:)
66
+ # @param canonical_status [Symbol, EInvoiceAPI::Models::DocumentLifecycleResponse::Event::CanonicalStatus, nil]
67
+ # @param direction [Symbol, EInvoiceAPI::Models::DocumentLifecycleResponse::Event::Direction]
68
+ # @param level [Symbol, EInvoiceAPI::Models::DocumentLifecycleResponse::Event::Level]
69
+ # @param native_code [String, nil]
70
+ # @param occurred_at [Time]
71
+ # @param reason [String, nil]
72
+ # @param reason_code [String, nil]
73
+ # @param source [Symbol, EInvoiceAPI::Models::DocumentLifecycleResponse::Event::Source]
74
+
75
+ # @see EInvoiceAPI::Models::DocumentLifecycleResponse::Event#canonical_status
76
+ module CanonicalStatus
77
+ extend EInvoiceAPI::Internal::Type::Enum
78
+
79
+ DEPOSITED = :deposited
80
+ EMITTED = :emitted
81
+ DELIVERED = :delivered
82
+ REJECTED = :rejected
83
+ ACKNOWLEDGED = :acknowledged
84
+ APPROVED = :approved
85
+ PARTIALLY_APPROVED = :partially_approved
86
+ DISPUTED = :disputed
87
+ ON_HOLD = :on_hold
88
+ REFUSED = :refused
89
+ PAYMENT_SENT = :payment_sent
90
+ PAID = :paid
91
+
92
+ # @!method self.values
93
+ # @return [Array<Symbol>]
94
+ end
95
+
96
+ # @see EInvoiceAPI::Models::DocumentLifecycleResponse::Event#direction
97
+ module Direction
98
+ extend EInvoiceAPI::Internal::Type::Enum
99
+
100
+ IN = :in
101
+ OUT = :out
102
+
103
+ # @!method self.values
104
+ # @return [Array<Symbol>]
105
+ end
106
+
107
+ # @see EInvoiceAPI::Models::DocumentLifecycleResponse::Event#level
108
+ module Level
109
+ extend EInvoiceAPI::Internal::Type::Enum
110
+
111
+ TRANSPORT = :transport
112
+ BUSINESS = :business
113
+
114
+ # @!method self.values
115
+ # @return [Array<Symbol>]
116
+ end
117
+
118
+ # @see EInvoiceAPI::Models::DocumentLifecycleResponse::Event#source
119
+ module Source
120
+ extend EInvoiceAPI::Internal::Type::Enum
121
+
122
+ PEPPOL_MLR = :"peppol:mlr"
123
+ PEPPOL_MLS = :"peppol:mls"
124
+ PEPPOL_IMR = :"peppol:imr"
125
+ FR_SUPERPDP = :"fr:superpdp"
126
+ LOCAL = :local
127
+
128
+ # @!method self.values
129
+ # @return [Array<Symbol>]
130
+ end
131
+ end
132
+ end
133
+ end
134
+ end