e-invoice-api 0.32.0 → 0.34.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 (111) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/README.md +1 -1
  4. data/lib/e_invoice_api/client.rb +16 -0
  5. data/lib/e_invoice_api/models/conversion/document_create_from_pdf_task.rb +43 -0
  6. data/lib/e_invoice_api/models/conversion/pdf_create_params.rb +22 -0
  7. data/lib/e_invoice_api/models/conversion/pdf_result_params.rb +22 -0
  8. data/lib/e_invoice_api/models/conversion/pdf_retrieve_params.rb +22 -0
  9. data/lib/e_invoice_api/models/document_create.rb +158 -5
  10. data/lib/e_invoice_api/models/document_create_from_pdf_response.rb +108 -5
  11. data/lib/e_invoice_api/models/document_lifecycle_params.rb +20 -0
  12. data/lib/e_invoice_api/models/document_lifecycle_response.rb +134 -0
  13. data/lib/e_invoice_api/models/document_response.rb +112 -7
  14. data/lib/e_invoice_api/models/document_timeline_params.rb +20 -0
  15. data/lib/e_invoice_api/models/document_timeline_response.rb +71 -0
  16. data/lib/e_invoice_api/models/draft_list_params.rb +113 -0
  17. data/lib/e_invoice_api/models/inbound_email_response.rb +129 -0
  18. data/lib/e_invoice_api/models/mailbox_download_attachment_params.rb +26 -0
  19. data/lib/e_invoice_api/models/mailbox_list_params.rb +129 -0
  20. data/lib/e_invoice_api/models/mailbox_reprocess_params.rb +20 -0
  21. data/lib/e_invoice_api/models/mailbox_retrieve_params.rb +20 -0
  22. data/lib/e_invoice_api/models/me_retrieve_response.rb +8 -7
  23. data/lib/e_invoice_api/models/payment_detail_create.rb +4 -2
  24. data/lib/e_invoice_api/models/stats_retrieve_params.rb +55 -0
  25. data/lib/e_invoice_api/models/stats_retrieve_response.rb +141 -0
  26. data/lib/e_invoice_api/models/ubl_document_validation.rb +10 -1
  27. data/lib/e_invoice_api/models/webhook_history_params.rb +20 -0
  28. data/lib/e_invoice_api/models/webhook_history_response.rb +17 -0
  29. data/lib/e_invoice_api/models/webhook_test_params.rb +37 -0
  30. data/lib/e_invoice_api/models/webhook_test_response.rb +35 -0
  31. data/lib/e_invoice_api/models.rb +24 -0
  32. data/lib/e_invoice_api/resources/conversion/pdf.rb +76 -0
  33. data/lib/e_invoice_api/resources/conversion.rb +18 -0
  34. data/lib/e_invoice_api/resources/documents.rb +62 -1
  35. data/lib/e_invoice_api/resources/drafts.rb +55 -0
  36. data/lib/e_invoice_api/resources/mailbox.rb +123 -0
  37. data/lib/e_invoice_api/resources/stats.rb +47 -0
  38. data/lib/e_invoice_api/resources/validate.rb +22 -2
  39. data/lib/e_invoice_api/resources/webhooks.rb +45 -0
  40. data/lib/e_invoice_api/version.rb +1 -1
  41. data/lib/e_invoice_api.rb +25 -0
  42. data/rbi/e_invoice_api/client.rbi +12 -0
  43. data/rbi/e_invoice_api/models/conversion/document_create_from_pdf_task.rbi +108 -0
  44. data/rbi/e_invoice_api/models/conversion/pdf_create_params.rbi +43 -0
  45. data/rbi/e_invoice_api/models/conversion/pdf_result_params.rbi +40 -0
  46. data/rbi/e_invoice_api/models/conversion/pdf_retrieve_params.rbi +40 -0
  47. data/rbi/e_invoice_api/models/document_create.rbi +210 -3
  48. data/rbi/e_invoice_api/models/document_create_from_pdf_response.rbi +124 -3
  49. data/rbi/e_invoice_api/models/document_lifecycle_params.rbi +38 -0
  50. data/rbi/e_invoice_api/models/document_lifecycle_response.rbi +353 -0
  51. data/rbi/e_invoice_api/models/document_response.rbi +130 -5
  52. data/rbi/e_invoice_api/models/document_timeline_params.rbi +38 -0
  53. data/rbi/e_invoice_api/models/document_timeline_response.rbi +168 -0
  54. data/rbi/e_invoice_api/models/draft_list_params.rbi +194 -0
  55. data/rbi/e_invoice_api/models/inbound_email_response.rbi +189 -0
  56. data/rbi/e_invoice_api/models/mailbox_download_attachment_params.rbi +46 -0
  57. data/rbi/e_invoice_api/models/mailbox_list_params.rbi +218 -0
  58. data/rbi/e_invoice_api/models/mailbox_reprocess_params.rbi +41 -0
  59. data/rbi/e_invoice_api/models/mailbox_retrieve_params.rbi +41 -0
  60. data/rbi/e_invoice_api/models/me_retrieve_response.rbi +10 -8
  61. data/rbi/e_invoice_api/models/payment_detail_create.rbi +6 -2
  62. data/rbi/e_invoice_api/models/stats_retrieve_params.rbi +111 -0
  63. data/rbi/e_invoice_api/models/stats_retrieve_response.rbi +251 -0
  64. data/rbi/e_invoice_api/models/ubl_document_validation.rbi +11 -1
  65. data/rbi/e_invoice_api/models/webhook_history_params.rbi +38 -0
  66. data/rbi/e_invoice_api/models/webhook_history_response.rbi +32 -0
  67. data/rbi/e_invoice_api/models/webhook_test_params.rbi +57 -0
  68. data/rbi/e_invoice_api/models/webhook_test_response.rbi +57 -0
  69. data/rbi/e_invoice_api/models.rbi +25 -0
  70. data/rbi/e_invoice_api/resources/conversion/pdf.rbi +44 -0
  71. data/rbi/e_invoice_api/resources/conversion.rbi +15 -0
  72. data/rbi/e_invoice_api/resources/documents.rbi +67 -0
  73. data/rbi/e_invoice_api/resources/drafts.rbi +55 -0
  74. data/rbi/e_invoice_api/resources/mailbox.rbi +93 -0
  75. data/rbi/e_invoice_api/resources/stats.rbi +38 -0
  76. data/rbi/e_invoice_api/resources/validate.rbi +44 -1
  77. data/rbi/e_invoice_api/resources/webhooks.rbi +29 -0
  78. data/sig/e_invoice_api/client.rbs +8 -0
  79. data/sig/e_invoice_api/models/conversion/document_create_from_pdf_task.rbs +45 -0
  80. data/sig/e_invoice_api/models/conversion/pdf_create_params.rbs +26 -0
  81. data/sig/e_invoice_api/models/conversion/pdf_result_params.rbs +25 -0
  82. data/sig/e_invoice_api/models/conversion/pdf_retrieve_params.rbs +25 -0
  83. data/sig/e_invoice_api/models/document_create.rbs +87 -4
  84. data/sig/e_invoice_api/models/document_create_from_pdf_response.rbs +61 -4
  85. data/sig/e_invoice_api/models/document_lifecycle_params.rbs +23 -0
  86. data/sig/e_invoice_api/models/document_lifecycle_response.rbs +151 -0
  87. data/sig/e_invoice_api/models/document_response.rbs +61 -4
  88. data/sig/e_invoice_api/models/document_timeline_params.rbs +23 -0
  89. data/sig/e_invoice_api/models/document_timeline_response.rbs +84 -0
  90. data/sig/e_invoice_api/models/draft_list_params.rbs +112 -0
  91. data/sig/e_invoice_api/models/inbound_email_response.rbs +126 -0
  92. data/sig/e_invoice_api/models/mailbox_download_attachment_params.rbs +28 -0
  93. data/sig/e_invoice_api/models/mailbox_list_params.rbs +112 -0
  94. data/sig/e_invoice_api/models/mailbox_reprocess_params.rbs +24 -0
  95. data/sig/e_invoice_api/models/mailbox_retrieve_params.rbs +24 -0
  96. data/sig/e_invoice_api/models/stats_retrieve_params.rbs +48 -0
  97. data/sig/e_invoice_api/models/stats_retrieve_response.rbs +107 -0
  98. data/sig/e_invoice_api/models/webhook_history_params.rbs +23 -0
  99. data/sig/e_invoice_api/models/webhook_history_response.rbs +13 -0
  100. data/sig/e_invoice_api/models/webhook_test_params.rbs +32 -0
  101. data/sig/e_invoice_api/models/webhook_test_response.rbs +30 -0
  102. data/sig/e_invoice_api/models.rbs +24 -0
  103. data/sig/e_invoice_api/resources/conversion/pdf.rbs +24 -0
  104. data/sig/e_invoice_api/resources/conversion.rbs +9 -0
  105. data/sig/e_invoice_api/resources/documents.rbs +19 -0
  106. data/sig/e_invoice_api/resources/drafts.rbs +20 -0
  107. data/sig/e_invoice_api/resources/mailbox.rbs +36 -0
  108. data/sig/e_invoice_api/resources/stats.rbs +14 -0
  109. data/sig/e_invoice_api/resources/validate.rbs +9 -0
  110. data/sig/e_invoice_api/resources/webhooks.rbs +12 -0
  111. metadata +77 -2
