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.
@@ -10,8 +10,7 @@ module EInvoiceAPI
10
10
  optional :allowances, -> { EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::Allowance] }, nil?: true
11
11
 
12
12
  # @!attribute amount_due
13
- # The amount due of the invoice. Must be positive and rounded to maximum 2
14
- # decimals
13
+ # The amount due for payment. Must be positive and rounded to maximum 2 decimals
15
14
  #
16
15
  # @return [String, nil]
17
16
  optional :amount_due, String, nil?: true
@@ -24,11 +23,13 @@ module EInvoiceAPI
24
23
  nil?: true
25
24
 
26
25
  # @!attribute billing_address
26
+ # The billing address (if different from customer address)
27
27
  #
28
28
  # @return [String, nil]
29
29
  optional :billing_address, String, nil?: true
30
30
 
31
31
  # @!attribute billing_address_recipient
32
+ # The recipient name at the billing address
32
33
  #
33
34
  # @return [String, nil]
34
35
  optional :billing_address_recipient, String, nil?: true
@@ -39,69 +40,88 @@ module EInvoiceAPI
39
40
  optional :charges, -> { EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::Charge] }, nil?: true
40
41
 
41
42
  # @!attribute currency
42
- # Currency of the invoice
43
+ # Currency of the invoice (ISO 4217 currency code)
43
44
  #
44
45
  # @return [Symbol, EInvoiceAPI::Models::CurrencyCode, nil]
45
46
  optional :currency, enum: -> { EInvoiceAPI::CurrencyCode }
46
47
 
47
48
  # @!attribute customer_address
49
+ # The address of the customer/buyer
48
50
  #
49
51
  # @return [String, nil]
50
52
  optional :customer_address, String, nil?: true
51
53
 
52
54
  # @!attribute customer_address_recipient
55
+ # The recipient name at the customer address
53
56
  #
54
57
  # @return [String, nil]
55
58
  optional :customer_address_recipient, String, nil?: true
56
59
 
60
+ # @!attribute customer_company_id
61
+ # Customer company ID. For Belgium this is the CBE number or their EUID (European
62
+ # Unique Identifier) number. In the Netherlands this is the KVK number.
63
+ #
64
+ # @return [String, nil]
65
+ optional :customer_company_id, String, nil?: true
66
+
57
67
  # @!attribute customer_email
68
+ # The email address of the customer
58
69
  #
59
70
  # @return [String, nil]
60
71
  optional :customer_email, String, nil?: true
61
72
 
62
73
  # @!attribute customer_id
74
+ # The unique identifier for the customer in your system
63
75
  #
64
76
  # @return [String, nil]
65
77
  optional :customer_id, String, nil?: true
66
78
 
67
79
  # @!attribute customer_name
80
+ # The company name of the customer/buyer
68
81
  #
69
82
  # @return [String, nil]
70
83
  optional :customer_name, String, nil?: true
71
84
 
72
85
  # @!attribute customer_tax_id
86
+ # Customer tax ID. For Belgium this is the VAT number. Must include the country
87
+ # prefix
73
88
  #
74
89
  # @return [String, nil]
75
90
  optional :customer_tax_id, String, nil?: true
76
91
 
77
92
  # @!attribute direction
93
+ # The direction of the document: INBOUND (purchases) or OUTBOUND (sales)
78
94
  #
79
95
  # @return [Symbol, EInvoiceAPI::Models::DocumentDirection, nil]
80
96
  optional :direction, enum: -> { EInvoiceAPI::DocumentDirection }
81
97
 
82
98
  # @!attribute document_type
99
+ # The type of document: INVOICE, CREDIT_NOTE, or DEBIT_NOTE
83
100
  #
84
101
  # @return [Symbol, EInvoiceAPI::Models::DocumentType, nil]
85
102
  optional :document_type, enum: -> { EInvoiceAPI::DocumentType }
86
103
 
87
104
  # @!attribute due_date
105
+ # The date when payment is due
88
106
  #
89
107
  # @return [Date, nil]
90
108
  optional :due_date, Date, nil?: true
91
109
 
92
110
  # @!attribute invoice_date
111
+ # The date when the invoice was issued
93
112
  #
94
113
  # @return [Date, nil]
95
114
  optional :invoice_date, Date, nil?: true
96
115
 
97
116
  # @!attribute invoice_id
117
+ # The unique invoice identifier/number
98
118
  #
99
119
  # @return [String, nil]
100
120
  optional :invoice_id, String, nil?: true
