e-invoice-api 0.11.0 → 0.12.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 (31) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/README.md +2 -2
  4. data/lib/e_invoice_api/models/allowance.rb +42 -14
  5. data/lib/e_invoice_api/models/charge.rb +193 -4
  6. data/lib/e_invoice_api/models/document_create.rb +721 -120
  7. data/lib/e_invoice_api/models/document_create_from_pdf_response.rb +123 -58
  8. data/lib/e_invoice_api/models/document_response.rb +373 -80
  9. data/lib/e_invoice_api/models/me_retrieve_response.rb +21 -7
  10. data/lib/e_invoice_api/models/payment_detail_create.rb +15 -4
  11. data/lib/e_invoice_api/resources/documents.rb +42 -38
  12. data/lib/e_invoice_api/resources/validate.rb +42 -38
  13. data/lib/e_invoice_api/version.rb +1 -1
  14. data/rbi/e_invoice_api/models/allowance.rbi +81 -21
  15. data/rbi/e_invoice_api/models/charge.rbi +202 -5
  16. data/rbi/e_invoice_api/models/document_create.rbi +3085 -702
  17. data/rbi/e_invoice_api/models/document_create_from_pdf_response.rbi +136 -30
  18. data/rbi/e_invoice_api/models/document_response.rbi +1232 -58
  19. data/rbi/e_invoice_api/models/me_retrieve_response.rbi +20 -6
  20. data/rbi/e_invoice_api/models/payment_detail_create.rbi +10 -0
  21. data/rbi/e_invoice_api/resources/documents.rbi +51 -10
  22. data/rbi/e_invoice_api/resources/validate.rbi +51 -10
  23. data/sig/e_invoice_api/models/allowance.rbs +59 -8
  24. data/sig/e_invoice_api/models/charge.rbs +369 -4
  25. data/sig/e_invoice_api/models/document_create.rbs +939 -44
  26. data/sig/e_invoice_api/models/document_create_from_pdf_response.rbs +15 -0
  27. data/sig/e_invoice_api/models/document_response.rbs +443 -12
  28. data/sig/e_invoice_api/models/me_retrieve_response.rbs +5 -0
  29. data/sig/e_invoice_api/resources/documents.rbs +2 -0
  30. data/sig/e_invoice_api/resources/validate.rbs +2 -0
  31. metadata +2 -2
@@ -28,7 +28,7 @@ module EInvoiceAPI
28
28
  sig { returns(T.nilable(String)) }
29
29
  attr_accessor :bcc_recipient_email
30
30
 
31
- # Address of the company
31
+ # Address of the company. Must be in the form of `Street Name Street Number`
32
32
  sig { returns(T.nilable(String)) }
33
33
  attr_accessor :company_address
34
34
 
@@ -44,14 +44,21 @@ module EInvoiceAPI
44
44
  sig { returns(T.nilable(String)) }
45
45
  attr_accessor :company_email
46
46
 
47
- # Name of the company
47
+ # Name of the company. Must include the company type. For example: `BV`, `NV`,
48
+ # `CVBA`, `VOF`
48
49
  sig { returns(T.nilable(String)) }
49
50
  attr_accessor :company_name
50
51
 
51
- # Company number
52
+ # Company number. For Belgium this is the CBE number or their EUID (European
53
+ # Unique Identifier) number
52
54
  sig { returns(T.nilable(String)) }
53
55
  attr_accessor :company_number
54
56
 
57
+ # Company tax ID. For Belgium this is the VAT number. Must include the country
58
+ # prefix
59
+ sig { returns(T.nilable(String)) }
60
+ attr_accessor :company_tax_id
61
+
55
62
  # Zip code of the company
56
63
  sig { returns(T.nilable(String)) }
57
64
  attr_accessor :company_zip
@@ -87,6 +94,7 @@ module EInvoiceAPI
87
94
  company_email: T.nilable(String),
88
95
  company_name: T.nilable(String),
89
96
  company_number: T.nilable(String),
97
+ company_tax_id: T.nilable(String),
90
98
  company_zip: T.nilable(String),
91
99
  description: T.nilable(String),