@@ -7,6 +7,8 @@ module EInvoiceAPI
7
7
 
8
8
  Charge = EInvoiceAPI::Models::Charge
9
9
 
10
+ Conversion = EInvoiceAPI::Models::Conversion
11
+
10
12
  CurrencyCode = EInvoiceAPI::Models::CurrencyCode
11
13
 
12
14
  DocumentAttachmentCreate = EInvoiceAPI::Models::DocumentAttachmentCreate
@@ -21,6 +23,8 @@ module EInvoiceAPI
21
23
 
22
24
  DocumentDirection = EInvoiceAPI::Models::DocumentDirection
23
25
 
26
+ DocumentLifecycleParams = EInvoiceAPI::Models::DocumentLifecycleParams
27
+
24
28
  DocumentResponse = EInvoiceAPI::Models::DocumentResponse
25
29
 
26
30
  DocumentRetrieveParams = EInvoiceAPI::Models::DocumentRetrieveParams
@@ -31,10 +35,16 @@ module EInvoiceAPI
31
35
 
32
36
  DocumentState = EInvoiceAPI::Models::DocumentState
33
37
 
38
+ DocumentTimelineParams = EInvoiceAPI::Models::DocumentTimelineParams
39
+
34
40
  DocumentType = EInvoiceAPI::Models::DocumentType
