e-invoice-api 0.25.0 → 0.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -0
  3. data/README.md +1 -1
  4. data/lib/e_invoice_api/internal/util.rb +1 -2
  5. data/lib/e_invoice_api/models/document_create.rb +9 -1
  6. data/lib/e_invoice_api/models/document_create_from_pdf_response.rb +9 -1
  7. data/lib/e_invoice_api/models/document_create_params.rb +13 -1
  8. data/lib/e_invoice_api/models/document_response.rb +16 -1
  9. data/lib/e_invoice_api/models/document_type.rb +2 -0
  10. data/lib/e_invoice_api/models/inbox_list_credit_notes_params.rb +44 -1
  11. data/lib/e_invoice_api/models/inbox_list_invoices_params.rb +44 -1
  12. data/lib/e_invoice_api/models/inbox_list_params.rb +45 -10
  13. data/lib/e_invoice_api/models/lookup_retrieve_response.rb +17 -1
  14. data/lib/e_invoice_api/models/me_retrieve_response.rb +17 -17
  15. data/lib/e_invoice_api/models/outbox_list_draft_documents_params.rb +68 -1
  16. data/lib/e_invoice_api/models/outbox_list_received_documents_params.rb +57 -10
  17. data/lib/e_invoice_api/models/paginated_document_response.rb +7 -1
  18. data/lib/e_invoice_api/resources/documents/attachments.rb +4 -2
  19. data/lib/e_invoice_api/resources/documents.rb +63 -51
  20. data/lib/e_invoice_api/resources/inbox.rb +16 -6
  21. data/lib/e_invoice_api/resources/outbox.rb +26 -6
  22. data/lib/e_invoice_api/resources/validate.rb +3 -1
  23. data/lib/e_invoice_api/version.rb +1 -1
  24. data/rbi/e_invoice_api/models/document_create.rbi +8 -0
  25. data/rbi/e_invoice_api/models/document_create_from_pdf_response.rbi +8 -0
  26. data/rbi/e_invoice_api/models/document_create_params.rbi +26 -5
  27. data/rbi/e_invoice_api/models/document_response.rbi +14 -0
  28. data/rbi/e_invoice_api/models/document_type.rbi +4 -0
  29. data/rbi/e_invoice_api/models/inbox_list_credit_notes_params.rbi +132 -0
  30. data/rbi/e_invoice_api/models/inbox_list_invoices_params.rbi +126 -0
  31. data/rbi/e_invoice_api/models/inbox_list_params.rbi +100 -11
  32. data/rbi/e_invoice_api/models/lookup_retrieve_response.rbi +19 -3
  33. data/rbi/e_invoice_api/models/me_retrieve_response.rbi +30 -18
  34. data/rbi/e_invoice_api/models/outbox_list_draft_documents_params.rbi +163 -0
  35. data/rbi/e_invoice_api/models/outbox_list_received_documents_params.rbi +156 -11
  36. data/rbi/e_invoice_api/models/paginated_document_response.rbi +6 -1
  37. data/rbi/e_invoice_api/resources/documents/attachments.rbi +4 -2
  38. data/rbi/e_invoice_api/resources/documents.rbi +78 -56
  39. data/rbi/e_invoice_api/resources/inbox.rbi +21 -5
  40. data/rbi/e_invoice_api/resources/outbox.rbi +33 -6
  41. data/rbi/e_invoice_api/resources/validate.rbi +3 -0
  42. data/sig/e_invoice_api/models/document_create.rbs +5 -0
  43. data/sig/e_invoice_api/models/document_create_from_pdf_response.rbs +5 -0
  44. data/sig/e_invoice_api/models/document_create_params.rbs +13 -3
  45. data/sig/e_invoice_api/models/document_response.rbs +10 -0
  46. data/sig/e_invoice_api/models/document_type.rbs +8 -1
  47. data/sig/e_invoice_api/models/inbox_list_credit_notes_params.rbs +56 -1
  48. data/sig/e_invoice_api/models/inbox_list_invoices_params.rbs +56 -1
  49. data/sig/e_invoice_api/models/inbox_list_params.rbs +51 -4
  50. data/sig/e_invoice_api/models/lookup_retrieve_response.rbs +13 -3
  51. data/sig/e_invoice_api/models/me_retrieve_response.rbs +16 -10
  52. data/sig/e_invoice_api/models/outbox_list_draft_documents_params.rbs +71 -1
  53. data/sig/e_invoice_api/models/outbox_list_received_documents_params.rbs +56 -4
  54. data/sig/e_invoice_api/models/paginated_document_response.rbs +5 -0
  55. data/sig/e_invoice_api/resources/documents.rbs +2 -0
  56. data/sig/e_invoice_api/resources/inbox.rbs +6 -1
  57. data/sig/e_invoice_api/resources/outbox.rbs +8 -1
  58. data/sig/e_invoice_api/resources/validate.rbs +1 -0
  59. metadata +2 -2