92
100
  ibans: T.nilable(T::Array[String]),
@@ -103,7 +111,7 @@ module EInvoiceAPI
103
111
  plan:,
104
112
  # BCC recipient email to deliver documents
105
113
  bcc_recipient_email: nil,
106
- # Address of the company
114
+ # Address of the company. Must be in the form of `Street Name Street Number`
107
115
  company_address: nil,
108
116
  # City of the company
109
117
  company_city: nil,
@@ -111,10 +119,15 @@ module EInvoiceAPI
111
119
  company_country: nil,
112
120
  # Email of the company
113
121
  company_email: nil,
114
- # Name of the company
122
+ # Name of the company. Must include the company type. For example: `BV`, `NV`,
123
+ # `CVBA`, `VOF`
115
124
  company_name: nil,
116
- # Company number
125
+ # Company number. For Belgium this is the CBE number or their EUID (European
126
+ # Unique Identifier) number
117
127
  company_number: nil,
128
+ # Company tax ID. For Belgium this is the VAT number. Must include the country
129
+ # prefix
130
+ company_tax_id: nil,
118
131
  # Zip code of the company
119
132
  company_zip: nil,
120
133
  description: nil,
@@ -142,6 +155,7 @@ module EInvoiceAPI
142
155
  company_email: T.nilable(String),
143
156
  company_name: T.nilable(String),
144
157
  company_number: T.nilable(String),
158
+ company_tax_id: T.nilable(String),
145
159
  company_zip: T.nilable(String),
146
160
  description: T.nilable(String),
147
161
  ibans: T.nilable(T::Array[String]),
@@ -11,15 +11,20 @@ module EInvoiceAPI
11
11
  )
12
12
  end
13
13
 
14
+ # Bank account number (for non-IBAN accounts)
14
15
  sig { returns(T.nilable(String)) }
15
16
  attr_accessor :bank_account_number
16
17
 
18
+ # International Bank Account Number for payment transfers
17
19
  sig { returns(T.nilable(String)) }
18
20
  attr_accessor :iban
19
21
 
22
+ # Structured payment reference or communication (e.g., structured communication
23
+ # for Belgian bank transfers)
20
24
  sig { returns(T.nilable(String)) }
21
25
  attr_accessor :payment_reference
22
26
 
27
+ # SWIFT/BIC code of the bank
23
28
  sig { returns(T.nilable(String)) }
24
29
  attr_accessor :swift
25
30
 
@@ -32,9 +37,14 @@ module EInvoiceAPI
32
37
  ).returns(T.attached_class)
33
38
  end
34
39
  def self.new(
40
+ # Bank account number (for non-IBAN accounts)
35
41
  bank_account_number: nil,
42
+ # International Bank Account Number for payment transfers
36
43
  iban: nil,
44
+ # Structured payment reference or communication (e.g., structured communication
45
+ # for Belgian bank transfers)
37
46
  payment_reference: nil,
47
+ # SWIFT/BIC code of the bank
38
48
  swift: nil
39
49
  )
40
50
  end
@@ -25,6 +25,7 @@ module EInvoiceAPI
25
25
  currency: EInvoiceAPI::CurrencyCode::OrSymbol,
26
26
  customer_address: T.nilable(String),
27
27
  customer_address_recipient: T.nilable(String),
28
+ customer_company_id: T.nilable(String),
28
29
  customer_email: T.nilable(String),
29
30
  customer_id: T.nilable(String),
30
31
  customer_name: T.nilable(String),
@@ -66,6 +67,7 @@ module EInvoiceAPI
66
67
  vatex_note: T.nilable(String),
67
68
  vendor_address: T.nilable(String),
68
69
  vendor_address_recipient: T.nilable(String),
70
+ vendor_company_id: T.nilable(String),
69
71
  vendor_email: T.nilable(String),
70
72
  vendor_name: T.nilable(String),
71
73
  vendor_tax_id: T.nilable(String),
@@ -74,70 +76,109 @@ module EInvoiceAPI
74
76
  end