35
41
 
36
42
  DocumentValidateParams = EInvoiceAPI::Models::DocumentValidateParams
37
43
 
44
+ DraftListParams = EInvoiceAPI::Models::DraftListParams
45
+
46
+ InboundEmailResponse = EInvoiceAPI::Models::InboundEmailResponse
47
+
38
48
  InboxListCreditNotesParams = EInvoiceAPI::Models::InboxListCreditNotesParams
39
49
 
40
50
  InboxListInvoicesParams = EInvoiceAPI::Models::InboxListInvoicesParams
@@ -46,6 +56,15 @@ module EInvoiceAPI
46
56
  LookupRetrieveParticipantsParams =
47
57
  EInvoiceAPI::Models::LookupRetrieveParticipantsParams
48
58
 
59
+ MailboxDownloadAttachmentParams =
60
+ EInvoiceAPI::Models::MailboxDownloadAttachmentParams
61
+
62
+ MailboxListParams = EInvoiceAPI::Models::MailboxListParams
63
+
64
+ MailboxReprocessParams = EInvoiceAPI::Models::MailboxReprocessParams
65
+
66
+ MailboxRetrieveParams = EInvoiceAPI::Models::MailboxRetrieveParams
67
+
49
68
  MeRetrieveParams = EInvoiceAPI::Models::MeRetrieveParams
50
69
 
51
70
  OutboxListDraftDocumentsParams =
@@ -58,6 +77,8 @@ module EInvoiceAPI
58
77
 
59
78
  PaymentDetailCreate = EInvoiceAPI::Models::PaymentDetailCreate
60
79
 
80
+ StatsRetrieveParams = EInvoiceAPI::Models::StatsRetrieveParams
81
+
61
82
  UblDocumentValidation = EInvoiceAPI::Models::UblDocumentValidation
62
83
 
63
84
  UnitOfMeasureCode = EInvoiceAPI::Models::UnitOfMeasureCode
@@ -73,11 +94,15 @@ module EInvoiceAPI
73
94
 
74
95
  WebhookDeleteParams = EInvoiceAPI::Models::WebhookDeleteParams
75
96
 
97
+ WebhookHistoryParams = EInvoiceAPI::Models::WebhookHistoryParams
98
+
76
99
  WebhookListParams = EInvoiceAPI::Models::WebhookListParams
77
100
 
78
101
  WebhookResponse = EInvoiceAPI::Models::WebhookResponse
79
102
 
80
103
  WebhookRetrieveParams = EInvoiceAPI::Models::WebhookRetrieveParams
81
104
 
105
+ WebhookTestParams = EInvoiceAPI::Models::WebhookTestParams
106
+
82
107
  WebhookUpdateParams = EInvoiceAPI::Models::WebhookUpdateParams
83
108
  end
@@ -0,0 +1,44 @@
1
+ # typed: strong
2
+
3
+ module EInvoiceAPI
4
+ module Resources
5
+ class Conversion
6
+ class Pdf
7
+ # Convert a PDF to a document
8
+ sig do
9
+ params(
10
+ file: EInvoiceAPI::Internal::FileInput,
11
+ request_options: EInvoiceAPI::RequestOptions::OrHash
12
+ ).returns(EInvoiceAPI::Conversion::DocumentCreateFromPdfTask)
13
+ end
14
+ def create(file:, request_options: {})
15
+ end
16
+
17
+ # Get the status of a PDF conversion task
18
+ sig do
19
+ params(
20
+ task_id: String,
21
+ request_options: EInvoiceAPI::RequestOptions::OrHash
22
+ ).returns(EInvoiceAPI::Conversion::DocumentCreateFromPdfTask)
23
+ end
24
+ def retrieve(task_id, request_options: {})
25
+ end
26
+
27
+ # Get the result of a PDF conversion task
28
+ sig do
29
+ params(
30
+ task_id: String,
31
+ request_options: EInvoiceAPI::RequestOptions::OrHash
32
+ ).returns(EInvoiceAPI::Models::DocumentCreateFromPdfResponse)
33
+ end
34
+ def result(task_id, request_options: {})
35
+ end
36
+
37
+ # @api private
38
+ sig { params(client: EInvoiceAPI::Client).returns(T.attached_class) }
39
+ def self.new(client:)
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,15 @@
1
+ # typed: strong
2
+
3
+ module EInvoiceAPI
4
+ module Resources
5
+ class Conversion
6
+ sig { returns(EInvoiceAPI::Resources::Conversion::Pdf) }
7
+ attr_reader :pdf
8
+
9
+ # @api private
10
+ sig { params(client: EInvoiceAPI::Client).returns(T.attached_class) }
11
+ def self.new(client:)
12
+ end
13
+ end
14
+ end
15
+ end
@@ -21,6 +21,7 @@ module EInvoiceAPI
21
21
  T.nilable(T::Array[EInvoiceAPI::DocumentAttachmentCreate::OrHash]),
22
22
  billing_address: T.nilable(String),
23
23
  billing_address_recipient: T.nilable(String),
24
+ buyer_reference: T.nilable(String),
24
25
  charges:
25
26
  T.nilable(T::Array[EInvoiceAPI::DocumentCreate::Charge::OrHash]),
