Index by title
FileStatus" />

FileStatus

1 #Status
2 member :status, :string
3 #Hash of file
4 member :filehash, :string
5 #Filename
6 member :filename, :string

TrxListItem" />

TrxListItem

 1 member :invoice_nr, :string
 2 
 3 #User company information
 4 member :customer_name, :string
 5 member :customer_bid, :string
 6 member :customer_maventa_id, :string
 7 
 8 #Transaction type and timestamp
 9 member :action, :string
10 member :timestamp, :string
11 
12 #If action is iPost, this holds amount of pages
13 member :pages, :int
14 
15 #Debit prices for action, Maventa price and defined partner price
16 member :price_maventa, :string
17 member :price_partner, :string

About API keys

The Maventa API-keys are 16-byte strings, called UUID’s (Universally Unique Identifier). An API-key in Maventa looks like this c35db559-dd4c-423d-9ca7-f334f94aa074 (this is a dummy, please refrain from using this in your experiments). There are currently two types of API-keys: Personal API-keys and Partner API-keys, and they both obey the UUID format.

How do I obtain my API-key?

Your Personal API-key is automatically generated upon account creation. The API-key is presented to you as soon as your account has been successfully activated. You can also see your Personal API-key by logging into the Maventa-GUI and browsing to Settings -> Details

Public Application / Vendor API-keys can only be accessed by users who have opened a Maventa Partner Account. These API-keys are usually bound to a certain version of the partner’s software and can be managed in the Maventa-GUI under Settings -> Software API keys

Personal API-key, Partner API-key – you get me confused?

The Personal API-key is the key which is similar to your username and password combination in connections through the machine-to-machine API. The Personal API-key identifies your company and allows the access to your company’s sensitive data. Therefore it is of utmost importance that this key is kept secret! Your Personal API-key is equivalent to the PIN-number of your credit-card – do not lose it, nor tell it to anyone you wouldn’t trust your credit-card PIN with.

The Partner’s API-keys are used to track software that they distribute. These API-keys are not sensitive for prying eyes and are usually bundled, transparent to the end-user, in to the distributed software source code.

Is my Personal API-key(s) subject to change?

No. Your Personal API-key is not bound to your username or password used to log in to Maventa-GUI. It will not change unless you regenerate it yourself in the Maventa-GUI under “Settings”. Note: If you change your API-key, you must assure that you change it also in the software from where you wish to use the Maventa Service and all other services authenticating as your company against the API.

I suspect that my API-key(s) are being used by someone else – not representing our company?

Request a change of your Personal API-key. You can do that in the Maventa-GUI under “Settings”.


API Callable Methods

This documentation currently applies to the WSDL at https://secure.maventa.com/api/wsdl/. We recommend using the WSDL at https://secure.maventa.com/api_net/wsdl/ for new integrations, since that will be the style in which future updates are done. The most notable difference is in the return values which, for the latter WSDL, always includes a ‘status’ variable where OK/ERROR message is saved.

Hello world!

  1. hello_world

LISTINGS

  1. List bank accounts: bank_account_list
  2. List for countries: country_list
  3. List for currencies: currency_list
  4. List company fees: company_fee_list
  5. List companies where user is registered: company_list
  6. List for languages: language_list
  7. List for relay operators: relay_operator_list
  8. List invoices: invoice_list
  9. List inbound invoices: invoice_list_inbound
  10. List users: user_list
  11. List postal addresses: postal_address_list

COMPANYLOOKUP

  1. Lookup for company information: company_lookup

INVOICES

  1. Create a new invoice: invoice_create
  2. Create a credit-note (minus invoice): invoice_revoke
  3. Show invoice, needs invoice db-id: invoice_show
  4. Show inbound invoice data: inbound_invoice_show
  5. Mark invoice as paid: invoice_confirm
  6. Accept invoice (inbound): invoice_accept
  7. Decline invoice (inbound): invoice_decline
  8. Dispute invoice (inbound): invoice_dispute

USERS

  1. Create a new user: user_create
  2. Update user: user_update
  3. Delete user: user_delete
  4. Show user: user_show

COMPANIES

  1. Update company: company_update
  2. Show company: company_show
  3. Show company settings: company_settings_show
  4. Update company settings: company_settings_update
  5. Show a company fee: company_fee_show
  6. Create a new company fee: company_fee_create
  7. Update a company fee: company_fee_update
  8. Delete a company fee: company_fee_delete

BANK ACCOUNTS

  1. Create a new bank account: bank_account_create
  2. Update bank account: bank_account_update
  3. Delete bank account: bank_account_delete
  4. Show bank account: bank_account_show

POSTAL ADDRESSES

  1. Create postal address: postal_address_create
  2. Update postal address: postal_address_update
  3. Delete postal address: postal_address_delete
  4. Show postal address: postal_address_show

File handling

  1. Get invoice PDF: get_pdf
  2. Get partner transactions: get_partner_transactions
  3. Get files: get_files
  4. Upload invoice as XML file (supported formats: Teapps, Oio, finvoice): put_xml
  5. Upload multiple invoices in one ZIP file: put_zip
  6. Upload attachment to an invoice: put_attachment

API Endpoints

Please conduct all testing in the dedicated testing environment before going live on the production API.

Testing:

On the testing server no invoices except for e-mail invoices are really sent. Please make sure to use e-mail addresses that you own when conducting testing to avoid any confusion (e.g. do not use something like test@test.com since that domain really exists which means that the e-mail address might also exist).

The database of the testing server may be emptied without notice and the server might be unavailable at times!


The SOAP Server Endpoint URL for API version BRAVO developers is https://testing.maventa.com/apis/bravo/wsdl/
The SOAP Server Endpoint URL for API version ALPHA developers is https://testing.maventa.com/api_net/wsdl/
The SOAP Server Endpoint URL for file transfer is https://testtrx.maventa.com/ NOTE! Only used in ALPHA-version of API

Production:


The SOAP Server Endpoint URL for API version BRAVO developers is https://secure.maventa.com/apis/bravo/wsdl/
The SOAP Server Endpoint URL for API version ALPHA developers is https://secure.maventa.com/api_net/wsdl/
The SOAP Server Endpoint URL for file transfer is https://trx.maventa.com/ NOTE! Only used in ALPHA-version of API


Api keys

1 #Users own API-key
2 member :user_api_key, :string
3 
4 #Possible software vendors API-key
5 member :vendor_api_key, :string
6 
7 #If user has multiple companies, id of company to act for
8 member :company_uuid, :string

Authenticate token

Method authenticate_token is used for authenticating a user’s USB auth token.

Return value

This method returns a string (“OK” or “FAIL”)

Arguments

  1. api_keys (required)
  2. otp string (required, one-time-password from the auth token)

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 puts server.authenticate_token(api_keys, "echdheebedeeectnklekhcdivdhktederbjhegbkribd")

Authentication

Authenticity is verified by a Personal API key, which is validated on each request to the Maventa Webservice.

You can only interact with Maventa API over HTTPS. The Maventa WSDL, which describes the Maventa API in a machine-readable way, is available at: https://secure.maventa.com/apis/bravo/wsdl

Most users will interact with Maventa API using a SOAP toolkit tailored for their language and development environment. Different toolkits will expose the Maventa API in different ways. Please refer to your specific toolkit documentation to understand how to use it. This section illustrates the Maventa API SOAP operations in a toolkit-independent way by exhibiting the XML requests and responses as they appear “on the wire.”

SOAP Endpoint

You can send Maventa SOAP messages over SSL secured http protocol to the endpoint. Note that authenticated SOAP requests are only accepted over SSL. The available Maventa SOAP endpoints are described in API Endpoints.

Common Elements

You should include the following authorization-related elements (where applicable) with any SOAP request:

user_api_key: The registered user’s API-key (always included in every request)

vendor_api_key: The software vendor’s API-key

company_uuid: The company which the user is acting on behalf (if having many companies)

BankAccountParamsIn

 1 #Account number - *required*
 2 member :account, :string
 3 #Bank name - *required*
 4 member :bank, :string
 5 #IBAN account number - *required*
 6 member :iban, :string
 7 #SWIFT/BIC
 8 member :swift, :string
 9 #Is this the default account? (used when invoice format only allows one account)
10 member :default, :bool

BankAccountParamsOut

 1 #BankAccount db-id
 2 member :id, :string
 3 #Account number
 4 member :account, :string
 5 #Bank name
 6 member :bank, :string
 7 #IBAN account number
 8 member :iban, :string
 9 #SWIFT/BIC
10 member :swift, :string
11 #Is this the default account?
12 member :default, :bool

Bank account create

Method bank_account_create is used for adding bank account details to be used in invoices.

Return value

This method returns a string with the status.

Arguments

  1. api_keys (required)
  2. BankAccountParamsIn (required)

Example code

 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 bank_account = Hash.new
11 bank_account[:account] = "2202" 
12 bank_account[:bank]    = "TSTBANK" 
13 bank_account[:iban]    = "FI0031223222" 
14 bank_account[:swift]   = "TSTBANKFI" 
15 
16 puts server.bank_account_create(api_keys, bank_account)

Bank account delete

Method bank_account_delete is used for deleting bank account details.

Return value

This method returns a string with the status.

Arguments

  1. api_keys (required)
  2. bank_account_id (required)

Example code

 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 puts server.bank_account_delete(api_keys, "58c4f3ae-c637-4447-a2ee-4d03cbd62f6e")

Bank account list

Method bank_account_list is used for listing company’s bank accounts.

Return value(s)

This method returns an array that contains return code as a string and an array of BankAccountParamsOut.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)

Example code

 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9   api_keys[:company_uuid] = "" # Put here UUID of the Company you are acting for
10 
11   # List all bank accounts for company
12   results = serv.bank_account_list(api_keys)
13 
14   results[1].each do |result|
15     puts result.id, result.account, result.bank, result.iban, result.swift
16   end
17 
18 rescue Exception => ex 
19   puts ex
20 end

Bank account list

Method bank_account_list is used for listing company’s bank accounts.

Return value

This method returns an array of BankAccountParamsOut structs.

Arguments

  1. api_keys (required)

Example code

 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 results = server.bank_account_list(api_keys)
11 
12 if results[0].status == "OK" 
13   results.each do |result|
14     puts result.id, result.account, result.bank, result.iban, result.swift
15   end
16 end

Bank account show

Method bank_account_show is used for showing a certain bank accounts details.

Return value(s)

This method returns an array that contains return code as a string and BankAccountParamsOut hash table.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)
  2. Bank account ID string (required)

Example code

 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9   api_keys[:company_uuid] = "" # Put here UUID of the Company you are acting for
10 
11   # Show single bank account
12   result = serv.bank_account_show(api_keys, "bank account ID")
13 
14   puts result[1].id, result[1].account, result[1].bank, result[1].iban, result[1].swift
15 
16 rescue Exception => ex 
17   puts ex
18 end

Bank account list

Method bank_account_list is used for showing information about a specific bank account.

Return value

This method returns a BankAccountParamsOut struct.

Arguments

  1. api_keys (required)
  2. bank_account_id (required)

Example code

 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 account = server.bank_account_show(api_keys, "58c4f3ae-c637-4447-a2ee-4d03cbd62f6e")
11 
12 if account.status == "OK" 
13   puts account.account, account.bank, account.iban, account.swift
14 end

Bank account show .NET

Method bank_account_show is used for showing bank account details.

Return value(s)

This method returns a BankAccountParamsOut hash table.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)
  2. Bank account ID string (required)
h2. Example code
 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9   api_keys[:company_uuid] = "" # Put here UUID of the company you are acting for
10 
11   # Show single bank account
12   result = serv.bank_account_show(api_keys, "bank account ID")
13 
14   if result.status == "OK" 
15     puts result.id, result.account, result.bank, result.iban, result.swift
16   end
17 
18 rescue Exception => ex 
19   puts ex
20 end

Bank account update

Method bank_account_update is used for updating bank account details to be used in invoices.

Return value

This method returns a string with the status.

Arguments

  1. api_keys (required)
  2. bank_account_id (required)
  3. BankAccountParamsIn (required)

Example code

 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 bank_account = Hash.new
11 bank_account[:account] = "2202" 
12 bank_account[:bank]    = "TSTBANK" 
13 bank_account[:iban]    = "FI0031223222" 
14 bank_account[:swift]   = "TSTBANKFI" 
15 bank_account[:default] = 1
16 
17 puts server.bank_account_update(api_keys, "58c4f3ae-c637-4447-a2ee-4d03cbd62f6e", bank_account)

Bravo API callable methods

This documentation currently applies to the WSDL at:

Testing: https://testing.maventa.com/apis/bravo/wsdl/
Production: https://secure.maventa.com/apis/bravo/wsdl/

MISC

INVOICES

USERS

COMPANIES

BANK ACCOUNTS

Bank accounts, postal address and company fee can also be given in the invoice_create request.

POSTAL ADDRESSES

Bank accounts, postal address and company fee can also be given in the invoice_create request.

COMPANY FEES

Bank accounts, postal address and company fee can also be given in the invoice_create request.


CompanyFeeParamsIn

1 #Interest percentage for late invoices (e.g. 11.5)
2 member :interest, :double
3 #Currency for fee (e.g. 'EUR') - *required*
4 member :currency, :string
5 #Reminder fee for late invoices (e.g. '5.50')
6 member :reminder_fee, :string
7 #Fee added for paper invoices (e.g. '4.30')
8 member :paper_fee, :string

CompanyFeeParamsOut

 1 #CompanyFee db-id
 2 member :id, :string
 3 #Interest percentage for late invoices (e.g. 11.5)
 4 member :interest, :double
 5 #Currency for fee (e.g. 'EUR')
 6 member :currency, :string
 7 #Reminder fee for late invoices (e.g. '5.50')
 8 member :reminder_fee, :string
 9 #Fee added for paper invoices (e.g. '4.30')
10 member :paper_fee, :string

CompanyFeeParamsOut

 1 #Status
 2 member :status, :string
 3 #CompanyFee db-id
 4 member :id, :string
 5 #Interest percentage for late invoices (e.g. 11.5)
 6 member :interest, :double
 7 #Currency for fee (e.g. 'EUR')
 8 member :currency, :string
 9 #Reminder fee for late invoices (e.g. '5.50')
10 member :reminder_fee, :string
11 #Fee added for paper invoices (e.g. '4.30')
12 member :paper_fee, :string

Company hash table

 1 #Name
 2 member :name, :string
 3 #Maventa ID
 4 member :maventa_id, :string
 5 #Business ID, VAT
 6 member :bid, :string
 7 #Address line 1
 8 member :address1, :string
 9 #Address line 2
10 member :address2, :string
11 #Post code
12 member :post_code, :string
13 #Post office
14 member :post_office, :string
15 #State
16 member :state, :string
17 #Country
18 member :country, :string
19 #EDI-code (OVT)
20 member :ovt, :string

CompanyLookupOut

 1 #Status
 2 member :status, :string
 3 #Name
 4 member :name, :string
 5 #Maventa ID
 6 member :maventa_id, :string
 7 #Business ID, VAT
 8 member :bid, :string
 9 #Address line 1
10 member :address1, :string
11 #Address line 2
12 member :address2, :string
13 #Post code
14 member :post_code, :string
15 #Post office
16 member :post_office, :string
17 #State
18 member :state, :string
19 #Country
20 member :country, :string
21 #EDI-codes (OVTs)
22 member :edis, [:string]

CompanyParamsIn

1 #Name - *required* 
2 member :name, :string
3 #Email - *required*
4 member :email, :string
5 #Countrycode (see country_list) - *required*
6 member :country, :string

CompanyParamsOut

 1 #Company_uuid
 2 member :id, :string
 3 #Maventa ID
 4 member :maventa_id, :string
 5 #Name
 6 member :name, :string
 7 #Business ID, VAT etc.
 8 member :bid, :string
 9 #Email
10 member :email, :string
11 #Country
12 member :country, :string

CompanyParamsOut

 1 #Status
 2 member :status, :string
 3 #Company db-id
 4 member :id, :string
 5 #Maventa ID
 6 member :maventa_id, :string
 7 #Name
 8 member :name, :string
 9 #Business ID, VAT etc.
10 member :bid, :string
11 #Email
12 member :email, :string
13 #Country
14 member :country, :string

CompanySettingsParams

 1 #Status
 2 member :status, :string
 3 #Account manager's email address where links to invoices are sent
 4 member :acc_man_email, :string
 5 #Website of company, displayed on invoice
 6 member :website, :string
 7 #iPost enabled, only for Finnish companies (0 = disabled, 1 = Finland, 2 = Europe, 3 = Worldwide)
 8 member :ipost, :int
 9 #iPost request, only for Finnish companies (0 = disabled, 1 = Finland, 2 = Europe, 3 = Worldwide)
10 member :ipost_request, :int
11 #Is iPost verified (means that iPost can be enabled)
12 member :ipost_verified, :boolean
13 #iPost mail class (1 = Priority, 0 = Economy)
14 member :ipost_type, :integer
15 #Frequency of email reminder's for open invoices in days (e.g. 2)
16 member :email_remind_freq, :int
17 #Use own iPost PDF images (iPost sending normally uses Maventa created PDFs for compatibility. You can choose to use your own PDF but Maventa will add a cover sheet to ensure the address is printed correctly.)
18 member :ipost_own_pdf, :boolean

Company fee create

Method company_fee_create is used for creating company invoicing fees for different currencies.

Return value

This method returns a string with the status.

Arguments

  1. api_keys (required)
  2. CompanyFeeParamsIn (required)

Example code

 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 fee = Hash.new
11 fee[:interest] = "15" 
12 fee[:currency] = "EUR" 
13 fee[:reminder_fee] = "5" 
14 fee[:paper_fee] = "7.5" 
15 
16 puts server.company_fee_show(api_keys, fee)

Company fee delete

Method company_fee_delete is used for deleting a company invoicing fee for a certain currency.

Return value

This method returns a string with the status.

Arguments

  1. api_keys (required)
  2. fee_id string (required)

Example code

 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 puts server.company_fee_delete(api_keys, "cc1eec9b-5423-4506-9518-f74c16500f97")

Company fee list

Method company_fee_list is used for listing company invoicing fees for different currencies.

Return value(s)

This method returns an array that contains return code as a string and an array of CompanyFeeParamsOut.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)

Example code

 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9   api_keys[:company_uuid] = "" # Put here UUID of the Company you are acting for
10 
11   results = serv.company_fee_list(api_keys)
12 
13   if results[0] == "OK" 
14   results[1].each do |result|
15     puts result.id, result.interest, result.currency, result.reminder_fee, result.paper_fee
16   end
17 
18 rescue Exception => ex 
19   puts ex
20 end