101
121
 
102
122
  # @!attribute invoice_total
103
- # The total amount of the invoice (so invoice_total = subtotal + total_tax +
104
- # total_discount). Must be positive and rounded to maximum 2 decimals
123
+ # The total amount of the invoice including tax (invoice_total = subtotal +
124
+ # total_tax + total_discount). Must be positive and rounded to maximum 2 decimals
105
125
  #
106
126
  # @return [String, nil]
107
127
  optional :invoice_total, String, nil?: true
@@ -114,6 +134,7 @@ module EInvoiceAPI
114
134
  -> { EInvoiceAPI::Internal::Type::ArrayOf[EInvoiceAPI::Models::DocumentCreateFromPdfResponse::Item] }
115
135
 
116
136
  # @!attribute note
137
+ # Additional notes or comments for the invoice
117
138
  #
118
139
  # @return [String, nil]
119
140
  optional :note, String, nil?: true
@@ -126,63 +147,74 @@ module EInvoiceAPI
126
147
  nil?: true
127
148
 
128
149
  # @!attribute payment_term
150
+ # The payment terms (e.g., 'Net 30', 'Due on receipt', '2/10 Net 30')
129
151
  #
130
152
  # @return [String, nil]
131
153
  optional :payment_term, String, nil?: true
132
154
 
133
155
  # @!attribute previous_unpaid_balance
134
- # The previous unpaid balance of the invoice, if any. Must be positive and rounded
135
- # to maximum 2 decimals
156
+ # The previous unpaid balance from prior invoices, if any. Must be positive and
157
+ # rounded to maximum 2 decimals
136
158
  #
137
159
  # @return [String, nil]
138
160
  optional :previous_unpaid_balance, String, nil?: true
139
161
 
140
162
  # @!attribute purchase_order
163
+ # The purchase order reference number
141
164
  #
142
165
  # @return [String, nil]
143
166
  optional :purchase_order, String, nil?: true
144
167
 
145
168
  # @!attribute remittance_address
169
+ # The address where payment should be sent or remitted to
146
170
  #
147
171
  # @return [String, nil]
148
172
  optional :remittance_address, String, nil?: true
149
173
 
150
174
  # @!attribute remittance_address_recipient
175
+ # The recipient name at the remittance address
151
176
  #
152
177
  # @return [String, nil]
153
178
  optional :remittance_address_recipient, String, nil?: true
154
179
 
155
180
  # @!attribute service_address
181
+ # The address where services were performed or goods were delivered
156
182
  #
157
183
  # @return [String, nil]
158
184
  optional :service_address, String, nil?: true
159
185
 
160
186
  # @!attribute service_address_recipient
187
+ # The recipient name at the service address
161
188
  #
162
189
  # @return [String, nil]
163
190
  optional :service_address_recipient, String, nil?: true
164
191
 
165
192
  # @!attribute service_end_date
193
+ # The end date of the service period or delivery period
166
194
  #
167
195
  # @return [Date, nil]
168
196
  optional :service_end_date, Date, nil?: true
169
197
 
170
198
  # @!attribute service_start_date
199
+ # The start date of the service period or delivery period
171
200
  #
172
201
  # @return [Date, nil]
173
202
  optional :service_start_date, Date, nil?: true
174
203
 
175
204
  # @!attribute shipping_address
205
+ # The shipping/delivery address
176
206
  #
177
207
  # @return [String, nil]
178
208
  optional :shipping_address, String, nil?: true
179
209
 
180
210
  # @!attribute shipping_address_recipient
211
+ # The recipient name at the shipping address
181
212
  #
182
213
  # @return [String, nil]
183
214
  optional :shipping_address_recipient, String, nil?: true
184
215
 
185
216
  # @!attribute state
217
+ # The current state of the document: DRAFT, TRANSIT, FAILED, SENT, or RECEIVED
186
218
  #
187
219
  # @return [Symbol, EInvoiceAPI::Models::DocumentState, nil]
188
220
  optional :state, enum: -> { EInvoiceAPI::DocumentState }
@@ -202,7 +234,8 @@ module EInvoiceAPI
202
234
  optional :success, EInvoiceAPI::Internal::Type::Boolean
203
235
 
204
236
  # @!attribute tax_code
205
- # Tax category code of the invoice
237
+ # Tax category code of the invoice (e.g., S for standard rate, Z for zero rate, E
238
+ # for exempt)
206
239
  #