@@ -31,6 +31,13 @@ module EInvoiceAPI
31
31
  # @return [Integer, nil]
32
32
  optional :page_size, Integer
33
33
 
34
+ # @!attribute receiver
35
+ # Filter by receiver (customer_name, customer_email, customer_tax_id,
36
+ # customer_company_id, customer_id)
37
+ #
38
+ # @return [String, nil]
39
+ optional :receiver, String, nil?: true
40
+
34
41
  # @!attribute search
35
42
  # Search in invoice number, seller/buyer names
36
43
  #
@@ -38,24 +45,33 @@ module EInvoiceAPI
38
45
  optional :search, String, nil?: true
39
46
 
40
47
  # @!attribute sender
41
- # Filter by sender ID
48
+ # (Deprecated) Filter by sender ID
42
49
  #
43
50
  # @return [String, nil]
44
51
  optional :sender, String, nil?: true
45
52
 
46
- # @!attribute state
47
- # Filter by document state
53
+ # @!attribute sort_by
54
+ # Field to sort by
48
55
  #
49
- # @return [Symbol, EInvoiceAPI::Models::DocumentState, nil]
50
- optional :state, enum: -> { EInvoiceAPI::DocumentState }, nil?: true
56
+ # @return [Symbol, EInvoiceAPI::Models::OutboxListReceivedDocumentsParams::SortBy, nil]
57
+ optional :sort_by, enum: -> { EInvoiceAPI::OutboxListReceivedDocumentsParams::SortBy }
58
+
59
+ # @!attribute sort_order
60
+ # Sort direction (asc/desc)
61
+ #
62
+ # @return [Symbol, EInvoiceAPI::Models::OutboxListReceivedDocumentsParams::SortOrder, nil]
63
+ optional :sort_order, enum: -> { EInvoiceAPI::OutboxListReceivedDocumentsParams::SortOrder }
51
64
 
52
65
  # @!attribute type
53
- # Filter by document type
66
+ # Filter by document type. If not provided, returns all types.
54
67
  #
55
68
  # @return [Symbol, EInvoiceAPI::Models::DocumentType, nil]
56
69
  optional :type, enum: -> { EInvoiceAPI::DocumentType }, nil?: true
57
70
 
58
- # @!method initialize(date_from: nil, date_to: nil, page: nil, page_size: nil, search: nil, sender: nil, state: nil, type: nil, request_options: {})
71
+ # @!method initialize(date_from: nil, date_to: nil, page: nil, page_size: nil, receiver: nil, search: nil, sender: nil, sort_by: nil, sort_order: nil, type: nil, request_options: {})
72
+ # Some parameter documentations has been truncated, see
73
+ # {EInvoiceAPI::Models::OutboxListReceivedDocumentsParams} for more details.
74
+ #
59
75
  # @param date_from [Time, nil] Filter by issue date (from)
60
76
  #
61
77
  # @param date_to [Time, nil] Filter by issue date (to)
@@ -64,15 +80,46 @@ module EInvoiceAPI
64
80
  #
65
81
  # @param page_size [Integer] Number of items per page
66
82
  #
83
+ # @param receiver [String, nil] Filter by receiver (customer_name, customer_email, customer_tax_id, customer_com
84
+ #
67
85
  # @param search [String, nil] Search in invoice number, seller/buyer names
68
86
  #
69
- # @param sender [String, nil] Filter by sender ID
87
+ # @param sender [String, nil] (Deprecated) Filter by sender ID
70
88
  #
71
- # @param state [Symbol, EInvoiceAPI::Models::DocumentState, nil] Filter by document state
89
+ # @param sort_by [Symbol, EInvoiceAPI::Models::OutboxListReceivedDocumentsParams::SortBy] Field to sort by
72
90
  #
73
- # @param type [Symbol, EInvoiceAPI::Models::DocumentType, nil] Filter by document type
91
+ # @param sort_order [Symbol, EInvoiceAPI::Models::OutboxListReceivedDocumentsParams::SortOrder] Sort direction (asc/desc)
92
+ #
93
+ # @param type [Symbol, EInvoiceAPI::Models::DocumentType, nil] Filter by document type. If not provided, returns all types.
74
94
  #
75
95
  # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}]
96
+
97
+ # Field to sort by
98
+ module SortBy
99
+ extend EInvoiceAPI::Internal::Type::Enum
100
+
101
+ CREATED_AT = :created_at
102
+ INVOICE_DATE = :invoice_date
103
+ DUE_DATE = :due_date
104
+ INVOICE_TOTAL = :invoice_total
105
+ CUSTOMER_NAME = :customer_name
106
+ VENDOR_NAME = :vendor_name
107
+ INVOICE_ID = :invoice_id
108
+
109
+ # @!method self.values
110
+ # @return [Array<Symbol>]
111
+ end
112
+
113
+ # Sort direction (asc/desc)
114
+ module SortOrder
115
+ extend EInvoiceAPI::Internal::Type::Enum
116
+
117
+ ASC = :asc
118
+ DESC = :desc
119
+
120
+ # @!method self.values
121
+ # @return [Array<Symbol>]
122
+ end
76
123
  end
