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.
@@ -14,8 +14,7 @@ module EInvoiceAPI
14
14
  sig { returns(T.nilable(T::Array[EInvoiceAPI::Allowance])) }
15
15
  attr_accessor :allowances
16
16
 
17
- # The amount due of the invoice. Must be positive and rounded to maximum 2
18
- # decimals
17
+ # The amount due for payment. Must be positive and rounded to maximum 2 decimals
19
18
  sig { returns(T.nilable(String)) }
20
19
  attr_accessor :amount_due
21
20
 
@@ -24,63 +23,82 @@ module EInvoiceAPI
24
23
  end
25
24
  attr_accessor :attachments
26
25
 
26
+ # The billing address (if different from customer address)
27
27
  sig { returns(T.nilable(String)) }
28
28
  attr_accessor :billing_address
29
29
 
30
+ # The recipient name at the billing address
30
31
  sig { returns(T.nilable(String)) }
31
32
  attr_accessor :billing_address_recipient
32
33
 
33
34
  sig { returns(T.nilable(T::Array[EInvoiceAPI::Charge])) }
34
35
  attr_accessor :charges
35
36
 
36
- # Currency of the invoice
37
+ # Currency of the invoice (ISO 4217 currency code)
37
38
  sig { returns(T.nilable(EInvoiceAPI::CurrencyCode::TaggedSymbol)) }
38
39
  attr_reader :currency
39
40
 
40
41
  sig { params(currency: EInvoiceAPI::CurrencyCode::OrSymbol).void }
41
42
  attr_writer :currency
42
43
 
44
+ # The address of the customer/buyer
43
45
  sig { returns(T.nilable(String)) }
44
46
  attr_accessor :customer_address
45
47
 
48
+ # The recipient name at the customer address
46
49
  sig { returns(T.nilable(String)) }
47
50
  attr_accessor :customer_address_recipient
48
51
 
52
+ # Customer company ID. For Belgium this is the CBE number or their EUID (European
53
+ # Unique Identifier) number. In the Netherlands this is the KVK number.
54
+ sig { returns(T.nilable(String)) }
55
+ attr_accessor :customer_company_id
56
+
57
+ # The email address of the customer
49
58
  sig { returns(T.nilable(String)) }
50
59
  attr_accessor :customer_email
51
60
 
61
+ # The unique identifier for the customer in your system
52
62
  sig { returns(T.nilable(String)) }
53
63
  attr_accessor :customer_id
54
64
 
65
+ # The company name of the customer/buyer
55
66
  sig { returns(T.nilable(String)) }
56
67
  attr_accessor :customer_name
57
68
 
69
+ # Customer tax ID. For Belgium this is the VAT number. Must include the country
70
+ # prefix
58
71
  sig { returns(T.nilable(String)) }
59
72
  attr_accessor :customer_tax_id
60
73
 
74
+ # The direction of the document: INBOUND (purchases) or OUTBOUND (sales)
61
75
  sig { returns(T.nilable(EInvoiceAPI::DocumentDirection::TaggedSymbol)) }
62
76
  attr_reader :direction
63
77
 
64
78
  sig { params(direction: EInvoiceAPI::DocumentDirection::OrSymbol).void }
65
79
  attr_writer :direction
66
80
 
81
+ # The type of document: INVOICE, CREDIT_NOTE, or DEBIT_NOTE
67
82
  sig { returns(T.nilable(EInvoiceAPI::DocumentType::TaggedSymbol)) }
68
83
  attr_reader :document_type
69
84
 
70
85
  sig { params(document_type: EInvoiceAPI::DocumentType::OrSymbol).void }
71
86
  attr_writer :document_type
72
87
 
88
+ # The date when payment is due
73
89
  sig { returns(T.nilable(Date)) }
74
90
  attr_accessor :due_date
75
91
 
92
+ # The date when the invoice was issued
76
93
  sig { returns(T.nilable(Date)) }
77
94
  attr_accessor :invoice_date
78
95
 
96
+ # The unique invoice identifier/number
79
97
  sig { returns(T.nilable(String)) }
80
98
  attr_accessor :invoice_id
81
99
 
82
- # The total amount of the invoice (so invoice_total = subtotal + total_tax +
83
- # total_discount). Must be positive and rounded to maximum 2 decimals
100
+ # The total amount of the invoice including tax (invoice_total = subtotal +
101
+ # total_tax + total_discount). Must be positive and rounded to maximum 2 decimals
84
102
  sig { returns(T.nilable(String)) }
85
103
  attr_accessor :invoice_total
86
104
 
@@ -104,47 +122,59 @@ module EInvoiceAPI
104
122
  end
105
123
  attr_writer :items
106
124
 