207
240
  # @return [Symbol, EInvoiceAPI::Models::DocumentCreateFromPdfResponse::TaxCode, nil]
208
241
  optional :tax_code, enum: -> { EInvoiceAPI::Models::DocumentCreateFromPdfResponse::TaxCode }
@@ -223,7 +256,8 @@ module EInvoiceAPI
223
256
  optional :total_discount, String, nil?: true
224
257
 
225
258
  # @!attribute total_tax
226
- # The total tax of the invoice. Must be positive and rounded to maximum 2 decimals
259
+ # The total tax amount of the invoice. Must be positive and rounded to maximum 2
260
+ # decimals
227
261
  #
228
262
  # @return [String, nil]
229
263
  optional :total_tax, String, nil?: true
@@ -243,135 +277,152 @@ module EInvoiceAPI
243
277
  optional :vatex, enum: -> { EInvoiceAPI::Models::DocumentCreateFromPdfResponse::Vatex }, nil?: true
244
278
 
245
279
  # @!attribute vatex_note
246
- # VAT exemption note of the invoice
280
+ # Textual explanation for VAT exemption
247
281
  #
248
282
  # @return [String, nil]
249
283
  optional :vatex_note, String, nil?: true
250
284
 
251
285
  # @!attribute vendor_address
286
+ # The address of the vendor/seller
252
287
  #
253
288
  # @return [String, nil]
254
289
  optional :vendor_address, String, nil?: true
255
290
 
256
291
  # @!attribute vendor_address_recipient
292
+ # The recipient name at the vendor address
257
293
  #
258
294
  # @return [String, nil]
259
295
  optional :vendor_address_recipient, String, nil?: true
260
296
 
297
+ # @!attribute vendor_company_id
298
+ # Vendor company ID. For Belgium this is the CBE number or their EUID (European
299
+ # Unique Identifier) number. In the Netherlands this is the KVK number.
300
+ #
301
+ # @return [String, nil]
302
+ optional :vendor_company_id, String, nil?: true
303
+
261
304
  # @!attribute vendor_email
305
+ # The email address of the vendor
262
306
  #
263
307
  # @return [String, nil]
264
308
  optional :vendor_email, String, nil?: true
265
309
 
266
310
  # @!attribute vendor_name
311
+ # The name of the vendor/seller/supplier
267
312
  #
268
313
  # @return [String, nil]
269
314
  optional :vendor_name, String, nil?: true
270
315
 
271
316
  # @!attribute vendor_tax_id
317
+ # Vendor tax ID. For Belgium this is the VAT number. Must include the country
318
+ # prefix
272
319
  #
273
320
  # @return [String, nil]
274
321
  optional :vendor_tax_id, String, nil?: true
275
322
 
276
- # @!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_email: nil, customer_id: nil, customer_name: nil, customer_tax_id: nil, direction: nil, document_type: nil, due_date: nil, invoice_date: nil, invoice_id: nil, invoice_total: nil, items: nil, note: nil, payment_details: nil, payment_term: nil, previous_unpaid_balance: 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_email: nil, vendor_name: nil, vendor_tax_id: nil)
323
+ # @!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_tax_id: nil, direction: nil, document_type: nil, due_date: nil, invoice_date: nil, invoice_id: nil, invoice_total: nil, items: nil, note: nil, payment_details: nil, payment_term: nil, previous_unpaid_balance: 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)
277
324
  # Some parameter documentations has been truncated, see
278
325
  # {EInvoiceAPI::Models::DocumentCreateFromPdfResponse} for more details.
279
326
  #
280
327
  # @param allowances [Array<EInvoiceAPI::Models::Allowance>, nil]
281
328
  #
282
- # @param amount_due [String, nil] The amount due of the invoice. Must be positive and rounded to maximum 2 decimal
329
+ # @param amount_due [String, nil] The amount due for payment. Must be positive and rounded to maximum 2 decimals
283
330
  #
284
331
  # @param attachments [Array<EInvoiceAPI::Models::DocumentAttachmentCreate>, nil]
285
332
  #
286
- # @param billing_address [String, nil]
333
+ # @param billing_address [String, nil] The billing address (if different from customer address)
287
334
  #
288
- # @param billing_address_recipient [String, nil]
335
+ # @param billing_address_recipient [String, nil] The recipient name at the billing address
289
336
  #
290
337
  # @param charges [Array<EInvoiceAPI::Models::Charge>, nil]
291
338
  #
