Class: EInvoiceAPI::Resources::Inbox

Inherits:
Object
  • Object
show all
Defined in:
lib/e_invoice_api/resources/inbox.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Inbox

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Inbox.

Parameters:



110
111
112
# File 'lib/e_invoice_api/resources/inbox.rb', line 110

def initialize(client:)
  @client = client
end

Instance Method Details

#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: {}) ⇒ EInvoiceAPI::Internal::DocumentsNumberPage<EInvoiceAPI::Models::DocumentResponse>

Retrieve a paginated list of received documents with filtering options including state, type, sender, date range, and text search.

Parameters:

Returns:

See Also:



34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/e_invoice_api/resources/inbox.rb', line 34

def list(params = {})
  parsed, options = EInvoiceAPI::InboxListParams.dump_request(params)
  query = EInvoiceAPI::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "api/inbox/",
    query: query,
    page: EInvoiceAPI::Internal::DocumentsNumberPage,
    model: EInvoiceAPI::DocumentResponse,
    options: options
  )
end

#list_credit_notes(page: nil, page_size: nil, sort_by: nil, sort_order: nil, request_options: {}) ⇒ EInvoiceAPI::Internal::DocumentsNumberPage<EInvoiceAPI::Models::DocumentResponse>

Retrieve a paginated list of received credit notes with filtering options.

Parameters:

Returns:

See Also:



64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/e_invoice_api/resources/inbox.rb', line 64

def list_credit_notes(params = {})
  parsed, options = EInvoiceAPI::InboxListCreditNotesParams.dump_request(params)
  query = EInvoiceAPI::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "api/inbox/credit-notes",
    query: query,
    page: EInvoiceAPI::Internal::DocumentsNumberPage,
    model: EInvoiceAPI::DocumentResponse,
    options: options
  )
end

#list_invoices(page: nil, page_size: nil, sort_by: nil, sort_order: nil, request_options: {}) ⇒ EInvoiceAPI::Internal::DocumentsNumberPage<EInvoiceAPI::Models::DocumentResponse>

Retrieve a paginated list of received invoices with filtering options.

Parameters:

Returns:

See Also:



94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/e_invoice_api/resources/inbox.rb', line 94

def list_invoices(params = {})
  parsed, options = EInvoiceAPI::InboxListInvoicesParams.dump_request(params)
  query = EInvoiceAPI::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "api/inbox/invoices",
    query: query,
    page: EInvoiceAPI::Internal::DocumentsNumberPage,
    model: EInvoiceAPI::DocumentResponse,
    options: options
  )
end