Company fee list

Method company_fee_list is used for listing company invoicing fees for different currencies.

Return value

This method returns an array of CompanyFeeParamsOut structs.

Arguments

  1. api_keys (required)

Example code

 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 results = server.company_fee_list(api_keys)
11 
12 if results[0].status == "OK" 
13   results.each do |result|
14     puts result.id, result.interest, result.currency, result.reminder_fee, result.paper_fee
15   end
16 end

Company fee show

Method company_fee_show is used for showing details of company invoicing fee.

Return value(s)

This method returns an array that contains return code as a string and CompanyFeeParamsOut hash table.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)
  2. Fee ID string (required)

Example code

 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9   api_keys[:company_uuid] = "" # Put here UUID of the Company you are acting for
10 
11   result = serv.company_fee_show(api_keys, "Fee ID")
12 
13   if result[0] == "OK" 
14     puts result[1].currency, result[1].interest, result[1],reminder_fee, result[1].paper_fee
15   end
16 
17 rescue Exception => ex 
18   puts ex
19 end

Company fee show

Method company_fee_show is used for showing details of a specific company invoicing fee.

Return value

This method returns a CompanyFeeParamsOut struct.

Arguments

  1. api_keys (required)
  2. fee_id string (required)

Example code

 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.company_fee_show(api_keys, "Fee ID")
11 
12 if result.status == "OK" 
13   puts result.currency, result.interest, result.reminder_fee, result.paper_fee
14 end

Company fee show .NET

Method company_fee_show is used for showing details of company invoicing fee.

Return value(s)

This method returns a CompanyFeeParamsOut hash table.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)
  2. Fee ID string (required)
h2. Example code
 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api_net/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9   api_keys[:company_uuid] = "" # Put here UUID of the Company you are acting for
10 
11   result = serv.company_fee_show(api_keys, "Fee ID")
12 
13   if result.status == "OK" 
14     puts result.currency, result.interest, result.reminder_fee, result.paper_fee
15   end
16 
17 rescue Exception => ex 
18   puts ex
19 end

Company fee update

Method company_fee_update is used for updating details of a company invoicing fee for a certain currency.

Return value

This method returns a string with the status.

Arguments

  1. api_keys (required)
  2. fee_id string (required)
  3. CompanyFeeParamsIn (required)

Example code

 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 fee = Hash.new
11 fee[:interest] = "13" 
12 fee[:currency] = "EUR" 
13 fee[:reminder_fee] = "4.50" 
14 fee[:paper_fee] = "6.5" 
15 
16 puts server.company_fee_update(api_keys, "cc1eec9b-5423-4506-9518-f74c16500f97", fee)

Company list

Method company_list is used for listing all the companies user has access to.

Return value(s)

This method returns an array that contains return code as a string and an array of CompanyParamsOut hash tables.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)

Example code

 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9   api_keys[:company_uuid] = "" # Put here UUID of the Company you are acting for
10 
11   # List companies
12   results = serv.company_list(api_keys)
13 
14   if results[0] == "OK" 
15     results[1].each do |result|
16       puts result.id, result.name, result.bid, result.email, result.country
17     end
18   end
19 
20 rescue Exception => ex 
21   puts ex
22 end

Company list

Method company_list is used for listing all the companies user has access to.

Return value

This method returns an array of CompanyParamsOut structs.

Arguments

  1. api_keys (required)

Example code

 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 results = server.company_list(api_keys)
11 
12 if results[0].status == "OK" 
13   results.each do |result|
14     puts result.id, result.name, result.bid, result.email, result.country
15   end
16 end

Company lookup

Method company_lookup is used for searching companies Maventa knows.

Return value(s)

This method returns an array that contains return string and an array of CompanyLookupOut hash tables.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)
  2. Search string (required)

Example code

 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9 
10   # Search companies
11   results = serv.company_lookup(api_keys, "Search string")
12 
13   # Iterate through result set
14   if results[0] == "OK" 
15     results[1].each do |result|
16       # Name
17       puts result.name
18       # Maventa ID
19       puts result.maventa_id
20       # Business ID, VAT
21       puts result.bid
22       # Address line 1
23       puts result.address1
24       # Address line 2
25       puts result.address2
26       # Post code
27       puts result.post_code
28       # Post office
29       puts result.post_office
30       # State
31       puts result.state
32       # Country
33       puts result.country
34       # EDI-code (OVT)
35       puts result.ovt
36     end
37   end
38 end

Company lookup

Method company_lookup is used for finding recipient’s invoicing information.

Return value

This method returns an array of CompanyLookupOut struct.

Arguments

  1. api_keys (required)
  2. search_string string (required, search string can be company BID, name or EDI/OVT-code)

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 results = server.company_lookup(api_keys, "FI1234567")
11 
12 if results[0].status == "OK" 
13   results.each do |result|
14     puts result.name
15     puts result.bid
16     puts result.address1
17     puts result.post_code
18     puts result.post_office
19     puts result.country
20     result.edis.each do |edi_code|
21       puts edi_code
22     end
23   end
24 end

Company lookup .NET

Method company_lookup is used for searching companies Maventa knows.

Return value(s)

This method returns an array of CompanyLookupOut hash tables.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)
  2. Search string (required)

Example code

 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api_net/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9 
10   # Search companies
11   results = serv.company_lookup(api_keys, "Search string")
12 
13   # Iterate through result set
14   # There's always at least one result which contains the status
15   if results[0].status == "OK" 
16     results.each do |result|
17       # Name
18       puts result.name
19       # Maventa ID
20       puts result.maventa_id
21       # Business ID, VAT
22       puts result.bid
23       # Address line 1
24       puts result.address1
25       # Address line 2
26       puts result.address2
27       # Post code
28       puts result.post_code
29       # Post office
30       puts result.post_office
31       # State
32       puts result.state
33       # Country
34       puts result.country
35       # EDI-code (OVT)
36       puts result.ovt
37     end
38   end
39 end

Company settings show

Method company_settings_show is used for showing company setting details.

Return value(s)

This method returns an array that contains return code as a string and CompanySettingsParams hash table.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)

Example code

 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9   api_keys[:company_uuid] = "" # Put here UUID of the Company you are acting for
10 
11   # Show company setting details
12   result = serv.company_settings_show(api_keys)
13 
14   if result[0] == "OK" 
15     puts result[1].acc_man_email, result[1].website, result[1].ipost, result[1].email_remind_freq
16   end
17 
18 rescue Exception => ex 
19   puts ex
20 end

Company settings show

Method company_settings_show is used to view current company settings.

Return value

This method returns a CompanySettingsParams struct.

Arguments

  1. api_keys (required)

Example code

 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.company_settings_show(api_keys)
11 
12 if result.status == "OK" 
13   puts result.acc_man_email, result.website, result.ipost, result.ipost_type, result.email_remind_freq
14 end

Company settings show .NET

Method company_settings_show is used for showing company setting details.

Return value(s)

This method returns a CompanySettingsParams hash table.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)
h2. Example code
 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api_net/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9   api_keys[:company_uuid] = "" # Put here UUID of the Company you are acting for
10 
11   # Show company setting details
12   result = serv.company_settings_show(api_keys)
13 
14   if result.status == "OK" 
15     puts result.acc_man_email, result.website, result.ipost, result.email_remind_freq
16   end
17 
18 rescue Exception => ex 
19   puts ex
20 end

Company settings update

Method company_settings_update is used for updating company settings.

Return value

This method returns a string with the status.

Arguments

  1. api_keys (required)
  2. CompanySettingsParams (required)

Example code

 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 settings = Hash.new
11 settings[:acc_man_email]     = "invoice.receiver@company.com" 
12 settings[:website]           = "http://company.com" 
13 settings[:ipost_request]     = "1" 
14 settings[:ipost_type]        = "1" 
15 settings[:email_remind_freq] = "2" 
16 
17 puts server.company_settings_update(api_keys, settings)

Company show

Method company_show is used for showing company details.

Return value(s)

This method returns an array that contains return code as a string and an CompanyParamsOut hash table.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)

Example code

 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9   api_keys[:company_uuid] = "" # Put here UUID of the Company you are acting for
10 
11   # Show company details
12   result = serv.company_show(api_keys)
13 
14   if result[0] == "OK" 
15     puts result[1].id, result[1].name, result[1].bid, result[1].email, result[1].country
16   end
17 
18 rescue Exception => ex 
19   puts ex
20 end

Company show

Method company_show is used for showing current company information.

Return value

This method returns a CompanyParamsOut struct.

Arguments

  1. api_keys (required)

Example code

 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.company_show(api_keys)
11 
12 if result.status == "OK" 
13   puts result.id, result.name, result.bid, result.email, result.country
14 end

Company show .NET

Method company_show is used for showing company details.

Return value(s)

This method returns a CompanyParamsOut hash table.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)
h2. Example code
 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api_net/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9   api_keys[:company_uuid] = "" # Put here UUID of the Company you are acting for
10 
11   # Show company details
12   result = serv.company_show(api_keys)
13 
14   if result.status == "OK" 
15     puts result.id, result.name, result.bid, result.email, result.country
16   end
17 
18 rescue Exception => ex 
19   puts ex
20 end

Company update

Method company_update is used for updating company details. Changing of company name or email will require a verification of the changes. A verification link will be sent to the user requesting the change. If verification is not done, changes are reverted after 1 hour.

Return value

This method returns a string with the status.

Arguments

  1. api_keys (required)
  2. CompanyParamsIn

Example code

 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 company_info = Hash.new
11 company_info[:name]    = 'Example company - Updated'
12 company_info[:email]   = 'updated@company.com'
13 company_info[:country] = 'FI'
14 
15 puts server.company_update(api_keys, company_info)

Country hash table

1 #Country code
2 member :code, :string
3 #Country name
4 member :name, :string

Country list

Method country_list is used to get list of countries that can be used in your application. List contains abbreviation and common name for countries.

Return value(s)

This method returns an array that contains return string and an array of CountryParamsOut hash tables.

Authentication

This method requires that you have registered to Maventa and received API key.

Arguments

  1. api_keys (required)

Example code

 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9 
10   # List countries
11   results = serv.country_list(api_keys)
12 
13   if results[0] == "OK" 
14     results[1].each do |result|
15       # Country code
16       puts result.code
17       # Country name
18       puts result.name
19     end
20   end
21 end

Country list bravo

Method country_list is used for getting a list of all countries and country codes supported for invoices.

Return value

This method returns an array of CountryParamsOut struct.