292
- # @param currency [Symbol, EInvoiceAPI::Models::CurrencyCode] Currency of the invoice
339
+ # @param currency [Symbol, EInvoiceAPI::Models::CurrencyCode] Currency of the invoice (ISO 4217 currency code)
340
+ #
341
+ # @param customer_address [String, nil] The address of the customer/buyer
293
342
  #
294
- # @param customer_address [String, nil]
343
+ # @param customer_address_recipient [String, nil] The recipient name at the customer address
295
344
  #
296
- # @param customer_address_recipient [String, nil]
345
+ # @param customer_company_id [String, nil] Customer company ID. For Belgium this is the CBE number or their EUID (European
297
346
  #
298
- # @param customer_email [String, nil]
347
+ # @param customer_email [String, nil] The email address of the customer
299
348
  #
300
- # @param customer_id [String, nil]
349
+ # @param customer_id [String, nil] The unique identifier for the customer in your system
301
350
  #
302
- # @param customer_name [String, nil]
351
+ # @param customer_name [String, nil] The company name of the customer/buyer
303
352
  #
304
- # @param customer_tax_id [String, nil]
353
+ # @param customer_tax_id [String, nil] Customer tax ID. For Belgium this is the VAT number. Must include the country pr
305
354
  #
306
- # @param direction [Symbol, EInvoiceAPI::Models::DocumentDirection]
355
+ # @param direction [Symbol, EInvoiceAPI::Models::DocumentDirection] The direction of the document: INBOUND (purchases) or OUTBOUND (sales)
307
356
  #
308
- # @param document_type [Symbol, EInvoiceAPI::Models::DocumentType]
357
+ # @param document_type [Symbol, EInvoiceAPI::Models::DocumentType] The type of document: INVOICE, CREDIT_NOTE, or DEBIT_NOTE
309
358
  #
310
- # @param due_date [Date, nil]
359
+ # @param due_date [Date, nil] The date when payment is due
311
360
  #
312
- # @param invoice_date [Date, nil]
361
+ # @param invoice_date [Date, nil] The date when the invoice was issued
313
362
  #
314
- # @param invoice_id [String, nil]
363
+ # @param invoice_id [String, nil] The unique invoice identifier/number
315
364
  #
316
- # @param invoice_total [String, nil] The total amount of the invoice (so invoice_total = subtotal + total_tax + total
365
+ # @param invoice_total [String, nil] The total amount of the invoice including tax (invoice*total = subtotal + total*
317
366
  #
318
367
  # @param items [Array<EInvoiceAPI::Models::DocumentCreateFromPdfResponse::Item>] At least one line item is required
319
368
  #
320
- # @param note [String, nil]
369
+ # @param note [String, nil] Additional notes or comments for the invoice
321
370
  #
322
371
  # @param payment_details [Array<EInvoiceAPI::Models::PaymentDetailCreate>, nil]
323
372
  #
324
- # @param payment_term [String, nil]
373
+ # @param payment_term [String, nil] The payment terms (e.g., 'Net 30', 'Due on receipt', '2/10 Net 30')
325
374
  #
326
- # @param previous_unpaid_balance [String, nil] The previous unpaid balance of the invoice, if any. Must be positive and rounded
375
+ # @param previous_unpaid_balance [String, nil] The previous unpaid balance from prior invoices, if any. Must be positive and ro
327
376
  #
328
- # @param purchase_order [String, nil]
377
+ # @param purchase_order [String, nil] The purchase order reference number
329
378
  #
330
- # @param remittance_address [String, nil]
379
+ # @param remittance_address [String, nil] The address where payment should be sent or remitted to
331
380
  #
332
- # @param remittance_address_recipient [String, nil]
381
+ # @param remittance_address_recipient [String, nil] The recipient name at the remittance address
333
382
  #
334
- # @param service_address [String, nil]
383
+ # @param service_address [String, nil] The address where services were performed or goods were delivered
335
384
  #
336
- # @param service_address_recipient [String, nil]
385
+ # @param service_address_recipient [String, nil] The recipient name at the service address
337
386
  #
338
- # @param service_end_date [Date, nil]
387
+ # @param service_end_date [Date, nil] The end date of the service period or delivery period
339
388
  #
340
- # @param service_start_date [Date, nil]
389
+ # @param service_start_date [Date, nil] The start date of the service period or delivery period
341
390
  #
342
- # @param shipping_address [String, nil]
391
+ # @param shipping_address [String, nil] The shipping/delivery address
343
392
  #
344
- # @param shipping_address_recipient [String, nil]
393
+ # @param shipping_address_recipient [String, nil] The recipient name at the shipping address
345
394
  #