77
124
  end
78
125
  end
@@ -3,6 +3,11 @@
3
3
  module EInvoiceAPI
4
4
  module Models
5
5
  class PaginatedDocumentResponse < EInvoiceAPI::Internal::Type::BaseModel
6
+ # @!attribute has_next_page
7
+ #
8
+ # @return [Boolean]
9
+ required :has_next_page, EInvoiceAPI::Internal::Type::Boolean
10
+
6
11
  # @!attribute items
7
12
  #
8
13
  # @return [Array<EInvoiceAPI::Models::DocumentResponse>]
@@ -28,7 +33,8 @@ module EInvoiceAPI
28
33
  # @return [Integer]
29
34
  required :total, Integer
30
35
 
31
- # @!method initialize(items:, page:, page_size:, pages:, total:)
36
+ # @!method initialize(has_next_page:, items:, page:, page_size:, pages:, total:)
37
+ # @param has_next_page [Boolean]
32
38
  # @param items [Array<EInvoiceAPI::Models::DocumentResponse>]
33
39
  # @param page [Integer]
34
40
  # @param page_size [Integer]
@@ -76,8 +76,10 @@ module EInvoiceAPI
76
76
 
77
77
  # @deprecated
78
78
  #
79
- # Add one or more attachments when creating a new invoice or credit note via POST
80
- # /api/documents/
79
+ # Add one or more attachments to an invoice. Be careful: the attachments ARE NOT
80
+ # ADDED to the UBL! They are only stored in our database and can be downloaded
81
+ # later. To add attachments to the UBL, you need to add the attachment(s) via POST
82
+ # /api/documents
81
83
  #
82
84
  # @overload add(document_id, file:, request_options: {})
83
85
  #
@@ -14,103 +14,107 @@ module EInvoiceAPI
14
14
  #
15
15
  # Create a new invoice or credit note
16
16
  #
17
- # @overload create(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_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, 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: {})
18
18
  #
19
- # @param allowances [Array<EInvoiceAPI::Models::DocumentCreate::Allowance>, nil]
19
+ # @param construct_pdf [Boolean] Query param: If true, generate a constructed PDF from the document and include i
20
20
  #
21
- # @param amount_due [Float, String, nil] The amount due for payment. Must be positive and rounded to maximum 2 decimals
21
+ # @param allowances [Array<EInvoiceAPI::Models::DocumentCreate::Allowance>, nil] Body param
22
22
  #
23
- # @param attachments [Array<EInvoiceAPI::Models::DocumentAttachmentCreate>, nil]
23
+ # @param amount_due [Float, String, nil] Body param: The amount due for payment. Must be positive and rounded to maximum
24
24
  #
25
- # @param billing_address [String, nil] The billing address (if different from customer address)
25
+ # @param attachments [Array<EInvoiceAPI::Models::DocumentAttachmentCreate>, nil] Body param
26
26
  #
27
- # @param billing_address_recipient [String, nil] The recipient name at the billing address
27
+ # @param billing_address [String, nil] Body param: The billing address (if different from customer address)
28
28
  #
29
- # @param charges [Array<EInvoiceAPI::Models::DocumentCreate::Charge>, nil]
29
+ # @param billing_address_recipient [String, nil] Body param: The recipient name at the billing address
30
30
  #
31
- # @param currency [Symbol, EInvoiceAPI::Models::CurrencyCode] Currency of the invoice (ISO 4217 currency code)
31
+ # @param charges [Array<EInvoiceAPI::Models::DocumentCreate::Charge>, nil] Body param
32
32
  #
33
- # @param customer_address [String, nil] The address of the customer/buyer
33
+ # @param currency [Symbol, EInvoiceAPI::Models::CurrencyCode] Body param: Currency of the invoice (ISO 4217 currency code)
34
34
  #
35
- # @param customer_address_recipient [String, nil] The recipient name at the customer address
35
+ # @param customer_address [String, nil] Body param: The address of the customer/buyer
36
36
  #
37
- # @param customer_company_id [String, nil] Customer company ID. For Belgium this is the CBE number or their EUID (European
37
+ # @param customer_address_recipient [String, nil] Body param: The recipient name at the customer address
38
38
  #
39
- # @param customer_email [String, nil] The email address of the customer
39
+ # @param customer_company_id [String, nil] Body param: Customer company ID. For Belgium this is the CBE number or their EUI
40
40
  #
