Class: EInvoiceAPI::Resources::Lookup

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

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Lookup

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

Parameters:



66
67
68
# File 'lib/e_invoice_api/resources/lookup.rb', line 66

def initialize(client:)
  @client = client
end

Instance Method Details

#retrieve(peppol_id: , request_options: {}) ⇒ EInvoiceAPI::Models::LookupRetrieveResponse

Some parameter documentations has been truncated, see Models::LookupRetrieveParams for more details.

Lookup Peppol ID. The peppol_id must be in the form of ‘<scheme>:<id>`. The scheme is a 4-digit code representing the identifier scheme, and the id is the actual identifier value. For example, for a Belgian company it is `0208:0123456789` (where 0208 is the scheme for Belgian enterprises, followed by the 10 digits of the official BTW / KBO number).

Parameters:

  • peppol_id (String)

    Peppol ID in the format ‘<scheme>:<id>`. Example: `0208:1018265814` for a Belgia

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

Returns:

See Also:



24
25
26
27
28
29
30
31
32
33
# File 'lib/e_invoice_api/resources/lookup.rb', line 24

def retrieve(params)
  parsed, options = EInvoiceAPI::LookupRetrieveParams.dump_request(params)
  @client.request(
    method: :get,
    path: "api/lookup",
    query: parsed,
    model: EInvoiceAPI::Models::LookupRetrieveResponse,
    options: options
  )
end

#retrieve_participants(query: , country_code: nil, request_options: {}) ⇒ EInvoiceAPI::Models::LookupRetrieveParticipantsResponse

Some parameter documentations has been truncated, see Models::LookupRetrieveParticipantsParams for more details.

Lookup Peppol participants by name or other identifiers. You can limit the search to a specific country by providing the country code.

Parameters:

  • query (String)

    Query to lookup

  • country_code (String, nil)

    Country code of the company to lookup. If not provided, the search will be globa

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

Returns:

See Also:



52
53
54
55
56
57
58
59
60
61
# File 'lib/e_invoice_api/resources/lookup.rb', line 52

def retrieve_participants(params)
  parsed, options = EInvoiceAPI::LookupRetrieveParticipantsParams.dump_request(params)
  @client.request(
    method: :get,
    path: "api/lookup/participants",
    query: parsed,
    model: EInvoiceAPI::Models::LookupRetrieveParticipantsResponse,
    options: options
  )
end