346
- # @param state [Symbol, EInvoiceAPI::Models::DocumentState]
395
+ # @param state [Symbol, EInvoiceAPI::Models::DocumentState] The current state of the document: DRAFT, TRANSIT, FAILED, SENT, or RECEIVED
347
396
  #
348
397
  # @param subtotal [String, nil] The taxable base of the invoice. Should be the sum of all line items - allowance
349
398
  #
350
399
  # @param success [Boolean] Whether the PDF was successfully converted into a compliant e-invoice
351
400
  #
352
- # @param tax_code [Symbol, EInvoiceAPI::Models::DocumentCreateFromPdfResponse::TaxCode] Tax category code of the invoice
401
+ # @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
353
402
  #
354
403
  # @param tax_details [Array<EInvoiceAPI::Models::DocumentCreateFromPdfResponse::TaxDetail>, nil]
355
404
  #
356
405
  # @param total_discount [String, nil] The net financial discount/charge of the invoice (non-VAT charges minus non-VAT
357
406
  #
358
- # @param total_tax [String, nil] The total tax of the invoice. Must be positive and rounded to maximum 2 decimals
407
+ # @param total_tax [String, nil] The total tax amount of the invoice. Must be positive and rounded to maximum 2 d
359
408
  #
360
409
  # @param ubl_document [String, nil] The UBL document as an XML string
361
410
  #
362
411
  # @param vatex [Symbol, EInvoiceAPI::Models::DocumentCreateFromPdfResponse::Vatex, nil] VATEX code list for VAT exemption reasons
363
412
  #
364
- # @param vatex_note [String, nil] VAT exemption note of the invoice
413
+ # @param vatex_note [String, nil] Textual explanation for VAT exemption
365
414
  #
366
- # @param vendor_address [String, nil]
415
+ # @param vendor_address [String, nil] The address of the vendor/seller
367
416
  #
368
- # @param vendor_address_recipient [String, nil]
417
+ # @param vendor_address_recipient [String, nil] The recipient name at the vendor address
369
418
  #
370
- # @param vendor_email [String, nil]
419
+ # @param vendor_company_id [String, nil] Vendor company ID. For Belgium this is the CBE number or their EUID (European Un
371
420
  #
372
- # @param vendor_name [String, nil]
421
+ # @param vendor_email [String, nil] The email address of the vendor
373
422
  #
374
- # @param vendor_tax_id [String, nil]
423
+ # @param vendor_name [String, nil] The name of the vendor/seller/supplier
424
+ #
425
+ # @param vendor_tax_id [String, nil] Vendor tax ID. For Belgium this is the VAT number. Must include the country pref
375
426
 
376
427
  class Item < EInvoiceAPI::Internal::Type::BaseModel
377
428
  # @!attribute allowances
@@ -469,7 +520,8 @@ module EInvoiceAPI
469
520
  # @param unit_price [String, nil] The unit price of the line item. Must be rounded to maximum 2 decimals
470
521
  end
471
522
 
472
- # Tax category code of the invoice
523
+ # Tax category code of the invoice (e.g., S for standard rate, Z for zero rate, E
524
+ # for exempt)
473
525
  #
474
526
  # @see EInvoiceAPI::Models::DocumentCreateFromPdfResponse#tax_code
475
527
  module TaxCode
@@ -492,18 +544,21 @@ module EInvoiceAPI
492
544
 
493
545
  class TaxDetail < EInvoiceAPI::Internal::Type::BaseModel
494
546
  # @!attribute amount
547
+ # The tax amount for this tax category. Must be rounded to maximum 2 decimals
495
548
  #
496
549
  # @return [String, nil]
497
550
  optional :amount, String, nil?: true
498
551
 
499
552
  # @!attribute rate
553
+ # The tax rate as a percentage (e.g., '21.00', '6.00', '0.00')
500
554
  #
501
555
  # @return [String, nil]
502
556
  optional :rate, String, nil?: true
503
557
 
504
558
  # @!method initialize(amount: nil, rate: nil)
505
- # @param amount [String, nil]
506
- # @param rate [String, nil]
559
+ # @param amount [String, nil] The tax amount for this tax category. Must be rounded to maximum 2 decimals
560
+ #
561
+ # @param rate [String, nil] The tax rate as a percentage (e.g., '21.00', '6.00', '0.00')
507
562
  end
508
563
 
509
564
  # VATEX code list for VAT exemption reasons