125
+ # Additional notes or comments for the invoice
107
126
  sig { returns(T.nilable(String)) }
108
127
  attr_accessor :note
109
128
 
110
129
  sig { returns(T.nilable(T::Array[EInvoiceAPI::PaymentDetailCreate])) }
111
130
  attr_accessor :payment_details
112
131
 
132
+ # The payment terms (e.g., 'Net 30', 'Due on receipt', '2/10 Net 30')
113
133
  sig { returns(T.nilable(String)) }
114
134
  attr_accessor :payment_term
115
135
 
116
- # The previous unpaid balance of the invoice, if any. Must be positive and rounded
117
- # to maximum 2 decimals
136
+ # The previous unpaid balance from prior invoices, if any. Must be positive and
137
+ # rounded to maximum 2 decimals
118
138
  sig { returns(T.nilable(String)) }
119
139
  attr_accessor :previous_unpaid_balance
120
140
 
141
+ # The purchase order reference number
121
142
  sig { returns(T.nilable(String)) }
122
143
  attr_accessor :purchase_order
123
144
 
145
+ # The address where payment should be sent or remitted to
124
146
  sig { returns(T.nilable(String)) }
125
147
  attr_accessor :remittance_address
126
148
 
149
+ # The recipient name at the remittance address
127
150
  sig { returns(T.nilable(String)) }
128
151
  attr_accessor :remittance_address_recipient
129
152
 
153
+ # The address where services were performed or goods were delivered
130
154
  sig { returns(T.nilable(String)) }
131
155
  attr_accessor :service_address
132
156
 
157
+ # The recipient name at the service address
133
158
  sig { returns(T.nilable(String)) }
134
159
  attr_accessor :service_address_recipient
135
160
 
161
+ # The end date of the service period or delivery period
136
162
  sig { returns(T.nilable(Date)) }
137
163
  attr_accessor :service_end_date
138
164
 
165
+ # The start date of the service period or delivery period
139
166
  sig { returns(T.nilable(Date)) }
140
167
  attr_accessor :service_start_date
141
168
 
169
+ # The shipping/delivery address
142
170
  sig { returns(T.nilable(String)) }
143
171
  attr_accessor :shipping_address
144
172
 
173
+ # The recipient name at the shipping address
145
174
  sig { returns(T.nilable(String)) }
146
175
  attr_accessor :shipping_address_recipient
147
176
 
177
+ # The current state of the document: DRAFT, TRANSIT, FAILED, SENT, or RECEIVED
148
178
  sig { returns(T.nilable(EInvoiceAPI::DocumentState::TaggedSymbol)) }
149
179
  attr_reader :state
150
180
 
@@ -164,7 +194,8 @@ module EInvoiceAPI
164
194
  sig { params(success: T::Boolean).void }
165
195
  attr_writer :success
166
196
 
167
- # Tax category code of the invoice
197
+ # Tax category code of the invoice (e.g., S for standard rate, Z for zero rate, E
198
+ # for exempt)
168
199
  sig do