Arguments

  1. api_keys (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 results = server.country_list(api_keys)
11 
12 if results[0].status == "OK" 
13   results.each do |result|
14     puts "#{result.name}: #{result.code}" 
15   end
16 end

Currency hash table

1 #Currency name
2 member :name, :string
3 #Currency abbrevation
4 member :abbr, :string
5 #Currency sign
6 member :sign, :string

Currency list

Method currency_list is used for getting list of currencies. List can be used in your application. List contains abbreviation, common name and sign of currencies.

Return value(s)

This method returns an array that contains return string and an array of CurrencyParamsOut hash tables.

Authentication

This method requires that you have registered to Maventa and received an API key.

Arguments

  1. api_keys (required)

Example code

 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9 
10   # List currencies
11   results = serv.currency_list(api_keys)
12 
13   if results[0] == "OK" 
14     results[1].each do |result|
15       # Currency name
16       puts result.name
17       # Currency abbrevation
18       puts result.abbr
19       # Currency sign
20       puts result.sign
21     end
22   end
23 end

Currency list

Method currency_list is used for getting list of all supported currencies and currency codes for invoices.

Return value

This method returns an array of CurrencyParamsOut struct.

Arguments

  1. api_keys (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 results = server.currency_list(api_keys)
11 
12 if results[0].status == "OK" 
13   results.each do |result|
14     puts "#{result.name}: #{result.abbr}" 
15   end
16 end

CustomerParamsIn

 1 #Customer number
 2 member :customer_nr
 3 #Name - *required*
 4 member :name, :string
 5 #Email
 6 member :email, :string
 7 #Business ID, VAT, etc
 8 member :bid, :string
 9 #First line of street address
10 member :address1, :string
11 #Second line of street address
12 member :address2, :string
13 #Postal code
14 member :post_code, :string
15 #Postal office
16 member :post_office, :string
17 #State
18 member :state, :string
19 #Countrycode, see 'country_list'-method (e.g. 'FI')
20 member :country, :string
21 #Contact person's name
22 member :contact_p, :string
23 #Phone number
24 member :phone, :string
25 #GSM number
26 member :gsm, :string
27 #Primary language (e.g. 'FI')
28 member :lang, :string
29 #EDI-code
30 member :ovt, :string

CustomerParamsIn

 1 #Customer number
 2 member :customer_nr
 3 #Name - *required*
 4 member :name, :string
 5 #Email
 6 member :email, :string
 7 #Business ID, VAT, etc
 8 member :bid, :string
 9 #First line of street address
10 member :address1, :string
11 #Second line of street address
12 member :address2, :string
13 #Postal code
14 member :post_code, :string
15 #Postal office
16 member :post_office, :string
17 #State
18 member :state, :string
19 #Countrycode, see 'country_list'-method (e.g. 'FI')
20 member :country, :string
21 #Contact person's name
22 member :contact_p, :string
23 #Phone number
24 member :phone, :string
25 #GSM number
26 member :gsm, :string
27 #Primary language (e.g. 'FI')
28 member :lang, :string
29 #EDI-code (operator can also be given, separated with @ character, e.g. "003712345678@003721291126" 
30 member :ovt, :string
31 #Customer type (PRIVATE or COMPANY), if missing assumed to be COMPANY
32 member :customer_type, :string

Date formats

All dates in Maventa API are strings in Unix epoch YYYYMMDD-format. This format shall be used when communicating through Maventa API.

Encoding

Maventa expects that all content is UTF-8 encoded! Any other format will result as garbage. Maventa does not check or correct your input, and therefore you must make sure that all information is sent using the correct encoding.

More info about UTF-8 from http://www.utf-8.com/

Response Content Type

The response indicates the response type in the HTTP Content-Type header:

XML: Content-Type: text/xml;charset=utf-8


FileAttachment

1 #File data
2 member :file, :base64
3 #File name
4 member :filename, :string
5 #Attachment type (INVOICE_IMAGE, ATTACHMENT)
6 member :attachment_type, :string

FileStatus

1 #Status
2 member :status, :string
3 #Hash of file
4 member :filehash, :string
5 #Filename
6 member :filename, :string

FinvoiceTrx

#Array of file names
member :filenames, :string
#Array of files
member :files, [:base64]

Finvoice laskun luku

Tässä on listattu kentät jotka Maventa lukee Finvoice laskulta. Kentät jotka on merkitty *-merkillä ovat vapaaehtoisia kenttiä Maventan puolesta. Finvoice dokumentit validoidaan aina schemaa vasten. Käytössä on filtteri joka osaa poistaa tavallisimmat pienet virheet kuten ei sallittujen tyhjien rivien poiston (esim. rivi DeliveryOrganisationTaxCode/> poistetaan jos validaatio ei onnistu koska scheman mukaan kyseinen kenttä ei saa olla tyhjä jos se esiintyy laskulla). Kirjautumalla Maventa palveluun voitte testata oman Finvoice materiaalinne sopivuuden palveluun kohdassa Laskut / Testaa XML laskudata. Palvelu antaa pienen esikatselun laskun tiedoista mikäli se validoituu ja muussa tapauksessa virheviestin jonka perusteella voi lähteä tutkimaan vikaa. Ongelmatapauksissa voitte lähettä esimerkkilaskun tukipalveluumme support@maventa.com niin voimme tutkia asiaa tarkemmin.

Listassa on Maventan kentän nimi ja suluissa Finvoicella oleva kentän nimi / kenttien nimet. Näiden lisäksi poimitaan mahdollisesta SOAP-kehyksestä vastaanottajan OVT ja operaattoritunnus niille varauista kentistä (eb:PartyId).

Yleiset tiedot:

Laskunumero (InvoiceNumber)
Laskun päiväys (InvoiceDate)
Eräpäivä (InvoiceDueDate)
Viitenumero (EpiRemittanceInfoIdentifier)
Veroton summa (InvoiceTotalVatExcludedAmount)
Verollinen summa (InvoiceTotalVatIncludedAmount)
*Lisämerkintä/Viesti (SellerFreeText)
*Viitteenne (OrderIdentifier)
*Tilausnumero (OrderIdentifier)
*Toimituspäivämäärä (DeliveryDate)
*Viivästyskorko (PaymentOverDueFinePercent)

Lähettäjän tiedot, tärkeimmät täydennetään Maventan asetuksista jos jotain puuttuu (kuten y-tunnus):

Nimi (SellerOrganisationName)
*Y-tunnus (SellerPartyIdentifier)
*Lähiosoite (SellerStreetName)
*Postinumero (SellerPostCodeIdentifierr)
*Postitoimipaikka (SellerTownName)
*Puhelin (SellerPhoneNumber)
*Kotisivu (SellerWebaddressIdentifier)
*Sähköposti (SellerEmailaddressIdentifier)

Pankkitilitiedot

Tilinumero (IBAN tai kotimainen) (SellerAccountID / EpiAccountID)
Pankki BIC (SellerBic / EpiBfiIdentifier)

Myyjän tiedot (jos myyjätietoja ei erikseen anneta, käytetään laskun luojan tilin asetuksissa olevia tietoja):

Nimi (SellerContactPersonName)
*Sähköposti (SellerEmailaddressIdentifier / SellerCommonEmailaddressIdentifier)
*Puhelin (SellerPhoneNumberIdentifier / SellerPhoneNumber)

Toimitusosoite

Osoite (DeliveryStreetName)
*Postinumero (DeliveryPostCodeIdentifier)
*Postitoimipaikka (DeliveryTownName)
*Maa (CountryCode)

Vastaanottajan tiedot, ensisijaisesti noudetaan InvoiceRecipient tiedot ja jos ne ovat tyhjät käytetään Bueyer-tietoja:

Asiakasnumero (InvoiceRecipientPartyIdentifier / BuyerPartyIdentifier)
*Y-tunnus (InvoiceRecipientOrganisationTaxCode / BuyerOrganisationTaxCode)
Nimi (InvoiceRecipientOrganisationName / BuyerOrganisationName)
Lähiosoite (InvoiceRecipientStreetName / BuyerStreetName)
*Lisäosoite (InvoiceRecipientPostOfficeBoxIdentifier / BuyerPostOfficeBoxIdentifier)
Postinumero (InvoiceRecipientPostCodeIdentifier / BuyerPostCodeIdentifier)
Postitoimipaikka (InvoiceRecipientTownName / BuyerTownName)
Maa (CountryCode)
*Yhteyshenkilö (InvoiceRecipientContactPersonName / BuyerContactPersonName)
*Sähköposti (InvoiceRecipientEmailaddressIdentifier / BuyerEmailaddressIdentifier)
*OVT-tunnus (InvoiceRecipientOrganisationUnitNumber / BuyerOrganisationUnitNumber)

Laskurivin tiedot:

Tuote/palvelu nimike (ArticleName)
*Selite (RowFreeText/RowIdentifier)
Määrä (DeliveredQuantity/ConfirmedQuantity)
á hinta (UnitPriceAmount)
*Yksikkö (QuantityUnitCode)
ALV % (RowVatRatePercent)
*Alennus % (RowDiscountPercent)
Veroton summa (RowVatExcludedAmount)
*Verollinen summa (RowAmount)

HUOM! Laskurivillä täytyy siis olla vähintään tuotenimi, määrä, á hinta, ALV% sekä veroton summa


Get files

Method get_files is used for downloading invoice XML files.

Return value(s)

This method returns an zip file containing the files as SOAP attachment.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api key string (required)
  2. vendor api key string (required)
  3. XML format string (optional) If string is not given, only invoices attachments are returned.

Example code

 1   require 'soap/rpc/driver'
 2   require 'soap/attachment'
 3 
 4   driver = SOAP::RPC::Driver.new('https://trx.maventa.com/', 'files')
 5   driver.add_method('get_files', 'api_key', 'invoice_id', 'xmlformat')
 6 
 7   api_key = "" # put here your personal API key.
 8   invoice_id = "" # put here id of the wanted invoice
 9   xmlformat = "" 
10 
11   incoming_file = driver.get_files(api_key, invoice_id, xmlformat)
12 
13   begin
14     File.open("#{invoice_id}_files.zip", 'wb') do |f|
15         f << incoming_file.values
16     end
17 
18     puts "OK: FILES RECEIVED SUCCESSFULLY" 
19   rescue
20     puts "ERROR: COULD NOT RECEIVE FILES" 
21   end

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

  1. api_keys (required)
  2. timestamp (required, format “YYYYMMDDHHMMSS”)
  3. 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

Get partner transactions

Method get_partner_transactions is used for downloading partner transaction reports for a certain application.

Return value(s)

This method returns an zip file containing the reports as SOAP attachment.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api key string (required)
  2. vendor api key string (required)
  3. Report start date string (required)
  4. Report end date string (required)

Example code

 1   require 'soap/rpc/driver'
 2   require 'soap/attachment'
 3 
 4   driver = SOAP::RPC::Driver.new('https://trx.maventa.com/', 'files')
 5   driver.add_method('get_partner_transactions', 'api_key', 'vendor_api_key', 'date_start', 'date_end')
 6 
 7   api_key = "" # put here your personal API key.
 8   vendor_api_key = "" # put here api key of the wanted application
 9 
10   incoming_file = driver.get_partner_transactions(api_key, vendor_api_key, "YYYYMMDD", "YYYYMMDD")
11 
12   begin
13     File.open("transactions_#{Date.today}.zip", 'wb') do |f|
14         f << incoming_file.values
15     end
16 
17     puts "OK: ZIP RECEIVED SUCCESSFULLY" 
18   rescue
19     puts "ERROR: COULD NOT RECEIVE ZIP" 
20   end

Get pdf

Method get_pdf is used for downloading invoice as PDF document.

Return value(s)

This method returns an pdf documant as SOAP attachment.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. API key string (required)
  2. Invoice ID string (required)

Example code

 1   require 'soap/rpc/driver'
 2   require 'soap/attachment'
 3 
 4   driver = SOAP::RPC::Driver.new('https://trx.maventa.com/', 'files')
 5   driver.add_method('get_pdf', 'api_key', 'invoice_id')
 6 
 7   api_key = "" # put here your personal API key.
 8   invoice_id = "" # put here id of the wanted invoice
 9 
10   incoming_file = driver.get_pdf(api_key, invoice_id)
11 
12   begin
13     File.open("invoice_#{invoice_id}.pdf", 'wb') do |f|
14         f << incoming_file.values
15     end
16 
17     puts "OK: PDF RECEIVED SUCCESSFULLY" 
18   rescue
19     puts "ERROR: COULD NOT RECEIVE PDF" 
20   end

Hello world

Method hello_world is used for testing Maventa API-connection.

Return value(s)

This method returns “Hello world!” string.

Authentication

This method does not need any authentication, nor API key.

Arguments

This method does not take any arguments.

Example code

 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api/wsdl").create_rpc_driver
 4 
 5 begin 
 6   # Lets test are we working at all
 7   result = serv.hello_world
 8   puts result.to_s
 9 end

Hello world

Method hello_world is used for testing Maventa API-connection.

Return value

This method returns a “Hello world!” string.

Arguments

This method does not take any arguments.

Example code

1 require 'soap/wsdlDriver'
2 
3 server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/wsdl").create_rpc_driver
4 puts server.hello_world

How tos


Maventa Developer guide

How to accept invoice

Step-by-step guide

1. Register to Maventa to get your personal API-key.
2. Generate api_keys hash table containing your Personal API key, possible application/vendor API key and company id.
3. List your received invoices using method invoice_list_inbound
4. Iterate through invoice list to get invoice id you want to show/accept
5. Get invoice details with method invoice_show
6. If invoice seems to be ok accept it with method invoice_accept
7. Go into step 4. if you want to accept other invoices or to step 8. if you are done.
8. You’re done.


Maventa Developer guide

How to download invoice as PDF

NOTE! BRAVO API handles files on the same server as other data, this how-to shows how files are received in older API versions

Step-by-step guide

1. Register to Maventa to get your personal API-key.
2. Generate api_keys hash table containing your Personal API key, possible application/vendor API key and company id.
3. List your received invoices using method invoice_list_inbound
4. Iterate through invoice list to get invoice id you want to show
5. Get invoice pdf with method get_pdf
6. You’re done.


Maventa Developer guide

How to list received invoices

Step-by-step guide

1. Register to Maventa to get your personal API-key.
2. Generate api_keys hash table containing your Personal API key, possible application/vendor API key and company id.
3. List your received invoices using method invoice_list_inbound
4. Iterate through invoice list
5. You’re done.


Maventa Developer guide

How to search for company details

Step-by-step guide

1. Register to Maventa to get your personal API-key.
2. Generate api_keys hash table containing your Personal API key, possible application/vendor API key.
3. Get input for string to be used in search. Search is done in NAME and VAT-number/Business ID fields.
4. Search for company details using method company_lookup
5. Iterate through list of companies received.
6. You’re done.


HowTos Maventa Developer guide

How to send invoice

Step-by-step guide

1. Register to Maventa to get your personal API-key.
2. Generate api_keys hash table containing your Personal API key, possible application/vendor API key and company id.
3. Generate array of ItemsIn hash tables containing your invoice items.
4. Generate CustomerParamsIn hash table containing your invoice recipient data.
5. Generate InvoiceParamsIn hash table containing your invoice details.
6. Make request to method invoice_create with parameters generated earlier.
7. If return value is OK, the invoice has been sent to the recipient.
8. You’re done.


Maventa Developer guide

How to show invoice details

Step-by-step guide

1. Register to Maventa to get your personal API-key.
2. Generate api_keys hash table containing your Personal API key, possible application/vendor API key and company id.
3. List your received invoices using method invoice_list_inbound
4. Iterate through invoice list to get invoice id you want to show
5. Get invoice details with method invoice_show
6. You’re done.


InboundInvoiceParamsOut

 1 #Invoice db-id
 2 member :id, :string
 3 #Invoice state
 4 member :state, :int
 5 #Currency abbrevation
 6 member :currency, :string
 7 #Invoice number
 8 member :invoice_nr, :string
 9 #Total sum without tax
10 member :sum, :string
11 #Total sum with tax
12 member :sum_tax, :string
13 #Delivery date, YYYYMMDD
14 member :delivery_date, :string 
15 #Delivery type (e.g. mail)
16 member :delivery_type, :string 
17 #Invoice reference number
18 member :reference_nr, :string
19 #Invoicing date, YYYYMMDD
20 member :date, :string
21 #Invoice due date, YYYYMMDD
22 member :date_due, :string
23 #Reference for customer ("Viitteenne")
24 member :customer_reference, :string
25 #Reference for company ("Viitteemme")
26 member :company_reference, :string
27 #Comment for email invoice
28 member :company_comment, :string
29 #Additional information for invoice
30 member :notes, :string
31 #Language code for invoice (e.g. 'FI')
32 member :lang, :string
33 #Customer number
34 member :customer_nr, :int
35 #Name
36 member :customer_name, :string
37 #Email
38 member :customer_email, :string
39 #Business ID, VAT, etc
40 member :customer_bid, :string
41 #Contact person's name
42 member :customer_contact_p, :string
43 #First line of street address
44 member :customer_address1, :string
45 #Second line of street address
46 member :customer_address2, :string
47 #Postal code
48 member :customer_post_code, :string
49 #Postal office
50 member :customer_post_office, :string
51 #State
52 member :customer_state, :string
53 #Country (e.g. 'FI')
54 member :customer_country, :string
55 #EDI-code (OVT)
56 member :customer_ovt, :string
57 #Attachment file names (semicolon separated)
58 member :attachment, :string
59 #Company information
60 member :company_name, :string
61 member :company_bid, :string
62 member :company_address1, :string
63 member :company_address2, :string
64 member :company_post_code, :string
65 member :company_post_office, :string
66 member :company_city, :string
67 member :company_state, :string
68 member :company_country, :string
69 member :company_phone, :string
70 member :company_gsm, :string
71 member :company_fax, :string
72 member :company_email, :string
73 member :company_website, :string
74 member :company_interest, :string
75 member :company_reminder, :string
76 member :company_paper_fee, :string
77 member :user_name, :string
78 member :user_email, :string
79 member :user_phone, :string

InboundInvoiceParamsOut

#Status
member :status, :string
#Invoice db-id
member :id, :string
#Invoice state
member :state, :int
#Currency abbreviation
member :currency, :string
#Invoice number
member :invoice_nr, :string
#Order number
member :order_nr, :string
#Total sum without tax
member :sum, :string
#Total sum with tax
member :sum_tax, :string
#Delivery date, YYYYMMDD
member :delivery_date, :string 
#Delivery type (e.g. mail)
member :delivery_type, :string 
#Invoice reference number
member :reference_nr, :string
#Invoicing date, YYYYMMDD
member :date, :string
#Invoice due date, YYYYMMDD
member :date_due, :string
#Reference for customer ("Viitteenne")
member :customer_reference, :string
#Reference for company ("Viitteemme")
member :company_reference, :string
#Comment for email invoice
member :company_comment, :string
#Additional information for invoice
member :notes, :string
#Language code for invoice (e.g. 'FI')
member :lang, :string

#Recipient information
member :customer_nr, :int
member :customer_name, :string
member :customer_email, :string
member :customer_bid, :string
member :customer_contact_p, :string
member :customer_address1, :string
member :customer_address2, :string
member :customer_post_code, :string
member :customer_post_office, :string
member :customer_state, :string
member :customer_country, :string
member :customer_ovt, :string

#Beneficiary information
member :company_name, :string
member :company_bid, :string
member :company_address1, :string
member :company_address2, :string
member :company_post_code, :string
member :company_post_office, :string
member :company_city, :string
member :company_state, :string
member :company_country, :string
member :company_phone, :string
member :company_gsm, :string
member :company_fax, :string
member :company_email, :string
member :company_website, :string
member :company_interest, :string
member :company_reminder, :string
member :company_paper_fee, :string

#Seller contact information
member :user_name, :string
member :user_email, :string
member :user_phone, :string

#Invoice item lines, array
member :items, ItemsOut
#Invoice accounts (where payment is done), array
member :accounts, InvoiceAccountParamsOut
#File attachments
member :attachments, FileAttachment

Inbound invoice show

Method inbound_invoice_show is used for getting details of the invoice.

Return value(s)

This method returns an array that contains return code as a string, InboundInvoiceParamsOut hash table and an array of ItemsOut hash tables.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)
  2. Invoice id string
h2. Example code
 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9   api_keys[:company_uuid] = "" # Put here UUID of the Company you are acting for
10 
11   # Show invoice
12   results = serv.inbound_invoice_show(api_keys, "Invoice ID")
13 
14   result = results[1]
15   puts result.id, result.sum, result.sum_tax, result.invoice_nr, result.customer_nr, result.customer_name, result.customer_email, result.customer_bid, result.customer_address1, result.customer_address2, result.customer_post_code, result.customer_post_office, result.customer_state, result.customer_country, result.customer_contact_p, result.customer_ovt, result.customer_operator, result.lang
16 
17 rescue Exception => ex 
18   puts ex
19 end

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

  1. api_keys (required)
  2. id string (invoice id)
  3. include_files boolean (download invoice image and attachments)
  4. xmlformat string (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 

Inbound invoice show .NET

Method inbound_invoice_show is used for getting details of the invoice. Method inbound_invoice_items_show is used for getting details of the invoice’s items. Method inbound_invoice_accounts_show is used for getting details of the invoice’s accounts (the accounts where payment is expected).

Return value(s)

inbound_invoice_show method returns a InboundInvoiceParamsOut hash table, inbound_invoice_items_show method returns an array of ItemsOut hash tables and inbound_invoice_accounts_show returns an array of InvoiceAccountParamsOut hash tables.

Authentication

These methods requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)
  2. Invoice id string (required)

Example code

 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api_net/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9   api_keys[:company_uuid] = "" # Put here UUID of the Company you are acting for
10 
11   # Show invoice
12   result = serv.inbound_invoice_show(api_keys, "Invoice ID")
13   puts result.id, result.sum, result.sum_tax, result.invoice_nr, result.customer_nr, result.customer_name, result.customer_email, result.customer_bid, result.customer_address1, result.customer_address2, result.customer_post_code, result.customer_post_office, result.customer_state, result.customer_country, result.customer_contact_p, result.customer_ovt, result.lang
14 
15   # Show invoices items
16   results = serv.inbound_invoice_items_show(api_keys, "Invoice ID")
17   results.each do |result|
18     puts result.subject, result.unit_type, result.amount, result.price, result.discount, result.definition, result.tax, result.sum, result.sum_tax
19   end
20 
21   # Show invoices accounts
22   results = serv.inbound_invoice_accounts_show(api_keys, "Invoice ID")
23   results.each do |result|
24     puts result.account, result.bank, result.iban, result.swift
25   end
26 
27 rescue Exception => ex 
28   puts ex
29 end

InvoiceAccountParamsOut

1 #Account number
2 member :account, :string
3 #Bank name
4 member :bank, :string
5 #IBAN account number
6 member :iban, :string
7 #SWIFT/BIC
8 member :swift, :string

InvoiceActionParamsOut

1 #Action
2 member :action, :string
3 #Timestamp
4 member :timestamp, :string

InvoiceFile

1 #Status
2 member :status, :string
3 #File data
4 member :file, :base64

InvoiceParamsIn

 1 #Customer maventa ID
 2 member :customer_maventa_id, :string
 3 #Currency abbrevation
 4 member :currency, :string 
 5 #Invoice number
 6 member :invoice_nr, :string
 7 #Total sum without tax
 8 member :sum, :string
 9 #Total sum with tax
10 member :sum_tax, :string
11 #Delivery date, YYYYMMDD
12 member :delivery_date, :string
13 #Delivery type (e.g. mail)
14 member :delivery_type, :string
15 #Invoice reference number
16 member :reference_nr, :string
17 #Invoicing date, YYYYMMDD - *required*
18 member :date, :string
19 #Invoice due date, YYYYMMDD - *required*
20 member :date_due, :string
21 #Reference for customer ("Viitteenne")
22 member :customer_reference, :string
23 #Reference for company ("Viitteemme")
24 member :company_reference, :string
25 #Comment for email invoice
26 member :company_comment, :string
27 #Additional information for invoice
28 member :notes, :string
29 #Language code for invoice (currently 'FI', 'EN' or 'SE')
30 member :lang, :string
31 #Attachment file names (semicolon separated, e.g. "file1.pdf;file2.doc;file3.xls". Files need to be sent to trx-server before invoice is created)
32 member :attachment, :string
33 #Invoice image file name (this is the file that is sent as invoice image to customer, needs to be sent to trx-server before invoice is created)
34 member :invoice_image, :string

#Customer maventa ID
member :customer_maventa_id, :string
#Currency abbrevation (e.g. 'EUR')
member :currency, :string 
#Invoice number
member :invoice_nr, :string
#Order number
member :order_nr, :string
#Total sum without tax
member :sum, :string
#Total sum with tax
member :sum_tax, :string
#Delivery date, YYYYMMDD
member :delivery_date, :string
#Delivery type (e.g. 'MAIL')
member :delivery_type, :string
#Invoice reference number
member :reference_nr, :string
#Invoicing date, YYYYMMDD
member :date, :string
#Invoice due date, YYYYMMDD
member :date_due, :string
#Company's interest rate (e.g. 11.5)
member :company_interest, :string
#Company's reminder fee in invoices currency (e.g. 5.50)
member :company_reminder, :string
#Company's paper fee, added if customer requests paper invoice (e.g. 3.25)
member :company_paper_fee, :string
#Reference for customer ("Viitteenne")
member :customer_reference, :string
#Reference for company ("Viitteemme")
member :company_reference, :string
#Comment for email invoice
member :company_comment, :string
#Additional information for invoice
member :notes, :string
#Company's website, shown on PDF invoice
member :company_website, :string
#Language code for invoice (e.g. 'FI')
member :lang, :string
#Invoice image file name
member :invoice_image, :string
#Customer information
member :customer, CustomerParamsIn
#Invoice item rows array
member :items, ItemsIn
#Beneficiarys postal address
member :company_postal, PostalAddressParamsIn
#File attachments array
member :attachments, FileAttachment
#Bank accounts array
member :bank_accounts, BankAccountParamsIn
#Require signing before send (not yet in use)
member :require_sign, :bool
#Disable sending routes
member :disabled_routes, RouteDisable

InvoiceParamsOut

 1 #Invoice db-id
 2 member :id, :string
 3 #Invoice state
 4 member :state, :int
 5 #Customer db-id NOT USED
 6 #member :customer_id, :string
 7 #Currency abbrevation
 8 member :currency, :string
 9 #Invoice number
10 member :invoice_nr, :string
11 #Total sum without tax
12 member :sum, :string
13 #Total sum with tax
14 member :sum_tax, :string
15 #Delivery date, YYYYMMDD
16 member :delivery_date, :string 
17 #Delivery type (e.g. mail)
18 member :delivery_type, :string 
19 #Invoice reference number
20 member :reference_nr, :string
21 #Invoicing date, YYYYMMDD
22 member :date, :string
23 #Invoice due date, YYYYMMDD
24 member :date_due, :string
25 #Reference for customer ("Viitteenne")
26 member :customer_reference, :string
27 #Reference for company ("Viitteemme")
28 member :company_reference, :string
29 #Comment for email invoice
30 member :company_comment, :string
31 #Additional information for invoice
32 member :notes, :string
33 #Language code for invoice (e.g. 'FI')
34 member :lang, :string
35 #Customer number
36 member :customer_nr, :int
37 #Name
38 member :customer_name, :string
39 #Email
40 member :customer_email, :string
41 #Business ID, VAT, etc
42 member :customer_bid, :string
43 #Contact person's name
44 member :customer_contact_p, :string
45 #First line of street address
46 member :customer_address1, :string
47 #Second line of street address
48 member :customer_address2, :string
49 #Postal code
50 member :customer_post_code, :string
51 #Postal office
52 member :customer_post_office, :string
53 #State
54 member :customer_state, :string
55 #Country (e.g. 'FI')
56 member :customer_country, :string
57 #EDI-code (OVT)
58 member :customer_ovt, :string
59 #Attachment file names (semicolon separated)
60 member :attachment, :string

InvoiceParamsOutBravo

#Status
member :status, :string
#Invoice db-id
member :id, :string
#Invoice state
member :state, :int
#Currency abbrevation
member :currency, :string
#Invoice number
member :invoice_nr, :string
#Order number
member :order_nr, :string
#Total sum without tax
member :sum, :string
#Total sum with tax
member :sum_tax, :string
#Delivery date, YYYYMMDD
member :delivery_date, :string 
#Delivery type (e.g. mail)
member :delivery_type, :string 
#Invoice reference number
member :reference_nr, :string
#Invoicing date, YYYYMMDD
member :date, :string
#Invoice due date, YYYYMMDD
member :date_due, :string
#Company's interest rate (e.g. 11.5)
member :company_interest, :string
#Company's reminder fee in invoices currency (e.g. 5.50)
member :company_reminder, :string
#Company's paper fee, added if customer requests paper invoice (e.g. 3.25)
member :company_paper_fee, :string
#Reference for customer ("Viitteenne")
member :customer_reference, :string
#Reference for company ("Viitteemme")
member :company_reference, :string
#Comment for email invoice
member :company_comment, :string
#Customer comment (from decline invoice)
member :customer_comment, :string
#Additional information for invoice
member :notes, :string
#Language code for invoice (e.g. 'FI')
member :lang, :string
#Customer number
member :customer_nr, :int
#Name
member :customer_name, :string
#Email
member :customer_email, :string
#Business ID, VAT, etc
member :customer_bid, :string
#Contact person's name
member :customer_contact_p, :string
#First line of street address
member :customer_address1, :string
#Second line of street address
member :customer_address2, :string
#Postal code
member :customer_post_code, :string
#Postal office
member :customer_post_office, :string
#State
member :customer_state, :string
#Country (e.g. 'FI')
member :customer_country, :string
#EDI-code (OVT)
member :customer_ovt, :string
#Invoice item lines, array
member :items, ItemsOut
#Invoice accounts (where payment is done), array
member :accounts, InvoiceAccountParamsOut
#Invoice actions, array
member :actions, InvoiceActionParamsOut
#File attachments
member :attachments, FileAttachment

InvoiceState

1 #Status
2 member :status, :string
3 #Invoice id
4 member :invoice_id, :string
5 #Invoice state
6 member :state, :integer

Invoice states:

0 = PENDING / NOT YET SENT
1 = SENT FROM MAVENTA
2 = REJECTED BY CUSTOMER (only possible for email and internally sent invoices)
3 = APPROVED BY CUSTOMER (only possible for email and internally sent invoices)
4 = OVERDUE
5 = PAID (marked by customer, only possible for internally sent invoices)
6 = PAYMENT RECEIVED (marked by sender for archiving)
12 = WAITING SIGN (will not be sent until invoice is signed, not yet in use)
99 = SEND ERROR (invoice could not be delivered, fix customer information and try sending again)


InvoiceStatus

1 #Status
2 member :status, :string
3 #Invoice id
4 member :invoice_id, :string
5 #Array of filestatuses
6 member :file_statuses, FileStatus" class="wiki-page">FileStatus

Invoice accept

Method invoice_accept is used for accepting incoming invoice. This means that the invoice seems to be legit and the contents according to an agreement. The acceptance sends a notification to the invoice sender so they now you have received the invoice.

Return value

This method returns a string with the result (“OK” or “ERROR: @error”).

Arguments

  1. api_keys (required)
  2. Invoice id string (required)

Example code

 1 require 'soap/wsdlDriver'
 2 
 3 require 'soap/wsdlDriver'
 4 
 5 server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/wsdl").create_rpc_driver
 6 
 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 puts server.invoice_accept(api_keys, "00521759-4570-467c-98dd-c496b22de0bc")

Invoice cancel

Method invoice_cancel is used for canceling an invoice already sent which is in state SENT. The only thing this does it set the invoice state to REJECTED so that any e-mail reminders won’t be sent for the invoice. The method cannot cancel invoices relayed to other networks or sent as paper.

Return value

This method returns a string with the result (“OK: INVOICE CANCELED” or “ERROR: @error”).

Arguments

  1. api_keys (required)
  2. Invoice id string (required)

Example code

 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 puts server.invoice_cancel(api_keys, "00521759-4570-467c-98dd-c496b22de0bc")

Invoice confirm

Method invoice_confirm is used for marking an outbound invoice as paid, meaning you have received payment and want to archive the invoice.

Return value

This method returns a string with the status.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)
  2. Invoice id string (required)
  3. Date string (date of payment or nil for current date, format “YYYYMMDD”)

