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 Models
|
|
5
|
+
class WebhookHistoryParams < EInvoiceAPI::Internal::Type::BaseModel
|
|
6
|
+
extend EInvoiceAPI::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include EInvoiceAPI::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(
|
|
12
|
+
EInvoiceAPI::WebhookHistoryParams,
|
|
13
|
+
EInvoiceAPI::Internal::AnyHash
|
|
14
|
+
)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
sig { returns(String) }
|
|
18
|
+
attr_accessor :webhook_id
|
|
19
|
+
|
|
20
|
+
sig do
|
|
21
|
+
params(
|
|
22
|
+
webhook_id: String,
|
|
23
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
|
24
|
+
).returns(T.attached_class)
|
|
25
|
+
end
|
|
26
|
+
def self.new(webhook_id:, request_options: {})
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
sig do
|
|
30
|
+
override.returns(
|
|
31
|
+
{ webhook_id: String, request_options: EInvoiceAPI::RequestOptions }
|
|
32
|
+
)
|
|
33
|
+
end
|
|
34
|
+
def to_hash
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module EInvoiceAPI
|
|
4
|
+
module Models
|
|
5
|
+
class WebhookHistoryResponse < EInvoiceAPI::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
EInvoiceAPI::Models::WebhookHistoryResponse,
|
|
10
|
+
EInvoiceAPI::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig { returns(T::Array[T::Hash[Symbol, T.anything]]) }
|
|
15
|
+
attr_accessor :history
|
|
16
|
+
|
|
17
|
+
sig do
|
|
18
|
+
params(history: T::Array[T::Hash[Symbol, T.anything]]).returns(
|
|
19
|
+
T.attached_class
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
def self.new(history:)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
sig do
|
|
26
|
+
override.returns({ history: T::Array[T::Hash[Symbol, T.anything]] })
|
|
27
|
+
end
|
|
28
|
+
def to_hash
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module EInvoiceAPI
|
|
4
|
+
module Models
|
|
5
|
+
class WebhookTestParams < EInvoiceAPI::Internal::Type::BaseModel
|
|
6
|
+
extend EInvoiceAPI::Internal::Type::RequestParameters::Converter
|
|
7
|
+
include EInvoiceAPI::Internal::Type::RequestParameters
|
|
8
|
+
|
|
9
|
+
OrHash =
|
|
10
|
+
T.type_alias do
|
|
11
|
+
T.any(EInvoiceAPI::WebhookTestParams, EInvoiceAPI::Internal::AnyHash)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
sig { returns(String) }
|
|
15
|
+
attr_accessor :webhook_id
|
|
16
|
+
|
|
17
|
+
# Custom event data payload
|
|
18
|
+
sig { returns(T::Hash[Symbol, T.anything]) }
|
|
19
|
+
attr_accessor :data
|
|
20
|
+
|
|
21
|
+
# Must be valid WebhookEventType
|
|
22
|
+
sig { returns(String) }
|
|
23
|
+
attr_accessor :event_type
|
|
24
|
+
|
|
25
|
+
sig do
|
|
26
|
+
params(
|
|
27
|
+
webhook_id: String,
|
|
28
|
+
data: T::Hash[Symbol, T.anything],
|
|
29
|
+
event_type: String,
|
|
30
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
|
31
|
+
).returns(T.attached_class)
|
|
32
|
+
end
|
|
33
|
+
def self.new(
|
|
34
|
+
webhook_id:,
|
|
35
|
+
# Custom event data payload
|
|
36
|
+
data:,
|
|
37
|
+
# Must be valid WebhookEventType
|
|
38
|
+
event_type:,
|
|
39
|
+
request_options: {}
|
|
40
|
+
)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
sig do
|
|
44
|
+
override.returns(
|
|
45
|
+
{
|
|
46
|
+
webhook_id: String,
|
|
47
|
+
data: T::Hash[Symbol, T.anything],
|
|
48
|
+
event_type: String,
|
|
49
|
+
request_options: EInvoiceAPI::RequestOptions
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
end
|
|
53
|
+
def to_hash
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module EInvoiceAPI
|
|
4
|
+
module Models
|
|
5
|
+
class WebhookTestResponse < EInvoiceAPI::Internal::Type::BaseModel
|
|
6
|
+
OrHash =
|
|
7
|
+
T.type_alias do
|
|
8
|
+
T.any(
|
|
9
|
+
EInvoiceAPI::Models::WebhookTestResponse,
|
|
10
|
+
EInvoiceAPI::Internal::AnyHash
|
|
11
|
+
)
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Descriptive message about the test result
|
|
15
|
+
sig { returns(String) }
|
|
16
|
+
attr_accessor :message
|
|
17
|
+
|
|
18
|
+
# Whether the test completed successfully
|
|
19
|
+
sig { returns(T::Boolean) }
|
|
20
|
+
attr_accessor :success
|
|
21
|
+
|
|
22
|
+
# Result from process_webhook_task
|
|
23
|
+
sig { returns(T::Hash[Symbol, T.anything]) }
|
|
24
|
+
attr_accessor :webhook_delivery_result
|
|
25
|
+
|
|
26
|
+
# Schema for webhook test response.
|
|
27
|
+
sig do
|
|
28
|
+
params(
|
|
29
|
+
message: String,
|
|
30
|
+
success: T::Boolean,
|
|
31
|
+
webhook_delivery_result: T::Hash[Symbol, T.anything]
|
|
32
|
+
).returns(T.attached_class)
|
|
33
|
+
end
|
|
34
|
+
def self.new(
|
|
35
|
+
# Descriptive message about the test result
|
|
36
|
+
message:,
|
|
37
|
+
# Whether the test completed successfully
|
|
38
|
+
success:,
|
|
39
|
+
# Result from process_webhook_task
|
|
40
|
+
webhook_delivery_result:
|
|
41
|
+
)
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
sig do
|
|
45
|
+
override.returns(
|
|
46
|
+
{
|
|
47
|
+
message: String,
|
|
48
|
+
success: T::Boolean,
|
|
49
|
+
webhook_delivery_result: T::Hash[Symbol, T.anything]
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
end
|
|
53
|
+
def to_hash
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -7,6 +7,8 @@ module EInvoiceAPI
|
|
|
7
7
|
|
|
8
8
|
Charge = EInvoiceAPI::Models::Charge
|
|
9
9
|
|
|
10
|
+
Conversion = EInvoiceAPI::Models::Conversion
|
|
11
|
+
|
|
10
12
|
CurrencyCode = EInvoiceAPI::Models::CurrencyCode
|
|
11
13
|
|
|
12
14
|
DocumentAttachmentCreate = EInvoiceAPI::Models::DocumentAttachmentCreate
|
|
@@ -21,6 +23,8 @@ module EInvoiceAPI
|
|
|
21
23
|
|
|
22
24
|
DocumentDirection = EInvoiceAPI::Models::DocumentDirection
|
|
23
25
|
|
|
26
|
+
DocumentLifecycleParams = EInvoiceAPI::Models::DocumentLifecycleParams
|
|
27
|
+
|
|
24
28
|
DocumentResponse = EInvoiceAPI::Models::DocumentResponse
|
|
25
29
|
|
|
26
30
|
DocumentRetrieveParams = EInvoiceAPI::Models::DocumentRetrieveParams
|
|
@@ -31,10 +35,16 @@ module EInvoiceAPI
|
|
|
31
35
|
|
|
32
36
|
DocumentState = EInvoiceAPI::Models::DocumentState
|
|
33
37
|
|
|
38
|
+
DocumentTimelineParams = EInvoiceAPI::Models::DocumentTimelineParams
|
|
39
|
+
|
|
34
40
|
DocumentType = EInvoiceAPI::Models::DocumentType
|
|
35
41
|
|
|
36
42
|
DocumentValidateParams = EInvoiceAPI::Models::DocumentValidateParams
|
|
37
43
|
|
|
44
|
+
DraftListParams = EInvoiceAPI::Models::DraftListParams
|
|
45
|
+
|
|
46
|
+
InboundEmailResponse = EInvoiceAPI::Models::InboundEmailResponse
|
|
47
|
+
|
|
38
48
|
InboxListCreditNotesParams = EInvoiceAPI::Models::InboxListCreditNotesParams
|
|
39
49
|
|
|
40
50
|
InboxListInvoicesParams = EInvoiceAPI::Models::InboxListInvoicesParams
|
|
@@ -46,6 +56,15 @@ module EInvoiceAPI
|
|
|
46
56
|
LookupRetrieveParticipantsParams =
|
|
47
57
|
EInvoiceAPI::Models::LookupRetrieveParticipantsParams
|
|
48
58
|
|
|
59
|
+
MailboxDownloadAttachmentParams =
|
|
60
|
+
EInvoiceAPI::Models::MailboxDownloadAttachmentParams
|
|
61
|
+
|
|
62
|
+
MailboxListParams = EInvoiceAPI::Models::MailboxListParams
|
|
63
|
+
|
|
64
|
+
MailboxReprocessParams = EInvoiceAPI::Models::MailboxReprocessParams
|
|
65
|
+
|
|
66
|
+
MailboxRetrieveParams = EInvoiceAPI::Models::MailboxRetrieveParams
|
|
67
|
+
|
|
49
68
|
MeRetrieveParams = EInvoiceAPI::Models::MeRetrieveParams
|
|
50
69
|
|
|
51
70
|
OutboxListDraftDocumentsParams =
|
|
@@ -58,6 +77,8 @@ module EInvoiceAPI
|
|
|
58
77
|
|
|
59
78
|
PaymentDetailCreate = EInvoiceAPI::Models::PaymentDetailCreate
|
|
60
79
|
|
|
80
|
+
StatsRetrieveParams = EInvoiceAPI::Models::StatsRetrieveParams
|
|
81
|
+
|
|
61
82
|
UblDocumentValidation = EInvoiceAPI::Models::UblDocumentValidation
|
|
62
83
|
|
|
63
84
|
UnitOfMeasureCode = EInvoiceAPI::Models::UnitOfMeasureCode
|
|
@@ -73,11 +94,15 @@ module EInvoiceAPI
|
|
|
73
94
|
|
|
74
95
|
WebhookDeleteParams = EInvoiceAPI::Models::WebhookDeleteParams
|
|
75
96
|
|
|
97
|
+
WebhookHistoryParams = EInvoiceAPI::Models::WebhookHistoryParams
|
|
98
|
+
|
|
76
99
|
WebhookListParams = EInvoiceAPI::Models::WebhookListParams
|
|
77
100
|
|
|
78
101
|
WebhookResponse = EInvoiceAPI::Models::WebhookResponse
|
|
79
102
|
|
|
80
103
|
WebhookRetrieveParams = EInvoiceAPI::Models::WebhookRetrieveParams
|
|
81
104
|
|
|
105
|
+
WebhookTestParams = EInvoiceAPI::Models::WebhookTestParams
|
|
106
|
+
|
|
82
107
|
WebhookUpdateParams = EInvoiceAPI::Models::WebhookUpdateParams
|
|
83
108
|
end
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module EInvoiceAPI
|
|
4
|
+
module Resources
|
|
5
|
+
class Conversion
|
|
6
|
+
class Pdf
|
|
7
|
+
# Convert a PDF to a document
|
|
8
|
+
sig do
|
|
9
|
+
params(
|
|
10
|
+
file: EInvoiceAPI::Internal::FileInput,
|
|
11
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
|
12
|
+
).returns(EInvoiceAPI::Conversion::DocumentCreateFromPdfTask)
|
|
13
|
+
end
|
|
14
|
+
def create(file:, request_options: {})
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# Get the status of a PDF conversion task
|
|
18
|
+
sig do
|
|
19
|
+
params(
|
|
20
|
+
task_id: String,
|
|
21
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
|
22
|
+
).returns(EInvoiceAPI::Conversion::DocumentCreateFromPdfTask)
|
|
23
|
+
end
|
|
24
|
+
def retrieve(task_id, request_options: {})
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Get the result of a PDF conversion task
|
|
28
|
+
sig do
|
|
29
|
+
params(
|
|
30
|
+
task_id: String,
|
|
31
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
|
32
|
+
).returns(EInvoiceAPI::Models::DocumentCreateFromPdfResponse)
|
|
33
|
+
end
|
|
34
|
+
def result(task_id, request_options: {})
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# @api private
|
|
38
|
+
sig { params(client: EInvoiceAPI::Client).returns(T.attached_class) }
|
|
39
|
+
def self.new(client:)
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module EInvoiceAPI
|
|
4
|
+
module Resources
|
|
5
|
+
class Conversion
|
|
6
|
+
sig { returns(EInvoiceAPI::Resources::Conversion::Pdf) }
|
|
7
|
+
attr_reader :pdf
|
|
8
|
+
|
|
9
|
+
# @api private
|
|
10
|
+
sig { params(client: EInvoiceAPI::Client).returns(T.attached_class) }
|
|
11
|
+
def self.new(client:)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -21,6 +21,7 @@ module EInvoiceAPI
|
|
|
21
21
|
T.nilable(T::Array[EInvoiceAPI::DocumentAttachmentCreate::OrHash]),
|
|
22
22
|
billing_address: T.nilable(String),
|
|
23
23
|
billing_address_recipient: T.nilable(String),
|
|
24
|
+
buyer_reference: T.nilable(String),
|
|
24
25
|
charges:
|
|
25
26
|
T.nilable(T::Array[EInvoiceAPI::DocumentCreate::Charge::OrHash]),
|
|
26
27
|
currency: EInvoiceAPI::CurrencyCode::OrSymbol,
|
|
@@ -31,6 +32,7 @@ module EInvoiceAPI
|
|
|
31
32
|
customer_id: T.nilable(String),
|
|
32
33
|
customer_name: T.nilable(String),
|
|
33
34
|
customer_peppol_id: T.nilable(String),
|
|
35
|
+
customer_phone: T.nilable(String),
|
|
34
36
|
customer_tax_id: T.nilable(String),
|
|
35
37
|
direction: EInvoiceAPI::DocumentDirection::OrSymbol,
|
|
36
38
|
document_type: EInvoiceAPI::DocumentType::OrSymbol,
|
|
@@ -44,6 +46,8 @@ module EInvoiceAPI
|
|
|
44
46
|
payment_details:
|
|
45
47
|
T.nilable(T::Array[EInvoiceAPI::PaymentDetailCreate::OrHash]),
|
|
46
48
|
payment_term: T.nilable(String),
|
|
49
|
+
preceding_invoice_date: T.nilable(Date),
|
|
50
|
+
preceding_invoice_id: T.nilable(String),
|
|
47
51
|
previous_unpaid_balance:
|
|
48
52
|
T.nilable(
|
|
49
53
|
EInvoiceAPI::DocumentCreate::PreviousUnpaidBalance::Variants
|
|
@@ -51,6 +55,9 @@ module EInvoiceAPI
|
|
|
51
55
|
purchase_order: T.nilable(String),
|
|
52
56
|
remittance_address: T.nilable(String),
|
|
53
57
|
remittance_address_recipient: T.nilable(String),
|
|
58
|
+
rounding_amount:
|
|
59
|
+
T.nilable(EInvoiceAPI::DocumentCreate::RoundingAmount::Variants),
|
|
60
|
+
sales_order: T.nilable(String),
|
|
54
61
|
service_address: T.nilable(String),
|
|
55
62
|
service_address_recipient: T.nilable(String),
|
|
56
63
|
service_end_date: T.nilable(Date),
|
|
@@ -60,11 +67,16 @@ module EInvoiceAPI
|
|
|
60
67
|
state: EInvoiceAPI::DocumentState::OrSymbol,
|
|
61
68
|
subtotal: T.nilable(EInvoiceAPI::DocumentCreate::Subtotal::Variants),
|
|
62
69
|
tax_code: EInvoiceAPI::DocumentCreate::TaxCode::OrSymbol,
|
|
70
|
+
tax_currency: T.nilable(String),
|
|
63
71
|
tax_details:
|
|
64
72
|
T.nilable(T::Array[EInvoiceAPI::DocumentCreate::TaxDetail::OrHash]),
|
|
65
73
|
total_discount:
|
|
66
74
|
T.nilable(EInvoiceAPI::DocumentCreate::TotalDiscount::Variants),
|
|
67
75
|
total_tax: T.nilable(EInvoiceAPI::DocumentCreate::TotalTax::Variants),
|
|
76
|
+
total_tax_in_tax_currency:
|
|
77
|
+
T.nilable(
|
|
78
|
+
EInvoiceAPI::DocumentCreate::TotalTaxInTaxCurrency::Variants
|
|
79
|
+
),
|
|
68
80
|
vatex: T.nilable(EInvoiceAPI::DocumentCreate::Vatex::OrSymbol),
|
|
69
81
|
vatex_note: T.nilable(String),
|
|
70
82
|
vendor_address: T.nilable(String),
|
|
@@ -72,6 +84,7 @@ module EInvoiceAPI
|
|
|
72
84
|
vendor_company_id: T.nilable(String),
|
|
73
85
|
vendor_email: T.nilable(String),
|
|
74
86
|
vendor_name: T.nilable(String),
|
|
87
|
+
vendor_phone: T.nilable(String),
|
|
75
88
|
vendor_tax_id: T.nilable(String),
|
|
76
89
|
request_options: EInvoiceAPI::RequestOptions::OrHash
|
|
77
90
|
).returns(EInvoiceAPI::DocumentResponse)
|
|
@@ -91,13 +104,17 @@ module EInvoiceAPI
|
|
|
91
104
|
billing_address: nil,
|
|
92
105
|
# Body param: The recipient name at the billing address
|
|
93
106
|
billing_address_recipient: nil,
|
|
107
|
+
# Body param: The buyer reference (BT-10), e.g. a cost centre or accounting
|
|
108
|
+
# reference requested by the buyer
|
|
109
|
+
buyer_reference: nil,
|
|
94
110
|
# Body param
|
|
95
111
|
charges: nil,
|
|
96
112
|
# Body param: Currency of the invoice (ISO 4217 currency code)
|
|
97
113
|
currency: nil,
|
|
98
114
|
# Body param: The address of the customer/buyer
|
|
99
115
|
customer_address: nil,
|
|
100
|
-
# Body param: The recipient name at the customer address
|
|
116
|
+
# Body param: The recipient name at the customer address. Also the customer
|
|
117
|
+
# contact name (BT-56) in the UBL.
|
|
101
118
|
customer_address_recipient: nil,
|
|
102
119
|
# Body param: Customer company ID. For Belgium this is the CBE number or their
|
|
103
120
|
# EUID (European Unique Identifier) number. In the Netherlands this is the KVK
|
|
@@ -111,6 +128,8 @@ module EInvoiceAPI
|
|
|
111
128
|
customer_name: nil,
|
|
112
129
|
# Body param: Customer Peppol ID
|
|
113
130
|
customer_peppol_id: nil,
|
|
131
|
+
# Body param: The telephone number of the customer contact (BT-57)
|
|
132
|
+
customer_phone: nil,
|
|
114
133
|
# Body param: Customer tax ID. For Belgium this is the VAT number. Must include
|
|
115
134
|
# the country prefix
|
|
116
135
|
customer_tax_id: nil,
|
|
@@ -137,15 +156,27 @@ module EInvoiceAPI
|
|
|
137
156
|
payment_details: nil,
|
|
138
157
|
# Body param: The payment terms (e.g., 'Net 30', 'Due on receipt', '2/10 Net 30')
|
|
139
158
|
payment_term: nil,
|
|
159
|
+
# Body param: The preceding invoice issue date (BT-26)
|
|
160
|
+
preceding_invoice_date: nil,
|
|
161
|
+
# Body param: The preceding invoice reference (BT-25): the number of the invoice
|
|
162
|
+
# this document corrects, for example the invoice a credit note credits
|
|
163
|
+
preceding_invoice_id: nil,
|
|
140
164
|
# Body param: The previous unpaid balance from prior invoices, if any. Must be
|
|
141
165
|
# positive and rounded to maximum 2 decimals
|
|
142
166
|
previous_unpaid_balance: nil,
|
|
143
|
-
# Body param: The purchase order reference number
|
|
167
|
+
# Body param: The purchase order reference number (BT-13)
|
|
144
168
|
purchase_order: nil,
|
|
145
169
|
# Body param: The address where payment should be sent or remitted to
|
|
146
170
|
remittance_address: nil,
|
|
147
171
|
# Body param: The recipient name at the remittance address
|
|
148
172
|
remittance_address_recipient: nil,
|
|
173
|
+
# Body param: The amount added to the invoice total to round the amount for
|
|
174
|
+
# payment (BT-114), for example to whole kronor (amount_due = invoice_total +
|
|
175
|
+
# rounding_amount when nothing is prepaid). Can be negative. Between -5.00 and
|
|
176
|
+
# 5.00, rounded to maximum 2 decimals
|
|
177
|
+
rounding_amount: nil,
|
|
178
|
+
# Body param: The sales order reference (BT-14) assigned by the seller
|
|
179
|
+
sales_order: nil,
|
|
149
180
|
# Body param: The address where services were performed or goods were delivered
|
|
150
181
|
service_address: nil,
|
|
151
182
|
# Body param: The recipient name at the service address
|
|
@@ -156,7 +187,7 @@ module EInvoiceAPI
|
|
|
156
187
|
service_start_date: nil,
|
|
157
188
|
# Body param: The shipping/delivery address
|
|
158
189
|
shipping_address: nil,
|
|
159
|
-
# Body param: The
|
|
190
|
+
# Body param: The name of the deliver-to party (BT-70)
|
|
160
191
|
shipping_address_recipient: nil,
|
|
161
192
|
# Body param: The current state of the document: DRAFT, TRANSIT, FAILED, SENT, or
|
|
162
193
|
# RECEIVED
|
|
@@ -168,6 +199,10 @@ module EInvoiceAPI
|
|
|
168
199
|
# Body param: Tax category code of the invoice (e.g., S for standard rate, Z for
|
|
169
200
|
# zero rate, E for exempt)
|
|
170
201
|
tax_code: nil,
|
|
202
|
+
# Body param: The VAT accounting currency (BT-6, ISO 4217 currency code), when VAT
|
|
203
|
+
# is accounted in a currency other than the invoice currency. Must differ from
|
|
204
|
+
# currency and requires total_tax_in_tax_currency
|
|
205
|
+
tax_currency: nil,
|
|
171
206
|
# Body param
|
|
172
207
|
tax_details: nil,
|
|
173
208
|
# Body param: The net financial discount/charge of the invoice (non-VAT charges
|
|
@@ -177,15 +212,23 @@ module EInvoiceAPI
|
|
|
177
212
|
# Body param: The total tax amount of the invoice. Must be positive and rounded to
|
|
178
213
|
# maximum 2 decimals
|
|
179
214
|
total_tax: nil,
|
|
215
|
+
# Body param: The total VAT amount in the VAT accounting currency tax_currency
|
|
216
|
+
# (BT-111). Does not add to invoice_total. Requires tax_currency. Rounded to
|
|
217
|
+
# maximum 2 decimals
|
|
218
|
+
total_tax_in_tax_currency: nil,
|
|
180
219
|
# Body param: VATEX code list for VAT exemption reasons
|
|
181
220
|
#
|
|
182
221
|
# Agency: CEF Identifier: vatex
|
|
183
222
|
vatex: nil,
|
|
184
|
-
# Body param:
|
|
223
|
+
# Body param: VAT exemption reason text (BT-120). An exemption reason (vatex or
|
|
224
|
+
# vatex_note) is required for tax_code E, AE, K, G and O, and not allowed for S,
|
|
225
|
+
# Z, L and M
|
|
185
226
|
vatex_note: nil,
|
|
186
227
|
# Body param: The address of the vendor/seller
|
|
187
228
|
vendor_address: nil,
|
|
188
|
-
# Body param: The recipient name at the vendor address
|
|
229
|
+
# Body param: The recipient name at the vendor address. Also the vendor contact
|
|
230
|
+
# name (BT-41) in the UBL, required when vendor and customer are both in Germany
|
|
231
|
+
# (DE-R-005).
|
|
189
232
|
vendor_address_recipient: nil,
|
|
190
233
|
# Body param: Vendor company ID. For Belgium this is the CBE number or their EUID
|
|
191
234
|
# (European Unique Identifier) number. In the Netherlands this is the KVK number.
|
|
@@ -194,6 +237,10 @@ module EInvoiceAPI
|
|
|
194
237
|
vendor_email: nil,
|
|
195
238
|
# Body param: The name of the vendor/seller/supplier
|
|
196
239
|
vendor_name: nil,
|
|
240
|
+
# Body param: The telephone number of the vendor contact (BT-42). Required when
|
|
241
|
+
# vendor and customer are both in Germany (DE-R-006); it must then hold at least 3
|
|
242
|
+
# digits (DE-R-027, a warning).
|
|
243
|
+
vendor_phone: nil,
|
|
197
244
|
# Body param: Vendor tax ID. For Belgium this is the VAT number. Must include the
|
|
198
245
|
# country prefix
|
|
199
246
|
vendor_tax_id: nil,
|
|
@@ -283,6 +330,31 @@ module EInvoiceAPI
|
|
|
283
330
|
def validate(document_id, request_options: {})
|
|
284
331
|
end
|
|
285
332
|
|
|
333
|
+
# Get the timeline of events for an invoice or credit note, including creation,
|
|
334
|
+
# validation, transmission, and delivery events
|
|
335
|
+
sig do
|
|
336
|
+
params(
|
|
337
|
+
document_id: String,
|
|
338
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
|
339
|
+
).returns(EInvoiceAPI::Models::DocumentTimelineResponse)
|
|
340
|
+
end
|
|
341
|
+
def timeline(document_id, request_options: {})
|
|
342
|
+
end
|
|
343
|
+
|
|
344
|
+
# Get the lifecycle events stated about an invoice or credit note after creation
|
|
345
|
+
# (Peppol Message Level and Invoice Responses, partner status events), oldest
|
|
346
|
+
# first. Each event carries a route-agnostic canonical status next to the
|
|
347
|
+
# untouched native code of its source; native codes without a canonical equivalent
|
|
348
|
+
# have canonical_status null.
|
|
349
|
+
sig do
|
|
350
|
+
params(
|
|
351
|
+
document_id: String,
|
|
352
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
|
353
|
+
).returns(EInvoiceAPI::Models::DocumentLifecycleResponse)
|
|
354
|
+
end
|
|
355
|
+
def lifecycle(document_id, request_options: {})
|
|
356
|
+
end
|
|
357
|
+
|
|
286
358
|
# @api private
|
|
287
359
|
sig { params(client: EInvoiceAPI::Client).returns(T.attached_class) }
|
|
288
360
|
def self.new(client:)
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module EInvoiceAPI
|
|
4
|
+
module Resources
|
|
5
|
+
class Drafts
|
|
6
|
+
# Retrieve a paginated list of draft documents with filtering options including
|
|
7
|
+
# state and text search.
|
|
8
|
+
sig do
|
|
9
|
+
params(
|
|
10
|
+
date_from: T.nilable(Time),
|
|
11
|
+
date_to: T.nilable(Time),
|
|
12
|
+
page: Integer,
|
|
13
|
+
page_size: Integer,
|
|
14
|
+
search: T.nilable(String),
|
|
15
|
+
sort_by: EInvoiceAPI::DraftListParams::SortBy::OrSymbol,
|
|
16
|
+
sort_order: EInvoiceAPI::DraftListParams::SortOrder::OrSymbol,
|
|
17
|
+
state: T.nilable(EInvoiceAPI::DocumentState::OrSymbol),
|
|
18
|
+
type: T.nilable(EInvoiceAPI::DocumentType::OrSymbol),
|
|
19
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
|
20
|
+
).returns(
|
|
21
|
+
EInvoiceAPI::Internal::DocumentsNumberPage[
|
|
22
|
+
EInvoiceAPI::DocumentResponse
|
|
23
|
+
]
|
|
24
|
+
)
|
|
25
|
+
end
|
|
26
|
+
def list(
|
|
27
|
+
# Filter by issue date (from)
|
|
28
|
+
date_from: nil,
|
|
29
|
+
# Filter by issue date (to)
|
|
30
|
+
date_to: nil,
|
|
31
|
+
# Page number
|
|
32
|
+
page: nil,
|
|
33
|
+
# Number of items per page
|
|
34
|
+
page_size: nil,
|
|
35
|
+
# Search in invoice number, seller/buyer names
|
|
36
|
+
search: nil,
|
|
37
|
+
# Field to sort by
|
|
38
|
+
sort_by: nil,
|
|
39
|
+
# Sort direction (asc/desc)
|
|
40
|
+
sort_order: nil,
|
|
41
|
+
# Filter by document state. By default return all states (DRAFT, TRANSIT, FAILED).
|
|
42
|
+
state: nil,
|
|
43
|
+
# Filter by document type
|
|
44
|
+
type: nil,
|
|
45
|
+
request_options: {}
|
|
46
|
+
)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# @api private
|
|
50
|
+
sig { params(client: EInvoiceAPI::Client).returns(T.attached_class) }
|
|
51
|
+
def self.new(client:)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# typed: strong
|
|
2
|
+
|
|
3
|
+
module EInvoiceAPI
|
|
4
|
+
module Resources
|
|
5
|
+
class Mailbox
|
|
6
|
+
# Retrieve a paginated list of received inbound emails with filtering, search, and
|
|
7
|
+
# sorting options.
|
|
8
|
+
sig do
|
|
9
|
+
params(
|
|
10
|
+
page: Integer,
|
|
11
|
+
page_size: Integer,
|
|
12
|
+
processed: T.nilable(T::Boolean),
|
|
13
|
+
received_from: T.nilable(Time),
|
|
14
|
+
received_to: T.nilable(Time),
|
|
15
|
+
search: T.nilable(String),
|
|
16
|
+
sort_by: EInvoiceAPI::MailboxListParams::SortBy::OrSymbol,
|
|
17
|
+
sort_order: EInvoiceAPI::MailboxListParams::SortOrder::OrSymbol,
|
|
18
|
+
status: T.nilable(EInvoiceAPI::MailboxListParams::Status::OrSymbol),
|
|
19
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
|
20
|
+
).returns(
|
|
21
|
+
EInvoiceAPI::Internal::DocumentsNumberPage[
|
|
22
|
+
EInvoiceAPI::InboundEmailResponse
|
|
23
|
+
]
|
|
24
|
+
)
|
|
25
|
+
end
|
|
26
|
+
def list(
|
|
27
|
+
# Page number
|
|
28
|
+
page: nil,
|
|
29
|
+
# Number of items per page
|
|
30
|
+
page_size: nil,
|
|
31
|
+
# Filter by processing status. If not provided, returns all. Ignored when `status`
|
|
32
|
+
# is set.
|
|
33
|
+
processed: nil,
|
|
34
|
+
# Inclusive lower bound on received date (falls back to created_at when
|
|
35
|
+
# received_at is null)
|
|
36
|
+
received_from: nil,
|
|
37
|
+
# Inclusive upper bound on received date (falls back to created_at when
|
|
38
|
+
# received_at is null)
|
|
39
|
+
received_to: nil,
|
|
40
|
+
# Case-insensitive search across sender email, subject, message ID, and attachment
|
|
41
|
+
# filenames
|
|
42
|
+
search: nil,
|
|
43
|
+
# Field to sort by
|
|
44
|
+
sort_by: nil,
|
|
45
|
+
# Sort direction (asc/desc)
|
|
46
|
+
sort_order: nil,
|
|
47
|
+
# Filter by status: pending, success, or failed. Takes precedence over `processed`
|
|
48
|
+
# if both are provided.
|
|
49
|
+
status: nil,
|
|
50
|
+
request_options: {}
|
|
51
|
+
)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Retrieve a single inbound email by ID, scoped to the caller's tenant.
|
|
55
|
+
sig do
|
|
56
|
+
params(
|
|
57
|
+
inbound_email_id: String,
|
|
58
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
|
59
|
+
).returns(EInvoiceAPI::InboundEmailResponse)
|
|
60
|
+
end
|
|
61
|
+
def retrieve(inbound_email_id, request_options: {})
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Download a specific attachment from an inbound email by filename. Returns the
|
|
65
|
+
# binary content with the correct Content-Type.
|
|
66
|
+
sig do
|
|
67
|
+
params(
|
|
68
|
+
filename: String,
|
|
69
|
+
inbound_email_id: String,
|
|
70
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
|
71
|
+
).returns(T.anything)
|
|
72
|
+
end
|
|
73
|
+
def download_attachment(filename, inbound_email_id:, request_options: {})
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Retry processing of a previously failed inbound email by replaying the original
|
|
77
|
+
# Postmark payload.
|
|
78
|
+
sig do
|
|
79
|
+
params(
|
|
80
|
+
inbound_email_id: String,
|
|
81
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
|
82
|
+
).returns(EInvoiceAPI::InboundEmailResponse)
|
|
83
|
+
end
|
|
84
|
+
def reprocess(inbound_email_id, request_options: {})
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# @api private
|
|
88
|
+
sig { params(client: EInvoiceAPI::Client).returns(T.attached_class) }
|
|
89
|
+
def self.new(client:)
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
end
|