e-invoice-api 0.11.0 → 0.13.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.
@@ -13,8 +13,7 @@ module EInvoiceAPI
13
13
  end
14
14
  attr_accessor :allowances
15
15
 
16
- # The amount due of the invoice. Must be positive and rounded to maximum 2
17
- # decimals
16
+ # The amount due for payment. Must be positive and rounded to maximum 2 decimals
18
17
  sig do
19
18
  returns(T.nilable(EInvoiceAPI::DocumentCreate::AmountDue::Variants))
20
19
  end
@@ -25,63 +24,82 @@ module EInvoiceAPI
25
24
  end
26
25
  attr_accessor :attachments
27
26
 
27
+ # The billing address (if different from customer address)
28
28
  sig { returns(T.nilable(String)) }
29
29
  attr_accessor :billing_address
30
30
 
31
+ # The recipient name at the billing address
31
32
  sig { returns(T.nilable(String)) }
32
33
  attr_accessor :billing_address_recipient
33
34
 
34
35
  sig { returns(T.nilable(T::Array[EInvoiceAPI::DocumentCreate::Charge])) }
35
36
  attr_accessor :charges
36
37
 
37
- # Currency of the invoice
38
+ # Currency of the invoice (ISO 4217 currency code)
38
39
  sig { returns(T.nilable(EInvoiceAPI::CurrencyCode::OrSymbol)) }
39
40
  attr_reader :currency
40
41
 
41
42
  sig { params(currency: EInvoiceAPI::CurrencyCode::OrSymbol).void }
42
43
  attr_writer :currency
43
44
 
45
+ # The address of the customer/buyer
44
46
  sig { returns(T.nilable(String)) }
45
47
  attr_accessor :customer_address
46
48
 
49
+ # The recipient name at the customer address
47
50
  sig { returns(T.nilable(String)) }
48
51
  attr_accessor :customer_address_recipient
49
52
 
53
+ # Customer company ID. For Belgium this is the CBE number or their EUID (European
54
+ # Unique Identifier) number. In the Netherlands this is the KVK number.
55
+ sig { returns(T.nilable(String)) }
56
+ attr_accessor :customer_company_id
57
+
58
+ # The email address of the customer
50
59
  sig { returns(T.nilable(String)) }
51
60
  attr_accessor :customer_email
52
61
 
62
+ # The unique identifier for the customer in your system
53
63
  sig { returns(T.nilable(String)) }
54
64
  attr_accessor :customer_id
55
65
 
66
+ # The company name of the customer/buyer
56
67
  sig { returns(T.nilable(String)) }
57
68
  attr_accessor :customer_name
58
69
 
70
+ # Customer tax ID. For Belgium this is the VAT number. Must include the country
71
+ # prefix
59
72
  sig { returns(T.nilable(String)) }
60
73
  attr_accessor :customer_tax_id
61
74
 
75
+ # The direction of the document: INBOUND (purchases) or OUTBOUND (sales)
62
76
  sig { returns(T.nilable(EInvoiceAPI::DocumentDirection::OrSymbol)) }
63
77
  attr_reader :direction
64
78
 
65
79
  sig { params(direction: EInvoiceAPI::DocumentDirection::OrSymbol).void }
66
80
  attr_writer :direction
67
81
 
82
+ # The type of document: INVOICE, CREDIT_NOTE, or DEBIT_NOTE
68
83
  sig { returns(T.nilable(EInvoiceAPI::DocumentType::OrSymbol)) }
69
84
  attr_reader :document_type
70
85
 
71
86
  sig { params(document_type: EInvoiceAPI::DocumentType::OrSymbol).void }
72
87
  attr_writer :document_type
73
88
 
89
+ # The date when payment is due
74
90
  sig { returns(T.nilable(Date)) }
75
91
  attr_accessor :due_date
76
92
 
93
+ # The date when the invoice was issued
77
94
  sig { returns(T.nilable(Date)) }
78
95
  attr_accessor :invoice_date
79
96
 
97
+ # The unique invoice identifier/number
80
98
  sig { returns(T.nilable(String)) }
81
99
  attr_accessor :invoice_id
82
100
 
83
- # The total amount of the invoice (so invoice_total = subtotal + total_tax +
84
- # total_discount). Must be positive and rounded to maximum 2 decimals
101
+ # The total amount of the invoice including tax (invoice_total = subtotal +
102
+ # total_tax + total_discount). Must be positive and rounded to maximum 2 decimals
85
103
  sig do