Example code

 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 puts server.invoice_confirm(api_keys, "3b24eff1-50d2-4e67-b16c-8b711e87df15", "20090917")

Invoice create

Method invoice_create is used for sending invoices through SOAP API.

Return value(s)

This method returns an array that contains return code string and id of successfully created invoice or nil in error situations.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)
  2. InvoiceParamsIn (required)
  3. CustomerParamsIn (required)
  4. Array of ItemsIn (required)

Example code

 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9   api_keys[:company_uuid] = "" # Put here UUID of the Company you are acting for
10 
11   # Gather needed data for invoice customer
12   customer = Hash.new
13   customer[:customer_nr] = "2002" 
14   customer[:name] = "Test Customer" 
15   customer[:email] = "invoices@customer.com" 
16   customer[:bid] = "FI1234567" 
17   customer[:address1] = "Customer address" 
18   customer[:address2] = "" 
19   customer[:post_code] = "00100" 
20   customer[:post_office] = "Helsinki" 
21   customer[:state] = "" 
22   customer[:country] = "FI" 
23   customer[:contact_p] = "John Doe" 
24   customer[:lang] = "FI" 
25   customer[:ovt] = "123123123123" 
26 
27   # Gather invoice items into array
28   items_out = Array.new
29 
30   inv_items = Hash.new
31   inv_items[:subject]    = "Test item" 
32   inv_items[:unit_type]  = "pcs" 
33   inv_items[:amount]     = "10" 
34   inv_items[:price]      = "10" 
35   inv_items[:discount]   = "0" 
36   inv_items[:definition] = "" 
37   inv_items[:tax]        = "22" 
38 
39   items_out.push(inv_items)
40 
41   # Gather invoice data
42   invoice = Hash.new
43   invoice[:invoice_nr] = 1001
44   invoice[:reference_nr] = 10014
45   invoice[:date] = "20080405" 
46   invoice[:date_due] = "20080415" 
47   invoice[:currency] = "EUR" 
48   invoice[:sum] = "100.00" 
49   invoice[:sum_tax] = "122.00" 
50 
51   # Create the invoice
52   result = serv.invoice_create(api_keys, invoice, customer, items_out)
53 
54   puts result
55 rescue Exception => ex 
56   puts ex
57 end

Invoice create

Method invoice_create is used for creating new invoices.

Return value

This method returns an InvoiceStatus struct.

Arguments

  1. api_keys (required)
  2. InvoiceParamsIn (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 #Set up customer information
13 customer = Hash.new
14 customer[:customer_nr] = "1001" 
15 customer[:name] = "Test Customer" 
16 customer[:address1] = "Post Address" 
17 customer[:post_code] = "00100" 
18 customer[:post_office] = "TEST" 
19 customer[:country] = "FI" 
20 customer[:lang] = "FI" 
21 customer[:contact_p] = "John Doe" 
22 customer[:email] = "customer@maventa.com" 
23 customer[:bid] = "FI1234567" 
24 customer[:ovt] = "00371111111" 
25 
26 #Set up invoice items
27 items_out = Array.new
28 inv_item = Hash.new
29 inv_item[:subject]    = "Test item" 
30 inv_item[:unit_type]  = "pcs" 
31 inv_item[:amount]     = "1" 
32 inv_item[:price]      = "200" 
33 inv_item[:discount]   = "50" 
34 inv_item[:definition] = "" 
35 inv_item[:tax]        = "22" 
36 inv_item[:sum]        = "100" 
37 inv_item[:sum_tax]    = "122" 
38 items_out.push(inv_item)
39 
40 #Set up attachments
41 attachments_out = Array.new
42 fa = Hash.new
43 fa[:filename] = "invoice_1001.pdf" 
44 fa[:file] = SOAP::Attachment.new(File.new("invoice_1001.pdf"))
45 fa[:attachment_type] = "INVOICE_IMAGE" 
46 attachments_out.push(fa)
47 
48 fa = Hash.new
49 fa[:filename] = "attachment_1001.doc" 
50 fa[:file] = SOAP::Attachment.new(File.new("attachment_1001.doc"))
51 fa[:attachment_type] = "ATTACHMENT" 
52 attachments_out.push(fa)
53 
54 #Set up invoice information
55 invoice = Hash.new
56 invoice[:invoice_nr] = 1001
57 invoice[:date] = "20090915" 
58 invoice[:date_due] = "20090930" 
59 invoice[:currency] = "EUR" 
60 invoice[:notes] = "TEST INVOICE / DO NOT PAY" 
61 invoice[:sum] = "100" 
62 invoice[:sum_tax] = "122" 
63 invoice[:customer] = customer
64 invoice[:items] = items_out
65 invoice[:attachments] = attachments_out
66 
67 #Create the invoice
68 result = server.invoice_create(api_keys, invoice)
69 
70 puts result.status

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             //Create invoice
24             InvoiceParamsIn invoiceOut = new InvoiceParamsIn();
25             invoiceOut.invoice_nr = "1001";
26             invoiceOut.reference_nr = "10016";
27             invoiceOut.date = "20090918";
28             invoiceOut.date_due = "20090925";
29             invoiceOut.sum = "200";
30             invoiceOut.sum_tax = "244";
31             invoiceOut.currency = "EUR";
32             invoiceOut.lang = "FI";
33 
34             //Customer information
35             CustomerParamsIn customerOut = new CustomerParamsIn();
36             customerOut.name = "Test Customer";
37             customerOut.bid = "FI1234567";
38                         customerOut.ovt = "0037111111";
39             customerOut.email = "customer@maventa.com";
40             customerOut.country = "FI";
41             invoiceOut.customer = customerOut;
42 
43             //Invoice items
44             ItemsIn[] itemArray = new ItemsIn[2];
45 
46             ItemsIn itemOut1 = new ItemsIn();
47             itemOut1.item_code = "TST001";
48             itemOut1.subject = "Test item 1";
49             itemOut1.definition = "blue";
50             itemOut1.amount = 1;
51             itemOut1.price = "100";
52             itemOut1.tax = 22;
53             itemOut1.sum = "100";
54             itemOut1.sum_tax = "122";
55             itemOut1.position = 1;
56 
57             ItemsIn itemOut2 = new ItemsIn();
58             itemOut2.item_code = "TST002";
59             itemOut2.subject = "Test item 2";
60             itemOut2.definition = "red";
61             itemOut2.amount = 1;
62             itemOut2.price = "100";
63             itemOut2.tax = 22;
64             itemOut2.sum = "100";
65             itemOut2.sum_tax = "122";
66             itemOut2.position = 2;
67 
68             itemArray[0] = itemOut1;
69             itemArray[1] = itemOut2;
70             invoiceOut.items = itemArray;
71 
72             //File attachments
73             FileAttachment[] fileArray = new FileAttachment[1];
74 
75             FileAttachment attachmentFile1 = new FileAttachment();
76             attachmentFile1.filename = "attachment1.doc";
77             attachmentFile1.file = File.ReadAllBytes("C:\\attachment1.doc");
78             attachmentFile1.attachment_type = "ATTACHMENT";
79 
80             fileArray[0] = attachmentFile1;
81             invoiceOut.attachments = fileArray;
82 
83             //Send invoice
84             InvoiceStatus invoiceResponse = new InvoiceStatus();
85             invoiceResponse = m_server.invoice_create(apiKeys, invoiceOut);
86             MessageBox.Show(invoiceResponse.status);
87         }
88     }
89 }
90 

Example code in PHP

 1 <?php
 2   require 'SOAP/Client.php';
 3   # NOTE! In PHP when using the 'SOAP/Client.php', all WSDL properties need to be present for request to work, use 'null' for values not used.
 4 
 5   $client = new SoapClient('https://testing.maventa.com/apis/bravo/wsdl');
 6 
 7   $api_keys = array();
 8   $api_keys["vendor_api_key"] = null;
 9   $api_keys["user_api_key"] = null;
10   $api_keys["company_uuid"] = null;
11 
12   # Gather needed data for invoice customer
13   $customer = array();
14   $customer["customer_nr"] = "1001";
15   $customer["name"] = "Test Customer";
16   $customer["email"] = "test.customer@maventa.com";
17   $customer["bid"] = "FI12345678";
18   $customer["address1"] = "Customer address";
19   $customer["address2"] = "";
20   $customer["post_code"] = "00100";
21   $customer["post_office"] = "Helsinki";
22   $customer["country"] = "FI";
23   $customer["contact_p"] = "Customer Test";
24   $customer["lang"] = "FI";
25   $customer["customer_type"] = "COMPANY";
26   $customer["state"] = null;
27   $customer["phone"] = null;
28   $customer["gsm"] = null;
29   $customer["ovt"] = null;
30 
31   # Gather invoice items into array
32   # NOTE! Items are an array of arrays
33   $items_out = array();
34 
35   $inv_items = array();
36   $inv_items["position"]   = 1;
37   $inv_items["item_code"]  = "itm0001";
38   $inv_items["subject"]    = "Test item";
39   $inv_items["unit_type"]  = "pcs";
40   $inv_items["amount"]     = 10;
41   $inv_items["price"]      = "10";
42   $inv_items["discount"]   = 0;
43   $inv_items["definition"] = "red";
44   $inv_items["tax"]        = 22;
45   $inv_items["sum"]        = "100";
46   $inv_items["sum_tax"]    = "122";
47 
48   array_push($items_out, $inv_items);
49 
50   # Gather invoice data
51   $invoice = array();
52   $invoice["invoice_nr"] = "1001";
53   $invoice["reference_nr"] = "10012";
54   $invoice["date"] = "20091028";
55   $invoice["date_due"] = "20091104";
56   $invoice["currency"] = "EUR";
57   $invoice["sum"] = "100.00";
58   $invoice["sum_tax"] = "122.00";
59   $invoice["lang"] = "FI";
60   $invoice["order_nr"] = null;
61   $invoice["company_comment"] = null;
62   $invoice["notes"] = null;
63   $invoice["customer_maventa_id"] = null;
64   $invoice["delivery_date"] = null;
65   $invoice["delivery_type"] = null;
66   $invoice["customer_reference"] = null;
67   $invoice["company_reference"] = null;
68   $invoice["company_paper_fee"] = null;
69   $invoice["company_interest"] = null;
70   $invoice["company_reminder"] = null;
71   $invoice["company_website"] = null;
72   $invoice["require_sign"] = null;
73   $invoice["disabled_routes"] = null;
74   $invoice["attachments"] = null;
75   $invoice["bank_accounts"] = null;
76   $invoice["company_postal"] = null;
77 
78   # Assign customer and item info to invoice
79   $invoice["customer"] = $customer;
80   $invoice["items"] = $items_out;
81 
82   $result = $client->invoice_create($api_keys, $invoice);
83   print $result->status;
84 ?>

Invoice decline

Method invoice_decline is used for declining incoming invoice in cases where they contain an error.

Return value(s)

This method returns a string with the result (“OK” or “ERROR: @error”).

Arguments

  1. api_keys (required)
  2. Invoice id string (required)
  3. Message string (why invoice is declined, will be sent to invoice sender by email)

Example code

 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 puts server.invoice_decline(api_keys, "00521759-4570-467c-98dd-c496b22de0bc", "Message, why invoice was declined")

Invoice dispute

Please bear in mind that disputing invoices may lead to legal actions!

You may be looking for Invoice_decline?


Method invoice_dispute is used for disputing invoices in cases where an inbound invoice is deemed to be fraudulent. It will alert the Maventa administrators and actions will be taken.

Return value

This method returns a string with the result (“OK” or “ERROR: @error”).

Arguments

  1. api_keys (required)
  2. Invoice id string (required)
  3. Message string

Example code

 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 puts server.invoice_dispute(api_keys, "00521759-4570-467c-98dd-c496b22de0bc", "Message, why invoice was disputed")

Invoice list

Method invoice_list is used for getting list of invoices.

Return value(s)

This method returns an array that contains return code as a string and an array of InvoiceParamsOut.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)
  2. all boolean (optional)

Example code

 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9   api_keys[:company_uuid] = "" # Put here UUID of the Company you are acting for
10 
11 # List invoices for company
12 results = serv.invoice_list(api_keys)
13 
14 puts results[0]
15 
16 results[1].each do |result|
17     puts result.id, result.sum, result.sum_tax, result.invoice_nr, result.customer_nr, result.customer_name, result.customer_email, result.customer_bid, result.customer_address1, result.customer_address2, result.customer_post_code, result.customer_post_office, result.customer_state, result.customer_country, result.customer_contact_p, result.customer_ovt, result.customer_operator, result.lang
18 
19 rescue Exception => ex 
20   puts ex
21 end

Invoice list

Method invoice_list is used for getting list of outbound invoices.

Return value

This method returns an array of InvoiceParamsOut struct without the ‘items’, ‘accounts’, ‘actions’ and ‘attachments’ members.

