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:



97
98
99
# File 'lib/e_invoice_api/resources/inbox.rb', line 97

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, state: 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:

  • date_from (Time, nil)

    Filter by issue date (from)

  • date_to (Time, nil)

    Filter by issue date (to)

  • page (Integer)

    Page number

  • page_size (Integer)

    Number of items per page

  • search (String, nil)

    Search in invoice number, seller/buyer names

  • sender (String, nil)

    Filter by sender ID

  • state (Symbol, EInvoiceAPI::Models::DocumentState, nil)

    Filter by document state

  • type (Symbol, EInvoiceAPI::Models::DocumentType, nil)

    Filter by document type

  • request_options (EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



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

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

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

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

Parameters:

  • page (Integer)

    Page number

  • page_size (Integer)

    Number of items per page

  • request_options (EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



57
58
59
60
61
62
63
64
65
66
67
# File 'lib/e_invoice_api/resources/inbox.rb', line 57

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

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

Retrieve a paginated list of received invoices with filtering options.

Parameters:

  • page (Integer)

    Page number

  • page_size (Integer)

    Number of items per page

  • request_options (EInvoiceAPI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



82
83
84
85
86
87
88
89
90
91
92
# File 'lib/e_invoice_api/resources/inbox.rb', line 82

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