26
27
  currency: EInvoiceAPI::CurrencyCode::OrSymbol,
@@ -31,6 +32,7 @@ module EInvoiceAPI
31
32
  customer_id: T.nilable(String),
32
33
  customer_name: T.nilable(String),
33
34
  customer_peppol_id: T.nilable(String),
35
+ customer_phone: T.nilable(String),
34
36
  customer_tax_id: T.nilable(String),
35
37
  direction: EInvoiceAPI::DocumentDirection::OrSymbol,
36
38
  document_type: EInvoiceAPI::DocumentType::OrSymbol,
@@ -44,6 +46,8 @@ module EInvoiceAPI
44
46
  payment_details:
45
47
  T.nilable(T::Array[EInvoiceAPI::PaymentDetailCreate::OrHash]),
46
48
  payment_term: T.nilable(String),
49
+ preceding_invoice_date: T.nilable(Date),
50
+ preceding_invoice_id: T.nilable(String),
47
51
  previous_unpaid_balance:
48
52
  T.nilable(
49
53
  EInvoiceAPI::DocumentCreate::PreviousUnpaidBalance::Variants
@@ -51,6 +55,9 @@ module EInvoiceAPI
51
55
  purchase_order: T.nilable(String),
52
56
  remittance_address: T.nilable(String),
53
57
  remittance_address_recipient: T.nilable(String),
58
+ rounding_amount:
59
+ T.nilable(EInvoiceAPI::DocumentCreate::RoundingAmount::Variants),
60
+ sales_order: T.nilable(String),
54
61
  service_address: T.nilable(String),
55
62
  service_address_recipient: T.nilable(String),
56
63
  service_end_date: T.nilable(Date),
@@ -60,11 +67,16 @@ module EInvoiceAPI
60
67
  state: EInvoiceAPI::DocumentState::OrSymbol,
61
68
  subtotal: T.nilable(EInvoiceAPI::DocumentCreate::Subtotal::Variants),
62
69
  tax_code: EInvoiceAPI::DocumentCreate::TaxCode::OrSymbol,
70
+ tax_currency: T.nilable(String),
63
71
  tax_details:
64
72
  T.nilable(T::Array[EInvoiceAPI::DocumentCreate::TaxDetail::OrHash]),
65
73
  total_discount:
66
74
  T.nilable(EInvoiceAPI::DocumentCreate::TotalDiscount::Variants),
67
75
  total_tax: T.nilable(EInvoiceAPI::DocumentCreate::TotalTax::Variants),
76
+ total_tax_in_tax_currency:
77
+ T.nilable(
78
+ EInvoiceAPI::DocumentCreate::TotalTaxInTaxCurrency::Variants
79
+ ),
68
80
  vatex: T.nilable(EInvoiceAPI::DocumentCreate::Vatex::OrSymbol),
69
81
  vatex_note: T.nilable(String),
70
82
  vendor_address: T.nilable(String),
@@ -72,6 +84,7 @@ module EInvoiceAPI
72
84
  vendor_company_id: T.nilable(String),
73
85
  vendor_email: T.nilable(String),
74
86
  vendor_name: T.nilable(String),
87
+ vendor_phone: T.nilable(String),
75
88
  vendor_tax_id: T.nilable(String),
76
89
  request_options: EInvoiceAPI::RequestOptions::OrHash
77
90
  ).returns(EInvoiceAPI::DocumentResponse)
@@ -91,6 +104,9 @@ module EInvoiceAPI
91
104
  billing_address: nil,
92
105
  # Body param: The recipient name at the billing address
93
106
  billing_address_recipient: nil,
107
+ # Body param: The buyer reference (BT-10), e.g. a cost centre or accounting
108
+ # reference requested by the buyer
109
+ buyer_reference: nil,
94
110
  # Body param
95
111
  charges: nil,
96
112
  # Body param: Currency of the invoice (ISO 4217 currency code)
@@ -111,6 +127,8 @@ module EInvoiceAPI
111
127
  customer_name: nil,
112
128
  # Body param: Customer Peppol ID
113
129
  customer_peppol_id: nil,
130
+ # Body param: The telephone number of the customer contact (BT-57)
131
+ customer_phone: nil,
114
132
  # Body param: Customer tax ID. For Belgium this is the VAT number. Must include
115
133
  # the country prefix
116
134
  customer_tax_id: nil,
@@ -137,6 +155,11 @@ module EInvoiceAPI
137
155
  payment_details: nil,
138
156
  # Body param: The payment terms (e.g., 'Net 30', 'Due on receipt', '2/10 Net 30')
139
157
  payment_term: nil,
158
+ # Body param: The preceding invoice issue date (BT-26)
159
+ preceding_invoice_date: nil,
160
+ # Body param: The preceding invoice reference (BT-25): the number of the invoice
161
+ # this document corrects, for example the invoice a credit note credits
162
+ preceding_invoice_id: nil,
140
163
  # Body param: The previous unpaid balance from prior invoices, if any. Must be
141
164
  # positive and rounded to maximum 2 decimals
142
165
  previous_unpaid_balance: nil,
@@ -146,6 +169,13 @@ module EInvoiceAPI
146
169
  remittance_address: nil,
147
170
  # Body param: The recipient name at the remittance address
148
171
  remittance_address_recipient: nil,