Arguments

  1. api_keys (required)
  2. all integer (nil => open invoices, 1 => archived invoices, 2 => all invoices, 3 => invoices in error state)

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 invoices = server.invoice_list(api_keys)
11 
12 if invoices[0].status == "OK" 
13 
14   invoices.each do |invoice|
15     puts invoice.id, invoice.sum, invoice.sum_tax, invoice.invoice_nr, invoice.customer_nr, invoice.customer_name, invoice.customer_email, invoice.customer_bid, invoice.customer_address1, invoice.customer_address2, invoice.customer_post_code, invoice.customer_post_office, invoice.customer_state, invoice.customer_country, invoice.customer_contact_p, invoice.customer_ovt, invoice.lang
16   end
17 
18 end

Invoice list inbound

Method invoice_list_inbound is used for getting list of incoming invoices. List contains only such invoices that aren’t yet returned through API.

Return value(s)

This method returns an array that contains return code as a string and an array of InboundInvoiceParamsOut.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)
  2. all boolean (optional)

Example code

 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9   api_keys[:company_uuid] = "" # Put here UUID of the Company you are acting for
10 
11 # List inbound invoices for company
12 results = serv.invoice_list_inbound(api_keys)
13 
14 puts results[0]
15 
16 results[1].each do |result|
17     puts result.id, result.sum, result.sum_tax, result.invoice_nr, result.customer_nr, result.customer_name, result.customer_email, result.customer_bid, result.customer_address1, result.customer_address2, result.customer_post_code, result.customer_post_office, result.customer_state, result.customer_country, result.customer_contact_p, result.customer_ovt, result.customer_operator, result.lang
18 
19 rescue Exception => ex 
20   puts ex
21 end

Invoice list inbound

Method invoice_list_inbound is used for getting list of inbound invoices.

Return value(s)

This method returns an array of InboundInvoiceParamsOut.

Arguments

  1. api_keys (required)
  2. timestamp string of timestamp (format “YYYYMMDDHHMMSS”, if nil, gets all unseen invoices)

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 invoices = server.invoice_list_inbound(api_keys, "20090916000000")
11 
12 if invoices[0].status == "OK" 
13 
14   invoices.each do |invoice|
15     puts "#{invoice.id} #{invoice.invoice_nr} #{invoice.date}" 
16   end
17 
18 end

Invoice max number

Method invoice_max_number is used for getting the largest invoice number used. Note! This might not work as expected if company uses characters in their invoice numbers.

Return value

This method returns a string with the invoice number.

Arguments

  1. api_keys (required)

Example code in Ruby

 1 require 'soap/wsdlDriver'
 2 
 3 server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/api/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 puts server.invoice_max_number(api_keys)

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 }


Invoice put finvoice

Method invoice_put_finvoice is used for creating new invoices from existing Finvoice XML files or ZIP files with Finvoice XML files and attachments. Since Finvoice XML does not have support for attachment, the method is very strictly defined so that only one XML is allowed per request and all other files are considered attachments. If a PDF document with the same filename as the XML file exists, it is used as invoice image.

Return value

This method returns a InvoiceStatus struct.

Arguments

  1. api_keys (required)
  2. FinvoiceTrx (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 files_out = Hash.new
13 files_out[:files] = []
14 files_out[:filenames] = []
15 
16 files_out[:files] << SOAP::Attachment.new(File.new("finvoice.xml"))
17 files_out[:filenames] << "finvoice.xml" 
18 files_out[:files] << SOAP::Attachment.new(File.new("finvoice.pdf"))
19 files_out[:filenames] << "finvoice.pdf" 
20 
21 result = server.invoice_put_finvoice(api_keys, files_out)
22 puts result.status
23 

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             FinvoiceTrx finvoiceOut = new FinvoiceTrx();
22 
23             //Finvoice method requires that PDF image has the same name as the Finvoice XML file
24             string[] filenameArray = new string[2];
25             filenameArray[0] = "finvoice.xml";
26             filenameArray[1] = "finvoice.pdf";
27 
28             byte[][] fileArray = new byte[2][];
29             fileArray[0] = File.ReadAllBytes("finvoice.xml");
30             fileArray[1] = File.ReadAllBytes("finvoice.pdf");
31 
32             finvoiceOut.filenames = filenameArray;
33             finvoiceOut.files = fileArray;
34 
35             InvoiceStatus result = new InvoiceStatus();
36             result = m_server.invoice_put_finvoice(apiKeyParams, finvoiceOut);
37             MessageBox.Show(result.status);
38         }
39     }
40 }


Invoice revoke

Method invoice_revoke is used for sending invoice credit-note.

Return value(s)

This method returns return code as a string.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)
  2. Invoice id string (required)

Example code

 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9   api_keys[:company_uuid] = "" # Put here UUID of the Company you are acting for
10 
11   # Create a credit-note (minus invoice)
12   result = serv.invoice_revoke(api_keys, "Invoice ID")
13   puts result
14 
15 rescue Exception => ex 
16   puts ex
17 end

Invoice show

Method invoice_show is used for getting details of the invoice.

Return value(s)

This method returns an array that contains return code as a string, InvoiceParamsOut hash table and an array of ItemsOut hash tables.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)
  2. Invoice id string

Example code

 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9   api_keys[:company_uuid] = "" # Put here UUID of the Company you are acting for
10 
11   # Show invoice
12   results = serv.invoice_show(api_keys, "Invoice ID")
13 
14   result = results[1]
15   puts result.id, result.sum, result.sum_tax, result.invoice_nr, result.customer_nr, result.customer_name, result.customer_email, result.customer_bid, result.customer_address1, result.customer_address2, result.customer_post_code, result.customer_post_office, result.customer_state, result.customer_country, result.customer_contact_p, result.customer_ovt, result.customer_operator, result.lang
16 
17 rescue Exception => ex 
18   puts ex
19 end

Invoice show

Method invoice_show is used for getting information about a specific outbound invoice.

Return value

This method returns a InvoiceParamsOut struct.

Arguments

  1. api_keys (required)
  2. id string (invoice id)
  3. include_files boolean (download invoice image and attachments)
  4. xmlformat string (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.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

Invoice show .NET

Method invoice_show is used for getting details of the invoice. Method invoice_items_show is used for getting details of the invoice’s items.

Return value(s)

invoice_show method returns a InvoiceParamsOut hash table and invoice_items_show method returns an array of ItemsOut hash tables.

Authentication

These methods requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)
  2. Invoice id string (required)

Example code

 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api_net/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9   api_keys[:company_uuid] = "" # Put here UUID of the Company you are acting for
10 
11   # Show invoice
12   result = serv.invoice_show(api_keys, "Invoice ID")
13   puts result.id, result.sum, result.sum_tax, result.invoice_nr, result.customer_nr, result.customer_name, result.customer_email, result.customer_bid, result.customer_address1, result.customer_address2, result.customer_post_code, result.customer_post_office, result.customer_state, result.customer_country, result.customer_contact_p, result.customer_ovt, result.lang
14 
15   # Show invoices items
16   results = serv.invoice_items_show(api_keys, "Invoice ID")
17   results.each do |result|
18     puts result.subject, result.unit_type, result.amount, result.price, result.discount, result.definition, result.tax, result.sum, result.sum_tax
19   end
20 
21 rescue Exception => ex 
22   puts ex
23 end

Invoice state list

Method invoice_state_list is used for getting list of states for given set of invoices and can be used to update state of multiple invoices at once.

Return value(s)

This method returns an array of InvoiceState.

