Invoice xml test
Method invoice_xml_test is used for testing the compatibility of an XML invoice material created with a third-party application with the Maventa XML parser.
Return value
This method returns an struct of XmlTestStatus.
Arguments
api_keys(required)xml_invoicebase64 (required)
Example code in Ruby
1 require 'soap/wsdlDriver'
2
3 server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/wsdl").create_rpc_driver
4
5 api_keys = Hash.new
6 api_keys[:vendor_api_key] = "" # Partner software API key
7 api_keys[:user_api_key] = "" # User API key
8 api_keys[:company_uuid] = "" # UUID of current company
9
10 result = serv.invoice_xml_test(api_keys, SOAP::Attachment.new("testfile.xml"))
11 puts "VALIDATION RESULT: #{result.status}"
12 puts "XML FORMAT: #{result.xml_format}"
13 puts "INVOICE COUNT: #{result.invoices.size}"
14
15 result.invoices.each do |invoice|
16 puts "Invoice number: #{invoice.invoice_nr}"
17 puts "Status: #{invoice.status}"
18 puts "Customer name: #{invoice.customer_name}"
19 puts "Total sum: #{invoice.sum_tax}"
20 end