75
77
  def create(
76
78
  allowances: nil,
77
- # The amount due of the invoice. Must be positive and rounded to maximum 2
78
- # decimals
79
+ # The amount due for payment. Must be positive and rounded to maximum 2 decimals
79
80
  amount_due: nil,
80
81
  attachments: nil,
82
+ # The billing address (if different from customer address)
81
83
  billing_address: nil,
84
+ # The recipient name at the billing address
82
85
  billing_address_recipient: nil,
83
86
  charges: nil,
84
- # Currency of the invoice
87
+ # Currency of the invoice (ISO 4217 currency code)
85
88
  currency: nil,
89
+ # The address of the customer/buyer
86
90
  customer_address: nil,
91
+ # The recipient name at the customer address
87
92
  customer_address_recipient: nil,
93
+ # Customer company ID. For Belgium this is the CBE number or their EUID (European
94
+ # Unique Identifier) number. In the Netherlands this is the KVK number.
95
+ customer_company_id: nil,
96
+ # The email address of the customer
88
97
  customer_email: nil,
98
+ # The unique identifier for the customer in your system
89
99
  customer_id: nil,
100
+ # The company name of the customer/buyer
90
101
  customer_name: nil,
102
+ # Customer tax ID. For Belgium this is the VAT number. Must include the country
103
+ # prefix
91
104
  customer_tax_id: nil,
105
+ # The direction of the document: INBOUND (purchases) or OUTBOUND (sales)
92
106
  direction: nil,
107
+ # The type of document: INVOICE, CREDIT_NOTE, or DEBIT_NOTE
93
108
  document_type: nil,
109
+ # The date when payment is due
94
110
  due_date: nil,
111
+ # The date when the invoice was issued
95
112
  invoice_date: nil,
113
+ # The unique invoice identifier/number
96
114
  invoice_id: nil,
97
- # The total amount of the invoice (so invoice_total = subtotal + total_tax +
98
- # total_discount). Must be positive and rounded to maximum 2 decimals
115
+ # The total amount of the invoice including tax (invoice_total = subtotal +
116
+ # total_tax + total_discount). Must be positive and rounded to maximum 2 decimals
99
117
  invoice_total: nil,
100
118
  # At least one line item is required
101
119
  items: nil,
120
+ # Additional notes or comments for the invoice
102
121
  note: nil,
103
122
  payment_details: nil,
123
+ # The payment terms (e.g., 'Net 30', 'Due on receipt', '2/10 Net 30')
104
124
  payment_term: nil,
105
- # The previous unpaid balance of the invoice, if any. Must be positive and rounded
106
- # to maximum 2 decimals
125
+ # The previous unpaid balance from prior invoices, if any. Must be positive and
126
+ # rounded to maximum 2 decimals
107
127
  previous_unpaid_balance: nil,
128
+ # The purchase order reference number
108
129
  purchase_order: nil,
130
+ # The address where payment should be sent or remitted to
109
131
  remittance_address: nil,
132
+ # The recipient name at the remittance address
110
133
  remittance_address_recipient: nil,
134
+ # The address where services were performed or goods were delivered
111
135
  service_address: nil,
136
+ # The recipient name at the service address
112
137
  service_address_recipient: nil,
138
+ # The end date of the service period or delivery period
113
139
  service_end_date: nil,
140
+ # The start date of the service period or delivery period
114
141
  service_start_date: nil,
142
+ # The shipping/delivery address
115
143
  shipping_address: nil,
144
+ # The recipient name at the shipping address
116
145
  shipping_address_recipient: nil,
146
+ # The current state of the document: DRAFT, TRANSIT, FAILED, SENT, or RECEIVED
117
147
  state: nil,
118
148
  # The taxable base of the invoice. Should be the sum of all line items -
119
149
  # allowances (for example commercial discounts) + charges with impact on VAT. Must
120
150
  # be positive and rounded to maximum 2 decimals
121
151
  subtotal: nil,
122
- # Tax category code of the invoice
152
+ # Tax category code of the invoice (e.g., S for standard rate, Z for zero rate, E
153
+ # for exempt)
123
154
  tax_code: nil,
124
155
  tax_details: nil,
125
156
  # The net financial discount/charge of the invoice (non-VAT charges minus non-VAT
126
157
  # allowances). Can be positive (net charge), negative (net discount), or zero.
127
158
  # Must be rounded to maximum 2 decimals
128
159
  total_discount: nil,
129
- # The total tax of the invoice. Must be positive and rounded to maximum 2 decimals
160
+ # The total tax amount of the invoice. Must be positive and rounded to maximum 2
161
+ # decimals
130
162
  total_tax: nil,
131
163
  # VATEX code list for VAT exemption reasons
132
164
  #
133
165
  # Agency: CEF Identifier: vatex
134
166
  vatex: nil,
135
- # VAT exemption note of the invoice
167
+ # Textual explanation for VAT exemption
136
168
  vatex_note: nil,
169
+ # The address of the vendor/seller
137
170
  vendor_address: nil,
171
+ # The recipient name at the vendor address
138
172
  vendor_address_recipient: nil,
173
+ # Vendor company ID. For Belgium this is the CBE number or their EUID (European
174
+ # Unique Identifier) number. In the Netherlands this is the KVK number.
175
+ vendor_company_id: nil,
176
+ # The email address of the vendor
139
177
  vendor_email: nil,
178
+ # The name of the vendor/seller/supplier
140
179
  vendor_name: nil,
180
+ # Vendor tax ID. For Belgium this is the VAT number. Must include the country
181
+ # prefix
141
182
  vendor_tax_id: nil,
142
183
  request_options: {}
143
184
  )