41
- # @param customer_id [String, nil] The unique identifier for the customer in your system
41
+ # @param customer_email [String, nil] Body param: The email address of the customer
42
42
  #
43
- # @param customer_name [String, nil] The company name of the customer/buyer
43
+ # @param customer_id [String, nil] Body param: The unique identifier for the customer in your system
44
44
  #
45
- # @param customer_tax_id [String, nil] Customer tax ID. For Belgium this is the VAT number. Must include the country pr
45
+ # @param customer_name [String, nil] Body param: The company name of the customer/buyer
46
46
  #
47
- # @param direction [Symbol, EInvoiceAPI::Models::DocumentDirection] The direction of the document: INBOUND (purchases) or OUTBOUND (sales)
47
+ # @param customer_peppol_id [String, nil] Body param: Customer Peppol ID
48
48
  #
49
- # @param document_type [Symbol, EInvoiceAPI::Models::DocumentType] The type of document: INVOICE, CREDIT_NOTE, or DEBIT_NOTE
49
+ # @param customer_tax_id [String, nil] Body param: Customer tax ID. For Belgium this is the VAT number. Must include th
50
50
  #
51
- # @param due_date [Date, nil] The date when payment is due
51
+ # @param direction [Symbol, EInvoiceAPI::Models::DocumentDirection] Body param: The direction of the document: INBOUND (purchases) or OUTBOUND (sale
52
52
  #
53
- # @param invoice_date [Date, nil] The date when the invoice was issued
53
+ # @param document_type [Symbol, EInvoiceAPI::Models::DocumentType] Body param: The type of document: INVOICE, CREDIT_NOTE, or DEBIT_NOTE
54
54
  #
55
- # @param invoice_id [String, nil] The unique invoice identifier/number
55
+ # @param due_date [Date, nil] Body param: The date when payment is due
56
56
  #
57
- # @param invoice_total [Float, String, nil] The total amount of the invoice including tax (invoice*total = subtotal + total*
57
+ # @param invoice_date [Date, nil] Body param: The date when the invoice was issued
58
58
  #
59
- # @param items [Array<EInvoiceAPI::Models::DocumentCreate::Item>] At least one line item is required
59
+ # @param invoice_id [String, nil] Body param: The unique invoice identifier/number
60
60
  #
61
- # @param note [String, nil] Additional notes or comments for the invoice
61
+ # @param invoice_total [Float, String, nil] Body param: The total amount of the invoice including tax (invoice_total = subto
62
62
  #
63
- # @param payment_details [Array<EInvoiceAPI::Models::PaymentDetailCreate>, nil]
63
+ # @param items [Array<EInvoiceAPI::Models::DocumentCreate::Item>] Body param: At least one line item is required
64
64
  #
65
- # @param payment_term [String, nil] The payment terms (e.g., 'Net 30', 'Due on receipt', '2/10 Net 30')
65
+ # @param note [String, nil] Body param: Additional notes or comments for the invoice
66
66
  #
67
- # @param previous_unpaid_balance [Float, String, nil] The previous unpaid balance from prior invoices, if any. Must be positive and ro
67
+ # @param payment_details [Array<EInvoiceAPI::Models::PaymentDetailCreate>, nil] Body param
68
68
  #
69
- # @param purchase_order [String, nil] The purchase order reference number
69
+ # @param payment_term [String, nil] Body param: The payment terms (e.g., 'Net 30', 'Due on receipt', '2/10 Net 30')
70
70
  #
71
- # @param remittance_address [String, nil] The address where payment should be sent or remitted to
71
+ # @param previous_unpaid_balance [Float, String, nil] Body param: The previous unpaid balance from prior invoices, if any. Must be pos
72
72
  #
73
- # @param remittance_address_recipient [String, nil] The recipient name at the remittance address
73
+ # @param purchase_order [String, nil] Body param: The purchase order reference number
74
74
  #
75
- # @param service_address [String, nil] The address where services were performed or goods were delivered
75
+ # @param remittance_address [String, nil] Body param: The address where payment should be sent or remitted to
76
76
  #
77
- # @param service_address_recipient [String, nil] The recipient name at the service address
77
+ # @param remittance_address_recipient [String, nil] Body param: The recipient name at the remittance address
78
78
  #
79
- # @param service_end_date [Date, nil] The end date of the service period or delivery period
79
+ # @param service_address [String, nil] Body param: The address where services were performed or goods were delivered
80
80
  #
81
- # @param service_start_date [Date, nil] The start date of the service period or delivery period
81
+ # @param service_address_recipient [String, nil] Body param: The recipient name at the service address
82
82
  #
83
- # @param shipping_address [String, nil] The shipping/delivery address
83
+ # @param service_end_date [Date, nil] Body param: The end date of the service period or delivery period
84
84
  #
