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
|
@@ -14,109 +14,127 @@ module EInvoiceAPI
|
|
|
14
14
|
#
|
|
15
15
|
# Create a new invoice or credit note
|
|
16
16
|
#
|
|
17
|
-
# @overload create(construct_pdf: nil, allowances: nil, amount_due: nil, attachments: nil, billing_address: nil, billing_address_recipient: nil, charges: nil, currency: nil, customer_address: nil, customer_address_recipient: nil, customer_company_id: nil, customer_email: nil, customer_id: nil, customer_name: nil, customer_peppol_id: nil, customer_tax_id: nil, direction: nil, document_type: nil, due_date: nil, invoice_date: nil, invoice_id: nil, invoice_total: nil, items: nil, note: nil, payment_details: nil, payment_term: nil, previous_unpaid_balance: nil, purchase_order: nil, remittance_address: nil, remittance_address_recipient: nil, service_address: nil, service_address_recipient: nil, service_end_date: nil, service_start_date: nil, shipping_address: nil, shipping_address_recipient: nil, state: nil, subtotal: nil, tax_code: nil, tax_details: nil, total_discount: nil, total_tax: nil, vatex: nil, vatex_note: nil, vendor_address: nil, vendor_address_recipient: nil, vendor_company_id: nil, vendor_email: nil, vendor_name: nil, vendor_tax_id: nil, request_options: {})
|
|
17
|
+
# @overload create(construct_pdf: nil, allowances: nil, amount_due: nil, attachments: nil, billing_address: nil, billing_address_recipient: nil, buyer_reference: nil, charges: nil, currency: nil, customer_address: nil, customer_address_recipient: nil, customer_company_id: nil, customer_email: nil, customer_id: nil, customer_name: nil, customer_peppol_id: nil, customer_phone: nil, customer_tax_id: nil, direction: nil, document_type: nil, due_date: nil, invoice_date: nil, invoice_id: nil, invoice_total: nil, items: nil, note: nil, payment_details: nil, payment_term: nil, preceding_invoice_date: nil, preceding_invoice_id: nil, previous_unpaid_balance: nil, purchase_order: nil, remittance_address: nil, remittance_address_recipient: nil, rounding_amount: nil, sales_order: nil, service_address: nil, service_address_recipient: nil, service_end_date: nil, service_start_date: nil, shipping_address: nil, shipping_address_recipient: nil, state: nil, subtotal: nil, tax_code: nil, tax_currency: nil, tax_details: nil, total_discount: nil, total_tax: nil, total_tax_in_tax_currency: nil, vatex: nil, vatex_note: nil, vendor_address: nil, vendor_address_recipient: nil, vendor_company_id: nil, vendor_email: nil, vendor_name: nil, vendor_phone: nil, vendor_tax_id: nil, request_options: {})
|
|
18
18
|
#
|
|
19
|
-
#
|
|
19
|
+
# @param construct_pdf [Boolean] Query param: If true, generate a constructed PDF from the document and include i
|
|
20
20
|
#
|
|
21
|
-
#
|
|
21
|
+
# @param allowances [Array<EInvoiceAPI::Models::DocumentCreate::Allowance>, nil] Body param
|
|
22
22
|
#
|
|
23
|
-
#
|
|
23
|
+
# @param amount_due [Float, String, nil] Body param: The amount due for payment. Must be positive and rounded to maximum
|
|
24
24
|
#
|
|
25
|
-
#
|
|
25
|
+
# @param attachments [Array<EInvoiceAPI::Models::DocumentAttachmentCreate>, nil] Body param
|
|
26
26
|
#
|
|
27
|
-
#
|
|
27
|
+
# @param billing_address [String, nil] Body param: The billing address (if different from customer address)
|
|
28
28
|
#
|
|
29
|
-
#
|
|
29
|
+
# @param billing_address_recipient [String, nil] Body param: The recipient name at the billing address
|
|
30
30
|
#
|
|
31
|
-
#
|
|
31
|
+
# @param buyer_reference [String, nil] Body param: The buyer reference (BT-10), e.g. a cost centre or accounting refere
|
|
32
32
|
#
|
|
33
|
-
#
|
|
33
|
+
# @param charges [Array<EInvoiceAPI::Models::DocumentCreate::Charge>, nil] Body param
|
|
34
34
|
#
|
|
35
|
-
#
|
|
35
|
+
# @param currency [Symbol, EInvoiceAPI::Models::CurrencyCode] Body param: Currency of the invoice (ISO 4217 currency code)
|
|
36
36
|
#
|
|
37
|
-
#
|
|
37
|
+
# @param customer_address [String, nil] Body param: The address of the customer/buyer
|
|
38
38
|
#
|
|
39
|
-
#
|
|
39
|
+
# @param customer_address_recipient [String, nil] Body param: The recipient name at the customer address. Also the customer contac
|
|
40
40
|
#
|
|
41
|
-
#
|
|
41
|
+
# @param customer_company_id [String, nil] Body param: Customer company ID. For Belgium this is the CBE number or their EUI
|
|
42
42
|
#
|
|
43
|
-
#
|
|
43
|
+
# @param customer_email [String, nil] Body param: The email address of the customer
|
|
44
44
|
#
|
|
45
|
-
#
|
|
45
|
+
# @param customer_id [String, nil] Body param: The unique identifier for the customer in your system
|
|
46
46
|
#
|
|
47
|
-
#
|
|
47
|
+
# @param customer_name [String, nil] Body param: The company name of the customer/buyer
|
|
48
48
|
#
|
|
49
|
-
#
|
|
49
|
+
# @param customer_peppol_id [String, nil] Body param: Customer Peppol ID
|
|
50
50
|
#
|
|
51
|
-
#
|
|
51
|
+
# @param customer_phone [String, nil] Body param: The telephone number of the customer contact (BT-57)
|
|
52
52
|
#
|
|
53
|
-
#
|
|
53
|
+
# @param customer_tax_id [String, nil] Body param: Customer tax ID. For Belgium this is the VAT number. Must include th
|
|
54
54
|
#
|
|
55
|
-
#
|
|
55
|
+
# @param direction [Symbol, EInvoiceAPI::Models::DocumentDirection] Body param: The direction of the document: INBOUND (purchases) or OUTBOUND (sale
|
|
56
56
|
#
|
|
57
|
-
#
|
|
57
|
+
# @param document_type [Symbol, EInvoiceAPI::Models::DocumentType] Body param: The type of document: INVOICE, CREDIT_NOTE, or DEBIT_NOTE
|
|
58
58
|
#
|
|
59
|
-
#
|
|
59
|
+
# @param due_date [Date, nil] Body param: The date when payment is due
|
|
60
60
|
#
|
|
61
|
-
#
|
|
61
|
+
# @param invoice_date [Date, nil] Body param: The date when the invoice was issued
|
|
62
62
|
#
|
|
63
|
-
#
|
|
63
|
+
# @param invoice_id [String, nil] Body param: The unique invoice identifier/number
|
|
64
64
|
#
|
|
65
|
-
#
|
|
65
|
+
# @param invoice_total [Float, String, nil] Body param: The total amount of the invoice including tax (invoice_total = subto
|
|
66
66
|
#
|
|
67
|
-
#
|
|
67
|
+
# @param items [Array<EInvoiceAPI::Models::DocumentCreate::Item>] Body param: At least one line item is required
|
|
68
68
|
#
|
|
69
|
-
#
|
|
69
|
+
# @param note [String, nil] Body param: Additional notes or comments for the invoice
|
|
70
70
|
#
|
|
71
|
-
#
|
|
71
|
+
# @param payment_details [Array<EInvoiceAPI::Models::PaymentDetailCreate>, nil] Body param
|
|
72
72
|
#
|
|
73
|
-
#
|
|
73
|
+
# @param payment_term [String, nil] Body param: The payment terms (e.g., 'Net 30', 'Due on receipt', '2/10 Net 30')
|
|
74
74
|
#
|
|
75
|
-
#
|
|
75
|
+
# @param preceding_invoice_date [Date, nil] Body param: The preceding invoice issue date (BT-26)
|
|
76
76
|
#
|
|
77
|
-
#
|
|
77
|
+
# @param preceding_invoice_id [String, nil] Body param: The preceding invoice reference (BT-25): the number of the invoice t
|
|
78
78
|
#
|
|
79
|
-
#
|
|
79
|
+
# @param previous_unpaid_balance [Float, String, nil] Body param: The previous unpaid balance from prior invoices, if any. Must be pos
|
|
80
80
|
#
|
|
81
|
-
#
|
|
81
|
+
# @param purchase_order [String, nil] Body param: The purchase order reference number (BT-13)
|
|
82
82
|
#
|
|
83
|
-
#
|
|
83
|
+
# @param remittance_address [String, nil] Body param: The address where payment should be sent or remitted to
|
|
84
84
|
#
|
|
85
|
-
#
|
|
85
|
+
# @param remittance_address_recipient [String, nil] Body param: The recipient name at the remittance address
|
|
86
86
|
#
|
|
87
|
-
#
|
|
87
|
+
# @param rounding_amount [Float, String, nil] Body param: The amount added to the invoice total to round the amount for paymen
|
|
88
88
|
#
|
|
89
|
-
#
|
|
89
|
+
# @param sales_order [String, nil] Body param: The sales order reference (BT-14) assigned by the seller
|
|
90
90
|
#
|
|
91
|
-
#
|
|
91
|
+
# @param service_address [String, nil] Body param: The address where services were performed or goods were delivered
|
|
92
92
|
#
|
|
93
|
-
#
|
|
93
|
+
# @param service_address_recipient [String, nil] Body param: The recipient name at the service address
|
|
94
94
|
#
|
|
95
|
-
#
|
|
95
|
+
# @param service_end_date [Date, nil] Body param: The end date of the service period or delivery period
|
|
96
96
|
#
|
|
97
|
-
#
|
|
97
|
+
# @param service_start_date [Date, nil] Body param: The start date of the service period or delivery period
|
|
98
98
|
#
|
|
99
|
-
#
|
|
99
|
+
# @param shipping_address [String, nil] Body param: The shipping/delivery address
|
|
100
100
|
#
|
|
101
|
-
#
|
|
101
|
+
# @param shipping_address_recipient [String, nil] Body param: The name of the deliver-to party (BT-70)
|
|
102
102
|
#
|
|
103
|
-
#
|
|
103
|
+
# @param state [Symbol, EInvoiceAPI::Models::DocumentState] Body param: The current state of the document: DRAFT, TRANSIT, FAILED, SENT, or
|
|
104
104
|
#
|
|
105
|
-
#
|
|
105
|
+
# @param subtotal [Float, String, nil] Body param: The taxable base of the invoice. Should be the sum of all line items
|
|
106
106
|
#
|
|
107
|
-
#
|
|
107
|
+
# @param tax_code [Symbol, EInvoiceAPI::Models::DocumentCreate::TaxCode] Body param: Tax category code of the invoice (e.g., S for standard rate, Z for z
|
|
108
108
|
#
|
|
109
|
-
#
|
|
109
|
+
# @param tax_currency [String, nil] Body param: The VAT accounting currency (BT-6, ISO 4217 currency code), when VAT
|
|
110
110
|
#
|
|
111
|
-
#
|
|
111
|
+
# @param tax_details [Array<EInvoiceAPI::Models::DocumentCreate::TaxDetail>, nil] Body param
|
|
112
112
|
#
|
|
113
|
-
#
|
|
113
|
+
# @param total_discount [Float, String, nil] Body param: The net financial discount/charge of the invoice (non-VAT charges mi
|
|
114
114
|
#
|
|
115
|
-
#
|
|
115
|
+
# @param total_tax [Float, String, nil] Body param: The total tax amount of the invoice. Must be positive and rounded to
|
|
116
116
|
#
|
|
117
|
-
#
|
|
117
|
+
# @param total_tax_in_tax_currency [Float, String, nil] Body param: The total VAT amount in the VAT accounting currency tax_currency (BT
|
|
118
118
|
#
|
|
119
|
-
#
|
|
119
|
+
# @param vatex [Symbol, EInvoiceAPI::Models::DocumentCreate::Vatex, nil] Body param: VATEX code list for VAT exemption reasons
|
|
120
|
+
#
|
|
121
|
+
# @param vatex_note [String, nil] Body param: VAT exemption reason text (BT-120). An exemption reason (vatex or va
|
|
122
|
+
#
|
|
123
|
+
# @param vendor_address [String, nil] Body param: The address of the vendor/seller
|
|
124
|
+
#
|
|
125
|
+
# @param vendor_address_recipient [String, nil] Body param: The recipient name at the vendor address. Also the vendor contact na
|
|
126
|
+
#
|
|
127
|
+
# @param vendor_company_id [String, nil] Body param: Vendor company ID. For Belgium this is the CBE number or their EUID
|
|
128
|
+
#
|
|
129
|
+
# @param vendor_email [String, nil] Body param: The email address of the vendor
|
|
130
|
+
#
|
|
131
|
+
# @param vendor_name [String, nil] Body param: The name of the vendor/seller/supplier
|
|
132
|
+
#
|
|
133
|
+
# @param vendor_phone [String, nil] Body param: The telephone number of the vendor contact (BT-42). Required when ve
|
|
134
|
+
#
|
|
135
|
+
# @param vendor_tax_id [String, nil] Body param: Vendor tax ID. For Belgium this is the VAT number. Must include the
|
|
136
|
+
#
|
|
137
|
+
# @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
120
138
|
#
|
|
121
139
|
# @return [EInvoiceAPI::Models::DocumentResponse]
|
|
122
140
|
#
|
|
@@ -139,8 +157,8 @@ module EInvoiceAPI
|
|
|
139
157
|
#
|
|
140
158
|
# @overload retrieve(document_id, request_options: {})
|
|
141
159
|
#
|
|
142
|
-
#
|
|
143
|
-
#
|
|
160
|
+
# @param document_id [String]
|
|
161
|
+
# @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
144
162
|
#
|
|
145
163
|
# @return [EInvoiceAPI::Models::DocumentResponse]
|
|
146
164
|
#
|
|
@@ -158,8 +176,8 @@ module EInvoiceAPI
|
|
|
158
176
|
#
|
|
159
177
|
# @overload delete(document_id, request_options: {})
|
|
160
178
|
#
|
|
161
|
-
#
|
|
162
|
-
#
|
|
179
|
+
# @param document_id [String]
|
|
180
|
+
# @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
163
181
|
#
|
|
164
182
|
# @return [EInvoiceAPI::Models::DocumentDeleteResponse]
|
|
165
183
|
#
|
|
@@ -181,13 +199,13 @@ module EInvoiceAPI
|
|
|
181
199
|
#
|
|
182
200
|
# @overload create_from_pdf(file:, customer_tax_id: nil, vendor_tax_id: nil, request_options: {})
|
|
183
201
|
#
|
|
184
|
-
#
|
|
202
|
+
# @param file [Pathname, StringIO, IO, String, EInvoiceAPI::FilePart] Body param
|
|
185
203
|
#
|
|
186
|
-
#
|
|
204
|
+
# @param customer_tax_id [String, nil] Query param
|
|
187
205
|
#
|
|
188
|
-
#
|
|
206
|
+
# @param vendor_tax_id [String, nil] Query param
|
|
189
207
|
#
|
|
190
|
-
#
|
|
208
|
+
# @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
191
209
|
#
|
|
192
210
|
# @return [EInvoiceAPI::Models::DocumentCreateFromPdfResponse]
|
|
193
211
|
#
|
|
@@ -216,13 +234,13 @@ module EInvoiceAPI
|
|
|
216
234
|
#
|
|
217
235
|
# @overload send_(document_id, email: nil, receiver_peppol_id: nil, receiver_peppol_scheme: nil, sender_peppol_id: nil, sender_peppol_scheme: nil, request_options: {})
|
|
218
236
|
#
|
|
219
|
-
#
|
|
220
|
-
#
|
|
221
|
-
#
|
|
222
|
-
#
|
|
223
|
-
#
|
|
224
|
-
#
|
|
225
|
-
#
|
|
237
|
+
# @param document_id [String]
|
|
238
|
+
# @param email [String, nil]
|
|
239
|
+
# @param receiver_peppol_id [String, nil]
|
|
240
|
+
# @param receiver_peppol_scheme [String, nil]
|
|
241
|
+
# @param sender_peppol_id [String, nil]
|
|
242
|
+
# @param sender_peppol_scheme [String, nil]
|
|
243
|
+
# @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
226
244
|
#
|
|
227
245
|
# @return [EInvoiceAPI::Models::DocumentResponse]
|
|
228
246
|
#
|
|
@@ -243,8 +261,8 @@ module EInvoiceAPI
|
|
|
243
261
|
#
|
|
244
262
|
# @overload validate(document_id, request_options: {})
|
|
245
263
|
#
|
|
246
|
-
#
|
|
247
|
-
#
|
|
264
|
+
# @param document_id [String]
|
|
265
|
+
# @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
248
266
|
#
|
|
249
267
|
# @return [EInvoiceAPI::Models::UblDocumentValidation]
|
|
250
268
|
#
|
|
@@ -258,6 +276,49 @@ module EInvoiceAPI
|
|
|
258
276
|
)
|
|
259
277
|
end
|
|
260
278
|
|
|
279
|
+
# Get the timeline of events for an invoice or credit note, including creation,
|
|
280
|
+
# validation, transmission, and delivery events
|
|
281
|
+
#
|
|
282
|
+
# @overload timeline(document_id, request_options: {})
|
|
283
|
+
#
|
|
284
|
+
# @param document_id [String]
|
|
285
|
+
# @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
286
|
+
#
|
|
287
|
+
# @return [EInvoiceAPI::Models::DocumentTimelineResponse]
|
|
288
|
+
#
|
|
289
|
+
# @see EInvoiceAPI::Models::DocumentTimelineParams
|
|
290
|
+
def timeline(document_id, params = {})
|
|
291
|
+
@client.request(
|
|
292
|
+
method: :get,
|
|
293
|
+
path: ["api/documents/%1$s/timeline", document_id],
|
|
294
|
+
model: EInvoiceAPI::Models::DocumentTimelineResponse,
|
|
295
|
+
options: params[:request_options]
|
|
296
|
+
)
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
# Get the lifecycle events stated about an invoice or credit note after creation
|
|
300
|
+
# (Peppol Message Level and Invoice Responses, partner status events), oldest
|
|
301
|
+
# first. Each event carries a route-agnostic canonical status next to the
|
|
302
|
+
# untouched native code of its source; native codes without a canonical equivalent
|
|
303
|
+
# have canonical_status null.
|
|
304
|
+
#
|
|
305
|
+
# @overload lifecycle(document_id, request_options: {})
|
|
306
|
+
#
|
|
307
|
+
# @param document_id [String]
|
|
308
|
+
# @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
309
|
+
#
|
|
310
|
+
# @return [EInvoiceAPI::Models::DocumentLifecycleResponse]
|
|
311
|
+
#
|
|
312
|
+
# @see EInvoiceAPI::Models::DocumentLifecycleParams
|
|
313
|
+
def lifecycle(document_id, params = {})
|
|
314
|
+
@client.request(
|
|
315
|
+
method: :get,
|
|
316
|
+
path: ["api/documents/%1$s/lifecycle", document_id],
|
|
317
|
+
model: EInvoiceAPI::Models::DocumentLifecycleResponse,
|
|
318
|
+
options: params[:request_options]
|
|
319
|
+
)
|
|
320
|
+
end
|
|
321
|
+
|
|
261
322
|
# @api private
|
|
262
323
|
#
|
|
263
324
|
# @param client [EInvoiceAPI::Client]
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
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
|
+
#
|
|
9
|
+
# @overload list(date_from: nil, date_to: nil, page: nil, page_size: nil, search: nil, sort_by: nil, sort_order: nil, state: nil, type: nil, request_options: {})
|
|
10
|
+
#
|
|
11
|
+
# @param date_from [Time, nil] Filter by issue date (from)
|
|
12
|
+
#
|
|
13
|
+
# @param date_to [Time, nil] Filter by issue date (to)
|
|
14
|
+
#
|
|
15
|
+
# @param page [Integer] Page number
|
|
16
|
+
#
|
|
17
|
+
# @param page_size [Integer] Number of items per page
|
|
18
|
+
#
|
|
19
|
+
# @param search [String, nil] Search in invoice number, seller/buyer names
|
|
20
|
+
#
|
|
21
|
+
# @param sort_by [Symbol, EInvoiceAPI::Models::DraftListParams::SortBy] Field to sort by
|
|
22
|
+
#
|
|
23
|
+
# @param sort_order [Symbol, EInvoiceAPI::Models::DraftListParams::SortOrder] Sort direction (asc/desc)
|
|
24
|
+
#
|
|
25
|
+
# @param state [Symbol, EInvoiceAPI::Models::DocumentState, nil] Filter by document state. By default return all states (DRAFT, TRANSIT, FAILED).
|
|
26
|
+
#
|
|
27
|
+
# @param type [Symbol, EInvoiceAPI::Models::DocumentType, nil] Filter by document type
|
|
28
|
+
#
|
|
29
|
+
# @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
30
|
+
#
|
|
31
|
+
# @return [EInvoiceAPI::Internal::DocumentsNumberPage<EInvoiceAPI::Models::DocumentResponse>]
|
|
32
|
+
#
|
|
33
|
+
# @see EInvoiceAPI::Models::DraftListParams
|
|
34
|
+
def list(params = {})
|
|
35
|
+
parsed, options = EInvoiceAPI::DraftListParams.dump_request(params)
|
|
36
|
+
query = EInvoiceAPI::Internal::Util.encode_query_params(parsed)
|
|
37
|
+
@client.request(
|
|
38
|
+
method: :get,
|
|
39
|
+
path: "api/drafts/",
|
|
40
|
+
query: query,
|
|
41
|
+
page: EInvoiceAPI::Internal::DocumentsNumberPage,
|
|
42
|
+
model: EInvoiceAPI::DocumentResponse,
|
|
43
|
+
options: options
|
|
44
|
+
)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# @api private
|
|
48
|
+
#
|
|
49
|
+
# @param client [EInvoiceAPI::Client]
|
|
50
|
+
def initialize(client:)
|
|
51
|
+
@client = client
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -8,25 +8,25 @@ module EInvoiceAPI
|
|
|
8
8
|
#
|
|
9
9
|
# @overload list(date_from: nil, date_to: nil, page: nil, page_size: nil, search: nil, sender: nil, sort_by: nil, sort_order: nil, type: nil, request_options: {})
|
|
10
10
|
#
|
|
11
|
-
#
|
|
11
|
+
# @param date_from [Time, nil] Filter by issue date (from)
|
|
12
12
|
#
|
|
13
|
-
#
|
|
13
|
+
# @param date_to [Time, nil] Filter by issue date (to)
|
|
14
14
|
#
|
|
15
|
-
#
|
|
15
|
+
# @param page [Integer] Page number
|
|
16
16
|
#
|
|
17
|
-
#
|
|
17
|
+
# @param page_size [Integer] Number of items per page
|
|
18
18
|
#
|
|
19
|
-
#
|
|
19
|
+
# @param search [String, nil] Search in invoice number, seller/buyer names
|
|
20
20
|
#
|
|
21
|
-
#
|
|
21
|
+
# @param sender [String, nil] Filter by sender (vendor_name, vendor_email, vendor_tax_id, vendor_company_id)
|
|
22
22
|
#
|
|
23
|
-
#
|
|
23
|
+
# @param sort_by [Symbol, EInvoiceAPI::Models::InboxListParams::SortBy] Field to sort by
|
|
24
24
|
#
|
|
25
|
-
#
|
|
25
|
+
# @param sort_order [Symbol, EInvoiceAPI::Models::InboxListParams::SortOrder] Sort direction (asc/desc)
|
|
26
26
|
#
|
|
27
|
-
#
|
|
27
|
+
# @param type [Symbol, EInvoiceAPI::Models::DocumentType, nil] Filter by document type. If not provided, returns all types.
|
|
28
28
|
#
|
|
29
|
-
#
|
|
29
|
+
# @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
30
30
|
#
|
|
31
31
|
# @return [EInvoiceAPI::Internal::DocumentsNumberPage<EInvoiceAPI::Models::DocumentResponse>]
|
|
32
32
|
#
|
|
@@ -48,15 +48,15 @@ module EInvoiceAPI
|
|
|
48
48
|
#
|
|
49
49
|
# @overload list_credit_notes(page: nil, page_size: nil, sort_by: nil, sort_order: nil, request_options: {})
|
|
50
50
|
#
|
|
51
|
-
#
|
|
51
|
+
# @param page [Integer] Page number
|
|
52
52
|
#
|
|
53
|
-
#
|
|
53
|
+
# @param page_size [Integer] Number of items per page
|
|
54
54
|
#
|
|
55
|
-
#
|
|
55
|
+
# @param sort_by [Symbol, EInvoiceAPI::Models::InboxListCreditNotesParams::SortBy] Field to sort by
|
|
56
56
|
#
|
|
57
|
-
#
|
|
57
|
+
# @param sort_order [Symbol, EInvoiceAPI::Models::InboxListCreditNotesParams::SortOrder] Sort direction (asc/desc)
|
|
58
58
|
#
|
|
59
|
-
#
|
|
59
|
+
# @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
60
60
|
#
|
|
61
61
|
# @return [EInvoiceAPI::Internal::DocumentsNumberPage<EInvoiceAPI::Models::DocumentResponse>]
|
|
62
62
|
#
|
|
@@ -78,15 +78,15 @@ module EInvoiceAPI
|
|
|
78
78
|
#
|
|
79
79
|
# @overload list_invoices(page: nil, page_size: nil, sort_by: nil, sort_order: nil, request_options: {})
|
|
80
80
|
#
|
|
81
|
-
#
|
|
81
|
+
# @param page [Integer] Page number
|
|
82
82
|
#
|
|
83
|
-
#
|
|
83
|
+
# @param page_size [Integer] Number of items per page
|
|
84
84
|
#
|
|
85
|
-
#
|
|
85
|
+
# @param sort_by [Symbol, EInvoiceAPI::Models::InboxListInvoicesParams::SortBy] Field to sort by
|
|
86
86
|
#
|
|
87
|
-
#
|
|
87
|
+
# @param sort_order [Symbol, EInvoiceAPI::Models::InboxListInvoicesParams::SortOrder] Sort direction (asc/desc)
|
|
88
88
|
#
|
|
89
|
-
#
|
|
89
|
+
# @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
90
90
|
#
|
|
91
91
|
# @return [EInvoiceAPI::Internal::DocumentsNumberPage<EInvoiceAPI::Models::DocumentResponse>]
|
|
92
92
|
#
|
|
@@ -14,9 +14,9 @@ module EInvoiceAPI
|
|
|
14
14
|
#
|
|
15
15
|
# @overload retrieve(peppol_id:, request_options: {})
|
|
16
16
|
#
|
|
17
|
-
#
|
|
17
|
+
# @param peppol_id [String] Peppol ID in the format `<scheme>:<id>`. Example: `0208:1018265814` for a Belgia
|
|
18
18
|
#
|
|
19
|
-
#
|
|
19
|
+
# @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
20
20
|
#
|
|
21
21
|
# @return [EInvoiceAPI::Models::LookupRetrieveResponse]
|
|
22
22
|
#
|
|
@@ -41,11 +41,11 @@ module EInvoiceAPI
|
|
|
41
41
|
#
|
|
42
42
|
# @overload retrieve_participants(query:, country_code: nil, request_options: {})
|
|
43
43
|
#
|
|
44
|
-
#
|
|
44
|
+
# @param query [String] Query to lookup
|
|
45
45
|
#
|
|
46
|
-
#
|
|
46
|
+
# @param country_code [String, nil] Country code of the company to lookup. If not provided, the search will be globa
|
|
47
47
|
#
|
|
48
|
-
#
|
|
48
|
+
# @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
49
49
|
#
|
|
50
50
|
# @return [EInvoiceAPI::Models::LookupRetrieveParticipantsResponse]
|
|
51
51
|
#
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module EInvoiceAPI
|
|
4
|
+
module Resources
|
|
5
|
+
class Mailbox
|
|
6
|
+
# Some parameter documentations has been truncated, see
|
|
7
|
+
# {EInvoiceAPI::Models::MailboxListParams} for more details.
|
|
8
|
+
#
|
|
9
|
+
# Retrieve a paginated list of received inbound emails with filtering, search, and
|
|
10
|
+
# sorting options.
|
|
11
|
+
#
|
|
12
|
+
# @overload list(page: nil, page_size: nil, processed: nil, received_from: nil, received_to: nil, search: nil, sort_by: nil, sort_order: nil, status: nil, request_options: {})
|
|
13
|
+
#
|
|
14
|
+
# @param page [Integer] Page number
|
|
15
|
+
#
|
|
16
|
+
# @param page_size [Integer] Number of items per page
|
|
17
|
+
#
|
|
18
|
+
# @param processed [Boolean, nil] Filter by processing status. If not provided, returns all. Ignored when `status`
|
|
19
|
+
#
|
|
20
|
+
# @param received_from [Time, nil] Inclusive lower bound on received date (falls back to created_at when received_a
|
|
21
|
+
#
|
|
22
|
+
# @param received_to [Time, nil] Inclusive upper bound on received date (falls back to created_at when received_a
|
|
23
|
+
#
|
|
24
|
+
# @param search [String, nil] Case-insensitive search across sender email, subject, message ID, and attachment
|
|
25
|
+
#
|
|
26
|
+
# @param sort_by [Symbol, EInvoiceAPI::Models::MailboxListParams::SortBy] Field to sort by
|
|
27
|
+
#
|
|
28
|
+
# @param sort_order [Symbol, EInvoiceAPI::Models::MailboxListParams::SortOrder] Sort direction (asc/desc)
|
|
29
|
+
#
|
|
30
|
+
# @param status [Symbol, EInvoiceAPI::Models::MailboxListParams::Status, nil] Filter by status: pending, success, or failed. Takes precedence over `processed`
|
|
31
|
+
#
|
|
32
|
+
# @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
33
|
+
#
|
|
34
|
+
# @return [EInvoiceAPI::Internal::DocumentsNumberPage<EInvoiceAPI::Models::InboundEmailResponse>]
|
|
35
|
+
#
|
|
36
|
+
# @see EInvoiceAPI::Models::MailboxListParams
|
|
37
|
+
def list(params = {})
|
|
38
|
+
parsed, options = EInvoiceAPI::MailboxListParams.dump_request(params)
|
|
39
|
+
query = EInvoiceAPI::Internal::Util.encode_query_params(parsed)
|
|
40
|
+
@client.request(
|
|
41
|
+
method: :get,
|
|
42
|
+
path: "api/mailbox/",
|
|
43
|
+
query: query,
|
|
44
|
+
page: EInvoiceAPI::Internal::DocumentsNumberPage,
|
|
45
|
+
model: EInvoiceAPI::InboundEmailResponse,
|
|
46
|
+
options: options
|
|
47
|
+
)
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Retrieve a single inbound email by ID, scoped to the caller's tenant.
|
|
51
|
+
#
|
|
52
|
+
# @overload retrieve(inbound_email_id, request_options: {})
|
|
53
|
+
#
|
|
54
|
+
# @param inbound_email_id [String]
|
|
55
|
+
# @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
56
|
+
#
|
|
57
|
+
# @return [EInvoiceAPI::Models::InboundEmailResponse]
|
|
58
|
+
#
|
|
59
|
+
# @see EInvoiceAPI::Models::MailboxRetrieveParams
|
|
60
|
+
def retrieve(inbound_email_id, params = {})
|
|
61
|
+
@client.request(
|
|
62
|
+
method: :get,
|
|
63
|
+
path: ["api/mailbox/%1$s", inbound_email_id],
|
|
64
|
+
model: EInvoiceAPI::InboundEmailResponse,
|
|
65
|
+
options: params[:request_options]
|
|
66
|
+
)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Download a specific attachment from an inbound email by filename. Returns the
|
|
70
|
+
# binary content with the correct Content-Type.
|
|
71
|
+
#
|
|
72
|
+
# @overload download_attachment(filename, inbound_email_id:, request_options: {})
|
|
73
|
+
#
|
|
74
|
+
# @param filename [String]
|
|
75
|
+
# @param inbound_email_id [String]
|
|
76
|
+
# @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
77
|
+
#
|
|
78
|
+
# @return [Object]
|
|
79
|
+
#
|
|
80
|
+
# @see EInvoiceAPI::Models::MailboxDownloadAttachmentParams
|
|
81
|
+
def download_attachment(filename, params)
|
|
82
|
+
parsed, options = EInvoiceAPI::MailboxDownloadAttachmentParams.dump_request(params)
|
|
83
|
+
inbound_email_id =
|
|
84
|
+
parsed.delete(:inbound_email_id) do
|
|
85
|
+
raise ArgumentError.new("missing required path argument #{_1}")
|
|
86
|
+
end
|
|
87
|
+
@client.request(
|
|
88
|
+
method: :get,
|
|
89
|
+
path: ["api/mailbox/%1$s/attachments/%2$s", inbound_email_id, filename],
|
|
90
|
+
model: EInvoiceAPI::Internal::Type::Unknown,
|
|
91
|
+
options: options
|
|
92
|
+
)
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Retry processing of a previously failed inbound email by replaying the original
|
|
96
|
+
# Postmark payload.
|
|
97
|
+
#
|
|
98
|
+
# @overload reprocess(inbound_email_id, request_options: {})
|
|
99
|
+
#
|
|
100
|
+
# @param inbound_email_id [String]
|
|
101
|
+
# @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
102
|
+
#
|
|
103
|
+
# @return [EInvoiceAPI::Models::InboundEmailResponse]
|
|
104
|
+
#
|
|
105
|
+
# @see EInvoiceAPI::Models::MailboxReprocessParams
|
|
106
|
+
def reprocess(inbound_email_id, params = {})
|
|
107
|
+
@client.request(
|
|
108
|
+
method: :post,
|
|
109
|
+
path: ["api/mailbox/%1$s/reprocess", inbound_email_id],
|
|
110
|
+
model: EInvoiceAPI::InboundEmailResponse,
|
|
111
|
+
options: params[:request_options]
|
|
112
|
+
)
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# @api private
|
|
116
|
+
#
|
|
117
|
+
# @param client [EInvoiceAPI::Client]
|
|
118
|
+
def initialize(client:)
|
|
119
|
+
@client = client
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
end
|
|
@@ -7,7 +7,7 @@ module EInvoiceAPI
|
|
|
7
7
|
#
|
|
8
8
|
# @overload retrieve(request_options: {})
|
|
9
9
|
#
|
|
10
|
-
#
|
|
10
|
+
# @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
|
|
11
11
|
#
|
|
12
12
|
# @return [EInvoiceAPI::Models::MeRetrieveResponse]
|
|
13
13
|
#
|