@@ -19,6 +19,7 @@ module EInvoiceAPI
19
19
  currency: EInvoiceAPI::CurrencyCode::OrSymbol,
20
20
  customer_address: T.nilable(String),
21
21
  customer_address_recipient: T.nilable(String),
22
+ customer_company_id: T.nilable(String),
22
23
  customer_email: T.nilable(String),
23
24
  customer_id: T.nilable(String),
24
25
  customer_name: T.nilable(String),
@@ -60,6 +61,7 @@ module EInvoiceAPI
60
61
  vatex_note: T.nilable(String),
61
62
  vendor_address: T.nilable(String),
62
63
  vendor_address_recipient: T.nilable(String),
64
+ vendor_company_id: T.nilable(String),
63
65
  vendor_email: T.nilable(String),
64
66
  vendor_name: T.nilable(String),
65
67
  vendor_tax_id: T.nilable(String),
@@ -68,70 +70,109 @@ module EInvoiceAPI
68
70
  end
69
71
  def validate_json(
70
72
  allowances: nil,
71
- # The amount due of the invoice. Must be positive and rounded to maximum 2
72
- # decimals
73
+ # The amount due for payment. Must be positive and rounded to maximum 2 decimals
73
74
  amount_due: nil,
74
75
  attachments: nil,
76
+ # The billing address (if different from customer address)
75
77
  billing_address: nil,
78
+ # The recipient name at the billing address
76
79
  billing_address_recipient: nil,
77
80
  charges: nil,
78
- # Currency of the invoice
81
+ # Currency of the invoice (ISO 4217 currency code)
79
82
  currency: nil,
83
+ # The address of the customer/buyer
80
84
  customer_address: nil,
85
+ # The recipient name at the customer address
81
86
  customer_address_recipient: nil,
87
+ # Customer company ID. For Belgium this is the CBE number or their EUID (European
88
+ # Unique Identifier) number. In the Netherlands this is the KVK number.
89
+ customer_company_id: nil,
90
+ # The email address of the customer
82
91
  customer_email: nil,
92
+ # The unique identifier for the customer in your system
83
93
  customer_id: nil,
94
+ # The company name of the customer/buyer
84
95
  customer_name: nil,
96
+ # Customer tax ID. For Belgium this is the VAT number. Must include the country
97
+ # prefix
85
98
  customer_tax_id: nil,
99
+ # The direction of the document: INBOUND (purchases) or OUTBOUND (sales)
86
100
  direction: nil,
101
+ # The type of document: INVOICE, CREDIT_NOTE, or DEBIT_NOTE
87
102
  document_type: nil,
103
+ # The date when payment is due
88
104
  due_date: nil,
105
+ # The date when the invoice was issued
89
106
  invoice_date: nil,
107
+ # The unique invoice identifier/number
90
108
  invoice_id: nil,
91
- # The total amount of the invoice (so invoice_total = subtotal + total_tax +
92
- # total_discount). Must be positive and rounded to maximum 2 decimals
109
+ # The total amount of the invoice including tax (invoice_total = subtotal +
110
+ # total_tax + total_discount). Must be positive and rounded to maximum 2 decimals
93
111
  invoice_total: nil,
94
112
  # At least one line item is required
95
113
  items: nil,
114
+ # Additional notes or comments for the invoice
96
115
  note: nil,
97
116
  payment_details: nil,
117
+ # The payment terms (e.g., 'Net 30', 'Due on receipt', '2/10 Net 30')
98
118
  payment_term: nil,
99
- # The previous unpaid balance of the invoice, if any. Must be positive and rounded
100
- # to maximum 2 decimals
119
+ # The previous unpaid balance from prior invoices, if any. Must be positive and
120
+ # rounded to maximum 2 decimals
101
121
  previous_unpaid_balance: nil,
122
+ # The purchase order reference number
102
123
  purchase_order: nil,
124
+ # The address where payment should be sent or remitted to
103
125
  remittance_address: nil,
126
+ # The recipient name at the remittance address
104
127
  remittance_address_recipient: nil,
128
+ # The address where services were performed or goods were delivered
105
129
  service_address: nil,
130
+ # The recipient name at the service address
106
131
  service_address_recipient: nil,
132
+ # The end date of the service period or delivery period
107
133
  service_end_date: nil,
134
+ # The start date of the service period or delivery period
108
135
  service_start_date: nil,
136
+ # The shipping/delivery address
109
137
  shipping_address: nil,
138
+ # The recipient name at the shipping address
110
139
  shipping_address_recipient: nil,
140
+ # The current state of the document: DRAFT, TRANSIT, FAILED, SENT, or RECEIVED
111
141
  state: nil,
112
142
  # The taxable base of the invoice. Should be the sum of all line items -
113
143
  # allowances (for example commercial discounts) + charges with impact on VAT. Must
114
144
  # be positive and rounded to maximum 2 decimals
115
145
  subtotal: nil,
116
- # Tax category code of the invoice
146
+ # Tax category code of the invoice (e.g., S for standard rate, Z for zero rate, E
147
+ # for exempt)
117
148
  tax_code: nil,
118
149
  tax_details: nil,
119
150
  # The net financial discount/charge of the invoice (non-VAT charges minus non-VAT
120
151
  # allowances). Can be positive (net charge), negative (net discount), or zero.
121
152
  # Must be rounded to maximum 2 decimals
122
153
  total_discount: nil,
123
- # The total tax of the invoice. Must be positive and rounded to maximum 2 decimals
154
+ # The total tax amount of the invoice. Must be positive and rounded to maximum 2
155
+ # decimals
124
156
  total_tax: nil,
125
157
  # VATEX code list for VAT exemption reasons
126
158
  #
127
159
  # Agency: CEF Identifier: vatex
128
160
  vatex: nil,
129
- # VAT exemption note of the invoice
161
+ # Textual explanation for VAT exemption
130
162
  vatex_note: nil,
163
+ # The address of the vendor/seller
131
164
  vendor_address: nil,
165
+ # The recipient name at the vendor address
132
166
  vendor_address_recipient: nil,
167
+ # Vendor company ID. For Belgium this is the CBE number or their EUID (European
168
+ # Unique Identifier) number. In the Netherlands this is the KVK number.
169
+ vendor_company_id: nil,
170
+ # The email address of the vendor
133
171
  vendor_email: nil,
172
+ # The name of the vendor/seller/supplier
134
173
  vendor_name: nil,
174
+ # Vendor tax ID. For Belgium this is the VAT number. Must include the country
175
+ # prefix
135
176
  vendor_tax_id: nil,
136
177
  request_options: {}
137
178
  )
