e-invoice-api 0.1.0.pre.alpha.5
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 +7 -0
- data/.ignore +2 -0
- data/CHANGELOG.md +57 -0
- data/README.md +285 -0
- data/SECURITY.md +27 -0
- data/lib/e_invoice_api/client.rb +94 -0
- data/lib/e_invoice_api/errors.rb +192 -0
- data/lib/e_invoice_api/file_part.rb +55 -0
- data/lib/e_invoice_api/internal/documents_number_page.rb +96 -0
- data/lib/e_invoice_api/internal/transport/base_client.rb +555 -0
- data/lib/e_invoice_api/internal/transport/pooled_net_requester.rb +209 -0
- data/lib/e_invoice_api/internal/type/array_of.rb +162 -0
- data/lib/e_invoice_api/internal/type/base_model.rb +482 -0
- data/lib/e_invoice_api/internal/type/base_page.rb +55 -0
- data/lib/e_invoice_api/internal/type/boolean.rb +71 -0
- data/lib/e_invoice_api/internal/type/converter.rb +292 -0
- data/lib/e_invoice_api/internal/type/enum.rb +148 -0
- data/lib/e_invoice_api/internal/type/file_input.rb +103 -0
- data/lib/e_invoice_api/internal/type/hash_of.rb +182 -0
- data/lib/e_invoice_api/internal/type/request_parameters.rb +42 -0
- data/lib/e_invoice_api/internal/type/union.rb +236 -0
- data/lib/e_invoice_api/internal/type/unknown.rb +75 -0
- data/lib/e_invoice_api/internal/util.rb +914 -0
- data/lib/e_invoice_api/internal.rb +20 -0
- data/lib/e_invoice_api/models/certificate.rb +34 -0
- data/lib/e_invoice_api/models/currency_code.rb +28 -0
- data/lib/e_invoice_api/models/document_attachment_create.rb +33 -0
- data/lib/e_invoice_api/models/document_create.rb +521 -0
- data/lib/e_invoice_api/models/document_create_params.rb +14 -0
- data/lib/e_invoice_api/models/document_delete_params.rb +14 -0
- data/lib/e_invoice_api/models/document_delete_response.rb +16 -0
- data/lib/e_invoice_api/models/document_direction.rb +15 -0
- data/lib/e_invoice_api/models/document_response.rb +418 -0
- data/lib/e_invoice_api/models/document_retrieve_params.rb +14 -0
- data/lib/e_invoice_api/models/document_send_params.rb +44 -0
- data/lib/e_invoice_api/models/document_state.rb +18 -0
- data/lib/e_invoice_api/models/document_type.rb +15 -0
- data/lib/e_invoice_api/models/documents/attachment_add_params.rb +22 -0
- data/lib/e_invoice_api/models/documents/attachment_delete_params.rb +22 -0
- data/lib/e_invoice_api/models/documents/attachment_delete_response.rb +18 -0
- data/lib/e_invoice_api/models/documents/attachment_list_params.rb +16 -0
- data/lib/e_invoice_api/models/documents/attachment_list_response.rb +11 -0
- data/lib/e_invoice_api/models/documents/attachment_retrieve_params.rb +22 -0
- data/lib/e_invoice_api/models/documents/document_attachment.rb +44 -0
- data/lib/e_invoice_api/models/documents/ubl_get_params.rb +16 -0
- data/lib/e_invoice_api/models/documents/ubl_get_response.rb +72 -0
- data/lib/e_invoice_api/models/inbox_list_credit_notes_params.rb +30 -0
- data/lib/e_invoice_api/models/inbox_list_invoices_params.rb +30 -0
- data/lib/e_invoice_api/models/inbox_list_params.rb +78 -0
- data/lib/e_invoice_api/models/lookup_retrieve_params.rb +26 -0
- data/lib/e_invoice_api/models/lookup_retrieve_response.rb +491 -0
- data/lib/e_invoice_api/models/outbox_list_draft_documents_params.rb +30 -0
- data/lib/e_invoice_api/models/outbox_list_received_documents_params.rb +78 -0
- data/lib/e_invoice_api/models/paginated_document_response.rb +39 -0
- data/lib/e_invoice_api/models/payment_detail_create.rb +33 -0
- data/lib/e_invoice_api/models/ubl_document_validation.rb +97 -0
- data/lib/e_invoice_api/models/unit_of_measure_code.rb +104 -0
- data/lib/e_invoice_api/models/validate_validate_json_params.rb +14 -0
- data/lib/e_invoice_api/models/validate_validate_peppol_id_params.rb +26 -0
- data/lib/e_invoice_api/models/validate_validate_peppol_id_response.rb +80 -0
- data/lib/e_invoice_api/models/validate_validate_ubl_params.rb +20 -0
- data/lib/e_invoice_api/models/webhook_create_params.rb +32 -0
- data/lib/e_invoice_api/models/webhook_delete_params.rb +14 -0
- data/lib/e_invoice_api/models/webhook_delete_response.rb +18 -0
- data/lib/e_invoice_api/models/webhook_list_params.rb +14 -0
- data/lib/e_invoice_api/models/webhook_list_response.rb +8 -0
- data/lib/e_invoice_api/models/webhook_response.rb +42 -0
- data/lib/e_invoice_api/models/webhook_retrieve_params.rb +14 -0
- data/lib/e_invoice_api/models/webhook_update_params.rb +32 -0
- data/lib/e_invoice_api/models.rb +105 -0
- data/lib/e_invoice_api/request_options.rb +77 -0
- data/lib/e_invoice_api/resources/documents/attachments.rb +109 -0
- data/lib/e_invoice_api/resources/documents/ubl.rb +35 -0
- data/lib/e_invoice_api/resources/documents.rb +188 -0
- data/lib/e_invoice_api/resources/inbox.rb +101 -0
- data/lib/e_invoice_api/resources/lookup.rb +43 -0
- data/lib/e_invoice_api/resources/outbox.rb +76 -0
- data/lib/e_invoice_api/resources/validate.rb +168 -0
- data/lib/e_invoice_api/resources/webhooks.rb +117 -0
- data/lib/e_invoice_api/version.rb +5 -0
- data/lib/e_invoice_api.rb +107 -0
- data/manifest.yaml +15 -0
- data/rbi/e_invoice_api/client.rbi +64 -0
- data/rbi/e_invoice_api/errors.rbi +162 -0
- data/rbi/e_invoice_api/file_part.rbi +37 -0
- data/rbi/e_invoice_api/internal/documents_number_page.rbi +28 -0
- data/rbi/e_invoice_api/internal/transport/base_client.rbi +298 -0
- data/rbi/e_invoice_api/internal/transport/pooled_net_requester.rbi +80 -0
- data/rbi/e_invoice_api/internal/type/array_of.rbi +104 -0
- data/rbi/e_invoice_api/internal/type/base_model.rbi +304 -0
- data/rbi/e_invoice_api/internal/type/base_page.rbi +43 -0
- data/rbi/e_invoice_api/internal/type/boolean.rbi +56 -0
- data/rbi/e_invoice_api/internal/type/converter.rbi +162 -0
- data/rbi/e_invoice_api/internal/type/enum.rbi +82 -0
- data/rbi/e_invoice_api/internal/type/file_input.rbi +59 -0
- data/rbi/e_invoice_api/internal/type/hash_of.rbi +104 -0
- data/rbi/e_invoice_api/internal/type/request_parameters.rbi +31 -0
- data/rbi/e_invoice_api/internal/type/union.rbi +116 -0
- data/rbi/e_invoice_api/internal/type/unknown.rbi +56 -0
- data/rbi/e_invoice_api/internal/util.rbi +487 -0
- data/rbi/e_invoice_api/internal.rbi +18 -0
- data/rbi/e_invoice_api/models/certificate.rbi +54 -0
- data/rbi/e_invoice_api/models/currency_code.rbi +34 -0
- data/rbi/e_invoice_api/models/document_attachment_create.rbi +57 -0
- data/rbi/e_invoice_api/models/document_create.rbi +638 -0
- data/rbi/e_invoice_api/models/document_create_params.rbi +30 -0
- data/rbi/e_invoice_api/models/document_delete_params.rbi +30 -0
- data/rbi/e_invoice_api/models/document_delete_response.rbi +26 -0
- data/rbi/e_invoice_api/models/document_direction.rbi +22 -0
- data/rbi/e_invoice_api/models/document_response.rbi +504 -0
- data/rbi/e_invoice_api/models/document_retrieve_params.rbi +30 -0
- data/rbi/e_invoice_api/models/document_send_params.rbi +65 -0
- data/rbi/e_invoice_api/models/document_state.rbi +24 -0
- data/rbi/e_invoice_api/models/document_type.rbi +21 -0
- data/rbi/e_invoice_api/models/documents/attachment_add_params.rbi +43 -0
- data/rbi/e_invoice_api/models/documents/attachment_delete_params.rbi +43 -0
- data/rbi/e_invoice_api/models/documents/attachment_delete_response.rbi +28 -0
- data/rbi/e_invoice_api/models/documents/attachment_list_params.rbi +34 -0
- data/rbi/e_invoice_api/models/documents/attachment_list_response.rbi +15 -0
- data/rbi/e_invoice_api/models/documents/attachment_retrieve_params.rbi +43 -0
- data/rbi/e_invoice_api/models/documents/document_attachment.rbi +72 -0
- data/rbi/e_invoice_api/models/documents/ubl_get_params.rbi +34 -0
- data/rbi/e_invoice_api/models/documents/ubl_get_response.rbi +97 -0
- data/rbi/e_invoice_api/models/inbox_list_credit_notes_params.rbi +60 -0
- data/rbi/e_invoice_api/models/inbox_list_invoices_params.rbi +60 -0
- data/rbi/e_invoice_api/models/inbox_list_params.rbi +105 -0
- data/rbi/e_invoice_api/models/lookup_retrieve_params.rbi +45 -0
- data/rbi/e_invoice_api/models/lookup_retrieve_response.rbi +852 -0
- data/rbi/e_invoice_api/models/outbox_list_draft_documents_params.rbi +60 -0
- data/rbi/e_invoice_api/models/outbox_list_received_documents_params.rbi +108 -0
- data/rbi/e_invoice_api/models/paginated_document_response.rbi +56 -0
- data/rbi/e_invoice_api/models/payment_detail_create.rbi +56 -0
- data/rbi/e_invoice_api/models/ubl_document_validation.rbi +159 -0
- data/rbi/e_invoice_api/models/unit_of_measure_code.rbi +149 -0
- data/rbi/e_invoice_api/models/validate_validate_json_params.rbi +30 -0
- data/rbi/e_invoice_api/models/validate_validate_peppol_id_params.rbi +45 -0
- data/rbi/e_invoice_api/models/validate_validate_peppol_id_response.rbi +141 -0
- data/rbi/e_invoice_api/models/validate_validate_ubl_params.rbi +41 -0
- data/rbi/e_invoice_api/models/webhook_create_params.rbi +54 -0
- data/rbi/e_invoice_api/models/webhook_delete_params.rbi +30 -0
- data/rbi/e_invoice_api/models/webhook_delete_response.rbi +27 -0
- data/rbi/e_invoice_api/models/webhook_list_params.rbi +27 -0
- data/rbi/e_invoice_api/models/webhook_list_response.rbi +11 -0
- data/rbi/e_invoice_api/models/webhook_response.rbi +57 -0
- data/rbi/e_invoice_api/models/webhook_retrieve_params.rbi +30 -0
- data/rbi/e_invoice_api/models/webhook_update_params.rbi +51 -0
- data/rbi/e_invoice_api/models.rbi +70 -0
- data/rbi/e_invoice_api/request_options.rbi +59 -0
- data/rbi/e_invoice_api/resources/documents/attachments.rbi +58 -0
- data/rbi/e_invoice_api/resources/documents/ubl.rbi +24 -0
- data/rbi/e_invoice_api/resources/documents.rbi +164 -0
- data/rbi/e_invoice_api/resources/inbox.rbi +93 -0
- data/rbi/e_invoice_api/resources/lookup.rbi +31 -0
- data/rbi/e_invoice_api/resources/outbox.rbi +72 -0
- data/rbi/e_invoice_api/resources/validate.rbi +145 -0
- data/rbi/e_invoice_api/resources/webhooks.rbi +72 -0
- data/rbi/e_invoice_api/version.rbi +5 -0
- data/sig/e_invoice_api/client.rbs +36 -0
- data/sig/e_invoice_api/errors.rbs +101 -0
- data/sig/e_invoice_api/file_part.rbs +21 -0
- data/sig/e_invoice_api/internal/documents_number_page.rbs +17 -0
- data/sig/e_invoice_api/internal/transport/base_client.rbs +131 -0
- data/sig/e_invoice_api/internal/transport/pooled_net_requester.rbs +45 -0
- data/sig/e_invoice_api/internal/type/array_of.rbs +48 -0
- data/sig/e_invoice_api/internal/type/base_model.rbs +102 -0
- data/sig/e_invoice_api/internal/type/base_page.rbs +24 -0
- data/sig/e_invoice_api/internal/type/boolean.rbs +26 -0
- data/sig/e_invoice_api/internal/type/converter.rbs +56 -0
- data/sig/e_invoice_api/internal/type/enum.rbs +32 -0
- data/sig/e_invoice_api/internal/type/file_input.rbs +25 -0
- data/sig/e_invoice_api/internal/type/hash_of.rbs +48 -0
- data/sig/e_invoice_api/internal/type/request_parameters.rbs +19 -0
- data/sig/e_invoice_api/internal/type/union.rbs +52 -0
- data/sig/e_invoice_api/internal/type/unknown.rbs +26 -0
- data/sig/e_invoice_api/internal/util.rbs +185 -0
- data/sig/e_invoice_api/internal.rbs +9 -0
- data/sig/e_invoice_api/models/certificate.rbs +26 -0
- data/sig/e_invoice_api/models/currency_code.rbs +42 -0
- data/sig/e_invoice_api/models/document_attachment_create.rbs +39 -0
- data/sig/e_invoice_api/models/document_create.rbs +403 -0
- data/sig/e_invoice_api/models/document_create_params.rbs +15 -0
- data/sig/e_invoice_api/models/document_delete_params.rbs +15 -0
- data/sig/e_invoice_api/models/document_delete_response.rbs +13 -0
- data/sig/e_invoice_api/models/document_direction.rbs +14 -0
- data/sig/e_invoice_api/models/document_response.rbs +358 -0
- data/sig/e_invoice_api/models/document_retrieve_params.rbs +15 -0
- data/sig/e_invoice_api/models/document_send_params.rbs +46 -0
- data/sig/e_invoice_api/models/document_state.rbs +17 -0
- data/sig/e_invoice_api/models/document_type.rbs +14 -0
- data/sig/e_invoice_api/models/documents/attachment_add_params.rbs +26 -0
- data/sig/e_invoice_api/models/documents/attachment_delete_params.rbs +26 -0
- data/sig/e_invoice_api/models/documents/attachment_delete_response.rbs +15 -0
- data/sig/e_invoice_api/models/documents/attachment_list_params.rbs +17 -0
- data/sig/e_invoice_api/models/documents/attachment_list_response.rbs +10 -0
- data/sig/e_invoice_api/models/documents/attachment_retrieve_params.rbs +26 -0
- data/sig/e_invoice_api/models/documents/document_attachment.rbs +48 -0
- data/sig/e_invoice_api/models/documents/ubl_get_params.rbs +17 -0
- data/sig/e_invoice_api/models/documents/ubl_get_response.rbs +69 -0
- data/sig/e_invoice_api/models/inbox_list_credit_notes_params.rbs +32 -0
- data/sig/e_invoice_api/models/inbox_list_invoices_params.rbs +32 -0
- data/sig/e_invoice_api/models/inbox_list_params.rbs +65 -0
- data/sig/e_invoice_api/models/lookup_retrieve_params.rbs +23 -0
- data/sig/e_invoice_api/models/lookup_retrieve_response.rbs +365 -0
- data/sig/e_invoice_api/models/outbox_list_draft_documents_params.rbs +32 -0
- data/sig/e_invoice_api/models/outbox_list_received_documents_params.rbs +65 -0
- data/sig/e_invoice_api/models/paginated_document_response.rbs +40 -0
- data/sig/e_invoice_api/models/payment_detail_create.rbs +35 -0
- data/sig/e_invoice_api/models/ubl_document_validation.rbs +98 -0
- data/sig/e_invoice_api/models/unit_of_measure_code.rbs +192 -0
- data/sig/e_invoice_api/models/validate_validate_json_params.rbs +15 -0
- data/sig/e_invoice_api/models/validate_validate_peppol_id_params.rbs +23 -0
- data/sig/e_invoice_api/models/validate_validate_peppol_id_response.rbs +65 -0
- data/sig/e_invoice_api/models/validate_validate_ubl_params.rbs +24 -0
- data/sig/e_invoice_api/models/webhook_create_params.rbs +34 -0
- data/sig/e_invoice_api/models/webhook_delete_params.rbs +15 -0
- data/sig/e_invoice_api/models/webhook_delete_response.rbs +13 -0
- data/sig/e_invoice_api/models/webhook_list_params.rbs +15 -0
- data/sig/e_invoice_api/models/webhook_list_response.rbs +7 -0
- data/sig/e_invoice_api/models/webhook_response.rbs +42 -0
- data/sig/e_invoice_api/models/webhook_retrieve_params.rbs +15 -0
- data/sig/e_invoice_api/models/webhook_update_params.rbs +32 -0
- data/sig/e_invoice_api/models.rbs +65 -0
- data/sig/e_invoice_api/request_options.rbs +36 -0
- data/sig/e_invoice_api/resources/documents/attachments.rbs +32 -0
- data/sig/e_invoice_api/resources/documents/ubl.rbs +14 -0
- data/sig/e_invoice_api/resources/documents.rbs +76 -0
- data/sig/e_invoice_api/resources/inbox.rbs +31 -0
- data/sig/e_invoice_api/resources/lookup.rbs +12 -0
- data/sig/e_invoice_api/resources/outbox.rbs +25 -0
- data/sig/e_invoice_api/resources/validate.rbs +62 -0
- data/sig/e_invoice_api/resources/webhooks.rbs +36 -0
- data/sig/e_invoice_api/version.rbs +3 -0
- metadata +290 -0
@@ -0,0 +1,164 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module EInvoiceAPI
|
4
|
+
module Resources
|
5
|
+
class Documents
|
6
|
+
sig { returns(EInvoiceAPI::Resources::Documents::Attachments) }
|
7
|
+
attr_reader :attachments
|
8
|
+
|
9
|
+
sig { returns(EInvoiceAPI::Resources::Documents::Ubl) }
|
10
|
+
attr_reader :ubl
|
11
|
+
|
12
|
+
# Create a new invoice or credit note
|
13
|
+
sig do
|
14
|
+
params(
|
15
|
+
amount_due:
|
16
|
+
T.nilable(EInvoiceAPI::DocumentCreate::AmountDue::Variants),
|
17
|
+
attachments:
|
18
|
+
T.nilable(T::Array[EInvoiceAPI::DocumentAttachmentCreate::OrHash]),
|
19
|
+
billing_address: T.nilable(String),
|
20
|
+
billing_address_recipient: T.nilable(String),
|
21
|
+
currency: EInvoiceAPI::CurrencyCode::OrSymbol,
|
22
|
+
customer_address: T.nilable(String),
|
23
|
+
customer_address_recipient: T.nilable(String),
|
24
|
+
customer_email: T.nilable(String),
|
25
|
+
customer_id: T.nilable(String),
|
26
|
+
customer_name: T.nilable(String),
|
27
|
+
customer_tax_id: T.nilable(String),
|
28
|
+
direction: EInvoiceAPI::DocumentDirection::OrSymbol,
|
29
|
+
document_type: EInvoiceAPI::DocumentType::OrSymbol,
|
30
|
+
due_date: T.nilable(Date),
|
31
|
+
invoice_date: T.nilable(Date),
|
32
|
+
invoice_id: T.nilable(String),
|
33
|
+
invoice_total:
|
34
|
+
T.nilable(EInvoiceAPI::DocumentCreate::InvoiceTotal::Variants),
|
35
|
+
items: T.nilable(T::Array[EInvoiceAPI::DocumentCreate::Item::OrHash]),
|
36
|
+
note: T.nilable(String),
|
37
|
+
payment_details:
|
38
|
+
T.nilable(T::Array[EInvoiceAPI::PaymentDetailCreate::OrHash]),
|
39
|
+
payment_term: T.nilable(String),
|
40
|
+
previous_unpaid_balance:
|
41
|
+
T.nilable(
|
42
|
+
EInvoiceAPI::DocumentCreate::PreviousUnpaidBalance::Variants
|
43
|
+
),
|
44
|
+
purchase_order: T.nilable(String),
|
45
|
+
remittance_address: T.nilable(String),
|
46
|
+
remittance_address_recipient: T.nilable(String),
|
47
|
+
service_address: T.nilable(String),
|
48
|
+
service_address_recipient: T.nilable(String),
|
49
|
+
service_end_date: T.nilable(Date),
|
50
|
+
service_start_date: T.nilable(Date),
|
51
|
+
shipping_address: T.nilable(String),
|
52
|
+
shipping_address_recipient: T.nilable(String),
|
53
|
+
state: EInvoiceAPI::DocumentState::OrSymbol,
|
54
|
+
subtotal: T.nilable(EInvoiceAPI::DocumentCreate::Subtotal::Variants),
|
55
|
+
tax_details:
|
56
|
+
T.nilable(T::Array[EInvoiceAPI::DocumentCreate::TaxDetail::OrHash]),
|
57
|
+
total_discount:
|
58
|
+
T.nilable(EInvoiceAPI::DocumentCreate::TotalDiscount::Variants),
|
59
|
+
total_tax: T.nilable(EInvoiceAPI::DocumentCreate::TotalTax::Variants),
|
60
|
+
vendor_address: T.nilable(String),
|
61
|
+
vendor_address_recipient: T.nilable(String),
|
62
|
+
vendor_email: T.nilable(String),
|
63
|
+
vendor_name: T.nilable(String),
|
64
|
+
vendor_tax_id: T.nilable(String),
|
65
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
66
|
+
).returns(EInvoiceAPI::DocumentResponse)
|
67
|
+
end
|
68
|
+
def create(
|
69
|
+
amount_due: nil,
|
70
|
+
attachments: nil,
|
71
|
+
billing_address: nil,
|
72
|
+
billing_address_recipient: nil,
|
73
|
+
# Currency of the invoice
|
74
|
+
currency: nil,
|
75
|
+
customer_address: nil,
|
76
|
+
customer_address_recipient: nil,
|
77
|
+
customer_email: nil,
|
78
|
+
customer_id: nil,
|
79
|
+
customer_name: nil,
|
80
|
+
customer_tax_id: nil,
|
81
|
+
direction: nil,
|
82
|
+
document_type: nil,
|
83
|
+
due_date: nil,
|
84
|
+
invoice_date: nil,
|
85
|
+
invoice_id: nil,
|
86
|
+
invoice_total: nil,
|
87
|
+
items: nil,
|
88
|
+
note: nil,
|
89
|
+
payment_details: nil,
|
90
|
+
payment_term: nil,
|
91
|
+
previous_unpaid_balance: nil,
|
92
|
+
purchase_order: nil,
|
93
|
+
remittance_address: nil,
|
94
|
+
remittance_address_recipient: nil,
|
95
|
+
service_address: nil,
|
96
|
+
service_address_recipient: nil,
|
97
|
+
service_end_date: nil,
|
98
|
+
service_start_date: nil,
|
99
|
+
shipping_address: nil,
|
100
|
+
shipping_address_recipient: nil,
|
101
|
+
state: nil,
|
102
|
+
subtotal: nil,
|
103
|
+
tax_details: nil,
|
104
|
+
total_discount: nil,
|
105
|
+
total_tax: nil,
|
106
|
+
vendor_address: nil,
|
107
|
+
vendor_address_recipient: nil,
|
108
|
+
vendor_email: nil,
|
109
|
+
vendor_name: nil,
|
110
|
+
vendor_tax_id: nil,
|
111
|
+
request_options: {}
|
112
|
+
)
|
113
|
+
end
|
114
|
+
|
115
|
+
# Get an invoice or credit note by ID
|
116
|
+
sig do
|
117
|
+
params(
|
118
|
+
document_id: String,
|
119
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
120
|
+
).returns(EInvoiceAPI::DocumentResponse)
|
121
|
+
end
|
122
|
+
def retrieve(document_id, request_options: {})
|
123
|
+
end
|
124
|
+
|
125
|
+
# Delete an invoice or credit note
|
126
|
+
sig do
|
127
|
+
params(
|
128
|
+
document_id: String,
|
129
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
130
|
+
).returns(EInvoiceAPI::Models::DocumentDeleteResponse)
|
131
|
+
end
|
132
|
+
def delete(document_id, request_options: {})
|
133
|
+
end
|
134
|
+
|
135
|
+
# Send an invoice or credit note via Peppol
|
136
|
+
sig do
|
137
|
+
params(
|
138
|
+
document_id: String,
|
139
|
+
email: T.nilable(String),
|
140
|
+
receiver_peppol_id: T.nilable(String),
|
141
|
+
receiver_peppol_scheme: T.nilable(String),
|
142
|
+
sender_peppol_id: T.nilable(String),
|
143
|
+
sender_peppol_scheme: T.nilable(String),
|
144
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
145
|
+
).returns(EInvoiceAPI::DocumentResponse)
|
146
|
+
end
|
147
|
+
def send_(
|
148
|
+
document_id,
|
149
|
+
email: nil,
|
150
|
+
receiver_peppol_id: nil,
|
151
|
+
receiver_peppol_scheme: nil,
|
152
|
+
sender_peppol_id: nil,
|
153
|
+
sender_peppol_scheme: nil,
|
154
|
+
request_options: {}
|
155
|
+
)
|
156
|
+
end
|
157
|
+
|
158
|
+
# @api private
|
159
|
+
sig { params(client: EInvoiceAPI::Client).returns(T.attached_class) }
|
160
|
+
def self.new(client:)
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
@@ -0,0 +1,93 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module EInvoiceAPI
|
4
|
+
module Resources
|
5
|
+
class Inbox
|
6
|
+
# Retrieve a paginated list of received documents with filtering options.
|
7
|
+
sig do
|
8
|
+
params(
|
9
|
+
date_from: T.nilable(Time),
|
10
|
+
date_to: T.nilable(Time),
|
11
|
+
page: Integer,
|
12
|
+
page_size: Integer,
|
13
|
+
search: T.nilable(String),
|
14
|
+
sender: T.nilable(String),
|
15
|
+
state: T.nilable(EInvoiceAPI::DocumentState::OrSymbol),
|
16
|
+
type: T.nilable(EInvoiceAPI::DocumentType::OrSymbol),
|
17
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
18
|
+
).returns(
|
19
|
+
EInvoiceAPI::Internal::DocumentsNumberPage[
|
20
|
+
EInvoiceAPI::DocumentResponse
|
21
|
+
]
|
22
|
+
)
|
23
|
+
end
|
24
|
+
def list(
|
25
|
+
# Filter by issue date (from)
|
26
|
+
date_from: nil,
|
27
|
+
# Filter by issue date (to)
|
28
|
+
date_to: nil,
|
29
|
+
# Page number
|
30
|
+
page: nil,
|
31
|
+
# Number of items per page
|
32
|
+
page_size: nil,
|
33
|
+
# Search in invoice number, seller/buyer names
|
34
|
+
search: nil,
|
35
|
+
# Filter by sender ID
|
36
|
+
sender: nil,
|
37
|
+
# Filter by document state
|
38
|
+
state: nil,
|
39
|
+
# Filter by document type
|
40
|
+
type: nil,
|
41
|
+
request_options: {}
|
42
|
+
)
|
43
|
+
end
|
44
|
+
|
45
|
+
# Retrieve a paginated list of received credit notes with filtering options.
|
46
|
+
sig do
|
47
|
+
params(
|
48
|
+
page: Integer,
|
49
|
+
page_size: Integer,
|
50
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
51
|
+
).returns(
|
52
|
+
EInvoiceAPI::Internal::DocumentsNumberPage[
|
53
|
+
EInvoiceAPI::DocumentResponse
|
54
|
+
]
|
55
|
+
)
|
56
|
+
end
|
57
|
+
def list_credit_notes(
|
58
|
+
# Page number
|
59
|
+
page: nil,
|
60
|
+
# Number of items per page
|
61
|
+
page_size: nil,
|
62
|
+
request_options: {}
|
63
|
+
)
|
64
|
+
end
|
65
|
+
|
66
|
+
# Retrieve a paginated list of received invoices with filtering options.
|
67
|
+
sig do
|
68
|
+
params(
|
69
|
+
page: Integer,
|
70
|
+
page_size: Integer,
|
71
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
72
|
+
).returns(
|
73
|
+
EInvoiceAPI::Internal::DocumentsNumberPage[
|
74
|
+
EInvoiceAPI::DocumentResponse
|
75
|
+
]
|
76
|
+
)
|
77
|
+
end
|
78
|
+
def list_invoices(
|
79
|
+
# Page number
|
80
|
+
page: nil,
|
81
|
+
# Number of items per page
|
82
|
+
page_size: nil,
|
83
|
+
request_options: {}
|
84
|
+
)
|
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
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module EInvoiceAPI
|
4
|
+
module Resources
|
5
|
+
class Lookup
|
6
|
+
# Lookup Peppol ID. The peppol_id must be in the form of `<scheme>:<id>`. The
|
7
|
+
# scheme is a 4-digit code representing the identifier scheme, and the id is the
|
8
|
+
# actual identifier value. For example, for a Belgian company it is
|
9
|
+
# `0208:0123456789` (where 0208 is the scheme for Belgian enterprises, followed by
|
10
|
+
# the 10 digits of the official BTW / KBO number).
|
11
|
+
sig do
|
12
|
+
params(
|
13
|
+
peppol_id: String,
|
14
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
15
|
+
).returns(EInvoiceAPI::Models::LookupRetrieveResponse)
|
16
|
+
end
|
17
|
+
def retrieve(
|
18
|
+
# Peppol ID in the format `<scheme>:<id>`. Example: `0208:1018265814` for a
|
19
|
+
# Belgian company.
|
20
|
+
peppol_id:,
|
21
|
+
request_options: {}
|
22
|
+
)
|
23
|
+
end
|
24
|
+
|
25
|
+
# @api private
|
26
|
+
sig { params(client: EInvoiceAPI::Client).returns(T.attached_class) }
|
27
|
+
def self.new(client:)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module EInvoiceAPI
|
4
|
+
module Resources
|
5
|
+
class Outbox
|
6
|
+
# Retrieve a paginated list of draft documents with filtering options.
|
7
|
+
sig do
|
8
|
+
params(
|
9
|
+
page: Integer,
|
10
|
+
page_size: Integer,
|
11
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
12
|
+
).returns(
|
13
|
+
EInvoiceAPI::Internal::DocumentsNumberPage[
|
14
|
+
EInvoiceAPI::DocumentResponse
|
15
|
+
]
|
16
|
+
)
|
17
|
+
end
|
18
|
+
def list_draft_documents(
|
19
|
+
# Page number
|
20
|
+
page: nil,
|
21
|
+
# Number of items per page
|
22
|
+
page_size: nil,
|
23
|
+
request_options: {}
|
24
|
+
)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Retrieve a paginated list of received documents with filtering options.
|
28
|
+
sig do
|
29
|
+
params(
|
30
|
+
date_from: T.nilable(Time),
|
31
|
+
date_to: T.nilable(Time),
|
32
|
+
page: Integer,
|
33
|
+
page_size: Integer,
|
34
|
+
search: T.nilable(String),
|
35
|
+
sender: T.nilable(String),
|
36
|
+
state: T.nilable(EInvoiceAPI::DocumentState::OrSymbol),
|
37
|
+
type: T.nilable(EInvoiceAPI::DocumentType::OrSymbol),
|
38
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
39
|
+
).returns(
|
40
|
+
EInvoiceAPI::Internal::DocumentsNumberPage[
|
41
|
+
EInvoiceAPI::DocumentResponse
|
42
|
+
]
|
43
|
+
)
|
44
|
+
end
|
45
|
+
def list_received_documents(
|
46
|
+
# Filter by issue date (from)
|
47
|
+
date_from: nil,
|
48
|
+
# Filter by issue date (to)
|
49
|
+
date_to: nil,
|
50
|
+
# Page number
|
51
|
+
page: nil,
|
52
|
+
# Number of items per page
|
53
|
+
page_size: nil,
|
54
|
+
# Search in invoice number, seller/buyer names
|
55
|
+
search: nil,
|
56
|
+
# Filter by sender ID
|
57
|
+
sender: nil,
|
58
|
+
# Filter by document state
|
59
|
+
state: nil,
|
60
|
+
# Filter by document type
|
61
|
+
type: nil,
|
62
|
+
request_options: {}
|
63
|
+
)
|
64
|
+
end
|
65
|
+
|
66
|
+
# @api private
|
67
|
+
sig { params(client: EInvoiceAPI::Client).returns(T.attached_class) }
|
68
|
+
def self.new(client:)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,145 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module EInvoiceAPI
|
4
|
+
module Resources
|
5
|
+
class Validate
|
6
|
+
# Validate if the JSON document can be converted to a valid UBL document
|
7
|
+
sig do
|
8
|
+
params(
|
9
|
+
amount_due:
|
10
|
+
T.nilable(EInvoiceAPI::DocumentCreate::AmountDue::Variants),
|
11
|
+
attachments:
|
12
|
+
T.nilable(T::Array[EInvoiceAPI::DocumentAttachmentCreate::OrHash]),
|
13
|
+
billing_address: T.nilable(String),
|
14
|
+
billing_address_recipient: T.nilable(String),
|
15
|
+
currency: EInvoiceAPI::CurrencyCode::OrSymbol,
|
16
|
+
customer_address: T.nilable(String),
|
17
|
+
customer_address_recipient: T.nilable(String),
|
18
|
+
customer_email: T.nilable(String),
|
19
|
+
customer_id: T.nilable(String),
|
20
|
+
customer_name: T.nilable(String),
|
21
|
+
customer_tax_id: T.nilable(String),
|
22
|
+
direction: EInvoiceAPI::DocumentDirection::OrSymbol,
|
23
|
+
document_type: EInvoiceAPI::DocumentType::OrSymbol,
|
24
|
+
due_date: T.nilable(Date),
|
25
|
+
invoice_date: T.nilable(Date),
|
26
|
+
invoice_id: T.nilable(String),
|
27
|
+
invoice_total:
|
28
|
+
T.nilable(EInvoiceAPI::DocumentCreate::InvoiceTotal::Variants),
|
29
|
+
items: T.nilable(T::Array[EInvoiceAPI::DocumentCreate::Item::OrHash]),
|
30
|
+
note: T.nilable(String),
|
31
|
+
payment_details:
|
32
|
+
T.nilable(T::Array[EInvoiceAPI::PaymentDetailCreate::OrHash]),
|
33
|
+
payment_term: T.nilable(String),
|
34
|
+
previous_unpaid_balance:
|
35
|
+
T.nilable(
|
36
|
+
EInvoiceAPI::DocumentCreate::PreviousUnpaidBalance::Variants
|
37
|
+
),
|
38
|
+
purchase_order: T.nilable(String),
|
39
|
+
remittance_address: T.nilable(String),
|
40
|
+
remittance_address_recipient: T.nilable(String),
|
41
|
+
service_address: T.nilable(String),
|
42
|
+
service_address_recipient: T.nilable(String),
|
43
|
+
service_end_date: T.nilable(Date),
|
44
|
+
service_start_date: T.nilable(Date),
|
45
|
+
shipping_address: T.nilable(String),
|
46
|
+
shipping_address_recipient: T.nilable(String),
|
47
|
+
state: EInvoiceAPI::DocumentState::OrSymbol,
|
48
|
+
subtotal: T.nilable(EInvoiceAPI::DocumentCreate::Subtotal::Variants),
|
49
|
+
tax_details:
|
50
|
+
T.nilable(T::Array[EInvoiceAPI::DocumentCreate::TaxDetail::OrHash]),
|
51
|
+
total_discount:
|
52
|
+
T.nilable(EInvoiceAPI::DocumentCreate::TotalDiscount::Variants),
|
53
|
+
total_tax: T.nilable(EInvoiceAPI::DocumentCreate::TotalTax::Variants),
|
54
|
+
vendor_address: T.nilable(String),
|
55
|
+
vendor_address_recipient: T.nilable(String),
|
56
|
+
vendor_email: T.nilable(String),
|
57
|
+
vendor_name: T.nilable(String),
|
58
|
+
vendor_tax_id: T.nilable(String),
|
59
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
60
|
+
).returns(EInvoiceAPI::UblDocumentValidation)
|
61
|
+
end
|
62
|
+
def validate_json(
|
63
|
+
amount_due: nil,
|
64
|
+
attachments: nil,
|
65
|
+
billing_address: nil,
|
66
|
+
billing_address_recipient: nil,
|
67
|
+
# Currency of the invoice
|
68
|
+
currency: nil,
|
69
|
+
customer_address: nil,
|
70
|
+
customer_address_recipient: nil,
|
71
|
+
customer_email: nil,
|
72
|
+
customer_id: nil,
|
73
|
+
customer_name: nil,
|
74
|
+
customer_tax_id: nil,
|
75
|
+
direction: nil,
|
76
|
+
document_type: nil,
|
77
|
+
due_date: nil,
|
78
|
+
invoice_date: nil,
|
79
|
+
invoice_id: nil,
|
80
|
+
invoice_total: nil,
|
81
|
+
items: nil,
|
82
|
+
note: nil,
|
83
|
+
payment_details: nil,
|
84
|
+
payment_term: nil,
|
85
|
+
previous_unpaid_balance: nil,
|
86
|
+
purchase_order: nil,
|
87
|
+
remittance_address: nil,
|
88
|
+
remittance_address_recipient: nil,
|
89
|
+
service_address: nil,
|
90
|
+
service_address_recipient: nil,
|
91
|
+
service_end_date: nil,
|
92
|
+
service_start_date: nil,
|
93
|
+
shipping_address: nil,
|
94
|
+
shipping_address_recipient: nil,
|
95
|
+
state: nil,
|
96
|
+
subtotal: nil,
|
97
|
+
tax_details: nil,
|
98
|
+
total_discount: nil,
|
99
|
+
total_tax: nil,
|
100
|
+
vendor_address: nil,
|
101
|
+
vendor_address_recipient: nil,
|
102
|
+
vendor_email: nil,
|
103
|
+
vendor_name: nil,
|
104
|
+
vendor_tax_id: nil,
|
105
|
+
request_options: {}
|
106
|
+
)
|
107
|
+
end
|
108
|
+
|
109
|
+
# Validate if a Peppol ID exists in the Peppol network and retrieve supported
|
110
|
+
# document types. The peppol_id must be in the form of `<scheme>:<id>`. The scheme
|
111
|
+
# is a 4-digit code representing the identifier scheme, and the id is the actual
|
112
|
+
# identifier value. For example, for a Belgian company it is `0208:0123456789`
|
113
|
+
# (where 0208 is the scheme for Belgian enterprises, followed by the 10 digits of
|
114
|
+
# the official BTW / KBO number).
|
115
|
+
sig do
|
116
|
+
params(
|
117
|
+
peppol_id: String,
|
118
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
119
|
+
).returns(EInvoiceAPI::Models::ValidateValidatePeppolIDResponse)
|
120
|
+
end
|
121
|
+
def validate_peppol_id(
|
122
|
+
# Peppol ID in the format `<scheme>:<id>`. Example: `0208:1018265814` for a
|
123
|
+
# Belgian company.
|
124
|
+
peppol_id:,
|
125
|
+
request_options: {}
|
126
|
+
)
|
127
|
+
end
|
128
|
+
|
129
|
+
# Validate the correctness of a UBL document
|
130
|
+
sig do
|
131
|
+
params(
|
132
|
+
file: EInvoiceAPI::Internal::FileInput,
|
133
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
134
|
+
).returns(EInvoiceAPI::UblDocumentValidation)
|
135
|
+
end
|
136
|
+
def validate_ubl(file:, request_options: {})
|
137
|
+
end
|
138
|
+
|
139
|
+
# @api private
|
140
|
+
sig { params(client: EInvoiceAPI::Client).returns(T.attached_class) }
|
141
|
+
def self.new(client:)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# typed: strong
|
2
|
+
|
3
|
+
module EInvoiceAPI
|
4
|
+
module Resources
|
5
|
+
class Webhooks
|
6
|
+
# Create a new webhook
|
7
|
+
sig do
|
8
|
+
params(
|
9
|
+
events: T::Array[String],
|
10
|
+
url: String,
|
11
|
+
enabled: T::Boolean,
|
12
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
13
|
+
).returns(EInvoiceAPI::WebhookResponse)
|
14
|
+
end
|
15
|
+
def create(events:, url:, enabled: nil, request_options: {})
|
16
|
+
end
|
17
|
+
|
18
|
+
# Get a webhook by ID
|
19
|
+
sig do
|
20
|
+
params(
|
21
|
+
webhook_id: String,
|
22
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
23
|
+
).returns(EInvoiceAPI::WebhookResponse)
|
24
|
+
end
|
25
|
+
def retrieve(webhook_id, request_options: {})
|
26
|
+
end
|
27
|
+
|
28
|
+
# Update a webhook by ID
|
29
|
+
sig do
|
30
|
+
params(
|
31
|
+
webhook_id: String,
|
32
|
+
enabled: T.nilable(T::Boolean),
|
33
|
+
events: T.nilable(T::Array[String]),
|
34
|
+
url: T.nilable(String),
|
35
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
36
|
+
).returns(EInvoiceAPI::WebhookResponse)
|
37
|
+
end
|
38
|
+
def update(
|
39
|
+
webhook_id,
|
40
|
+
enabled: nil,
|
41
|
+
events: nil,
|
42
|
+
url: nil,
|
43
|
+
request_options: {}
|
44
|
+
)
|
45
|
+
end
|
46
|
+
|
47
|
+
# Get all webhooks for the current tenant
|
48
|
+
sig do
|
49
|
+
params(request_options: EInvoiceAPI::RequestOptions::OrHash).returns(
|
50
|
+
T::Array[EInvoiceAPI::WebhookResponse]
|
51
|
+
)
|
52
|
+
end
|
53
|
+
def list(request_options: {})
|
54
|
+
end
|
55
|
+
|
56
|
+
# Delete a webhook
|
57
|
+
sig do
|
58
|
+
params(
|
59
|
+
webhook_id: String,
|
60
|
+
request_options: EInvoiceAPI::RequestOptions::OrHash
|
61
|
+
).returns(EInvoiceAPI::Models::WebhookDeleteResponse)
|
62
|
+
end
|
63
|
+
def delete(webhook_id, request_options: {})
|
64
|
+
end
|
65
|
+
|
66
|
+
# @api private
|
67
|
+
sig { params(client: EInvoiceAPI::Client).returns(T.attached_class) }
|
68
|
+
def self.new(client:)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module EInvoiceAPI
|
2
|
+
class Client < EInvoiceAPI::Internal::Transport::BaseClient
|
3
|
+
DEFAULT_MAX_RETRIES: 2
|
4
|
+
|
5
|
+
DEFAULT_TIMEOUT_IN_SECONDS: Float
|
6
|
+
|
7
|
+
DEFAULT_INITIAL_RETRY_DELAY: Float
|
8
|
+
|
9
|
+
DEFAULT_MAX_RETRY_DELAY: Float
|
10
|
+
|
11
|
+
attr_reader api_key: String
|
12
|
+
|
13
|
+
attr_reader documents: EInvoiceAPI::Resources::Documents
|
14
|
+
|
15
|
+
attr_reader inbox: EInvoiceAPI::Resources::Inbox
|
16
|
+
|
17
|
+
attr_reader outbox: EInvoiceAPI::Resources::Outbox
|
18
|
+
|
19
|
+
attr_reader validate: EInvoiceAPI::Resources::Validate
|
20
|
+
|
21
|
+
attr_reader lookup: EInvoiceAPI::Resources::Lookup
|
22
|
+
|
23
|
+
attr_reader webhooks: EInvoiceAPI::Resources::Webhooks
|
24
|
+
|
25
|
+
private def auth_headers: -> ::Hash[String, String]
|
26
|
+
|
27
|
+
def initialize: (
|
28
|
+
?api_key: String?,
|
29
|
+
?base_url: String?,
|
30
|
+
?max_retries: Integer,
|
31
|
+
?timeout: Float,
|
32
|
+
?initial_retry_delay: Float,
|
33
|
+
?max_retry_delay: Float
|
34
|
+
) -> void
|
35
|
+
end
|
36
|
+
end
|