172
+ # Body param: The amount added to the invoice total to round the amount for
173
+ # payment (BT-114), for example to whole kronor (amount_due = invoice_total +
174
+ # rounding_amount when nothing is prepaid). Can be negative. Between -5.00 and
175
+ # 5.00, rounded to maximum 2 decimals
176
+ rounding_amount: nil,
177
+ # Body param: The sales order reference (BT-14) assigned by the seller
178
+ sales_order: nil,
149
179
  # Body param: The address where services were performed or goods were delivered
150
180
  service_address: nil,
151
181
  # Body param: The recipient name at the service address
@@ -168,6 +198,10 @@ module EInvoiceAPI
168
198
  # Body param: Tax category code of the invoice (e.g., S for standard rate, Z for
169
199
  # zero rate, E for exempt)
170
200
  tax_code: nil,
201
+ # Body param: The VAT accounting currency (BT-6, ISO 4217 currency code), when VAT
202
+ # is accounted in a currency other than the invoice currency. Must differ from
203
+ # currency and requires total_tax_in_tax_currency
204
+ tax_currency: nil,
171
205
  # Body param
172
206
  tax_details: nil,
173
207
  # Body param: The net financial discount/charge of the invoice (non-VAT charges
@@ -177,6 +211,10 @@ module EInvoiceAPI
177
211
  # Body param: The total tax amount of the invoice. Must be positive and rounded to
178
212
  # maximum 2 decimals
179
213
  total_tax: nil,
214
+ # Body param: The total VAT amount in the VAT accounting currency tax_currency
215
+ # (BT-111). Does not add to invoice_total. Requires tax_currency. Rounded to
216
+ # maximum 2 decimals
217
+ total_tax_in_tax_currency: nil,
180
218
  # Body param: VATEX code list for VAT exemption reasons
181
219
  #
182
220
  # Agency: CEF Identifier: vatex
@@ -194,6 +232,10 @@ module EInvoiceAPI
194
232
  vendor_email: nil,
195
233
  # Body param: The name of the vendor/seller/supplier
196
234
  vendor_name: nil,
235
+ # Body param: The telephone number of the vendor contact (BT-42). Required when
236
+ # vendor and customer are both in Germany (DE-R-006); it must then hold at least 3
237
+ # digits (DE-R-027, a warning).
238
+ vendor_phone: nil,
197
239
  # Body param: Vendor tax ID. For Belgium this is the VAT number. Must include the
198
240
  # country prefix
199
241
  vendor_tax_id: nil,
@@ -283,6 +325,31 @@ module EInvoiceAPI
283
325
  def validate(document_id, request_options: {})
284
326
  end
285
327
 
328
+ # Get the timeline of events for an invoice or credit note, including creation,
329
+ # validation, transmission, and delivery events
330
+ sig do
331
+ params(
332
+ document_id: String,
333
+ request_options: EInvoiceAPI::RequestOptions::OrHash
334
+ ).returns(EInvoiceAPI::Models::DocumentTimelineResponse)
335
+ end
336
+ def timeline(document_id, request_options: {})
337
+ end
338
+
339
+ # Get the lifecycle events stated about an invoice or credit note after creation
340
+ # (Peppol Message Level and Invoice Responses, partner status events), oldest
341
+ # first. Each event carries a route-agnostic canonical status next to the
342
+ # untouched native code of its source; native codes without a canonical equivalent
343
+ # have canonical_status null.
344
+ sig do
345
+ params(
346
+ document_id: String,
347
+ request_options: EInvoiceAPI::RequestOptions::OrHash
348
+ ).returns(EInvoiceAPI::Models::DocumentLifecycleResponse)
349
+ end
350
+ def lifecycle(document_id, request_options: {})
351
+ end
352
+
286
353
  # @api private
287
354
  sig { params(client: EInvoiceAPI::Client).returns(T.attached_class) }
288
355
  def self.new(client:)