@@ -6,8 +6,8 @@ module EInvoiceAPI
6
6
  base_amount: String?,
7
7
  multiplier_factor: String?,
8
8
  reason: String?,
9
- reason_code: String?,
10
- tax_code: EInvoiceAPI::Models::Allowance::tax_code?,
9
+ reason_code: EInvoiceAPI::Models::Allowance::reason_code?,
10
+ tax_code: EInvoiceAPI::Models::Allowance::tax_code,
11
11
  tax_rate: String?
12
12
  }
13
13
 
@@ -20,9 +20,13 @@ module EInvoiceAPI
20
20
 
21
21
  attr_accessor reason: String?
22
22
 
23
- attr_accessor reason_code: String?
23
+ attr_accessor reason_code: EInvoiceAPI::Models::Allowance::reason_code?
24
24
 
25
- attr_accessor tax_code: EInvoiceAPI::Models::Allowance::tax_code?
25
+ attr_reader tax_code: EInvoiceAPI::Models::Allowance::tax_code?
26
+
27
+ def tax_code=: (
28
+ EInvoiceAPI::Models::Allowance::tax_code
29
+ ) -> EInvoiceAPI::Models::Allowance::tax_code
26
30
 
27
31
  attr_accessor tax_rate: String?
28
32
 
@@ -31,8 +35,8 @@ module EInvoiceAPI
31
35
  ?base_amount: String?,
