Get inbound invoice files
Method get_inbound_invoice_files is used for receiving all invoices received after given time stamp as files. Can be used in “thin client” solutions where new invoices will be imported to a third party software.
Return value
This method returns a InvoiceFile struct which includes a ZIP-file which includes the invoice PDF images and possible attachments. Also included is an XML representation of the invoices, if requested.
Arguments
api_keys(required)timestamp(required, format “YYYYMMDDHHMMSS”)xmlformat(nil, “finvoice”, “teapps”, “oio”)
Example code in Ruby
1 require 'soap/wsdlDriver'
2 require 'soap/attachment'
3
4 server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/wsdl").create_rpc_driver
5
6 #Set up API keys
7 api_keys = Hash.new
8 api_keys[:vendor_api_key] = "" # Partner software API key
9 api_keys[:user_api_key] = "" # User API key
10 api_keys[:company_uuid] = "" # UUID of current company
11
12 result = server.get_invoice_files(api_keys, "20090917000000", "teapps")
13
14 if result.status == "OK"
15 File.open("invoices.zip", 'wb') do |f|
16 f << result.file
17 end
18 end