e-invoice-api 0.33.0 → 0.35.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +31 -0
- data/LICENSE +201 -0
- data/README.md +18 -7
- data/SECURITY.md +6 -16
- data/lib/e_invoice_api/client.rb +16 -0
- data/lib/e_invoice_api/internal/transport/base_client.rb +43 -78
- data/lib/e_invoice_api/internal/transport/pooled_net_requester.rb +8 -8
- data/lib/e_invoice_api/internal/type/array_of.rb +12 -12
- data/lib/e_invoice_api/internal/type/base_model.rb +18 -18
- data/lib/e_invoice_api/internal/type/boolean.rb +6 -6
- data/lib/e_invoice_api/internal/type/converter.rb +24 -24
- data/lib/e_invoice_api/internal/type/enum.rb +6 -6
- data/lib/e_invoice_api/internal/type/file_input.rb +6 -6
- data/lib/e_invoice_api/internal/type/hash_of.rb +12 -12
- data/lib/e_invoice_api/internal/type/request_parameters.rb +1 -1
- data/lib/e_invoice_api/internal/type/union.rb +10 -10
- data/lib/e_invoice_api/internal/type/unknown.rb +6 -6
- data/lib/e_invoice_api/internal/util.rb +15 -57
- data/lib/e_invoice_api/models/conversion/document_create_from_pdf_task.rb +43 -0
- data/lib/e_invoice_api/models/conversion/pdf_create_params.rb +22 -0
- data/lib/e_invoice_api/models/conversion/pdf_result_params.rb +22 -0
- data/lib/e_invoice_api/models/conversion/pdf_retrieve_params.rb +22 -0
- data/lib/e_invoice_api/models/document_create.rb +203 -17
- data/lib/e_invoice_api/models/document_create_from_pdf_response.rb +153 -17
- data/lib/e_invoice_api/models/document_lifecycle_params.rb +20 -0
- data/lib/e_invoice_api/models/document_lifecycle_response.rb +134 -0
- data/lib/e_invoice_api/models/document_response.rb +161 -21
- data/lib/e_invoice_api/models/document_timeline_params.rb +20 -0
- data/lib/e_invoice_api/models/document_timeline_response.rb +71 -0
- data/lib/e_invoice_api/models/draft_list_params.rb +113 -0
- data/lib/e_invoice_api/models/inbound_email_response.rb +129 -0
- data/lib/e_invoice_api/models/mailbox_download_attachment_params.rb +26 -0
- data/lib/e_invoice_api/models/mailbox_list_params.rb +129 -0
- data/lib/e_invoice_api/models/mailbox_reprocess_params.rb +20 -0
- data/lib/e_invoice_api/models/mailbox_retrieve_params.rb +20 -0
- data/lib/e_invoice_api/models/me_retrieve_response.rb +8 -7
- data/lib/e_invoice_api/models/payment_detail_create.rb +8 -4
- data/lib/e_invoice_api/models/stats_retrieve_params.rb +55 -0
- data/lib/e_invoice_api/models/stats_retrieve_response.rb +141 -0
- data/lib/e_invoice_api/models/ubl_document_validation.rb +10 -1
- data/lib/e_invoice_api/models/unit_of_measure_code.rb +1349 -0
- data/lib/e_invoice_api/models/webhook_history_params.rb +20 -0
- data/lib/e_invoice_api/models/webhook_history_response.rb +17 -0
- data/lib/e_invoice_api/models/webhook_test_params.rb +37 -0
- data/lib/e_invoice_api/models/webhook_test_response.rb +35 -0
- data/lib/e_invoice_api/models.rb +24 -0
- data/lib/e_invoice_api/resources/conversion/pdf.rb +76 -0
- data/lib/e_invoice_api/resources/conversion.rb +18 -0
- data/lib/e_invoice_api/resources/documents/attachments.rb +11 -11
- data/lib/e_invoice_api/resources/documents/ubl.rb +4 -4
- data/lib/e_invoice_api/resources/documents.rb +130 -69
- data/lib/e_invoice_api/resources/drafts.rb +55 -0
- data/lib/e_invoice_api/resources/inbox.rb +20 -20
- data/lib/e_invoice_api/resources/lookup.rb +5 -5
- data/lib/e_invoice_api/resources/mailbox.rb +123 -0
- data/lib/e_invoice_api/resources/me.rb +1 -1
- data/lib/e_invoice_api/resources/outbox.rb +19 -19
- data/lib/e_invoice_api/resources/stats.rb +47 -0
- data/lib/e_invoice_api/resources/validate.rb +76 -56
- data/lib/e_invoice_api/resources/webhooks.rb +59 -14
- data/lib/e_invoice_api/version.rb +1 -1
- data/lib/e_invoice_api.rb +25 -1
- data/rbi/e_invoice_api/client.rbi +12 -0
- data/rbi/e_invoice_api/internal/transport/base_client.rbi +2 -10
- data/rbi/e_invoice_api/internal/util.rbi +0 -12
- data/rbi/e_invoice_api/models/conversion/document_create_from_pdf_task.rbi +108 -0
- data/rbi/e_invoice_api/models/conversion/pdf_create_params.rbi +43 -0
- data/rbi/e_invoice_api/models/conversion/pdf_result_params.rbi +40 -0
- data/rbi/e_invoice_api/models/conversion/pdf_retrieve_params.rbi +40 -0
- data/rbi/e_invoice_api/models/document_create.rbi +366 -15
- data/rbi/e_invoice_api/models/document_create_from_pdf_response.rbi +280 -15
- data/rbi/e_invoice_api/models/document_lifecycle_params.rbi +38 -0
- data/rbi/e_invoice_api/models/document_lifecycle_response.rbi +353 -0
- data/rbi/e_invoice_api/models/document_response.rbi +292 -19
- data/rbi/e_invoice_api/models/document_timeline_params.rbi +38 -0
- data/rbi/e_invoice_api/models/document_timeline_response.rbi +168 -0
- data/rbi/e_invoice_api/models/draft_list_params.rbi +194 -0
- data/rbi/e_invoice_api/models/inbound_email_response.rbi +189 -0
- data/rbi/e_invoice_api/models/mailbox_download_attachment_params.rbi +46 -0
- data/rbi/e_invoice_api/models/mailbox_list_params.rbi +218 -0
- data/rbi/e_invoice_api/models/mailbox_reprocess_params.rbi +41 -0
- data/rbi/e_invoice_api/models/mailbox_retrieve_params.rbi +41 -0
- data/rbi/e_invoice_api/models/me_retrieve_response.rbi +10 -8
- data/rbi/e_invoice_api/models/payment_detail_create.rbi +12 -4
- data/rbi/e_invoice_api/models/stats_retrieve_params.rbi +111 -0
- data/rbi/e_invoice_api/models/stats_retrieve_response.rbi +251 -0
- data/rbi/e_invoice_api/models/ubl_document_validation.rbi +11 -1
- data/rbi/e_invoice_api/models/unit_of_measure_code.rbi +1349 -0
- data/rbi/e_invoice_api/models/webhook_history_params.rbi +38 -0
- data/rbi/e_invoice_api/models/webhook_history_response.rbi +32 -0
- data/rbi/e_invoice_api/models/webhook_test_params.rbi +57 -0
- data/rbi/e_invoice_api/models/webhook_test_response.rbi +57 -0
- data/rbi/e_invoice_api/models.rbi +25 -0
- data/rbi/e_invoice_api/resources/conversion/pdf.rbi +44 -0
- data/rbi/e_invoice_api/resources/conversion.rbi +15 -0
- data/rbi/e_invoice_api/resources/documents.rbi +77 -5
- data/rbi/e_invoice_api/resources/drafts.rbi +55 -0
- data/rbi/e_invoice_api/resources/mailbox.rbi +93 -0
- data/rbi/e_invoice_api/resources/stats.rbi +38 -0
- data/rbi/e_invoice_api/resources/validate.rbi +52 -6
- data/rbi/e_invoice_api/resources/webhooks.rbi +29 -0
- data/sig/e_invoice_api/client.rbs +8 -0
- data/sig/e_invoice_api/internal/transport/base_client.rbs +1 -4
- data/sig/e_invoice_api/internal/util.rbs +0 -4
- data/sig/e_invoice_api/models/conversion/document_create_from_pdf_task.rbs +45 -0
- data/sig/e_invoice_api/models/conversion/pdf_create_params.rbs +26 -0
- data/sig/e_invoice_api/models/conversion/pdf_result_params.rbs +25 -0
- data/sig/e_invoice_api/models/conversion/pdf_retrieve_params.rbs +25 -0
- data/sig/e_invoice_api/models/document_create.rbs +139 -4
- data/sig/e_invoice_api/models/document_create_from_pdf_response.rbs +113 -4
- data/sig/e_invoice_api/models/document_lifecycle_params.rbs +23 -0
- data/sig/e_invoice_api/models/document_lifecycle_response.rbs +151 -0
- data/sig/e_invoice_api/models/document_response.rbs +113 -4
- data/sig/e_invoice_api/models/document_timeline_params.rbs +23 -0
- data/sig/e_invoice_api/models/document_timeline_response.rbs +84 -0
- data/sig/e_invoice_api/models/draft_list_params.rbs +112 -0
- data/sig/e_invoice_api/models/inbound_email_response.rbs +126 -0
- data/sig/e_invoice_api/models/mailbox_download_attachment_params.rbs +28 -0
- data/sig/e_invoice_api/models/mailbox_list_params.rbs +112 -0
- data/sig/e_invoice_api/models/mailbox_reprocess_params.rbs +24 -0
- data/sig/e_invoice_api/models/mailbox_retrieve_params.rbs +24 -0
- data/sig/e_invoice_api/models/stats_retrieve_params.rbs +48 -0
- data/sig/e_invoice_api/models/stats_retrieve_response.rbs +107 -0
- data/sig/e_invoice_api/models/unit_of_measure_code.rbs +2698 -0
- data/sig/e_invoice_api/models/webhook_history_params.rbs +23 -0
- data/sig/e_invoice_api/models/webhook_history_response.rbs +13 -0
- data/sig/e_invoice_api/models/webhook_test_params.rbs +32 -0
- data/sig/e_invoice_api/models/webhook_test_response.rbs +30 -0
- data/sig/e_invoice_api/models.rbs +24 -0
- data/sig/e_invoice_api/resources/conversion/pdf.rbs +24 -0
- data/sig/e_invoice_api/resources/conversion.rbs +9 -0
- data/sig/e_invoice_api/resources/documents.rbs +19 -0
- data/sig/e_invoice_api/resources/drafts.rbs +20 -0
- data/sig/e_invoice_api/resources/mailbox.rbs +36 -0
- data/sig/e_invoice_api/resources/stats.rbs +14 -0
- data/sig/e_invoice_api/resources/validate.rbs +9 -0
- data/sig/e_invoice_api/resources/webhooks.rbs +12 -0
- metadata +102 -7
|
@@ -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,12 +93,16 @@ 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,
|
|
84
102
|
# The address of the customer/buyer
|
|
85
103
|
customer_address: nil,
|
|
86
|
-
# The recipient name at the customer address
|
|
104
|
+
# The recipient name at the customer address. Also the customer contact name
|
|
105
|
+
# (BT-56) in the UBL.
|
|
87
106
|
customer_address_recipient: nil,
|
|
88
107
|
# Customer company ID. For Belgium this is the CBE number or their EUID (European
|
|
89
108
|
# Unique Identifier) number. In the Netherlands this is the KVK number.
|
|
@@ -96,6 +115,8 @@ module EInvoiceAPI
|
|
|
96
115
|
customer_name: nil,
|
|
97
116
|
# Customer Peppol ID
|
|
98
117
|
customer_peppol_id: nil,
|
|
118
|
+
# The telephone number of the customer contact (BT-57)
|
|
119
|
+
customer_phone: nil,
|
|
99
120
|
# Customer tax ID. For Belgium this is the VAT number. Must include the country
|
|
100
121
|
# prefix
|
|
101
122
|
customer_tax_id: nil,
|
|
@@ -119,15 +140,27 @@ module EInvoiceAPI
|
|
|
119
140
|
payment_details: nil,
|
|
120
141
|
# The payment terms (e.g., 'Net 30', 'Due on receipt', '2/10 Net 30')
|
|
121
142
|
payment_term: nil,
|
|
143
|
+
# The preceding invoice issue date (BT-26)
|
|
144
|
+
preceding_invoice_date: nil,
|
|
145
|
+
# The preceding invoice reference (BT-25): the number of the invoice this document
|
|
146
|
+
# corrects, for example the invoice a credit note credits
|
|
147
|
+
preceding_invoice_id: nil,
|
|
122
148
|
# The previous unpaid balance from prior invoices, if any. Must be positive and
|
|
123
149
|
# rounded to maximum 2 decimals
|
|
124
150
|
previous_unpaid_balance: nil,
|
|
125
|
-
# The purchase order reference number
|
|
151
|
+
# The purchase order reference number (BT-13)
|
|
126
152
|
purchase_order: nil,
|
|
127
153
|
# The address where payment should be sent or remitted to
|
|
128
154
|
remittance_address: nil,
|
|
129
155
|
# The recipient name at the remittance address
|
|
130
156
|
remittance_address_recipient: nil,
|
|
157
|
+
# The amount added to the invoice total to round the amount for payment (BT-114),
|
|
158
|
+
# for example to whole kronor (amount_due = invoice_total + rounding_amount when
|
|
159
|
+
# nothing is prepaid). Can be negative. Between -5.00 and 5.00, rounded to maximum
|
|
160
|
+
# 2 decimals
|
|
161
|
+
rounding_amount: nil,
|
|
162
|
+
# The sales order reference (BT-14) assigned by the seller
|
|
163
|
+
sales_order: nil,
|
|
131
164
|
# The address where services were performed or goods were delivered
|
|
132
165
|
service_address: nil,
|
|
133
166
|
# The recipient name at the service address
|
|
@@ -138,7 +171,7 @@ module EInvoiceAPI
|
|
|
138
171
|
service_start_date: nil,
|
|
139
172
|
# The shipping/delivery address
|
|
140
173
|
shipping_address: nil,
|
|
141
|
-
# The
|
|
174
|
+
# The name of the deliver-to party (BT-70)
|
|
142
175
|
shipping_address_recipient: nil,
|
|
143
176
|
# The current state of the document: DRAFT, TRANSIT, FAILED, SENT, or RECEIVED
|
|
144
177
|
state: nil,
|
|
@@ -149,6 +182,10 @@ module EInvoiceAPI
|
|
|
149
182
|
# Tax category code of the invoice (e.g., S for standard rate, Z for zero rate, E
|
|
150
183
|
# for exempt)
|
|
151
184
|
tax_code: nil,
|
|
185
|
+
# The VAT accounting currency (BT-6, ISO 4217 currency code), when VAT is
|
|
186
|
+
# accounted in a currency other than the invoice currency. Must differ from
|
|
187
|
+
# currency and requires total_tax_in_tax_currency
|
|
188
|
+
tax_currency: nil,
|
|
152
189
|
tax_details: nil,
|
|
153
190
|
# The net financial discount/charge of the invoice (non-VAT charges minus non-VAT
|
|
154
191
|
# allowances). Can be positive (net charge), negative (net discount), or zero.
|
|
@@ -157,15 +194,20 @@ module EInvoiceAPI
|
|
|
157
194
|
# The total tax amount of the invoice. Must be positive and rounded to maximum 2
|
|
158
195
|
# decimals
|
|
159
196
|
total_tax: nil,
|
|
197
|
+
# The total VAT amount in the VAT accounting currency tax_currency (BT-111). Does
|
|
198
|
+
# not add to invoice_total. Requires tax_currency. Rounded to maximum 2 decimals
|
|
199
|
+
total_tax_in_tax_currency: nil,
|
|
160
200
|
# VATEX code list for VAT exemption reasons
|
|
161
201
|
#
|
|
162
202
|
# Agency: CEF Identifier: vatex
|
|
163
203
|
vatex: nil,
|
|
164
|
-
#
|
|
204
|
+
# VAT exemption reason text (BT-120). An exemption reason (vatex or vatex_note) is
|
|
205
|
+
# required for tax_code E, AE, K, G and O, and not allowed for S, Z, L and M
|
|
165
206
|
vatex_note: nil,
|
|
166
207
|
# The address of the vendor/seller
|
|
167
208
|
vendor_address: nil,
|
|
168
|
-
# The recipient name at the vendor address
|
|
209
|
+
# The recipient name at the vendor address. Also the vendor contact name (BT-41)
|
|
210
|
+
# in the UBL, required when vendor and customer are both in Germany (DE-R-005).
|
|
169
211
|
vendor_address_recipient: nil,
|
|
170
212
|
# Vendor company ID. For Belgium this is the CBE number or their EUID (European
|
|
171
213
|
# Unique Identifier) number. In the Netherlands this is the KVK number.
|
|
@@ -174,6 +216,10 @@ module EInvoiceAPI
|
|
|
174
216
|
vendor_email: nil,
|
|
175
217
|
# The name of the vendor/seller/supplier
|
|
176
218
|
vendor_name: nil,
|
|
219
|
+
# The telephone number of the vendor contact (BT-42). Required when vendor and
|
|
220
|
+
# customer are both in Germany (DE-R-006); it must then hold at least 3 digits
|
|
221
|
+
# (DE-R-027, a warning).
|
|
222
|
+
vendor_phone: nil,
|
|
177
223
|
# Vendor tax ID. For Belgium this is the VAT number. Must include the country
|
|
178
224
|
# prefix
|
|
179
225
|
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: (
|
|
@@ -34,8 +34,6 @@ module EInvoiceAPI
|
|
|
34
34
|
|
|
35
35
|
MAX_REDIRECTS: 20
|
|
36
36
|
|
|
37
|
-
PLATFORM_HEADERS: ::Hash[String, String]
|
|
38
|
-
|
|
39
37
|
def self.validate!: (
|
|
40
38
|
EInvoiceAPI::Internal::Transport::BaseClient::request_components req
|
|
41
39
|
) -> void
|
|
@@ -104,8 +102,7 @@ module EInvoiceAPI
|
|
|
104
102
|
def send_request: (
|
|
105
103
|
EInvoiceAPI::Internal::Transport::BaseClient::request_input request,
|
|
106
104
|
redirect_count: Integer,
|
|
107
|
-
retry_count: Integer
|
|
108
|
-
send_retry_header: bool
|
|
105
|
+
retry_count: Integer
|
|
109
106
|
) -> [Integer, top, Enumerable[String]]
|
|
110
107
|
|
|
111
108
|
def request: (
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
module EInvoiceAPI
|
|
2
|
+
module Models
|
|
3
|
+
class DocumentCreateFromPdfTask = Conversion::DocumentCreateFromPdfTask
|
|
4
|
+
|
|
5
|
+
module Conversion
|
|
6
|
+
type document_create_from_pdf_task =
|
|
7
|
+
{
|
|
8
|
+
task_id: String,
|
|
9
|
+
status: EInvoiceAPI::Models::Conversion::DocumentCreateFromPdfTask::status
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
class DocumentCreateFromPdfTask < EInvoiceAPI::Internal::Type::BaseModel
|
|
13
|
+
attr_accessor task_id: String
|
|
14
|
+
|
|
15
|
+
attr_reader status: EInvoiceAPI::Models::Conversion::DocumentCreateFromPdfTask::status?
|
|
16
|
+
|
|
17
|
+
def status=: (
|
|
18
|
+
EInvoiceAPI::Models::Conversion::DocumentCreateFromPdfTask::status
|
|
19
|
+
) -> EInvoiceAPI::Models::Conversion::DocumentCreateFromPdfTask::status
|
|
20
|
+
|
|
21
|
+
def initialize: (
|
|
22
|
+
task_id: String,
|
|
23
|
+
?status: EInvoiceAPI::Models::Conversion::DocumentCreateFromPdfTask::status
|
|
24
|
+
) -> void
|
|
25
|
+
|
|
26
|
+
def to_hash: -> {
|
|
27
|
+
task_id: String,
|
|
28
|
+
status: EInvoiceAPI::Models::Conversion::DocumentCreateFromPdfTask::status
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
type status = :pending | :completed | :failed
|
|
32
|
+
|
|
33
|
+
module Status
|
|
34
|
+
extend EInvoiceAPI::Internal::Type::Enum
|
|
35
|
+
|
|
36
|
+
PENDING: :pending
|
|
37
|
+
COMPLETED: :completed
|
|
38
|
+
FAILED: :failed
|
|
39
|
+
|
|
40
|
+
def self?.values: -> ::Array[EInvoiceAPI::Models::Conversion::DocumentCreateFromPdfTask::status]
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module EInvoiceAPI
|
|
2
|
+
module Models
|
|
3
|
+
module Conversion
|
|
4
|
+
type pdf_create_params =
|
|
5
|
+
{ file: EInvoiceAPI::Internal::file_input }
|
|
6
|
+
& EInvoiceAPI::Internal::Type::request_parameters
|
|
7
|
+
|
|
8
|
+
class PdfCreateParams < EInvoiceAPI::Internal::Type::BaseModel
|
|
9
|
+
extend EInvoiceAPI::Internal::Type::RequestParameters::Converter
|
|
10
|
+
include EInvoiceAPI::Internal::Type::RequestParameters
|
|
11
|
+
|
|
12
|
+
attr_accessor file: EInvoiceAPI::Internal::file_input
|
|
13
|
+
|
|
14
|
+
def initialize: (
|
|
15
|
+
file: EInvoiceAPI::Internal::file_input,
|
|
16
|
+
?request_options: EInvoiceAPI::request_opts
|
|
17
|
+
) -> void
|
|
18
|
+
|
|
19
|
+
def to_hash: -> {
|
|
20
|
+
file: EInvoiceAPI::Internal::file_input,
|
|
21
|
+
request_options: EInvoiceAPI::RequestOptions
|
|
22
|
+
}
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module EInvoiceAPI
|
|
2
|
+
module Models
|
|
3
|
+
module Conversion
|
|
4
|
+
type pdf_result_params =
|
|
5
|
+
{ task_id: String } & EInvoiceAPI::Internal::Type::request_parameters
|
|
6
|
+
|
|
7
|
+
class PdfResultParams < EInvoiceAPI::Internal::Type::BaseModel
|
|
8
|
+
extend EInvoiceAPI::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include EInvoiceAPI::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
attr_accessor task_id: String
|
|
12
|
+
|
|
13
|
+
def initialize: (
|
|
14
|
+
task_id: String,
|
|
15
|
+
?request_options: EInvoiceAPI::request_opts
|
|
16
|
+
) -> void
|
|
17
|
+
|
|
18
|
+
def to_hash: -> {
|
|
19
|
+
task_id: String,
|
|
20
|
+
request_options: EInvoiceAPI::RequestOptions
|
|
21
|
+
}
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module EInvoiceAPI
|
|
2
|
+
module Models
|
|
3
|
+
module Conversion
|
|
4
|
+
type pdf_retrieve_params =
|
|
5
|
+
{ task_id: String } & EInvoiceAPI::Internal::Type::request_parameters
|
|
6
|
+
|
|
7
|
+
class PdfRetrieveParams < EInvoiceAPI::Internal::Type::BaseModel
|
|
8
|
+
extend EInvoiceAPI::Internal::Type::RequestParameters::Converter
|
|
9
|
+
include EInvoiceAPI::Internal::Type::RequestParameters
|
|
10
|
+
|
|
11
|
+
attr_accessor task_id: String
|
|
12
|
+
|
|
13
|
+
def initialize: (
|
|
14
|
+
task_id: String,
|
|
15
|
+
?request_options: EInvoiceAPI::request_opts
|
|
16
|
+
) -> void
|
|
17
|
+
|
|
18
|
+
def to_hash: -> {
|
|
19
|
+
task_id: String,
|
|
20
|
+
request_options: EInvoiceAPI::RequestOptions
|
|
21
|
+
}
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|