85
- # @param shipping_address_recipient [String, nil] The recipient name at the shipping address
85
+ # @param service_start_date [Date, nil] Body param: The start date of the service period or delivery period
86
86
  #
87
- # @param state [Symbol, EInvoiceAPI::Models::DocumentState] The current state of the document: DRAFT, TRANSIT, FAILED, SENT, or RECEIVED
87
+ # @param shipping_address [String, nil] Body param: The shipping/delivery address
88
88
  #
89
- # @param subtotal [Float, String, nil] The taxable base of the invoice. Should be the sum of all line items - allowance
89
+ # @param shipping_address_recipient [String, nil] Body param: The recipient name at the shipping address
90
90
  #
91
- # @param tax_code [Symbol, EInvoiceAPI::Models::DocumentCreate::TaxCode] Tax category code of the invoice (e.g., S for standard rate, Z for zero rate, E
91
+ # @param state [Symbol, EInvoiceAPI::Models::DocumentState] Body param: The current state of the document: DRAFT, TRANSIT, FAILED, SENT, or
92
92
  #
93
- # @param tax_details [Array<EInvoiceAPI::Models::DocumentCreate::TaxDetail>, nil]
93
+ # @param subtotal [Float, String, nil] Body param: The taxable base of the invoice. Should be the sum of all line items
94
94
  #
95
- # @param total_discount [Float, String, nil] The net financial discount/charge of the invoice (non-VAT charges minus non-VAT
95
+ # @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
96
96
  #
97
- # @param total_tax [Float, String, nil] The total tax amount of the invoice. Must be positive and rounded to maximum 2 d
97
+ # @param tax_details [Array<EInvoiceAPI::Models::DocumentCreate::TaxDetail>, nil] Body param
98
98
  #
99
- # @param vatex [Symbol, EInvoiceAPI::Models::DocumentCreate::Vatex, nil] VATEX code list for VAT exemption reasons
99
+ # @param total_discount [Float, String, nil] Body param: The net financial discount/charge of the invoice (non-VAT charges mi
100
100
  #
101
- # @param vatex_note [String, nil] Textual explanation for VAT exemption
101
+ # @param total_tax [Float, String, nil] Body param: The total tax amount of the invoice. Must be positive and rounded to
102
102
  #
103
- # @param vendor_address [String, nil] The address of the vendor/seller
103
+ # @param vatex [Symbol, EInvoiceAPI::Models::DocumentCreate::Vatex, nil] Body param: VATEX code list for VAT exemption reasons
104
104
  #
105
- # @param vendor_address_recipient [String, nil] The recipient name at the vendor address
105
+ # @param vatex_note [String, nil] Body param: Textual explanation for VAT exemption
106
106
  #
107
- # @param vendor_company_id [String, nil] Vendor company ID. For Belgium this is the CBE number or their EUID (European Un
107
+ # @param vendor_address [String, nil] Body param: The address of the vendor/seller
108
108
  #
109
- # @param vendor_email [String, nil] The email address of the vendor
109
+ # @param vendor_address_recipient [String, nil] Body param: The recipient name at the vendor address
110
110
  #
111
- # @param vendor_name [String, nil] The name of the vendor/seller/supplier
111
+ # @param vendor_company_id [String, nil] Body param: Vendor company ID. For Belgium this is the CBE number or their EUID
112
112
  #
113
- # @param vendor_tax_id [String, nil] Vendor tax ID. For Belgium this is the VAT number. Must include the country pref
113
+ # @param vendor_email [String, nil] Body param: The email address of the vendor
114
+ #
115
+ # @param vendor_name [String, nil] Body param: The name of the vendor/seller/supplier
116
+ #
117
+ # @param vendor_tax_id [String, nil] Body param: Vendor tax ID. For Belgium this is the VAT number. Must include the
114
118
  #
115
119
  # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
116
120
  #
@@ -118,11 +122,14 @@ module EInvoiceAPI
118
122
  #
119
123
  # @see EInvoiceAPI::Models::DocumentCreateParams
120
124
  def create(params = {})
125
+ query_params = [:construct_pdf]
121
126
  parsed, options = EInvoiceAPI::DocumentCreateParams.dump_request(params)
127
+ query = EInvoiceAPI::Internal::Util.encode_query_params(parsed.slice(*query_params))
122
128
  @client.request(
123
129
  method: :post,
124
130
  path: "api/documents/",
125
- body: parsed,
131
+ query: query,
132
+ body: parsed.except(*query_params),
126
133
  model: EInvoiceAPI::DocumentResponse,
127
134
  options: options
128
135
  )
@@ -200,7 +207,12 @@ module EInvoiceAPI
200
207
  )
201
208
  end
202
209
 
