Invoice put file

Method invoice_put_file is used for creating new invoices from existing XML invoice files or ZIP files with XML files and attachments.

Return value

This method returns a FileStatus struct.

Arguments

  1. api_keys (required)
  2. FileAttachment (required)

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 file_out = Hash.new
13 file_out[:file] = SOAP::Attachment.new(File.new("invoice.xml"))
14 file_out[:filename] = "invoice.xml" 
15 
16 results = server.invoice_put_file(api_keys, file_out)
17 results.each do |result|
18   puts result.status
19 end
20 

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             MaventaService m_server = new MaventaService();        
17             ApiKeys apiKeyParams = new ApiKeys();
18             apiKeyParams.user_api_key = "";
19             apiKeyParams.company_uuid = "";
20 
21             FileAttachment fileOut = new FileAttachment();
22 
23                         fileOut.filename = "1001.xml";
24                         fileOut.file = File.ReadAllBytes("1001.xml");
25 
26             FileStatus[] fStatus = m_server.invoice_put_file(apiKeyParams, fileOut);;
27             MessageBox.Show(fStatus[0].filename + " " + fStatus[0].status);
28         }
29     }
30 }

Also available in: HTML TXT