32
36
  ?multiplier_factor: String?,
33
37
  ?reason: String?,
34
- ?reason_code: String?,
35
- ?tax_code: EInvoiceAPI::Models::Allowance::tax_code?,
38
+ ?reason_code: EInvoiceAPI::Models::Allowance::reason_code?,
39
+ ?tax_code: EInvoiceAPI::Models::Allowance::tax_code,
36
40
  ?tax_rate: String?
37
41
  ) -> void
38
42
 
@@ -41,11 +45,58 @@ module EInvoiceAPI
41
45
  base_amount: String?,
42
46
  multiplier_factor: String?,
43
47
  reason: String?,
44
- reason_code: String?,
45
- tax_code: EInvoiceAPI::Models::Allowance::tax_code?,
48
+ reason_code: EInvoiceAPI::Models::Allowance::reason_code?,
49
+ tax_code: EInvoiceAPI::Models::Allowance::tax_code,
46
50
  tax_rate: String?
47
51
  }
48
52
 
53
+ type reason_code =
54
+ :"41"
55
+ | :"42"
56
+ | :"60"
57
+ | :"62"
58
+ | :"63"
59
+ | :"64"
60
+ | :"65"
61
+ | :"66"
62
+ | :"67"
63
+ | :"68"
64
+ | :"70"
65
+ | :"71"
66
+ | :"88"
67
+ | :"95"
68
+ | :"100"
69
+ | :"102"
70
+ | :"103"
71
+ | :"104"
72
+ | :"105"
73
+
74
+ module ReasonCode
75
+ extend EInvoiceAPI::Internal::Type::Enum
76
+
77
+ REASON_CODE_41: :"41"
78
+ REASON_CODE_42: :"42"
79
+ REASON_CODE_60: :"60"
80
+ REASON_CODE_62: :"62"
81
+ REASON_CODE_63: :"63"
82
+ REASON_CODE_64: :"64"
83
+ REASON_CODE_65: :"65"
84
+ REASON_CODE_66: :"66"
85
+ REASON_CODE_67: :"67"
86
+ REASON_CODE_68: :"68"
87
+ REASON_CODE_70: :"70"
88
+ REASON_CODE_71: :"71"
89
+ REASON_CODE_88: :"88"
90
+ REASON_CODE_95: :"95"
91
+ REASON_CODE_100: :"100"
92
+ REASON_CODE_102: :"102"
93
+ REASON_CODE_103: :"103"
94
+ REASON_CODE_104: :"104"
95
+ REASON_CODE_105: :"105"
96
+
97
+ def self?.values: -> ::Array[EInvoiceAPI::Models::Allowance::reason_code]
98
+ end
99
+
49
100
  type tax_code = :AE | :E | :S | :Z | :G | :O | :K | :L | :M | :B
50
101
 
51
102
  module TaxCode