86
104
  returns(T.nilable(EInvoiceAPI::DocumentCreate::InvoiceTotal::Variants))
87
105
  end
@@ -96,17 +114,19 @@ module EInvoiceAPI
96
114
  end
97
115
  attr_writer :items
98
116
 
117
+ # Additional notes or comments for the invoice
99
118
  sig { returns(T.nilable(String)) }
100
119
  attr_accessor :note
101
120
 
102
121
  sig { returns(T.nilable(T::Array[EInvoiceAPI::PaymentDetailCreate])) }
103
122
  attr_accessor :payment_details
104
123
 
124
+ # The payment terms (e.g., 'Net 30', 'Due on receipt', '2/10 Net 30')
105
125
  sig { returns(T.nilable(String)) }
106
126
  attr_accessor :payment_term
107
127
 
108
- # The previous unpaid balance of the invoice, if any. Must be positive and rounded
109
- # to maximum 2 decimals
128
+ # The previous unpaid balance from prior invoices, if any. Must be positive and
129
+ # rounded to maximum 2 decimals
110
130
  sig do
111
131
  returns(
112
132
  T.nilable(
@@ -116,33 +136,43 @@ module EInvoiceAPI
116
136
  end
117
137
  attr_accessor :previous_unpaid_balance
118
138
 
139
+ # The purchase order reference number
119
140
  sig { returns(T.nilable(String)) }
120
141
  attr_accessor :purchase_order
121
142
 
143
+ # The address where payment should be sent or remitted to
122
144
  sig { returns(T.nilable(String)) }
123
145
  attr_accessor :remittance_address
124
146
 
147
+ # The recipient name at the remittance address
125
148
  sig { returns(T.nilable(String)) }
126
149
  attr_accessor :remittance_address_recipient
127
150
 
151
+ # The address where services were performed or goods were delivered
128
152
  sig { returns(T.nilable(String)) }
129
153
  attr_accessor :service_address
130
154
 
155
+ # The recipient name at the service address
131
156
  sig { returns(T.nilable(String)) }
132
157
  attr_accessor :service_address_recipient
133
158
 
159
+ # The end date of the service period or delivery period
134
160
  sig { returns(T.nilable(Date)) }
135
161
  attr_accessor :service_end_date
136
162
 
163
+ # The start date of the service period or delivery period
137
164
  sig { returns(T.nilable(Date)) }
138
165
  attr_accessor :service_start_date
139
166
 
167
+ # The shipping/delivery address
140
168
  sig { returns(T.nilable(String)) }
141
169
  attr_accessor :shipping_address
142
170
 
171
+ # The recipient name at the shipping address
143
172
  sig { returns(T.nilable(String)) }
144
173
  attr_accessor :shipping_address_recipient
145
174
 
175
+ # The current state of the document: DRAFT, TRANSIT, FAILED, SENT, or RECEIVED
146
176
  sig { returns(T.nilable(EInvoiceAPI::DocumentState::OrSymbol)) }
147
177
  attr_reader :state
148
178
 
@@ -157,7 +187,8 @@ module EInvoiceAPI
157
187
  end
158
188
  attr_accessor :subtotal
159
189
 
160
- # Tax category code of the invoice
190
+ # Tax category code of the invoice (e.g., S for standard rate, Z for zero rate, E
191
+ # for exempt)
161
192
  sig { returns(T.nilable(EInvoiceAPI::DocumentCreate::TaxCode::OrSymbol)) }
162
193
  attr_reader :tax_code
163
194
 
@@ -179,7 +210,8 @@ module EInvoiceAPI
179
210
  end
180
211
  attr_accessor :total_discount
181
212
 
182
- # The total tax of the invoice. Must be positive and rounded to maximum 2 decimals
213
+ # The total tax amount of the invoice. Must be positive and rounded to maximum 2
214
+ # decimals
183
215
  sig do
184
216
  returns(T.nilable(EInvoiceAPI::DocumentCreate::TotalTax::Variants))
185
217
  end
@@ -191,22 +223,33 @@ module EInvoiceAPI
191
223
  sig { returns(T.nilable(EInvoiceAPI::DocumentCreate::Vatex::OrSymbol)) }
192
224
  attr_accessor :vatex
193
225
 
194
- # VAT exemption note of the invoice
226
+ # Textual explanation for VAT exemption
195
227
  sig { returns(T.nilable(String)) }
196
228
  attr_accessor :vatex_note
197
229
 
230
+ # The address of the vendor/seller
198
231
  sig { returns(T.nilable(String)) }
199
232
  attr_accessor :vendor_address
200
233
 
234
+ # The recipient name at the vendor address
201
235
  sig { returns(T.nilable(String)) }
202
236
  attr_accessor :vendor_address_recipient
203
237
 
238
+ # Vendor company ID. For Belgium this is the CBE number or their EUID (European
239
+ # Unique Identifier) number. In the Netherlands this is the KVK number.
240
+ sig { returns(T.nilable(String)) }
241
+ attr_accessor :vendor_company_id
242
+
243
+ # The email address of the vendor
204
244
  sig { returns(T.nilable(String)) }
205
245
  attr_accessor :vendor_email
206
246
 
247
+ # The name of the vendor/seller/supplier
207
248
  sig { returns(T.nilable(String)) }
208
249
  attr_accessor :vendor_name
209
250
 
251
+ # Vendor tax ID. For Belgium this is the VAT number. Must include the country
252
+ # prefix
210
253
  sig { returns(T.nilable(String)) }
211
254
  attr_accessor :vendor_tax_id
212
255
 
@@ -225,6 +268,7 @@ module EInvoiceAPI
225
268
  currency: EInvoiceAPI::CurrencyCode::OrSymbol,
226
269
  customer_address: T.nilable(String),
227
270
  customer_address_recipient: T.nilable(String),
271
+ customer_company_id: T.nilable(String),
228
272
  customer_email: T.nilable(String),
229
273
  customer_id: T.nilable(String),
230
274
  customer_name: T.nilable(String),
@@ -266,6 +310,7 @@ module EInvoiceAPI
266
310
  vatex_note: T.nilable(String),
267
311
  vendor_address: T.nilable(String),
268
312
  vendor_address_recipient: T.nilable(String),
313
+ vendor_company_id: T.nilable(String),
269
314
  vendor_email: T.nilable(String),
270
315
  vendor_name: T.nilable(String),
271
316
  vendor_tax_id: T.nilable(String)
@@ -273,70 +318,109 @@ module EInvoiceAPI
273
318
  end
274
319
  def self.new(
275
320
  allowances: nil,
276
- # The amount due of the invoice. Must be positive and rounded to maximum 2
277
- # decimals
321
+ # The amount due for payment. Must be positive and rounded to maximum 2 decimals
278
322
  amount_due: nil,
279
323
  attachments: nil,
324
+ # The billing address (if different from customer address)
280
325
  billing_address: nil,
326
+ # The recipient name at the billing address
281
327
  billing_address_recipient: nil,
282
328
  charges: nil,
283
- # Currency of the invoice
329
+ # Currency of the invoice (ISO 4217 currency code)
284
330
  currency: nil,
331
+ # The address of the customer/buyer
285
332
  customer_address: nil,
333
+ # The recipient name at the customer address
286
334
  customer_address_recipient: nil,
335
+ # Customer company ID. For Belgium this is the CBE number or their EUID (European
336
+ # Unique Identifier) number. In the Netherlands this is the KVK number.
337
+ customer_company_id: nil,
338
+ # The email address of the customer
287
339
  customer_email: nil,
340
+ # The unique identifier for the customer in your system
288
341
  customer_id: nil,
342
+ # The company name of the customer/buyer
289
343
  customer_name: nil,
344
+ # Customer tax ID. For Belgium this is the VAT number. Must include the country
345
+ # prefix
290
346
  customer_tax_id: nil,
347
+ # The direction of the document: INBOUND (purchases) or OUTBOUND (sales)
291
348
  direction: nil,
349
+ # The type of document: INVOICE, CREDIT_NOTE, or DEBIT_NOTE
292
350
  document_type: nil,
351
+ # The date when payment is due
293
352
  due_date: nil,
353
+ # The date when the invoice was issued
294
354
  invoice_date: nil,
355
+ # The unique invoice identifier/number
295
356
  invoice_id: nil,
296
- # The total amount of the invoice (so invoice_total = subtotal + total_tax +
297
- # total_discount). Must be positive and rounded to maximum 2 decimals
357
+ # The total amount of the invoice including tax (invoice_total = subtotal +
358
+ # total_tax + total_discount). Must be positive and rounded to maximum 2 decimals
298
359
  invoice_total: nil,
299
360
  # At least one line item is required
300
361
  items: nil,
362
+ # Additional notes or comments for the invoice
301
363
  note: nil,
302
364
  payment_details: nil,
365
+ # The payment terms (e.g., 'Net 30', 'Due on receipt', '2/10 Net 30')
303
366
  payment_term: nil,
304
- # The previous unpaid balance of the invoice, if any. Must be positive and rounded
305
- # to maximum 2 decimals
367
+ # The previous unpaid balance from prior invoices, if any. Must be positive and
368
+ # rounded to maximum 2 decimals
306
369
  previous_unpaid_balance: nil,
370
+ # The purchase order reference number
307
371
  purchase_order: nil,
372
+ # The address where payment should be sent or remitted to
308
373
  remittance_address: nil,
374
+ # The recipient name at the remittance address
309
375
  remittance_address_recipient: nil,
376
+ # The address where services were performed or goods were delivered
310
377
  service_address: nil,
378
+ # The recipient name at the service address
311
379
  service_address_recipient: nil,
380
+ # The end date of the service period or delivery period
312
381
  service_end_date: nil,
382
+ # The start date of the service period or delivery period
313
383
  service_start_date: nil,
384
+ # The shipping/delivery address
314
385
  shipping_address: nil,
386
+ # The recipient name at the shipping address
315
387
  shipping_address_recipient: nil,
388
+ # The current state of the document: DRAFT, TRANSIT, FAILED, SENT, or RECEIVED
316
389
  state: nil,
317
390
  # The taxable base of the invoice. Should be the sum of all line items -
318
391
  # allowances (for example commercial discounts) + charges with impact on VAT. Must
319
392
  # be positive and rounded to maximum 2 decimals
320
393
  subtotal: nil,
321
- # Tax category code of the invoice
394
+ # Tax category code of the invoice (e.g., S for standard rate, Z for zero rate, E
395
+ # for exempt)
322
396
  tax_code: nil,
323
397
  tax_details: nil,
324
398
  # The net financial discount/charge of the invoice (non-VAT charges minus non-VAT
325
399
  # allowances). Can be positive (net charge), negative (net discount), or zero.
326
400
  # Must be rounded to maximum 2 decimals
327
401
  total_discount: nil,
328
- # The total tax of the invoice. Must be positive and rounded to maximum 2 decimals
402
+ # The total tax amount of the invoice. Must be positive and rounded to maximum 2
403
+ # decimals
329
404
  total_tax: nil,
330
405
  # VATEX code list for VAT exemption reasons
331
406
  #
332
407
  # Agency: CEF Identifier: vatex
333
408
  vatex: nil,
334
- # VAT exemption note of the invoice
409
+ # Textual explanation for VAT exemption
335
410
  vatex_note: nil,
411
+ # The address of the vendor/seller
336
412
  vendor_address: nil,
413
+ # The recipient name at the vendor address
337
414
  vendor_address_recipient: nil,
415
+ # Vendor company ID. For Belgium this is the CBE number or their EUID (European
416
+ # Unique Identifier) number. In the Netherlands this is the KVK number.
417
+ vendor_company_id: nil,
418
+ # The email address of the vendor
338
419
  vendor_email: nil,
420
+ # The name of the vendor/seller/supplier
339
421
  vendor_name: nil,
422
+ # Vendor tax ID. For Belgium this is the VAT number. Must include the country
423
+ # prefix
340
424
  vendor_tax_id: nil
341
425
  )
342
426
  end
@@ -356,6 +440,7 @@ module EInvoiceAPI
356
440
  currency: EInvoiceAPI::CurrencyCode::OrSymbol,
357
441
  customer_address: T.nilable(String),
358
442
  customer_address_recipient: T.nilable(String),
443
+ customer_company_id: T.nilable(String),
359
444
  customer_email: T.nilable(String),
360
445
  customer_id: T.nilable(String),
361
446
  customer_name: T.nilable(String),
@@ -399,6 +484,7 @@ module EInvoiceAPI
399
484
  vatex_note: T.nilable(String),
400
485
  vendor_address: T.nilable(String),
401
486
  vendor_address_recipient: T.nilable(String),
487
+ vendor_company_id: T.nilable(String),
402
488
  vendor_email: T.nilable(String),
403
489
  vendor_name: T.nilable(String),
404
490
  vendor_tax_id: T.nilable(String)
@@ -669,8 +755,7 @@ module EInvoiceAPI
669
755
  end
670
756
  end
671
757
 
672
- # The amount due of the invoice. Must be positive and rounded to maximum 2
673
- # decimals
758
+ # The amount due for payment. Must be positive and rounded to maximum 2 decimals
674
759
  module AmountDue
675
760
  extend EInvoiceAPI::Internal::Type::Union
676
761
 
@@ -940,8 +1025,8 @@ module EInvoiceAPI
940
1025
  end
941
1026
  end
942
1027
 
943
- # The total amount of the invoice (so invoice_total = subtotal + total_tax +
944
- # total_discount). Must be positive and rounded to maximum 2 decimals
1028
+ # The total amount of the invoice including tax (invoice_total = subtotal +
1029
+ # total_tax + total_discount). Must be positive and rounded to maximum 2 decimals
945
1030
  module InvoiceTotal
946
1031
  extend EInvoiceAPI::Internal::Type::Union
947
1032
 
@@ -1720,8 +1805,8 @@ module EInvoiceAPI
1720
1805
  end
1721
1806
  end
1722
1807
 
1723
- # The previous unpaid balance of the invoice, if any. Must be positive and rounded
1724
- # to maximum 2 decimals
1808
+ # The previous unpaid balance from prior invoices, if any. Must be positive and
1809
+ # rounded to maximum 2 decimals
1725
1810
  module PreviousUnpaidBalance
1726
1811
  extend EInvoiceAPI::Internal::Type::Union
1727
1812
 
@@ -1755,7 +1840,8 @@ module EInvoiceAPI
1755
1840
  end
1756
1841
  end
1757
1842
 
1758
- # Tax category code of the invoice
1843
+ # Tax category code of the invoice (e.g., S for standard rate, Z for zero rate, E
1844
+ # for exempt)
1759
1845
  module TaxCode
1760
1846
  extend EInvoiceAPI::Internal::Type::Enum
1761
1847
 
@@ -1792,6 +1878,7 @@ module EInvoiceAPI
1792
1878
  )
1793
1879
  end
1794
1880
 
1881
+ # The tax amount for this tax category. Must be rounded to maximum 2 decimals
1795
1882
  sig do
1796
1883
  returns(
1797
1884
  T.nilable(EInvoiceAPI::DocumentCreate::TaxDetail::Amount::Variants)
@@ -1799,6 +1886,7 @@ module EInvoiceAPI
1799
1886
  end
1800
1887
  attr_accessor :amount
1801
1888
 
1889
+ # The tax rate as a percentage (e.g., '21.00', '6.00', '0.00')
1802
1890
  sig { returns(T.nilable(String)) }
1803
1891
  attr_accessor :rate
1804
1892
 
@@ -1811,7 +1899,12 @@ module EInvoiceAPI
1811
1899
  rate: T.nilable(String)
1812
1900
  ).returns(T.attached_class)
1813
1901
  end
1814
- def self.new(amount: nil, rate: nil)
1902
+ def self.new(
1903
+ # The tax amount for this tax category. Must be rounded to maximum 2 decimals
1904
+ amount: nil,
1905
+ # The tax rate as a percentage (e.g., '21.00', '6.00', '0.00')
1906
+ rate: nil
1907
+ )
1815
1908
  end
1816
1909
 
1817
1910
  sig do
@@ -1828,6 +1921,7 @@ module EInvoiceAPI
1828
1921
  def to_hash
1829
1922
  end
1830
1923
 
1924
+ # The tax amount for this tax category. Must be rounded to maximum 2 decimals
1831
1925
  module Amount
1832
1926
  extend EInvoiceAPI::Internal::Type::Union
1833
1927
 
@@ -1860,7 +1954,8 @@ module EInvoiceAPI
1860
1954
  end
1861
1955
  end
1862
1956
 
1863
- # The total tax of the invoice. Must be positive and rounded to maximum 2 decimals
1957
+ # The total tax amount of the invoice. Must be positive and rounded to maximum 2
1958
+ # decimals
1864
1959
  module TotalTax
1865
1960
  extend EInvoiceAPI::Internal::Type::Union
1866
1961