Arguments

  1. api_keys (required)
  2. invoices array of strings (invoice ids)

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 invoices = Array.new
11 invoices.push("00521759-4570-467c-98dd-c496b22de0ba")
12 invoices.push("049b161d-4d15-45a9-95f6-f669d26acf51")
13 invoices.push("128dc817-90ae-4fa5-a0af-8e24e7650a72")
14 invoices.push("1c555458-fa83-402b-a1f6-4d22071020a8")
15 invoices.push("505459bf-8507-42ee-b0da-470f2407c96f")
16 invoices.push("5ad8cec7-ef53-4161-b9e1-da1921b29f43")
17 
18 result = server.invoice_state_list(api_keys, invoices)
19 if result[0].status == "OK" 
20   result.each do |i|
21     puts "#{i.invoice_id}: #{i.state}" 
22   end
23 end

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

  1. api_keys (required)
  2. xml_invoice base64 (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

ItemsIn

 1 #Item code
 2 member :item_code, :string
 3 #Subject string - *required*
 4 member :subject, :string
 5 #Type of item (e.g. 'hours')
 6 member :unit_type, :string
 7 #Amount of items - *required*
 8 member :amount, :double
 9 #Price per item - *required*
10 member :price, :string
11 #Discount percentage (e.g. 12.5)
12 member :discount, :double
13 #Additional definition for item
14 member :definition, :string
15 #Tax for item (e.g. 22) - *required*
16 member :tax, :double
17 #Sum without tax for item row (e.g. '123.45') - *required*
18 member :sum, :string
19 #Sum with tax for item row (e.g. '123.45') - *required*
20 member :sum_tax, :string
21 #Position in item list 
22 member :position, :int

ItemsOut

 1 #Item code
 2 member :item_code, :string
 3 #Subject string
 4 member :subject, :string
 5 #Type of item (e.g. 'hours')
 6 member :unit_type, :string
 7 #Amount of items
 8 member :amount, :double
 9 #Price per item
10 member :price, :string
11 #Discount percentage (e.g. 12.5)
12 member :discount, :double
13 #Additional definition for item
14 member :definition, :string
15 #Tax for item (e.g. 22)
16 member :tax, :double
17 #Sum for item row (e.g. '123.45')
18 member :sum, :string
19 #Sum with tax for item row (e.g. '123.45')
20 member :sum_tax, :string
21 #Position in item list 
22 member :position, :int

LanguageParamsOut

1 #Language code
2 member :code, :string
3 #Language name
4 member :name, :string

Language list

Method language_list is used for getting list on languages. List contains common name and an abbreviation for languages.

Return value(s)

This method returns an array that contains return string and an array of LanguageParamsOut hash tables.

Authentication

This method requires that you have registered to Maventa and received API key.

Arguments

  1. api_keys (required)

Example code

 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9 
10   # List languages
11   results = serv.language_list(api_keys)
12 
13   if results[0] == "OK" 
14     results[1].each do |result|
15       # Language code
16       puts result.code
17       # Language name
18       puts result.name
19     end
20   end
21 end

Maventa Developer guide

Current production version: BRAVO (released: 12/2009)
PLEASE VISIT http://www.maventa.com/en/community/maventa-api/ for a documentation on more recent versions of the API

The Maventa API is a set of interfaces for accessing your Maventa account data using HTTP and XML. The API makes it easy to create web and desktop applications that integrate with your account.

Some potential application ideas:

  • Integrating your financial package (SAP, MS Dynamics / Axapta, QuickBooks, Peachtree) to the Maventa Service
  • Custom import tools (SalesForce, QuickBooks, CSV, etc.)
  • Automatic time-based invoice creation
  • Accounting, Revenue analysis, Budgeting, Factoring and Claiming Services
  • External integration with online payment gateways

Read these before beginning:


Maventa API


API Callable Methods for version ALPHA

Note! Please consider upgrading to the BRAVO Api. If you have additional support requirements regarding the ALPHA Api version, please contact with your enquiry.

This documentation currently applies to the WSDL at:

Testing: https://testing.maventa.com/api_net/wsdl/
Production: https://secure.maventa.com/api_net/wsdl/

NOTE! Some of the examples may have other end points, make sure you use the right one.

Hello world!

  1. hello_world

LISTINGS

  1. List bank accounts: bank_account_list_net
  2. List for countries: country_list_net
  3. List for currencies: currency_list_net
  4. List company fees: company_fee_list_net
  5. List companies where user is registered: company_list_net
  6. List for languages: language_list_net
  7. List for relay operators: relay_operator_list_net
  8. List invoices: invoice_list_net
  9. List inbound invoices: invoice_list_inbound_net
  10. List users: user_list_net
  11. List postal addresses: postal_address_list_net

COMPANYLOOKUP

  1. Lookup for company information: company_lookup_net

INVOICES

  1. Create a new invoice: invoice_create_net
  2. Create a credit-note (minus invoice): invoice_revoke
  3. Show invoice, needs invoice db-id: invoice_show_net
  4. Show inbound invoice data: inbound_invoice_show_net
  5. Mark invoice as paid: invoice_confirm
  6. Accept invoice (inbound): invoice_accept
  7. Decline invoice (inbound): invoice_decline
  8. Dispute invoice (inbound): invoice_dispute

USERS

  1. Create a new user: user_create
  2. Update user: user_update
  3. Delete user: user_delete
  4. Show user: user_show_net

COMPANIES

  1. Update company: company_update
  2. Show company: company_show_net
  3. Show company settings: company_settings_show_net
  4. Update company settings: company_settings_update
  5. Show a company fee: company_fee_show_net
  6. Create a new company fee: company_fee_create
  7. Update a company fee: company_fee_update
  8. Delete a company fee: company_fee_delete

BANK ACCOUNTS

  1. Create a new bank account: bank_account_create
  2. Update bank account: bank_account_update
  3. Delete bank account: bank_account_delete
  4. Show bank account: bank_account_show_net

POSTAL ADDRESSES

  1. Create postal address: postal_address_create
  2. Update postal address: postal_address_update
  3. Delete postal address: postal_address_delete
  4. Show postal address: postal_address_show_net

File handling

  1. Get invoice PDF: get_pdf
  2. Get partner transactions: get_partner_transactions
  3. Get files: get_files
  4. Upload invoice as XML file (supported formats: TEAPPSXML, OIOXML, Finvoice): put_xml
  5. Upload multiple invoices in one ZIP file: put_zip
  6. Upload attachment to an invoice: put_attachment

Return values for API version ALPHA

A word with a @-sign in front is a changing variable in the return values
Return values inside square brackets [ ] are arrays

All methods can fail with these errors:
  • “ERROR: VENDOR API KEY DISABLED” Software vendor has disabled the use of this vendor api key
  • “ERROR: USER HAS NO RIGHTS TO COMPANY” Current user has no rights to company with id given in ‘company_uuid’
  • “ERROR: USER BELONGS TO MULTIPLE COMPANIES, NO COMPANY ID GIVEN” No ‘company_uuid’ given
  • “ERROR: USER NOT FOUND” API key not found
  • “ERROR: COMPANY ACCOUNT IS LOCKED” Company’s account has been locked for some reason (e.g. too many disputes)
  • “ERROR: COMPANY HAS NOT COMPLETED FIRST TIME WIZARD” API won’t work until the user that registered for Maventa has completed the first time wizard
hello_world
  • “Hello world!”
country_list currency_list language_list relay_operator_list company_lookup
  • [CompanyLookupOut] An array of CompanyLookupOut which match the search string given
invoice_create
  • [[InvoiceStatus]] InvoiceStatus
  • The “status” of the InvoiceStatus object can be one of the following:
  • “ERROR: FILE @file NOT FOUND, INVOICE WAS NOT CREATED” An attachment was specified in the creation call but no file with that name was found
  • “ERROR: CUSTOMER COMPANY NOT FOUND WITH MAVENTA ID ’@maventaid’” Maventa ID given for customer but no such id exists
  • “ERROR: NO CUSTOMER INFORMATION FOUND” No customer information given (maventa_id or the whole CustomerParamsOut)
  • “ERROR: CUSTOMER COUNTRY CODE INVALID” Country code given in customer information is nit supported
  • “ERROR: COMPANY HAS NO POSTAL ADDRESS” Company has no postal address set
  • “ERROR: LANGUAGE @lang IS NOT VALID” Given language is not supported
  • “ERROR: DATE FORMAT INVALID FOR INVOICE DATE” Invalid date format
  • “ERROR: DATE FORMAT INVALID FOR DUE DATE” Invalid date format
  • “ERROR: DATE FORMAT INVALID FOR DELIVERY DATE” Invalid date format
  • “ERROR: NO ITEMS FOUND” No items in items array, invoice needs at least one item
  • “ERROR: AN ITEM IS NOT VALID” An item does not have all required values (subject, price, amount, tax, sum, sum_tax)
  • “ERROR: UNKNOWN ERROR” Something unexpected happened, please contact support with timestamp of request
  • “ERROR: COULD NOT CREATE INVOICE” Invoice saving failed for some reason, please contact support with timestamp of request
  • “OK: INVOICE CREATED” Everything went OK and invoice will be sent

Bravo specific:

  • “ERROR: COMPANY HAS NO POSTAL ADDRESS AND NO ADDRESS GIVEN” Company has no postal address set or given in request
  • “ERROR: INVALID FILE ATTACHMENT ATTACHMENT_TYPE” Currently allowed ATTACHMENT_TYPEs are: “ATTACHMENT”, “INVOICE_IMAGE”, “FINVOICE”, “TEAPPS”, “OIO”
  • “ERROR: FILENAME CONTAINS INVALID CHARACTERS” Only letters, numbers, underscore and dot are allowed in file names
  • “ERROR: INVALID FILETYPE ’@filename’ (allowed doc, xls, tif, jpg, gif, txt, xml, xsl, html, htm, pdf)” Allowed attachment types
  • “ERROR: ALL SEND ROUTES DISABLED” disabled_routes is 111 which leads to invoice not being sent at all
invoice_revoke
  • ERROR: INVOICE NOT FOUND OR NO RIGHTS Given invoice_id was not found or user has no rights to it
  • ERROR: COULD NOT CREATE CREDIT NOTE Something went wrong
  • ERROR: DELIVERY FAILED (NOT ENOUGH INFORMATION OF CUSTOMER) Invoice created but sending failed, no route found to customer
  • OK: INVOICE SENT Everything went OK and invoice revocation has been sent
invoice_list invoice_list_inbound invoice_show invoice_confirm
  • ERROR: INVOICE NOT FOUND OR NO RIGHTS Given invoice_id was not found or user has no rights to it
  • ERROR: COULD NOT MARK INVOICE AS PAID Could not save invoice for some reason
  • OK: INVOICE MARKED AS PAID Invoice successfully marked as paid
invoice_accept
  • ERROR: INVOICE NOT FOUND OR NO RIGHTS Given invoice_id was not found or user has no rights to it
  • ERROR: INVOICE STATE DOES NOT ALLOW ACCEPTANCE Invoice state is not “SENT” which is the only state from which invoice can be accepted
  • ERROR: COULD NOT ACCEPT INVOICE Could not save invoice for some reason
  • OK: INVOICE ACCEPTED Invoice accepted successfully
invoice_decline
  • ERROR: INVOICE NOT FOUND OR NO RIGHTS Given invoice_id was not found or user has no rights to it
  • ERROR: INVOICE STATE DOES NOT ALLOW ACCEPTANCE Invoice state is not “SENT” which is the only state from which invoice can be declined
  • ERROR: COULD NOT DECLINE INVOICE Could not save invoice for some reason
  • OK: INVOICE DECLINED Invoice declined successfully
invoice_dispute
  • ERROR: INVOICE NOT FOUND OR NO RIGHTS Given invoice_id was not found or user has no rights to it
  • ERROR: INVOICE STATE DOES NOT ALLOW ACCEPTANCE Invoice state is not “SENT” which is the only state from which invoice can be disputed
  • ERROR: COULD NOT DISPUTE INVOICE Could not save invoice for some reason
  • OK: INVOICE DISPUTED Invoice disputed successfully
user_create
  • OK: USER SAVED User created and activation email sent
  • ERROR: NO RIGHTS TO ADD USERS Only admin user can add new users
  • ERROR: @errormessage Error message with validation errors for the user
user_update
  • ERROR: USER NOT FOUND User with given user_id was not found
  • ERROR: NO RIGHTS TO USER Only the user in question or an admin can update user information
  • ERROR: USER COULD NOT BE SAVED User could not be saved for some reason
  • OK: USER SAVED User updated successfully
user_delete
  • ERROR: USER NOT FOUND User with given user_id was not found
  • ERROR: NO RIGHTS TO USER Only an admin can delete users
  • ERROR: CANNOT DELETE YOURSELF User cannot delete himself
  • ERROR: COULD NOT DELETE USER User could not be deleted for somea reason
  • OK: USER DELETED FROM COMPANY User deleted successfully
user_list user_show company_update
  • ERROR: COUNTRY CODE INVALID Given country code does not exist or is not supported
  • ERROR: @errormessage Validation errors
  • ERROR: NO RIGHTS TO CHANGE SETTINGS Only admin user can change settings
  • OK: COMPANY SAVED Company details updated successfully
company_list company_show company_settings_show company_settings_update
  • ERROR: NO RIGHTS TO CHANGE SETTINGS Only admin user can change settings
  • ERROR: COULD NOT SAVE SETTINGS Could not save settings for some reason
  • OK: SETTINGS SAVED Settings saved successfully
company_fee_list company_fee_show company_fee_create
  • ERROR: INVALID CURRENCY FOR COMPANY FEE Given currency not supported
  • ERROR: COMPANY ALREADY HAS FEE FOR CURRENCY @currency Company can only have one fee per currency
  • ERROR: @error Exception handling
  • OK: COMPANY FEE SAVED Company fee saved successfully
company_fee_update
  • ERROR: COMPANY FEE NOT FOUND OR NO RIGHTS CompanyFee with given id does not exist for current company
  • ERROR: INVALID CURRENCY FOR COMPANY FEE Given currency not supported
  • ERROR: COMPANY ALREADY HAS FEE FOR CURRENCY @currency Company can only have one fee per currency
  • ERROR: @error Exception handling
  • OK: COMPANY FEE SAVED Company fee saved successfully
company_fee_delete
  • ERROR: COMPANY FEE NOT FOUND OR NO RIGHTS CompanyFee with given id does not exist for current company
  • ERROR: COULD NOT DELETE COMPANY FEE Failed to delete company fee
  • OK: COMPANY FEE DELETED Company fee deleted successfully
bank_account_create
  • ERROR: @errormessage Error message with validation errors for the bank account
  • OK: ACCOUNT SAVED Account created successfully
bank_account_update
  • ERROR: ACCOUNT NOT FOUND OR NO RIGHTS BankAccount with given id does not exist for current company
  • ERROR: @errormessage Error message with validation errors for the bank account
  • OK: ACCOUNT SAVED Account updated successfully
bank_account_delete
  • ERROR: ACCOUNT NOT FOUND OR NO RIGHTS BankAccount with given id does not exist for current company
  • ERROR: COULD NOT DELETE ACCOUNT Could not delete account
  • OK: ACCOUNT DELETED Account deleted successfully
bank_account_list bank_account_show postal_address_create
  • ERROR: COUNTRY CODE INVALID Given country code does not exist or is not supported
  • ERROR: COMPANY ALREADY HAS ADDRESS INFORMATION FOR @country / @lang Company can only have one postal address for each country and language pair
  • ERROR: @errormessage Error message with validation errors for the postal address
  • OK: POSTAL ADDRESS SAVED Postal address created successfully
postal_address_update
  • ERROR: POSTAL ADDRESS NOT FOUND OR NO RIGHTS Given postal_address_id not found for current company
  • ERROR: COUNTRY CODE INVALID Given country code does not exist or is not supported
  • ERROR: COMPANY ALREADY HAS ADDRESS INFORMATION FOR @country / @lang Company can only have one postal address for each country and language pair
  • ERROR: @errormessage Error message with validation errors for the postal address
  • OK: POSTAL ADDRESS SAVED Postal address updated successfully
postal_address_delete
  • ERROR: POSTAL ADDRESS NOT FOUND OR NO RIGHTS Given postal_address_id not found for current company
  • ERROR: COULD NOT DELETE POSTAL ADDRESS Postal address could not be deleted
  • OK: POSTAL ADDRESS DELETED Postal address deleted successfully
postal_address_list postal_address_show get_pdf
  • ERROR: INVOICE NOT FOUND Invoice not found for given invoice_id
  • ERROR: USER NOT FOUND FOR API KEY User not found for given API key
  • ERROR: COULD NOT CREATE PDF PDF creation failed for some reason
  • ERROR: USER HAS NO RIGHTS TO INVOICE Invoice does not belong to current company
  • SOAP Attachment If all goes well, return value is a SOAP Attachment with the name “invoice.pdf”
get_partner_transactions
  • ERROR: USER NOT FOUND FOR API KEY User not found for given API key
  • ERROR: VENDOR API KEY NOT FOUND @vendor_api_key Given vendor API key was not found
  • ERROR: USER HAS NO RIGHTS TO VENDOR API KEY Vendor API key does not belong to user’s company
  • SOAP Attachment If all goes well, return value is a SOAP Attachment with the name
get_files
  • ERROR: INVOICE NOT FOUND Invoice not found for given invoice_id
  • ERROR: USER NOT FOUND FOR API KEY User not found for given API key
  • ERROR: COULD NOT CREATE FILES Could not create files for some reason
  • ERROR: USER HAS NO RIGHTS TO INVOICE Invoice does not belong to current company
  • SOAP Attachment If all goes well, return value is a SOAP Attachment with the name “@invoice_nr.zip”
put_xml
  • ERROR: USER NOT FOUND FOR API KEY User not found for given API key
  • ERROR: COMPANY NOT FOUND OR NO RIGHTS User does not belong to given company_uuid
  • ERROR: NO VALID XML INVOICE FOUND File is not a valid XML invoice or is not supported
  • ERROR: FILENAME IS NOT AN XML Filename must be .xml
  • OK: INVOICE CREATED SUCCESSFULLY OK, an invoice created from the XML sent
put_zip
  • ERROR: USER NOT FOUND FOR API KEY User not found for given API key
  • ERROR: COMPANY NOT FOUND OR NO RIGHTS User does not belong to given company_uuid
  • ERROR: INVALID ZIP FILE Could not open the zip file
  • ERROR: NO VALID XML INVOICE FOUND No valid XML invoice found in zip
  • ERROR: FILE IS NOT A ZIP Filename must be .zip
  • ERROR: @error Exception handling
  • OK: INVOICE CREATED OK, at least one invoice was created
put_attachment
  • ERROR: USER NOT FOUND FOR API KEY User not found for given API key
  • ERROR: COMPANY NOT FOUND OR NO RIGHTS User does not belong to given company_uuid
  • ERROR: INVALID FILETYPE ’@filetype’ (allowed doc, xls, tif, jpg, gif, txt, xml, xsl, html, htm, pdf) Invalid filetype for attachment
  • ERROR: @error Exception handling
  • OK: FILE ’@filename’ RECEIVED File saved to company’s incoming files and can be added to an invoice

Overview

The Maventa API consists of a set of callable methods, and some API endpoints.

To perform an action using the Maventa API, you need to select a calling convention, send a request to its endpoint specifying a method and some arguments, and will receive a formatted response.

All request formats, listed on the API Callable Methods, take a list of named parameters.

The REQUIRED parameter api_key is used to specify your API Keys and Company ID.

The arguments, responses and examples for each method are listed on the method’s spec page. Methods are listed on the API index page.

Note: The format of the IDs can change over time, so relying on the current format may cause you problems in the future.

Take it for a spin in our demo environment:

1. Register an account https://testing.maventa.com

  • Invoices are not relayed from the test servers (except for email notification invoices, so please use own email addresses when testing)!
  • The database of the testing server may be emptied without notice

2. The SOAP Server Endpoint URL for testing is https://testing.maventa.com/apis/bravo/wsdl/


Partner trx list

Method partner_trx_list is used for getting a list of all transactions from given software between given dates (defined by software API key).

Return value

This method returns a TrxListResponse struct.

Arguments

  1. api_keys (required)
  2. date_start string (required, start date for report, format “YYYYMMDD”)
  3. date_end string (required, end date for report, format “YYYYMMDD”)
  4. csv_file boolean (if set, returns also a CSV file with the same information)

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.partner_trx_list(api_keys, "20090901", "20090917", true)
11 
12 if result.status == "OK" 
13   result.trx_list_items.each do |item|
14     puts "#{item.timestamp}: #{item.customer_name} (#{item.customer_bid}) - #{item.invoice_nr}: #{item.action}" 
15   end
16   File.open("trxlist.csv", 'wb') do |f|
17     f << result.file
18   end
19 end

PostalAddressParamsIn

 1 #Country by ISO-code (e.g. 'FI') - *required*
 2 member :country, :string
 3 #Language code (e.g. 'EN')
 4 member :lang, :string
 5 #Address line 1 - *required*
 6 member :address1, :string
 7 #Address line 2
 8 member :address2, :string
 9 #Postal code - *required*
10 member :post_code, :string
11 #Post office - *required*
12 member :post_office, :string
13 #City
14 member :city, :string
15 #State (if any)
16 member :state, :string
17 #Phone number for this country
18 member :phone, :string
19 #GSM number for this country
20 member :gsm, :string
21 #Fax number for this country
22 member :fax, :string
23 #Is this the default address? (used if no other existing country/lang combination matches customer's)
24 member :default, :bool

PostalAddressParamsOut

 1 #PostalAddres db-id
 2 member :id, :string
 3 #Country by ISO-code (e.g. 'FI')
 4 member :country, :string
 5 #Language code (e.g. 'EN')
 6 member :lang, :string
 7 #Address line 1
 8 member :address1, :string
 9 #Address line 2
10 member :address2, :string
11 #Postal code
12 member :post_code, :string
13 #Post office
14 member :post_office, :string
15 #City
16 member :city, :string
17 #State (if any)
18 member :state, :string
19 #Phone number for this country
20 member :phone, :string
21 #GSM number for this country
22 member :gsm, :string
23 #Fax number for this country
24 member :fax, :string
25 #Is this the default address?
26 member :default, :bool

Postal address create

Method postal_address_create is used for adding a postal address for the company.

Return value

This method returns a string with the status.

Arguments

  1. api_keys (required)
  2. PostalAddressParamsIn (required)

Example code

 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 postal_address = Hash.new
11 postal_address[:address1]    = "Company address" 
12 postal_address[:address2]    = "" 
13 postal_address[:post_code]   = "00100" 
14 postal_address[:post_office] = "Helsinki" 
15 postal_address[:city]        = "Helsinki" 
16 postal_address[:state]       = "" 
17 postal_address[:country]     = "FI" 
18 
19 puts server.postal_address_create(api_keys, postal_address)

Postal address delete

Method postal_address_delete is used for deleting postal address.

Return value

This method returns a string with the status

Arguments

  1. api_keys (required)
  2. postal_address_id (required)

Example code

 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 puts server.postal_address_delete(api_keys, "bc645d0c-64ed-4ad2-a8eb-bfc2af00ed46")

Postal address list

Method postal_address_list is used for listing all the company’s postal addresses.

Return value(s)

This method returns an array that contains return code as a string and an array of PostalAddressParamsOut hash tables.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)

Example code

 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9   api_keys[:company_uuid] = "" # Put here UUID of the Company you are acting for
10 
11   # List all postal addresses for company
12   results = serv.postal_address_list(api_keys)
13 
14   results[1].each do |result|
15     puts result.id, result.address1, result.address2, result.post_code, result.post_office, result.city, result.state, result.country
16   end
17 
18 rescue Exception => ex 
19   puts ex
20 end

Postal address list

Method postal_address_list is used for listing all the company’s postal addresses.

Return value

This method returns an array of PostalAddressParamsOut structs.

Arguments

  1. api_keys (required)

Example code

 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 results = server.postal_address_list(api_keys)
11 
12 if results[0].status == "OK" 
13   results.each do |result|
14     puts result.id, result.address1, result.address2, result.post_code, result.post_office, result.city, result.state, result.country
15   end
16 end

Postal address show

Method postal_address_show is used for showing postal address details.

Return value(s)

This method returns an array that contains return code as a string and PostalAddressParamsOut hash table.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)
  2. Postal address ID string (required)

Example code

 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9   api_keys[:company_uuid] = "" # Put here UUID of the Company you are acting for
10 
11   # Show single postal address
12   result = serv.postal_address_show(api_keys, "Postal address ID")
13 
14   puts result[1].id, result[1].address1, result[1].address2, result[1].post_code, result[1].post_office, result[1].city, result[1].state, result[1].country
15 
16 rescue Exception => ex 
17   puts ex
18 end

Postal address show bravo

Method postal_address_list is used displaying information for a specific postal address.

Return value

This method returns a PostalAddressParamsOut struct.

Arguments

  1. api_keys (required)
  2. postal_address_id (required)

Example code

 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.postal_address_show(api_keys, "bc645d0c-64ed-4ad2-a8eb-bfc2af00ed46")
11 
12 if result.status == "OK" 
13   puts result.id, result.address1, result.address2, result.post_code, result.post_office, result.city, result.state, result.country
14 end

Postal address show .NET

Method postal_address_show is used for showing postal address details.

Return value(s)

This method returns a [PostalAddressParamsOut] hash table.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)
  2. Postal address ID string (required)

Example code

 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api_net/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9   api_keys[:company_uuid] = "" # Put here UUID of the company you are acting for, if you 
10 
11   # Show single postal address
12   result = serv.postal_address_show(api_keys, "Postal address ID")
13 
14   if result.status == "OK" 
15     puts result.id, result.address1, result.address2, result.post_code, result.post_office, result.city, result.state, result.country
16   end
17 
18 rescue Exception => ex 
19   puts ex
20 end

Postal address update

Method postal_address_update is used for updating an existing postal address.

Return value

This method returns a string with the status.

Arguments

  1. api_keys (required)
  2. postal_address_id string (required)
  3. PostalAddressParamsIn (required)

Example code

 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 postal_address = Hash.new
11 postal_address[:address1]    = "Company address updated" 
12 postal_address[:address2]    = "" 
13 postal_address[:post_code]   = "00100" 
14 postal_address[:post_office] = "Helsinki" 
15 postal_address[:city]        = "Helsinki" 
16 postal_address[:state]       = "" 
17 postal_address[:country]     = "FI" 
18 
19 puts server.postal_address_update(api_keys, "bc645d0c-64ed-4ad2-a8eb-bfc2af00ed46", postal_address)

Put attachment

Method put_attachment is used for uploading attachments to an invoice.

Return value(s)

This method returns return code as a string.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. API key string (required)
  2. Company ID string (required)
  3. Filename string (required)
  4. File as SOAP attachment (required)

Example code

 1   require 'soap/rpc/driver'
 2   require 'soap/attachment'
 3 
 4   driver = SOAP::RPC::Driver.new('https://trx.maventa.com/', 'files')
 5   driver.add_method('put_attachment', 'api_key', 'company_uuid', 'name', 'file')
 6 
 7   api_key = "" # put here your personal API key.
 8   company_uuid = # company uuid
 9   attachment = SOAP::Attachment.new(File.open(name))
10   invoice_id = "Invoice ID" 
11 
12   puts driver.put_attachment(api_key, company_uuid, name, attachment)

Put XML

Method put_xml is used for uploading invoice XML files.

Return value(s)

This method returns return code as a string.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. API key string (required)
  2. Company ID string (required)
  3. Filename string (required)
  4. File as SOAP attachment (required)

Example code

 1   require 'soap/rpc/driver'
 2   require 'soap/attachment'
 3 
 4   driver = SOAP::RPC::Driver.new('https://trx.maventa.com/', 'files')
 5   driver.add_method('put_xml', 'api_key', 'company_uuid', 'name', 'file', 'vendor_api_key')
 6 
 7   api_key = "" # put here your personal API key.
 8   company_uuid = "" # company UUID
 9   vendor_api_key = "" # vendor API key
10 
11   attachment = SOAP::Attachment.new(File.open(name))
12 
13   puts driver.put_xml(api_key, company_uuid, name, attachment, vendor_api_key)

Put zip

Method put_zip is used for uploading multiple invoice XML files in zip file.

Return value(s)

This method returns return code as a string.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. API key string (required)
  2. Company ID string (required)
  3. Filename string (required)
  4. File as SOAP attachment (required)

Example code

 1   require 'soap/rpc/driver'
 2   require 'soap/attachment'
 3 
 4   driver = SOAP::RPC::Driver.new('https://trx.maventa.com/', 'files')
 5   driver.add_method('put_zip', 'api_key', 'company_uuid', 'name', 'file', 'vendor_api_key')
 6 
 7   api_key = "" # put here your personal API key.
 8   company_uuid = "" # company UUID
 9   vendor_api_key = "" # vendor API key
10   attachment = SOAP::Attachment.new(File.open(name))
11 
12   puts driver.put_zip(api_key, company_uuid, name, attachment, vendor_api_key)

Register

Method register can be used to register new companies trough the API. This method is only for partners and requires a partner software API key. Partner must make sure the user can read and understand the Maventa license agreements.

Return value

This method returns a RegistrationParamsOut struct which includes the new user’s API key, the company’s UUID and Maventa ID. This information can then be automatically updated to the software’s settings so the users do not need to input API key information by themselves.