203
- # Send an invoice or credit note via Peppol
210
+ # Send an invoice or credit note via Peppol. By default, the sender and receiver
211
+ # Peppol IDs are derived from the company (tax) IDs in the document, regardless of
212
+ # whether the document was created from a UBL with a different endpoint ID. To
213
+ # explicitly set the sender or receiver Peppol ID, provide them via the query
214
+ # parameters (sender_peppol_scheme, sender_peppol_id, receiver_peppol_scheme,
215
+ # receiver_peppol_id).
204
216
  #
205
217
  # @overload send_(document_id, email: nil, receiver_peppol_id: nil, receiver_peppol_scheme: nil, sender_peppol_id: nil, sender_peppol_scheme: nil, request_options: {})
206
218
  #
@@ -6,7 +6,7 @@ module EInvoiceAPI
6
6
  # Retrieve a paginated list of received documents with filtering options including
7
7
  # state, type, sender, date range, and text search.
8
8
  #
9
- # @overload list(date_from: nil, date_to: nil, page: nil, page_size: nil, search: nil, sender: nil, state: nil, type: nil, request_options: {})
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
  #
@@ -18,11 +18,13 @@ module EInvoiceAPI
18
18
  #
19
19
  # @param search [String, nil] Search in invoice number, seller/buyer names
20
20
  #
21
- # @param sender [String, nil] Filter by sender ID
21
+ # @param sender [String, nil] Filter by sender (vendor_name, vendor_email, vendor_tax_id, vendor_company_id)
22
22
  #
23
- # @param state [Symbol, EInvoiceAPI::Models::DocumentState, nil] Filter by document state
23
+ # @param sort_by [Symbol, EInvoiceAPI::Models::InboxListParams::SortBy] Field to sort by
24
24
  #
25
- # @param type [Symbol, EInvoiceAPI::Models::DocumentType, nil] Filter by document type
25
+ # @param sort_order [Symbol, EInvoiceAPI::Models::InboxListParams::SortOrder] Sort direction (asc/desc)
26
+ #
27
+ # @param type [Symbol, EInvoiceAPI::Models::DocumentType, nil] Filter by document type. If not provided, returns all types.
26
28
  #
27
29
  # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
28
30
  #
@@ -44,12 +46,16 @@ module EInvoiceAPI
44
46
 
45
47
  # Retrieve a paginated list of received credit notes with filtering options.
46
48
  #
47
- # @overload list_credit_notes(page: nil, page_size: nil, request_options: {})
49
+ # @overload list_credit_notes(page: nil, page_size: nil, sort_by: nil, sort_order: nil, request_options: {})
48
50
  #
49
51
  # @param page [Integer] Page number
50
52
  #
51
53
  # @param page_size [Integer] Number of items per page
52
54
  #
55
+ # @param sort_by [Symbol, EInvoiceAPI::Models::InboxListCreditNotesParams::SortBy] Field to sort by
56
+ #
57
+ # @param sort_order [Symbol, EInvoiceAPI::Models::InboxListCreditNotesParams::SortOrder] Sort direction (asc/desc)
58
+ #
53
59
  # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
54
60
  #
55
61
  # @return [EInvoiceAPI::Internal::DocumentsNumberPage<EInvoiceAPI::Models::DocumentResponse>]
@@ -70,12 +76,16 @@ module EInvoiceAPI
70
76
 
71
77
  # Retrieve a paginated list of received invoices with filtering options.
72
78
  #
73
- # @overload list_invoices(page: nil, page_size: nil, request_options: {})
79
+ # @overload list_invoices(page: nil, page_size: nil, sort_by: nil, sort_order: nil, request_options: {})
74
80
  #
75
81
  # @param page [Integer] Page number
76
82
  #
77
83
  # @param page_size [Integer] Number of items per page
78
84
  #
85
+ # @param sort_by [Symbol, EInvoiceAPI::Models::InboxListInvoicesParams::SortBy] Field to sort by
86
+ #
87
+ # @param sort_order [Symbol, EInvoiceAPI::Models::InboxListInvoicesParams::SortOrder] Sort direction (asc/desc)
88
+ #
79
89
  # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
80
90
  #
81
91
  # @return [EInvoiceAPI::Internal::DocumentsNumberPage<EInvoiceAPI::Models::DocumentResponse>]
@@ -3,14 +3,27 @@
3
3
  module EInvoiceAPI
4
4
  module Resources
5
5
  class Outbox
6
- # Retrieve a paginated list of draft documents with filtering options.
6
+ # @deprecated
7
7
  #
8
- # @overload list_draft_documents(page: nil, page_size: nil, request_options: {})
8
+ # Retrieve a paginated list of draft documents with filtering options including
9
+ # state and text search.
10
+ #
11
+ # @overload list_draft_documents(page: nil, page_size: nil, search: nil, sort_by: nil, sort_order: nil, state: nil, type: nil, request_options: {})
9
12
  #
