Class: Belvo::Invoice
Overview
An Invoice is the representation of an electronic invoice, that can be received or sent, by a business or an individual and has been uploaded to the fiscal institution website
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
-
#initialize(session) ⇒ Invoice
constructor
A new instance of Invoice.
-
#retrieve(link:, date_from:, date_to:, type:, options: nil) ⇒ Hash
Created invoices details.
Methods inherited from Resource
#clean, #delete, #detail, #list, #resume
Constructor Details
#initialize(session) ⇒ Invoice
Returns a new instance of Invoice.
336 337 338 339 |
# File 'lib/belvo/resources.rb', line 336 def initialize(session) super(session) @endpoint = 'api/invoices/' end |
Instance Method Details
#retrieve(link:, date_from:, date_to:, type:, options: nil) ⇒ Hash
Returns created invoices details.
347 348 349 350 351 352 353 354 355 356 357 358 359 360 |
# File 'lib/belvo/resources.rb', line 347 def retrieve(link:, date_from:, date_to:, type:, options: nil) = InvoiceOptions.from() body = { link: link, date_from: date_from, date_to: date_to, type: type, token: .token, save_data: .save_data || true, attach_xml: .attach_xml }.merge() body = clean body: body @session.post(@endpoint, body) end |