Class: EInvoiceAPI::Resources::Outbox

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Outbox

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 Outbox.

Parameters:



72
73
74
# File 'lib/e_invoice_api/resources/outbox.rb', line 72

def initialize(client:)
  @client = client
end

Instance Method Details

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

Retrieve a paginated list of draft documents 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:



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/e_invoice_api/resources/outbox.rb', line 19

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

#list_received_documents(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 sent 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:



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

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