@@ -0,0 +1,55 @@
1
+ # typed: strong
2
+
3
+ module EInvoiceAPI
4
+ module Resources
5
+ class Drafts
6
+ # Retrieve a paginated list of draft documents with filtering options including
7
+ # state and text search.
8
+ sig do
9
+ params(
10
+ date_from: T.nilable(Time),
11
+ date_to: T.nilable(Time),
12
+ page: Integer,
13
+ page_size: Integer,
14
+ search: T.nilable(String),
15
+ sort_by: EInvoiceAPI::DraftListParams::SortBy::OrSymbol,
16
+ sort_order: EInvoiceAPI::DraftListParams::SortOrder::OrSymbol,
17
+ state: T.nilable(EInvoiceAPI::DocumentState::OrSymbol),
18
+ type: T.nilable(EInvoiceAPI::DocumentType::OrSymbol),
19
+ request_options: EInvoiceAPI::RequestOptions::OrHash
20
+ ).returns(
21
+ EInvoiceAPI::Internal::DocumentsNumberPage[
22
+ EInvoiceAPI::DocumentResponse
23
+ ]
24
+ )
25
+ end
26
+ def list(
27
+ # Filter by issue date (from)
28
+ date_from: nil,
29
+ # Filter by issue date (to)
30
+ date_to: nil,
31
+ # Page number
32
+ page: nil,
33
+ # Number of items per page
34
+ page_size: nil,
35
+ # Search in invoice number, seller/buyer names
36
+ search: nil,
37
+ # Field to sort by
38
+ sort_by: nil,
39
+ # Sort direction (asc/desc)
40
+ sort_order: nil,
41
+ # Filter by document state. By default return all states (DRAFT, TRANSIT, FAILED).
42
+ state: nil,
43
+ # Filter by document type
44
+ type: nil,
45
+ request_options: {}
46
+ )
47
+ end
48
+
49
+ # @api private
50
+ sig { params(client: EInvoiceAPI::Client).returns(T.attached_class) }
51
+ def self.new(client:)
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,93 @@
1
+ # typed: strong
2
+
3
+ module EInvoiceAPI
4
+ module Resources
5
+ class Mailbox
6
+ # Retrieve a paginated list of received inbound emails with filtering, search, and
7
+ # sorting options.
8
+ sig do
9
+ params(
10
+ page: Integer,
11
+ page_size: Integer,
12
+ processed: T.nilable(T::Boolean),
13
+ received_from: T.nilable(Time),
14
+ received_to: T.nilable(Time),
15
+ search: T.nilable(String),
16
+ sort_by: EInvoiceAPI::MailboxListParams::SortBy::OrSymbol,
17
+ sort_order: EInvoiceAPI::MailboxListParams::SortOrder::OrSymbol,
18
+ status: T.nilable(EInvoiceAPI::MailboxListParams::Status::OrSymbol),
19
+ request_options: EInvoiceAPI::RequestOptions::OrHash
20
+ ).returns(
21
+ EInvoiceAPI::Internal::DocumentsNumberPage[
22
+ EInvoiceAPI::InboundEmailResponse
23
+ ]
24
+ )
25
+ end
26
+ def list(
27
+ # Page number
28
+ page: nil,
29
+ # Number of items per page
30
+ page_size: nil,
31
+ # Filter by processing status. If not provided, returns all. Ignored when `status`
32
+ # is set.
33
+ processed: nil,
34
+ # Inclusive lower bound on received date (falls back to created_at when
35
+ # received_at is null)
36
+ received_from: nil,
37
+ # Inclusive upper bound on received date (falls back to created_at when
38
+ # received_at is null)
39
+ received_to: nil,
40
+ # Case-insensitive search across sender email, subject, message ID, and attachment
41
+ # filenames
42
+ search: nil,
43
+ # Field to sort by
44
+ sort_by: nil,
45
+ # Sort direction (asc/desc)
46
+ sort_order: nil,
47
+ # Filter by status: pending, success, or failed. Takes precedence over `processed`
48
+ # if both are provided.
49
+ status: nil,
50
+ request_options: {}
51
+ )
52
+ end
53
+
54
+ # Retrieve a single inbound email by ID, scoped to the caller's tenant.
55
+ sig do
56
+ params(
57
+ inbound_email_id: String,
58
+ request_options: EInvoiceAPI::RequestOptions::OrHash
59
+ ).returns(EInvoiceAPI::InboundEmailResponse)
60
+ end
61
+ def retrieve(inbound_email_id, request_options: {})
62
+ end
63
+
64
+ # Download a specific attachment from an inbound email by filename. Returns the
65
+ # binary content with the correct Content-Type.
66
+ sig do
67
+ params(
68
+ filename: String,
69
+ inbound_email_id: String,
70
+ request_options: EInvoiceAPI::RequestOptions::OrHash
71
+ ).returns(T.anything)
72
+ end
73
+ def download_attachment(filename, inbound_email_id:, request_options: {})
74
+ end
75
+
76
+ # Retry processing of a previously failed inbound email by replaying the original
77
+ # Postmark payload.
78
+ sig do
79
+ params(
80
+ inbound_email_id: String,
81
+ request_options: EInvoiceAPI::RequestOptions::OrHash
82
+ ).returns(EInvoiceAPI::InboundEmailResponse)
83
+ end
84
+ def reprocess(inbound_email_id, request_options: {})
85
+ end
86
+
87
+ # @api private
88
+ sig { params(client: EInvoiceAPI::Client).returns(T.attached_class) }
89
+ def self.new(client:)
90
+ end
91
+ end
92
+ end
93
+ end
@@ -0,0 +1,38 @@
1
+ # typed: strong
2
+
3
+ module EInvoiceAPI
4
+ module Resources
5
+ class Stats
6
+ # Retrieve usage statistics for billing purposes. Returns statistics for document
7
+ # sent and document received actions, grouped by aggregation period
8
+ # (day/week/month). If no date parameters are provided, returns daily stats for
9
+ # all available data.
10
+ sig do
11
+ params(
12
+ aggregation:
13
+ T.nilable(EInvoiceAPI::StatsRetrieveParams::Aggregation::OrSymbol),
14
+ end_date: T.nilable(Date),
15
+ start_date: T.nilable(Date),
16
+ request_options: EInvoiceAPI::RequestOptions::OrHash
17
+ ).returns(EInvoiceAPI::Models::StatsRetrieveResponse)
18
+ end
19
+ def retrieve(
20
+ # Aggregation type: DAY, WEEK, or MONTH. Defaults to DAY.
21
+ aggregation: nil,
22
+ # End date in yyyy-mm-dd format. If not provided, queries to latest available
23
+ # data.
24
+ end_date: nil,
25
+ # Start date in yyyy-mm-dd format. If not provided, queries from earliest
26
+ # available data.
27
+ start_date: nil,
28
+ request_options: {}
29
+ )
30
+ end
31
+
32
+ # @api private
33
+ sig { params(client: EInvoiceAPI::Client).returns(T.attached_class) }
34
+ def self.new(client:)
35
+ end
36
+ end
37
+ end
38
+ end
@@ -3,7 +3,9 @@
3
3
  module EInvoiceAPI