10
13
  # @param page [Integer] Page number
11
14
  #
12
15
  # @param page_size [Integer] Number of items per page
13
16
  #
17
+ # @param search [String, nil] Search in invoice number, seller/buyer names
18
+ #
19
+ # @param sort_by [Symbol, EInvoiceAPI::Models::OutboxListDraftDocumentsParams::SortBy] Field to sort by
20
+ #
21
+ # @param sort_order [Symbol, EInvoiceAPI::Models::OutboxListDraftDocumentsParams::SortOrder] Sort direction (asc/desc)
22
+ #
23
+ # @param state [Symbol, EInvoiceAPI::Models::DocumentState, nil] Filter by document state
24
+ #
25
+ # @param type [Symbol, EInvoiceAPI::Models::DocumentType, nil] Filter by document type
26
+ #
14
27
  # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
15
28
  #
16
29
  # @return [EInvoiceAPI::Internal::DocumentsNumberPage<EInvoiceAPI::Models::DocumentResponse>]
@@ -29,10 +42,13 @@ module EInvoiceAPI
29
42
  )
30
43
  end
31
44
 
45
+ # Some parameter documentations has been truncated, see
46
+ # {EInvoiceAPI::Models::OutboxListReceivedDocumentsParams} for more details.
47
+ #
32
48
  # Retrieve a paginated list of sent documents with filtering options including
33
49
  # state, type, sender, date range, and text search.
34
50
  #
35
- # @overload list_received_documents(date_from: nil, date_to: nil, page: nil, page_size: nil, search: nil, sender: nil, state: nil, type: nil, request_options: {})
51
+ # @overload list_received_documents(date_from: nil, date_to: nil, page: nil, page_size: nil, receiver: nil, search: nil, sender: nil, sort_by: nil, sort_order: nil, type: nil, request_options: {})
36
52
  #
37
53
  # @param date_from [Time, nil] Filter by issue date (from)
38
54
  #
@@ -42,13 +58,17 @@ module EInvoiceAPI
42
58
  #
43
59
  # @param page_size [Integer] Number of items per page
44
60
  #
61
+ # @param receiver [String, nil] Filter by receiver (customer_name, customer_email, customer_tax_id, customer_com
62
+ #
45
63
  # @param search [String, nil] Search in invoice number, seller/buyer names
46
64
  #
47
- # @param sender [String, nil] Filter by sender ID
65
+ # @param sender [String, nil] (Deprecated) Filter by sender ID
48
66
  #
49
- # @param state [Symbol, EInvoiceAPI::Models::DocumentState, nil] Filter by document state
67
+ # @param sort_by [Symbol, EInvoiceAPI::Models::OutboxListReceivedDocumentsParams::SortBy] Field to sort by
50
68
  #
51
- # @param type [Symbol, EInvoiceAPI::Models::DocumentType, nil] Filter by document type
69
+ # @param sort_order [Symbol, EInvoiceAPI::Models::OutboxListReceivedDocumentsParams::SortOrder] Sort direction (asc/desc)
70
+ #
71
+ # @param type [Symbol, EInvoiceAPI::Models::DocumentType, nil] Filter by document type. If not provided, returns all types.
52
72
  #
53
73
  # @param request_options [EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil]
54
74
  #
@@ -8,7 +8,7 @@ module EInvoiceAPI
8
8
  #
9
9
  # Validate if the JSON document can be converted to a valid UBL document
10
10
  #
11
- # @overload validate_json(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_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: {})
11
+ # @overload validate_json(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: {})
12
12
  #
13
13
  # @param allowances [Array<EInvoiceAPI::Models::DocumentCreate::Allowance>, nil]
14
14
  #
@@ -36,6 +36,8 @@ module EInvoiceAPI
36
36
  #
37
37
  # @param customer_name [String, nil] The company name of the customer/buyer
38
38
  #
39
+ # @param customer_peppol_id [String, nil] Customer Peppol ID
40
+ #
39
41
  # @param customer_tax_id [String, nil] Customer tax ID. For Belgium this is the VAT number. Must include the country pr
40
42
  #
41
43
  # @param direction [Symbol, EInvoiceAPI::Models::DocumentDirection] The direction of the document: INBOUND (purchases) or OUTBOUND (sales)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EInvoiceAPI
4
- VERSION = "0.25.0"
4
+ VERSION = "0.26.1"
5
5
  end
@@ -67,6 +67,10 @@ module EInvoiceAPI
67
67
  sig { returns(T.nilable(String)) }
68
68
  attr_accessor :customer_name
69
69
 
70
+ # Customer Peppol ID
71
+ sig { returns(T.nilable(String)) }
72
+ attr_accessor :customer_peppol_id
73
+
70
74
  # Customer tax ID. For Belgium this is the VAT number. Must include the country
71
75
  # prefix