Arguments

  1. RegistrationParamsIn (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 registration_params = Hash.new
 6 
 7 #Vendor API key needs to be set and valid for register request to work
 8 registration_params[:vendor_api_key] = "bccd8e6e-fc64-427a-b1b2-3c3ab578e370" 
 9 
10 #License agreement needs to be agreed, vendor makes sure user can read the agreement
11 registration_params[:license_agreement] = true
12 
13 #Company name and BID/VAT
14 registration_params[:company_name] = "API TEST" 
15 registration_params[:company_bid] = "FI12345671" 
16 
17 #Company has VAT code or no
18 registration_params[:no_vat] = true
19 
20 #User information, activation email with password is sent to this email address
21 registration_params[:user_first_name] = "API" 
22 registration_params[:user_last_name] = "TEST" 
23 registration_params[:user_email] = "apitest@maventa.com" 
24 registration_params[:user_phone] = "040 123 4566" 
25 
26 #Company address information
27 registration_params[:address1] = "Test Street 1" 
28 registration_params[:address2] = "Section C" 
29 registration_params[:post_code] = "00100" 
30 registration_params[:post_office] = "HELSINKI" 
31 registration_params[:city] = "Helsinki" 
32 registration_params[:state] = nil
33 registration_params[:country] = "FI" 
34 
35 #Bank account information, not mandatory since account information can be given in the invoice_create request when using the new API
36 bank_account_params = Array.new
37 
38 ba1 = Hash.new
39 ba1[:bank] = "TESTBANK 1" 
40 ba1[:iban] = "F1111 1221121" 
41 ba1[:swift] = "TSTBNKFI" 
42 ba1[:account] = "12222-42211" 
43 ba1[:default] = true
44 
45 ba2 = Hash.new
46 ba2[:bank] = "TESTBANK 2" 
47 ba2[:iban] = "F222 2221222" 
48 ba2[:swift] = "TSTBNKFI" 
49 ba2[:account] = "222122-42221" 
50 
51 bank_account_params << ba1
52 bank_account_params << ba2  
53 
54 registration_params[:bank_accounts] = bank_account_params
55 
56 result = server.register(registration_params)
57 
58 if result.status == "OK" 
59   puts "User API key: #{result.user_api_key}" 
60   puts "Company UUID: #{result.company_uuid}" 
61   puts "Company Maventa ID: #{result.company_maventa_id}" 
62 end

RegistrationParamsIn

member :vendor_api_key, :string
member :license_agreement, :boolean
member :company_name, :string
member :company_bid, :string
member :company_email, :string
member :no_vat, :boolean

#User information
member :user_first_name, :string
member :user_last_name, :string
member :user_email, :string
member :user_phone, :string

#Company postal address
member :address1, :string
member :address2, :string
member :post_code, :string
member :post_office, :string
member :city, :string
member :state, :string
member :country, :string

#Bank accounts
member :bank_accounts, BankAccountParamsIn

RegistrationParamsOut

1 member :status, :string
2 member :user_api_key, :string
3 member :company_uuid, :string
4 member :company_maventa_id, :string

Relay operator hash table

1 #Operator code
2 member :code, :string
3 
4 #Operator name
5 member :name, :string

Relay operator list

Method relay_operator_list is used for getting list of known relay oprators. List can be used in your application. List contains abbreviation and common name of relay operators.

Return value(s)

This method returns an array that contains return string and an array of RelayOperatorParamsOut hash tables.

Authentication

This method requires that you have registered to Maventa and received API key.

Arguments

  1. api_keys (required)

Example code

 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9 
10   # List relay operators
11   results = serv.relay_operator_list(api_keys)
12 
13   if results[0] == "OK" 
14     results[1].each do |result|
15       # Operator code
16       puts result.code
17       # #Operator name
18       puts result.name
19     end
20   end
21 end

Request formats

Supported request formats

Are there any other request formats at the moment?

No.


Return values for Bravo API

A word with a @-sign in front is a changing variable in the return values
Return values inside square brackets [ ] are arrays

All methods can fail with these errors:
  • ERROR: VENDOR API KEY DISABLED Software vendor has disabled the use of this vendor api key
  • ERROR: USER HAS NO RIGHTS TO COMPANY Current user has no rights to company with id given in ‘company_uuid’
  • ERROR: USER BELONGS TO MULTIPLE COMPANIES, NO COMPANY ID GIVEN No ‘company_uuid’ given and user has access to multiple companies
  • ERROR: COULD NOT FIND USER API key not found
  • ERROR: COMPANY ACCOUNT IS LOCKED Company’s account has been locked for some reason (e.g. too many disputes)
  • ERROR: COMPANY HAS NOT COMPLETED FIRST TIME WIZARD API won’t work until the user that registered for Maventa has completed the first time wizard
hello_world_bravo
  • “Hello world!”
country_list_bravo currency_list_bravo company_lookup_bravo invoice_create_bravo
  • [[InvoiceStatus]] InvoiceStatus
  • The “status” of the InvoiceStatus object can be one of the following:
  • “ERROR: NO ITEMS FOUND” items parameter empty
  • “ERROR: CUSTOMER COMPANY NOT FOUND WITH MAVENTA ID ’@maventaid’” Maventa ID given for customer but no such id exists
  • “ERROR: NO CUSTOMER INFORMATION FOUND” No customer information given (maventa_id or the whole CustomerParamsOut)
  • “ERROR: COMPANY HAS NO POSTAL ADDRESS AND NO ADDRESS GIVEN” Company has no postal address set or no postal address given in request
  • “ERROR: LANGUAGE @lang IS NOT VALID” Given language is not supported
  • “ERROR: DATE FORMAT INVALID FOR INVOICE DATE” Invalid date format
  • “ERROR: DATE FORMAT INVALID FOR DUE DATE” Invalid date format
  • “ERROR: DATE FORMAT INVALID FOR DELIVERY DATE” Invalid date format
  • “ERROR: AN ITEM IS NOT VALID” One of the given items fails validation (items need subject, amount, price, tax, sum and sum_tax attributes)
  • “ERROR: INVALID FILE ATTACHMENT ATTACHMENT_TYPE” Valid attachment types are: “ATTACHMENT”, “INVOICE_IMAGE”, “FINVOICE”, “TEAPPS” and “OIO”
  • “ERROR: FILENAME CONTAINS INVALID CHARACTERS”
  • “ERROR: INVALID FILETYPE ’#{fa.filename}’ (allowed doc, xls, tif, jpg, gif, txt, xml, xsl, html, htm, pdf)”
  • “ERROR: COULD NOT CREATE INVOICE” Invoice saving failed for some reason
  • “OK: INVOICE CREATED” Everything went OK and invoice was created
invoice_list_bravo invoice_list_inbound_bravo invoice_show_bravo invoice_confirm
  • ERROR: INVOICE NOT FOUND OR NO RIGHTS Given invoice_id was not found or user has no rights to it
  • ERROR: COULD NOT MARK INVOICE AS PAID Could not save invoice for some reason
  • OK: INVOICE MARKED AS PAID Invoice successfully marked as paid
invoice_accept
  • ERROR: INVOICE NOT FOUND OR NO RIGHTS Given invoice_id was not found or user has no rights to it
  • ERROR: INVOICE STATE DOES NOT ALLOW ACCEPTANCE Invoice state is not “SENT” which is the only state from which invoice can be accepted
  • ERROR: COULD NOT ACCEPT INVOICE Could not save invoice for some reason
  • OK: INVOICE ACCEPTED Invoice accepted successfully
invoice_decline
  • ERROR: INVOICE NOT FOUND OR NO RIGHTS Given invoice_id was not found or user has no rights to it
  • ERROR: INVOICE STATE DOES NOT ALLOW ACCEPTANCE Invoice state is not “SENT” which is the only state from which invoice can be declined
  • ERROR: COULD NOT DECLINE INVOICE Could not save invoice for some reason
  • OK: INVOICE DECLINED Invoice declined successfully
invoice_dispute
  • ERROR: INVOICE NOT FOUND OR NO RIGHTS Given invoice_id was not found or user has no rights to it
  • ERROR: INVOICE STATE DOES NOT ALLOW ACCEPTANCE Invoice state is not “SENT” which is the only state from which invoice can be disputed
  • ERROR: COULD NOT DISPUTE INVOICE Could not save invoice for some reason
  • OK: INVOICE DISPUTED Invoice disputed successfully
user_create
  • OK: USER SAVED User created and activation email sent
  • ERROR: NO RIGHTS TO ADD USERS Only admin user can add new users
  • ERROR: @errormessage Error message with validation errors for the user
user_update
  • ERROR: USER NOT FOUND User with given user_id was not found
  • ERROR: NO RIGHTS TO USER Only the user in question or an admin can update user information
  • ERROR: USER COULD NOT BE SAVED User could not be saved for some reason
  • OK: USER SAVED User updated successfully
user_delete
  • ERROR: USER NOT FOUND User with given user_id was not found
  • ERROR: NO RIGHTS TO USER Only an admin can delete users
  • ERROR: CANNOT DELETE YOURSELF User cannot delete himself
  • ERROR: COULD NOT DELETE USER User could not be deleted for somea reason
  • OK: USER DELETED FROM COMPANY User deleted successfully
user_list_bravo user_show_bravo company_update
  • ERROR: COUNTRY CODE INVALID Given country code does not exist or is not supported
  • ERROR: @errormessage Validation errors
  • ERROR: NO RIGHTS TO CHANGE SETTINGS Only admin user can change settings
  • OK: COMPANY SAVED Company details updated successfully
company_list_bravo company_show_bravo company_settings_show_bravo company_settings_update
  • ERROR: NO RIGHTS TO CHANGE SETTINGS Only admin user can change settings
  • ERROR: COULD NOT SAVE SETTINGS Could not save settings for some reason
  • OK: SETTINGS SAVED Settings saved successfully
company_fee_list_bravo company_fee_show_bravo company_fee_create
  • ERROR: INVALID CURRENCY FOR COMPANY FEE Given currency not supported
  • ERROR: COMPANY ALREADY HAS FEE FOR CURRENCY @currency Company can only have one fee per currency
  • ERROR: @error Exception handling
  • OK: COMPANY FEE SAVED Company fee saved successfully
company_fee_update
  • ERROR: COMPANY FEE NOT FOUND OR NO RIGHTS CompanyFee with given id does not exist for current company
  • ERROR: INVALID CURRENCY FOR COMPANY FEE Given currency not supported
  • ERROR: COMPANY ALREADY HAS FEE FOR CURRENCY @currency Company can only have one fee per currency
  • ERROR: @error Exception handling
  • OK: COMPANY FEE SAVED Company fee saved successfully
company_fee_delete
  • ERROR: COMPANY FEE NOT FOUND OR NO RIGHTS CompanyFee with given id does not exist for current company
  • ERROR: COULD NOT DELETE COMPANY FEE Failed to delete company fee
  • OK: COMPANY FEE DELETED Company fee deleted successfully
bank_account_create
  • ERROR: @errormessage Error message with validation errors for the bank account
  • OK: ACCOUNT SAVED Account created successfully
bank_account_update
  • ERROR: ACCOUNT NOT FOUND OR NO RIGHTS BankAccount with given id does not exist for current company
  • ERROR: @errormessage Error message with validation errors for the bank account
  • OK: ACCOUNT SAVED Account updated successfully
bank_account_delete
  • ERROR: ACCOUNT NOT FOUND OR NO RIGHTS BankAccount with given id does not exist for current company
  • ERROR: COULD NOT DELETE ACCOUNT Could not delete account
  • OK: ACCOUNT DELETED Account deleted successfully
bank_account_list_bravo
  • [[BankAccountParamsOut]]] An array with BankAccountParamsOut
bank_account_show_bravo
  • [BankAccountParamsOut]] BankAccountParamsOut
postal_address_create
  • ERROR: COUNTRY CODE INVALID Given country code does not exist or is not supported
  • ERROR: COMPANY ALREADY HAS ADDRESS INFORMATION FOR @country / @lang Company can only have one postal address for each country and language pair
  • ERROR: @errormessage Error message with validation errors for the postal address
  • OK: POSTAL ADDRESS SAVED Postal address created successfully
postal_address_update
  • ERROR: POSTAL ADDRESS NOT FOUND OR NO RIGHTS Given postal_address_id not found for current company
  • ERROR: COUNTRY CODE INVALID Given country code does not exist or is not supported
  • ERROR: COMPANY ALREADY HAS ADDRESS INFORMATION FOR @country / @lang Company can only have one postal address for each country and language pair
  • ERROR: @errormessage Error message with validation errors for the postal address
  • OK: POSTAL ADDRESS SAVED Postal address updated successfully
postal_address_delete
  • ERROR: POSTAL ADDRESS NOT FOUND OR NO RIGHTS Given postal_address_id not found for current company
  • ERROR: COULD NOT DELETE POSTAL ADDRESS Postal address could not be deleted
  • OK: POSTAL ADDRESS DELETED Postal address deleted successfully
postal_address_list_bravo postal_address_show_bravo

Return values

A word with a @-sign in front is a changing variable in the return values
Return values inside square brackets [ ] are arrays
Because of WSDL type specification some return values are in the form of an array with a message as the first item and nil/null as the second for all methods that return an array, if the method only returns a string, that will be the error message

All methods can fail with these errors:
  • ERROR: VENDOR API KEY DISABLED Software vendor has disabled the use of this vendor api key
  • ERROR: USER HAS NO RIGHTS TO COMPANY Current user has no rights to company with id given in ‘company_uuid’
  • ERROR: USER BELONGS TO MULTIPLE COMPANIES, NO COMPANY ID GIVEN No ‘company_uuid’ given
  • ERROR: COULD NOT FIND USER API key not found
  • ERROR: COMPANY ACCOUNT IS LOCKED Company’s account has been locked for some reason (e.g. too many disputes)
  • ERROR: COMPANY HAS NOT COMPLETED FIRST TIME WIZARD API won’t work until the user that registered for Maventa has completed the first time wizard
hello_world
  • “Hello world!”
country_list
  • [“OK”, [CountryParamsOut]] An array including an “OK”-string and an array of CountryParamsOut
currency_list
  • [“OK”, [CurrencyParamsOut]] An array including an “OK”-string and an array of CurrencyParamsOut
language_list
  • [“OK”, [LanguageParamsOut]] An array including an “OK”-string and an array of LanguageParamsOut
relay_operator_list
  • [“OK”, [RelayOperatorParamsOut]] An array including an “OK”-string and an array of RelayOperatorParamsOut
company_lookup
  • [“OK”, [CompanyLookupOut]] An array including an “OK”-string and an array of CompanyLookupOut which match the search string given
invoice_create
  • [“ERROR: USER DAILY INVOICE LIMIT (@limit) REACHED”, nil] User API key can have a daily limit for created invoices
  • [“ERROR: VENDOR API KEY DAILY INVOICE LIMIT (@limit) REACHED”, nil] Vendor API key can have a daily limit for created invoices
  • [“ERROR: GLOBAL DAILY INVOICE LIMIT (@limit) REACHED”, nil] If user and vendor limits are not set, global limit is used
  • [“ERROR: FILE @file NOT FOUND, INVOICE WAS NOT CREATED”, nil] An attachment was specified in the creation call but no file with that name was found
  • [“ERROR: CUSTOMER COMPANY NOT FOUND WITH MAVENTA ID ’@maventaid’”, nil] Maventa ID given for customer but no such id exists
  • [“ERROR: NO CUSTOMER INFORMATION FOUND”, nil] No customer information given (maventa_id or the whole CustomerParamsOut)
  • [“ERROR: COMPANY HAS NO POSTAL ADDRESS”, nil] Company has no postal address set
  • [“ERROR: LANGUAGE @lang IS NOT VALID”, nil] Given language is not supported
  • [“ERROR: DATE FORMAT INVALID FOR INVOICE DATE”, nil] Invalid date format
  • [“ERROR: DATE FORMAT INVALID FOR DUE DATE”, nil] Invalid date format
  • [“ERROR: DATE FORMAT INVALID FOR DELIVERY DATE”, nil] Invalid date format
  • [“ERROR: COULD NOT CREATE INVOICE”, nil] Invoice saving failed for some reason
  • [“OK: INVOICE CREATED”, @invoice.id] Everything went OK and invoice will be sent
invoice_revoke
  • ERROR: INVOICE NOT FOUND OR NO RIGHTS Given invoice_id was not found or user has no rights to it
  • ERROR: COULD NOT CREATE CREDIT NOTE Something went wrong
  • ERROR: DELIVERY FAILED (NOT ENOUGH INFORMATION OF CUSTOMER) Invoice created but sending failed, no route found to customer
  • OK: INVOICE SENT Everything went OK and invoice has been sent
invoice_list
  • [“OK”, [InvoiceParamsOut]] An array including an “OK”-string and an array of InvoiceParamsOut
  • [“ERROR: @error”, nil] An array including “ERROR” and an exception message, second array item is nil
invoice_list_inbound
  • [“OK”, [InvoiceParamsOut]] An array including an “OK”-string and an array of InvoiceParamsOut
  • [“ERROR: @error”, nil] Exception handling
invoice_show
  • [“ERROR: INVOICE NOT FOUND OR NO RIGHTS”, nil] Given invoice_id was not found or user has no rights to it
  • [“ERROR: @error”, nil, nil] Exception handling
  • [“OK”, InvoiceParamsOut, [ItemsOut]] “OK”-message, InvoiceParamsOut, array with ItemsOut
invoice_confirm
  • ERROR: INVOICE NOT FOUND OR NO RIGHTS Given invoice_id was not found or user has no rights to it
  • ERROR: COULD NOT MARK INVOICE AS PAID Could not save invoice for some reason
  • OK: INVOICE MARKED AS PAID Invoice successfully marked as paid
invoice_accept
  • ERROR: INVOICE NOT FOUND OR NO RIGHTS Given invoice_id was not found or user has no rights to it
  • ERROR: INVOICE STATE DOES NOT ALLOW ACCEPTANCE Invoice state is not “SENT” which is the only state from which invoice can be accepted
  • ERROR: COULD NOT ACCEPT INVOICE Could not save invoice for some reason
  • OK: INVOICE ACCEPTED Invoice accepted successfully
invoice_decline
  • ERROR: INVOICE NOT FOUND OR NO RIGHTS Given invoice_id was not found or user has no rights to it
  • ERROR: INVOICE STATE DOES NOT ALLOW ACCEPTANCE Invoice state is not “SENT” which is the only state from which invoice can be declined
  • ERROR: COULD NOT DECLINE INVOICE Could not save invoice for some reason
  • OK: INVOICE DECLINED Invoice declined successfully
invoice_dispute
  • ERROR: INVOICE NOT FOUND OR NO RIGHTS Given invoice_id was not found or user has no rights to it
  • ERROR: INVOICE STATE DOES NOT ALLOW ACCEPTANCE Invoice state is not “SENT” which is the only state from which invoice can be disputed
  • ERROR: COULD NOT DISPUTE INVOICE Could not save invoice for some reason
  • OK: INVOICE DISPUTED Invoice disputed successfully