4
4
  module Resources
5
5
  class Validate
6
- # Validate if the JSON document can be converted to a valid UBL document
6
+ # Validate if the JSON document can be converted to a valid UBL document. The
7
+ # generated UBL is returned in ubl_document also when is_valid is false, so you
8
+ # can inspect it.
7
9
  sig do
8
10
  params(
9
11
  allowances:
@@ -14,6 +16,7 @@ module EInvoiceAPI
14
16
  T.nilable(T::Array[EInvoiceAPI::DocumentAttachmentCreate::OrHash]),
15
17
  billing_address: T.nilable(String),
16
18
  billing_address_recipient: T.nilable(String),
19
+ buyer_reference: T.nilable(String),
17
20
  charges:
18
21
  T.nilable(T::Array[EInvoiceAPI::DocumentCreate::Charge::OrHash]),
19
22
  currency: EInvoiceAPI::CurrencyCode::OrSymbol,
@@ -24,6 +27,7 @@ module EInvoiceAPI
24
27
  customer_id: T.nilable(String),
25
28
  customer_name: T.nilable(String),
26
29
  customer_peppol_id: T.nilable(String),
30
+ customer_phone: T.nilable(String),
27
31
  customer_tax_id: T.nilable(String),
28
32
  direction: EInvoiceAPI::DocumentDirection::OrSymbol,
29
33
  document_type: EInvoiceAPI::DocumentType::OrSymbol,
@@ -37,6 +41,8 @@ module EInvoiceAPI
37
41
  payment_details:
38
42
  T.nilable(T::Array[EInvoiceAPI::PaymentDetailCreate::OrHash]),
39
43
  payment_term: T.nilable(String),
44
+ preceding_invoice_date: T.nilable(Date),
45
+ preceding_invoice_id: T.nilable(String),
40
46
  previous_unpaid_balance:
41
47
  T.nilable(
42
48
  EInvoiceAPI::DocumentCreate::PreviousUnpaidBalance::Variants
@@ -44,6 +50,9 @@ module EInvoiceAPI
44
50
  purchase_order: T.nilable(String),
45
51
  remittance_address: T.nilable(String),
46
52
  remittance_address_recipient: T.nilable(String),
53
+ rounding_amount:
54
+ T.nilable(EInvoiceAPI::DocumentCreate::RoundingAmount::Variants),
55
+ sales_order: T.nilable(String),
47
56
  service_address: T.nilable(String),
48
57
  service_address_recipient: T.nilable(String),
49
58
  service_end_date: T.nilable(Date),
@@ -53,11 +62,16 @@ module EInvoiceAPI
53
62
  state: EInvoiceAPI::DocumentState::OrSymbol,
54
63
  subtotal: T.nilable(EInvoiceAPI::DocumentCreate::Subtotal::Variants),
55
64
  tax_code: EInvoiceAPI::DocumentCreate::TaxCode::OrSymbol,
65
+ tax_currency: T.nilable(String),
56
66
  tax_details:
57
67
  T.nilable(T::Array[EInvoiceAPI::DocumentCreate::TaxDetail::OrHash]),
58
68
  total_discount:
59
69
  T.nilable(EInvoiceAPI::DocumentCreate::TotalDiscount::Variants),
60
70
  total_tax: T.nilable(EInvoiceAPI::DocumentCreate::TotalTax::Variants),
71
+ total_tax_in_tax_currency:
72
+ T.nilable(
73
+ EInvoiceAPI::DocumentCreate::TotalTaxInTaxCurrency::Variants
74
+ ),
61
75
  vatex: T.nilable(EInvoiceAPI::DocumentCreate::Vatex::OrSymbol),
62
76
  vatex_note: T.nilable(String),
63
77
  vendor_address: T.nilable(String),
@@ -65,6 +79,7 @@ module EInvoiceAPI
65
79
  vendor_company_id: T.nilable(String),
66
80
  vendor_email: T.nilable(String),
67
81
  vendor_name: T.nilable(String),
82
+ vendor_phone: T.nilable(String),
68
83
  vendor_tax_id: T.nilable(String),
69
84
  request_options: EInvoiceAPI::RequestOptions::OrHash
70
85
  ).returns(EInvoiceAPI::UblDocumentValidation)
@@ -78,6 +93,9 @@ module EInvoiceAPI
78
93
  billing_address: nil,
79
94
  # The recipient name at the billing address
80
95
  billing_address_recipient: nil,
96
+ # The buyer reference (BT-10), e.g. a cost centre or accounting reference
97
+ # requested by the buyer
98
+ buyer_reference: nil,
81
99
  charges: nil,
82
100
  # Currency of the invoice (ISO 4217 currency code)
83
101
  currency: nil,
@@ -96,6 +114,8 @@ module EInvoiceAPI
96
114
  customer_name: nil,
97
115
  # Customer Peppol ID
98
116
  customer_peppol_id: nil,
117
+ # The telephone number of the customer contact (BT-57)
118
+ customer_phone: nil,
99
119
  # Customer tax ID. For Belgium this is the VAT number. Must include the country
100
120
  # prefix
101
121
  customer_tax_id: nil,
@@ -119,6 +139,11 @@ module EInvoiceAPI
119
139
  payment_details: nil,
120
140
  # The payment terms (e.g., 'Net 30', 'Due on receipt', '2/10 Net 30')
121
141
  payment_term: nil,
142
+ # The preceding invoice issue date (BT-26)
143
+ preceding_invoice_date: nil,
144
+ # The preceding invoice reference (BT-25): the number of the invoice this document
145
+ # corrects, for example the invoice a credit note credits
146
+ preceding_invoice_id: nil,
122
147
  # The previous unpaid balance from prior invoices, if any. Must be positive and
123
148
  # rounded to maximum 2 decimals
124
149
  previous_unpaid_balance: nil,
@@ -128,6 +153,13 @@ module EInvoiceAPI
128
153
  remittance_address: nil,
129
154
  # The recipient name at the remittance address
130
155
  remittance_address_recipient: nil,
156
+ # The amount added to the invoice total to round the amount for payment (BT-114),
157
+ # for example to whole kronor (amount_due = invoice_total + rounding_amount when
158
+ # nothing is prepaid). Can be negative. Between -5.00 and 5.00, rounded to maximum
159
+ # 2 decimals
160
+ rounding_amount: nil,
161
+ # The sales order reference (BT-14) assigned by the seller
162
+ sales_order: nil,
131
163
  # The address where services were performed or goods were delivered
132
164
  service_address: nil,
133
165
  # The recipient name at the service address
@@ -149,6 +181,10 @@ module EInvoiceAPI
149
181
  # Tax category code of the invoice (e.g., S for standard rate, Z for zero rate, E
150
182
  # for exempt)
151
183
  tax_code: nil,
184
+ # The VAT accounting currency (BT-6, ISO 4217 currency code), when VAT is
185
+ # accounted in a currency other than the invoice currency. Must differ from
186
+ # currency and requires total_tax_in_tax_currency
187
+ tax_currency: nil,
152
188
  tax_details: nil,
153
189
  # The net financial discount/charge of the invoice (non-VAT charges minus non-VAT
154
190
  # allowances). Can be positive (net charge), negative (net discount), or zero.
@@ -157,6 +193,9 @@ module EInvoiceAPI
157
193
  # The total tax amount of the invoice. Must be positive and rounded to maximum 2
158
194
  # decimals
159
195
  total_tax: nil,
196
+ # The total VAT amount in the VAT accounting currency tax_currency (BT-111). Does
197
+ # not add to invoice_total. Requires tax_currency. Rounded to maximum 2 decimals
198
+ total_tax_in_tax_currency: nil,
160
199
  # VATEX code list for VAT exemption reasons
161
200
  #
162
201
  # Agency: CEF Identifier: vatex
@@ -174,6 +213,10 @@ module EInvoiceAPI
174
213
  vendor_email: nil,
175
214
  # The name of the vendor/seller/supplier
176
215
  vendor_name: nil,
216
+ # The telephone number of the vendor contact (BT-42). Required when vendor and
217
+ # customer are both in Germany (DE-R-006); it must then hold at least 3 digits
218
+ # (DE-R-027, a warning).
219
+ vendor_phone: nil,
177
220
  # Vendor tax ID. For Belgium this is the VAT number. Must include the country
178
221
  # prefix
179
222
  vendor_tax_id: nil,
@@ -63,6 +63,35 @@ module EInvoiceAPI
63
63
  def delete(webhook_id, request_options: {})
64
64
  end
65
65
 
66
+ # Get the history of a webhook
67
+ sig do
68
+ params(
69
+ webhook_id: String,
70
+ request_options: EInvoiceAPI::RequestOptions::OrHash
71
+ ).returns(EInvoiceAPI::Models::WebhookHistoryResponse)
72
+ end
73
+ def history(webhook_id, request_options: {})
74
+ end
75
+
76
+ # Send a test event to a webhook for testing and debugging purposes
77
+ sig do
78
+ params(
79
+ webhook_id: String,
80
+ data: T::Hash[Symbol, T.anything],
81
+ event_type: String,
82
+ request_options: EInvoiceAPI::RequestOptions::OrHash
83
+ ).returns(EInvoiceAPI::Models::WebhookTestResponse)
84
+ end
85
+ def test_(
86
+ webhook_id,
87
+ # Custom event data payload
88
+ data:,
89
+ # Must be valid WebhookEventType
90
+ event_type:,
91
+ request_options: {}
92
+ )
93
+ end
94
+
66
95
  # @api private
67
96
  sig { params(client: EInvoiceAPI::Client).returns(T.attached_class) }
68
97
  def self.new(client:)
@@ -24,6 +24,14 @@ module EInvoiceAPI
24
24
 
25
25
  attr_reader webhooks: EInvoiceAPI::Resources::Webhooks
26
26
 
27
+ attr_reader drafts: EInvoiceAPI::Resources::Drafts
28
+
29
+ attr_reader conversion: EInvoiceAPI::Resources::Conversion
30
+
31
+ attr_reader stats: EInvoiceAPI::Resources::Stats
32
+
33
+ attr_reader mailbox: EInvoiceAPI::Resources::Mailbox
34
+
27
35
  private def auth_headers: -> ::Hash[String, String]
28
36
 
29
37
  def initialize: (