169
200
  returns(
170
201
  T.nilable(
@@ -199,7 +230,8 @@ module EInvoiceAPI
199
230
  sig { returns(T.nilable(String)) }
200
231
  attr_accessor :total_discount
201
232
 
202
- # The total tax of the invoice. Must be positive and rounded to maximum 2 decimals
233
+ # The total tax amount of the invoice. Must be positive and rounded to maximum 2
234
+ # decimals
203
235
  sig { returns(T.nilable(String)) }
204
236
  attr_accessor :total_tax
205
237
 
@@ -219,22 +251,33 @@ module EInvoiceAPI
219
251
  end
220
252
  attr_accessor :vatex
221
253
 
222
- # VAT exemption note of the invoice
254
+ # Textual explanation for VAT exemption
223
255
  sig { returns(T.nilable(String)) }
224
256
  attr_accessor :vatex_note
225
257
 
258
+ # The address of the vendor/seller
226
259
  sig { returns(T.nilable(String)) }
227
260
  attr_accessor :vendor_address
228
261
 
262
+ # The recipient name at the vendor address
229
263
  sig { returns(T.nilable(String)) }
230
264
  attr_accessor :vendor_address_recipient
231
265
 
266
+ # Vendor company ID. For Belgium this is the CBE number or their EUID (European
267
+ # Unique Identifier) number. In the Netherlands this is the KVK number.
268
+ sig { returns(T.nilable(String)) }
269
+ attr_accessor :vendor_company_id
270
+
271
+ # The email address of the vendor
232
272
  sig { returns(T.nilable(String)) }
233
273
  attr_accessor :vendor_email
234
274
 
275
+ # The name of the vendor/seller/supplier
235
276
  sig { returns(T.nilable(String)) }
236
277
  attr_accessor :vendor_name
237
278
 
279
+ # Vendor tax ID. For Belgium this is the VAT number. Must include the country
280
+ # prefix
238
281
  sig { returns(T.nilable(String)) }
239
282
  attr_accessor :vendor_tax_id
240
283
 
@@ -250,6 +293,7 @@ module EInvoiceAPI
250
293
  currency: EInvoiceAPI::CurrencyCode::OrSymbol,
251
294
  customer_address: T.nilable(String),
252
295
  customer_address_recipient: T.nilable(String),
296
+ customer_company_id: T.nilable(String),
253
297
  customer_email: T.nilable(String),
254
298
  customer_id: T.nilable(String),
255
299
  customer_name: T.nilable(String),
@@ -299,6 +343,7 @@ module EInvoiceAPI
299
343
  vatex_note: T.nilable(String),
300
344
  vendor_address: T.nilable(String),
301
345
  vendor_address_recipient: T.nilable(String),
346
+ vendor_company_id: T.nilable(String),
302
347
  vendor_email: T.nilable(String),
303
348
  vendor_name: T.nilable(String),
304
349
  vendor_tax_id: T.nilable(String)
@@ -306,46 +351,74 @@ module EInvoiceAPI
306
351
  end
307
352
  def self.new(
308
353
  allowances: nil,
309
- # The amount due of the invoice. Must be positive and rounded to maximum 2
310
- # decimals
354
+ # The amount due for payment. Must be positive and rounded to maximum 2 decimals
311
355
  amount_due: nil,
312
356
  attachments: nil,
357
+ # The billing address (if different from customer address)
313
358
  billing_address: nil,
359
+ # The recipient name at the billing address
314
360
  billing_address_recipient: nil,
315
361
  charges: nil,
316
- # Currency of the invoice
362
+ # Currency of the invoice (ISO 4217 currency code)
317
363
  currency: nil,
364
+ # The address of the customer/buyer
318
365
  customer_address: nil,
366
+ # The recipient name at the customer address
319
367
  customer_address_recipient: nil,
368
+ # Customer company ID. For Belgium this is the CBE number or their EUID (European
369
+ # Unique Identifier) number. In the Netherlands this is the KVK number.
370
+ customer_company_id: nil,
371
+ # The email address of the customer
320
372
  customer_email: nil,
373
+ # The unique identifier for the customer in your system
321
374
  customer_id: nil,
375
+ # The company name of the customer/buyer
322
376
  customer_name: nil,
377
+ # Customer tax ID. For Belgium this is the VAT number. Must include the country
378
+ # prefix
323
379
  customer_tax_id: nil,
380
+ # The direction of the document: INBOUND (purchases) or OUTBOUND (sales)
324
381
  direction: nil,
382
+ # The type of document: INVOICE, CREDIT_NOTE, or DEBIT_NOTE
325
383
  document_type: nil,
384
+ # The date when payment is due
326
385
  due_date: nil,
386
+ # The date when the invoice was issued
327
387
  invoice_date: nil,
388
+ # The unique invoice identifier/number
328
389
  invoice_id: nil,
329
- # The total amount of the invoice (so invoice_total = subtotal + total_tax +
330
- # total_discount). Must be positive and rounded to maximum 2 decimals
390
+ # The total amount of the invoice including tax (invoice_total = subtotal +
391
+ # total_tax + total_discount). Must be positive and rounded to maximum 2 decimals
331
392
  invoice_total: nil,
332
393
  # At least one line item is required
333
394
  items: nil,
395
+ # Additional notes or comments for the invoice
334
396
  note: nil,
335
397
  payment_details: nil,
398
+ # The payment terms (e.g., 'Net 30', 'Due on receipt', '2/10 Net 30')
336
399
  payment_term: nil,
337
- # The previous unpaid balance of the invoice, if any. Must be positive and rounded
338
- # to maximum 2 decimals
400
+ # The previous unpaid balance from prior invoices, if any. Must be positive and
401
+ # rounded to maximum 2 decimals
339
402
  previous_unpaid_balance: nil,
403
+ # The purchase order reference number
340
404
  purchase_order: nil,
405
+ # The address where payment should be sent or remitted to
341
406
  remittance_address: nil,
407
+ # The recipient name at the remittance address
342
408
  remittance_address_recipient: nil,
409
+ # The address where services were performed or goods were delivered
343
410
  service_address: nil,
411
+ # The recipient name at the service address
344
412
  service_address_recipient: nil,
413
+ # The end date of the service period or delivery period
345
414
  service_end_date: nil,
415
+ # The start date of the service period or delivery period
346
416
  service_start_date: nil,
417
+ # The shipping/delivery address
347
418
  shipping_address: nil,
419
+ # The recipient name at the shipping address
348
420
  shipping_address_recipient: nil,
421
+ # The current state of the document: DRAFT, TRANSIT, FAILED, SENT, or RECEIVED
349
422
  state: nil,
350
423
  # The taxable base of the invoice. Should be the sum of all line items -
351
424
  # allowances (for example commercial discounts) + charges with impact on VAT. Must
@@ -353,14 +426,16 @@ module EInvoiceAPI
353
426
  subtotal: nil,
354
427
  # Whether the PDF was successfully converted into a compliant e-invoice
355
428
  success: nil,
356
- # Tax category code of the invoice
429
+ # Tax category code of the invoice (e.g., S for standard rate, Z for zero rate, E
430
+ # for exempt)
357
431
  tax_code: nil,
358
432
  tax_details: nil,
359
433
  # The net financial discount/charge of the invoice (non-VAT charges minus non-VAT
360
434
  # allowances). Can be positive (net charge), negative (net discount), or zero.
361
435
  # Must be rounded to maximum 2 decimals
362
436
  total_discount: nil,
363
- # The total tax of the invoice. Must be positive and rounded to maximum 2 decimals
437
+ # The total tax amount of the invoice. Must be positive and rounded to maximum 2
438
+ # decimals
364
439
  total_tax: nil,
365
440
  # The UBL document as an XML string
366
441
  ubl_document: nil,
@@ -368,12 +443,21 @@ module EInvoiceAPI
368
443
  #
369
444
  # Agency: CEF Identifier: vatex
370
445
  vatex: nil,
371
- # VAT exemption note of the invoice
446
+ # Textual explanation for VAT exemption
372
447
  vatex_note: nil,
448
+ # The address of the vendor/seller
373
449
  vendor_address: nil,
450
+ # The recipient name at the vendor address
374
451
  vendor_address_recipient: nil,
452
+ # Vendor company ID. For Belgium this is the CBE number or their EUID (European
453
+ # Unique Identifier) number. In the Netherlands this is the KVK number.
454
+ vendor_company_id: nil,
455
+ # The email address of the vendor
375
456
  vendor_email: nil,
457
+ # The name of the vendor/seller/supplier
376
458
  vendor_name: nil,
459
+ # Vendor tax ID. For Belgium this is the VAT number. Must include the country
460
+ # prefix
377
461
  vendor_tax_id: nil
378
462
  )
379
463
  end
@@ -391,6 +475,7 @@ module EInvoiceAPI
391
475
  currency: EInvoiceAPI::CurrencyCode::TaggedSymbol,
392
476
  customer_address: T.nilable(String),
393
477
  customer_address_recipient: T.nilable(String),
478
+ customer_company_id: T.nilable(String),
394
479
  customer_email: T.nilable(String),
395
480
  customer_id: T.nilable(String),
396
481
  customer_name: T.nilable(String),
@@ -440,6 +525,7 @@ module EInvoiceAPI
440
525
  vatex_note: T.nilable(String),
441
526
  vendor_address: T.nilable(String),
442
527
  vendor_address_recipient: T.nilable(String),
528
+ vendor_company_id: T.nilable(String),
443
529
  vendor_email: T.nilable(String),
444
530
  vendor_name: T.nilable(String),
445
531
  vendor_tax_id: T.nilable(String)
@@ -568,7 +654,8 @@ module EInvoiceAPI
568
654
  end
569
655
  end
570
656
 
571
- # Tax category code of the invoice
657
+ # Tax category code of the invoice (e.g., S for standard rate, Z for zero rate, E
658
+ # for exempt)
572
659
  module TaxCode
573
660
  extend EInvoiceAPI::Internal::Type::Enum
574
661
 
@@ -652,9 +739,11 @@ module EInvoiceAPI
652
739
  )
653
740
  end
654
741
 
742
+ # The tax amount for this tax category. Must be rounded to maximum 2 decimals
655
743
  sig { returns(T.nilable(String)) }
656
744
  attr_accessor :amount
657
745
 
746
+ # The tax rate as a percentage (e.g., '21.00', '6.00', '0.00')
658
747
  sig { returns(T.nilable(String)) }
659
748
  attr_accessor :rate
660
749
 
@@ -663,7 +752,12 @@ module EInvoiceAPI
663
752
  T.attached_class
664
753
  )
665
754
  end
666
- def self.new(amount: nil, rate: nil)
755
+ def self.new(
756
+ # The tax amount for this tax category. Must be rounded to maximum 2 decimals
757
+ amount: nil,
758
+ # The tax rate as a percentage (e.g., '21.00', '6.00', '0.00')
759
+ rate: nil
760
+ )
667
761
  end
668
762
 
669
763
  sig do