Inbound invoice show
Method inboung_invoice_show is used for getting information about a specific inbound invoice.
Return value
This method returns a InboundInvoiceParamsOut struct.
Arguments
api_keys(required)idstring (invoice id)include_filesboolean (download invoice image and attachments)xmlformatstring (nil, “finvoice”, “teapps” or “oio” > defines if also an XML representation of the invoice will be returned in the attachments array)
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 = server.inbound_invoice_show(api_keys, "1c555458-fa83-402b-a1f6-4d22071020a8", true, "teapps")
11 if result.status == "OK"
12 puts "Invoice number: " + result.invoice_nr
13
14 if result.attachments
15 result.attachments.each do |fa|
16 File.open(fa.filename, 'wb') do |f|
17 f << fa.file
18 end
19 end
20 end
21 end
Example code in C#
1 //WSDL at https://testing.maventa.com/apis/bravo/wsdl needs to be added as web reference for the example to work
2
3 using System;
4 using System.IO;
5 using System.Collections.Generic;
6 using System.Drawing;
7 using System.Windows.Forms;
8 using MaventaAPI;
9
10 namespace MaventaDemo
11 {
12 public partial class MainForm : Form
13 {
14 public MainForm()
15 {
16 InitializeComponent();
17 MaventaService m_server = new MaventaService();
18
19 ApiKeys apiKeys = new ApiKeys();
20 apiKeys.user_api_key = ""; //User API key
21 apiKeys.company_uuid = ""; //UUID of current company
22
23 //Get invoice data and save attachments
24 InboundInvoiceParamsOut inbound_invoice = new InboundInvoiceParamsOut();
25 inbound_invoice = m_server.inbound_invoice_show(apiKeys, "1f7e5f62-93f2-4a62-a3bb-fc81d3570133", true, "finvoice");
26 if (inbound_invoice.attachments.Length > 0)
27 {
28 for (int j = 0; j < inbound_invoice.attachments.Length; j++)
29 {
30 FileStream fstream = new FileStream ("C:\\" + inbound_invoice.attachments[j].filename, FileMode.Append, FileAccess.Write);
31 BinaryWriter bwriter = new BinaryWriter(fstream);
32 bwriter.Write(inbound_invoice.attachments[j].file);
33 fstream.Close();
34 bwriter.Close();
35 }
36 }
37 MessageBox.Show(String.Format("Invoice number {0} downloaded", inbound_invoice.invoice_nr));
38
39 }
40 }
41 }
42