user_create
  • OK: USER SAVED User created and activation email sent
  • ERROR: NO RIGHTS TO ADD USERS Only admin user can add new users
  • ERROR: @errormessage Error message with validation errors for the user
user_update
  • ERROR: USER NOT FOUND User with given user_id was not found
  • ERROR: NO RIGHTS TO USER Only the user in question or an admin can update user information
  • ERROR: USER COULD NOT BE SAVED User could not be saved for some reason
  • OK: USER SAVED User updated successfully
user_delete
  • ERROR: USER NOT FOUND User with given user_id was not found
  • ERROR: NO RIGHTS TO USER Only an admin can delete users
  • ERROR: CANNOT DELETE YOURSELF User cannot delete himself
  • ERROR: COULD NOT DELETE USER User could not be deleted for somea reason
  • OK: USER DELETED FROM COMPANY User deleted successfully
user_list
  • [“ERROR: @error” , nil] Exception handling
  • [“OK”, [UserParamsOut]] Array with OK and an array with UserParamsOut
user_show
  • [“ERROR: USER NOT FOUND”, nil] User with given user_id was not found
  • [“ERROR: NO RIGHTS TO USER”, nil] User does not belong to current company
  • [“ERROR: @error” , nil] Exception handling
  • [“OK”, UserParamsOut] Array with OK and UserParamsOut
company_update
  • ERROR: COUNTRY CODE INVALID Given country code does not exist or is not supported
  • ERROR: @errormessage Validation errors
  • ERROR: NO RIGHTS TO CHANGE SETTINGS Only admin user can change settings
  • OK: COMPANY SAVED Company details updated successfully
company_list
  • [“ERROR: @error”, nil] Exception handling
  • [“OK”, [CompanyParamsOut]] Array with OK message and an array with CompanyParamsOut
company_show
  • [“ERROR: @error”, nil] Exception handling
  • [“OK”, CompanyParamsOut] Array with OK message and CompanyParamsOut
company_settings_show
  • [“ERROR: @error”, nil] Exception handling
  • [“OK”, CompanySettingsParams] Array with OK message and CompanySettingsParams
company_settings_update
  • ERROR: NO RIGHTS TO CHANGE SETTINGS Only admin user can change settings
  • ERROR: COULD NOT SAVE SETTINGS Could not save settings for some reason
  • OK: SETTINGS SAVED Settings saved successfully
company_fee_list
  • [“ERROR: @error”, nil] Exception handling
  • [“OK”, [CompanyFeeParamsOut]] Array with OK message and an array with CompanyFeeParamsOut
company_fee_show
  • [“ERROR: COMPANY FEE NOT FOUND OR NO RIGHTS”, nil] CompanyFee with given id does not exist for current company
  • [“ERROR: @error”, nil] Exception handling
  • [“OK”, CompanyFeeParamsOut] Array with OK message and CompanyFeeParamsOut
company_fee_create
  • ERROR: INVALID CURRENCY FOR COMPANY FEE Given currency not supported
  • ERROR: COMPANY ALREADY HAS FEE FOR CURRENCY @currency Company can only have one fee per currency
  • ERROR: @error Exception handling
  • OK: COMPANY FEE SAVED Company fee saved successfully
company_fee_update
  • ERROR: COMPANY FEE NOT FOUND OR NO RIGHTS CompanyFee with given id does not exist for current company
  • ERROR: INVALID CURRENCY FOR COMPANY FEE Given currency not supported
  • ERROR: COMPANY ALREADY HAS FEE FOR CURRENCY @currency Company can only have one fee per currency
  • ERROR: @error Exception handling
  • OK: COMPANY FEE SAVED Company fee saved successfully
company_fee_delete
  • ERROR: COMPANY FEE NOT FOUND OR NO RIGHTS CompanyFee with given id does not exist for current company
  • ERROR: COULD NOT DELETE COMPANY FEE Failed to delete company fee
  • OK: COMPANY FEE DELETED Company fee deleted successfully
bank_account_create
  • ERROR: @errormessage Error message with validation errors for the bank account
  • OK: ACCOUNT SAVED Account created successfully
bank_account_update
  • ERROR: ACCOUNT NOT FOUND OR NO RIGHTS BankAccount with given id does not exist for current company
  • ERROR: @errormessage Error message with validation errors for the bank account
  • OK: ACCOUNT SAVED Account updated successfully
bank_account_delete
  • ERROR: ACCOUNT NOT FOUND OR NO RIGHTS BankAccount with given id does not exist for current company
  • ERROR: COULD NOT DELETE ACCOUNT Could not delete account
  • OK: ACCOUNT DELETED Account deleted successfully
bank_account_list
  • [“ERROR: @error”, nil] Exception handling
  • [“OK”, [BankAccountParamsOut]] Array with OK and an array with BankAccountParamsOut
bank_account_shoW
  • [“ERROR: ACCOUNT NOT FOUND OR NO RIGHTS”, nil] BankAccount with given id does not exist for current company
  • [“ERROR: @error”, nil] Exception handling
  • [“OK”, BankAccountParamsOut] Array with OK and BankAccountParamsOut
postal_address_create
  • ERROR: COUNTRY CODE INVALID Given country code does not exist or is not supported
  • ERROR: COMPANY ALREADY HAS ADDRESS INFORMATION FOR @country / @lang Company can only have one postal address for each country and language pair
  • ERROR: @errormessage Error message with validation errors for the postal address
  • OK: POSTAL ADDRESS SAVED Postal address created successfully
postal_address_update
  • ERROR: POSTAL ADDRESS NOT FOUND OR NO RIGHTS Given postal_address_id not found for current company
  • ERROR: COUNTRY CODE INVALID Given country code does not exist or is not supported
  • ERROR: COMPANY ALREADY HAS ADDRESS INFORMATION FOR @country / @lang Company can only have one postal address for each country and language pair
  • ERROR: @errormessage Error message with validation errors for the postal address
  • OK: POSTAL ADDRESS SAVED Postal address updated successfully
postal_address_delete
  • ERROR: POSTAL ADDRESS NOT FOUND OR NO RIGHTS Given postal_address_id not found for current company
  • ERROR: COULD NOT DELETE POSTAL ADDRESS Postal address could not be deleted
  • OK: POSTAL ADDRESS DELETED Postal address deleted successfully
postal_address_list
  • [“ERROR: @error”, nil] Exception handling
  • [“OK”, [PostalAddressParamsOut]] Array with OK and an array with PostalAddressParamsOut
postal_address_show
  • [“ERROR: POSTAL ADDRESS NOT FOUND OR NO RIGHTS”, nil] Given postal_address_id not found for current company
  • [“ERROR: @error”, nil] Exception handling
  • [“OK”, PostalAddressParamsOut] Array with OK and PostalAddressParamsOut
get_pdf
  • ERROR: INVOICE NOT FOUND Invoice not found for given invoice_id
  • ERROR: USER NOT FOUND FOR API KEY User not found for given API key
  • ERROR: COULD NOT CREATE PDF PDF creation failed for some reason
  • ERROR: USER HAS NO RIGHTS TO INVOICE Invoice does not belong to current company
  • SOAP Attachment If all goes well, return value is a SOAP Attachment with the name “invoice.pdf”
get_partner_transactions
  • ERROR: USER NOT FOUND FOR API KEY User not found for given API key
  • ERROR: VENDOR API KEY NOT FOUND @vendor_api_key Given vendor API key was not found
  • ERROR: USER HAS NO RIGHTS TO VENDOR API KEY Vendor API key does not belong to user’s company
  • SOAP Attachment If all goes well, return value is a SOAP Attachment with the name
get_files
  • ERROR: INVOICE NOT FOUND Invoice not found for given invoice_id
  • ERROR: USER NOT FOUND FOR API KEY User not found for given API key
  • ERROR: COULD NOT CREATE FILES Could not create files for some reason
  • ERROR: USER HAS NO RIGHTS TO INVOICE Invoice does not belong to current company
  • SOAP Attachment If all goes well, return value is a SOAP Attachment with the name “@invoice_nr.zip”
put_xml
  • ERROR: USER NOT FOUND FOR API KEY User not found for given API key
  • ERROR: COMPANY NOT FOUND OR NO RIGHTS User does not belong to given company_uuid
  • ERROR: NO VALID XML INVOICE FOUND File is not a valid XML invoice or is not supported
  • ERROR: FILENAME IS NOT AN XML Filename must be .xml
  • OK: INVOICE CREATED SUCCESSFULLY OK, an invoice created from the XML sent
put_zip
  • ERROR: USER NOT FOUND FOR API KEY User not found for given API key
  • ERROR: COMPANY NOT FOUND OR NO RIGHTS User does not belong to given company_uuid
  • ERROR: INVALID ZIP FILE Could not open the zip file
  • ERROR: NO VALID XML INVOICE FOUND No valid XML invoice found in zip
  • ERROR: FILE IS NOT A ZIP Filename must be .zip
  • ERROR: @error Exception handling
  • OK: INVOICE CREATED OK, at least one invoice was created
put_attachment
  • ERROR: USER NOT FOUND FOR API KEY User not found for given API key
  • ERROR: COMPANY NOT FOUND OR NO RIGHTS User does not belong to given company_uuid
  • ERROR: INVALID FILETYPE ’@filetype’ (allowed doc, xls, tif, jpg, gif, txt, xml, xsl, html, htm, pdf) Invalid filetype for attachment
  • ERROR: @error Exception handling
  • OK: FILE ’@filename’ RECEIVED File saved to company’s incoming files and can be added to an invoice

RouteDisable

RouteDisable can be used to disable some sending routes. E.g. if you have a customer who only wishes to receive their invoices as paper, you can disable email and relay sending altogether by setting them true. Then Maventa will only try to send the invoice by the last available option which is paper.

NOTE! Internal delivery in the Maventa network cannot be disabled and is always the prefered option.

1 #Disable email sending
2 member :email, :boolean
3 #Disable paper sending
4 member :paper, :boolean
5 #Disable electronic relaying
6 member :relay, :boolean

Server time

Method server_time is used for getting current server time for timestamping purposes.

Return value

This method returns a string with the current server time (format “YYYYMMDDHHMMSS”)

Arguments

This method does not take any arguments.

Example code

1 require 'soap/wsdlDriver'
2 
3 server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/wsdl").create_rpc_driver
4 puts server.server_time

SOAP

SOAP Introduction

SOAP is a XML based end-to-end application layer protocol. SOAP messages are used when message-level security is desired. The message contains all the necessary information to protect itself and can contain optional Quality Of Service (QOS) attributes (for reliable messaging, transactions, security, etc). This meta-data information is recorded as a part of SOAP Message header. With security information in the message header, end to end security can be enforced as compared to Transport Layer Security (TLS/SSL) which is hop to hop. SOAP requests are “envelopes” of specially formatted XML data posted to a URL. You can find out more about SOAP at www.w3.org/TR/soap/.

About web services

Example SOAP-Envelope

 1  <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
 2   <SOAP-ENV:Envelope
 3    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
 4    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
 5    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" 
 6    xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" 
 7    xmlns:xsd="http://www.w3.org/1999/XMLSchema">
 8     <SOAP-ENV:Body>
 9         <ns1:getEmployeeDetails
10          xmlns:ns1="urn:MySoapServices">
11             <param1 xsi:type="xsd:int">1016577</param1>
12         </ns1:getEmployeeDetails>
13     </SOAP-ENV:Body>
14   </SOAP-ENV:Envelope>
By default, SOAP requests will yield a SOAP response!

Advantages with SOAP

Using SOAP over HTTP allows for easier communication through proxies and firewalls than previous remote execution technology.

  • SOAP is versatile enough to allow for the use of different transport protocols. The standard stacks use HTTP as a transport protocol, but other protocols are also usable (e.g., SMTP).
  • SOAP is platform independent.
  • SOAP is language independent.
  • SOAP is simple and extensible.

SOAP Toolkits for your language

We have dedicated a wiki-page for different SOAP toolkits


SOAP toolkit

PHP 5.x

http://freshmeat.net/projects/soap_toolkit/

Perl

http://www.soaplite.com

Visual Studio .NET (VB.net, C#)

Native SOAP-client
http://soa.sys-con.com/node/39517

Python

http://pywebsvcs.sourceforge.net/

Other goodies

http://www.soapclient.com/
http://www.soapclient.com/SourceCode.html


TrxListResponse

1 member :status, :string
2 member :file, :base64
3 member :trx_list_items, TrxListItem" class="wiki-page">TrxListItem

UserParamsIn

 1 #First name - *required*
 2 member :first_name, :string
 3 #Last name
 4 member :last_name, :string
 5 #Email address
 6 member :email, :string
 7 #Phone number
 8 member :phone, :string
 9 #User role in company (ADMIN or USER, default is USER)
10 member :user_role, :string

UserParamsOut

 1 #User db-id
 2 member :id, :string
 3 #First name
 4 member :first_name, :string
 5 #Last name
 6 member :last_name, :string
 7 #Email address
 8 member :email, :string
 9 #Phone number
10 member :phone, :string
11 #User role in company (ADMIN or USER)
12 member :user_role, :string

UserParamsOut

 1 #Status
 2 member :status, :string
 3 #User db-id
 4 member :id, :string
 5 #First name
 6 member :first_name, :string
 7 #Last name
 8 member :last_name, :string
 9 #Email address
10 member :email, :string
11 #Phone number
12 member :phone, :string
13 #User role in company (ADMIN or USER)
14 member :user_role, :string

User create

Method user_create is used for adding a new user to your company. An activation message will be sent to the given email address. The message will also include a randomly generated password for the user. The new account cannot be used until activation is done.

Return value

This method returns string which contains the new user’s API key or an ERROR message.

Arguments

  1. api_keys (required)
  2. UserParamsIn (required)

Example code

 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 user = Hash.new
11 user[:first_name]            = 'Test'
12 user[:last_name]             = 'Person2'
13 user[:email]                 = 'test.person2@company'
14 user[:phone]                 = '123-555-12345'
15 user[:user_role]             = 'USER' # Can be also ADMIN
16 
17 puts server.user_create(api_keys, user)

User delete

Method user_delete is used for deleting user from your company account. You cannot delete your own account.

Return value

This method returns a string with the status.

Arguments

  1. api_keys (required)
  2. user_id (required)

Example code

 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 puts server.user_delete(api_keys, "10f1626d-ceb6-414e-9120-bebd9d78524f")

User list

Method user_list is used for listing your company accounts users.

Return value(s)

This method returns an array that contains return code as a string and an array of UserParamsOut hash tables.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)

Example code

 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9   api_keys[:company_uuid] = "" # Put here UUID of the Company you are acting for
10 
11   # List users
12   results = serv.user_list(api_keys)
13 
14   if results[0] == "OK" 
15     results[1].each do |result|
16       puts result.id, result.first_name, result.last_name, result.email, result.phone, result.user_role
17       usr_id = result.id
18     end
19   end
20 
21 rescue Exception => ex 
22   puts ex
23 end

User list

Method user_list is used for listing your company’s users.

Return value

This method returns an array of UserParamsOut structs.

Arguments

  1. api_keys (required)

Example code

 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 results = server.user_list(api_keys)
11 
12 if results[0].status == "OK" 
13   results.each do |result|
14     puts result.first_name, result.last_name, result.email, result.user_role
15   end
16 end

User show

Method user_show is used for showing users details.

Return value(s)

This method returns an array that contains return code as a string and an UserParamsOut hash table.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)
  2. User ID string (required)

Example code

 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9   api_keys[:company_uuid] = "" # Put here UUID of the Company you are acting for
10 
11   # Show user
12   result = serv.user_show(api_keys, "User ID")
13 
14   if result[0] == "OK" 
15       puts result[1].id, result[1].first_name, result[1].last_name, result[1].email, result[1].phone, result[1].user_role
16   end
17 
18 rescue Exception => ex 
19   puts ex
20 end

User show bravo

Method user_show is used for showing information about a specific user.

Return value

This method returns a UserParamsOut structs.

Arguments

  1. api_keys (required)
  2. user_id (required)

Example code

 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.user_show(api_keys, "123456-123123")
11 
12 if result.status == "OK" 
13   puts result.first_name, result.last_name, result.email, result.user_role
14 end

User show .NET

Method user_show is used for showing users details.

Return value(s)

This method returns a UserParamsOut hash table.

Authentication

This method requires that you have registered to Maventa and received the API key.

Arguments

  1. api_keys (required)
  2. User ID string (required)
h2. Example code
 1 require 'soap/wsdlDriver'
 2 
 3 serv = SOAP::WSDLDriverFactory.new("https://secure.maventa.com/api_net/wsdl").create_rpc_driver
 4 
 5 begin 
 6   api_keys = Hash.new
 7   api_keys[:vendor_api_key] = "" # If you are software vendor, you shall put here API-key for this application
 8   api_keys[:user_api_key] = "" # Put here your API key
 9   api_keys[:company_uuid] = "" # Put here UUID of the Company you are acting for
10 
11   # Show user
12   result = serv.user_show(api_keys, "User ID")
13 
14   if result.status == "OK" 
15       puts result.id, result.first_name, result.last_name, result.email, result.phone, result.user_role
16   end
17 
18 rescue Exception => ex 
19   puts ex
20 end

User update

Method user_update is used for updating users details on your company account. You cannot update a user’s email address trough the API.

Return value

This method returns a string with the status.

Arguments

  1. api_keys (required)
  2. user_id (required)
  3. UserParamsIn (required)

Example code

 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 user = Hash.new
11 user[:first_name]            = 'Test'
12 user[:last_name]             = 'Person2'
13 user[:phone]                 = '123-555-12345'
14 
15 puts server.user_update(api_keys, "10f1626d-ceb6-414e-9120-bebd9d78524f", user)

XmlTestInvoiceStatus

#Validation status of invocie
member :status, :string
#Invoice number
member :invoice_nr, :string
#Invoice date
member :date, :string
#Invoice due date
member :date_due, :string
#Customer's name
member :customer_name, :string
#Customer's bid
member :customer_bid, :string
#Customer's EDI-code
member :customer_ovt, :string
#Invoice sum without VAT
member :sum, :string
#Invoice sum with VAT
member :sum_tax, :string
#Reference number of invoice
member :reference_nr, :string
#First find bank account number
member :bank_account, :string
#Currency of invoice
member :currency, :string

XmlTestStatus

#Validation status of the whole XML
member :status, :string
#XML format of received file
member :xml_format, :string
#Array of invoices included in the XML
member :invoices, XmlTestInvoiceStatus