72
76
  sig { returns(T.nilable(String)) }
@@ -272,6 +276,7 @@ module EInvoiceAPI
272
276
  customer_email: T.nilable(String),
273
277
  customer_id: T.nilable(String),
274
278
  customer_name: T.nilable(String),
279
+ customer_peppol_id: T.nilable(String),
275
280
  customer_tax_id: T.nilable(String),
276
281
  direction: EInvoiceAPI::DocumentDirection::OrSymbol,
277
282
  document_type: EInvoiceAPI::DocumentType::OrSymbol,
@@ -341,6 +346,8 @@ module EInvoiceAPI
341
346
  customer_id: nil,
342
347
  # The company name of the customer/buyer
343
348
  customer_name: nil,
349
+ # Customer Peppol ID
350
+ customer_peppol_id: nil,
344
351
  # Customer tax ID. For Belgium this is the VAT number. Must include the country
345
352
  # prefix
346
353
  customer_tax_id: nil,
@@ -444,6 +451,7 @@ module EInvoiceAPI
444
451
  customer_email: T.nilable(String),
445
452
  customer_id: T.nilable(String),
446
453
  customer_name: T.nilable(String),
454
+ customer_peppol_id: T.nilable(String),
447
455
  customer_tax_id: T.nilable(String),
448
456
  direction: EInvoiceAPI::DocumentDirection::OrSymbol,
449
457
  document_type: EInvoiceAPI::DocumentType::OrSymbol,
@@ -66,6 +66,10 @@ module EInvoiceAPI
66
66
  sig { returns(T.nilable(String)) }
67
67
  attr_accessor :customer_name
68
68
 
69
+ # Customer Peppol ID
70
+ sig { returns(T.nilable(String)) }
71
+ attr_accessor :customer_peppol_id
72
+
69
73
  # Customer tax ID. For Belgium this is the VAT number. Must include the country
70
74
  # prefix
71
75
  sig { returns(T.nilable(String)) }
@@ -292,6 +296,7 @@ module EInvoiceAPI
292
296
  customer_email: T.nilable(String),
293
297
  customer_id: T.nilable(String),
294
298
  customer_name: T.nilable(String),
299
+ customer_peppol_id: T.nilable(String),
295
300
  customer_tax_id: T.nilable(String),
296
301
  direction: EInvoiceAPI::DocumentDirection::OrSymbol,
297
302
  document_type: EInvoiceAPI::DocumentType::OrSymbol,
@@ -368,6 +373,8 @@ module EInvoiceAPI
368
373
  customer_id: nil,
369
374
  # The company name of the customer/buyer
370
375
  customer_name: nil,
376
+ # Customer Peppol ID
377
+ customer_peppol_id: nil,
371
378
  # Customer tax ID. For Belgium this is the VAT number. Must include the country
372
379
  # prefix
373
380
  customer_tax_id: nil,
@@ -470,6 +477,7 @@ module EInvoiceAPI
470
477
  customer_email: T.nilable(String),
471
478
  customer_id: T.nilable(String),
472
479
  customer_name: T.nilable(String),
480
+ customer_peppol_id: T.nilable(String),
473
481
  customer_tax_id: T.nilable(String),
474
482
  direction: EInvoiceAPI::DocumentDirection::TaggedSymbol,
475
483
  document_type: EInvoiceAPI::DocumentType::TaggedSymbol,
@@ -14,15 +14,36 @@ module EInvoiceAPI
14
14
  )
15
15
  end
16
16
 
17
+ # If true, generate a constructed PDF from the document and include it both as
18
+ # document attachment and embedded in the UBL.
19
+ sig { returns(T.nilable(T::Boolean)) }
20
+ attr_reader :construct_pdf
21
+
22
+ sig { params(construct_pdf: T::Boolean).void }
23
+ attr_writer :construct_pdf
24
+
17
25
  sig do
18
- params(request_options: EInvoiceAPI::RequestOptions::OrHash).returns(
19
- T.attached_class
20
- )
26
+ params(
27
+ construct_pdf: T::Boolean,
28
+ request_options: EInvoiceAPI::RequestOptions::OrHash
29
+ ).returns(T.attached_class)
21
30
  end
22
- def self.new(request_options: {})
31
+ def self.new(
32
+ # If true, generate a constructed PDF from the document and include it both as
33
+ # document attachment and embedded in the UBL.
34
+ construct_pdf: nil,
35
+ request_options: {}
36
+ )
23
37
  end
24
38
 
25
- sig { override.returns({ request_options: EInvoiceAPI::RequestOptions }) }
39
+ sig do
40
+ override.returns(
41
+ {
42
+ construct_pdf: T::Boolean,
43
+ request_options: EInvoiceAPI::RequestOptions
44
+ }
45
+ )
46
+ end
26
47
  def to_hash
27
48
  end
28
49
  end