API v1.1 documentation

Transport protocol: SOAP over HTTP
Operations:

Operations

  1. company_invoice_receiving
    Operation type:
    Enable/disable receiving of invoices.
    SOAP action:
    /v1.1/api/company_invoice_receiving
    Input:
    api-company_invoice_receiving (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    receive boolean
    Output:
    api-company_invoice_receivingResponse (soap:body, use = encoded)
    return string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    puts server.company_invoice_receiving(api_keys, true)
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    print client.service.company_invoice_receiving(api_keys, True)
    
    
  2. company_list
    Operation type:
    Used for listing all the companies user has access to.
    SOAP action:
    /v1.1/api/company_list
    Input:
    api-company_list (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    Output:
    api-company_listResponse (soap:body, use = encoded)

    return CompanyParamsOutArray – array of CompanyParamsOut

    • email string
    • status string
    • user_api_key string
    • name string
    • maventa_uuid string
    • maventa_id string
    • bid string
    • id string
    • country string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    results = server.company_list(api_keys)
    
    if results[0].status == "OK"
      results.each do |result|
        puts result.id, result.name, result.bid, result.email, result.country
      end
    end
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    response_code, result = client.service.company_list(api_keys)
    
    if response_code:
      if result[0].status == "OK":
          for r in result:
              print r.id, r.name, r.bid, r.email, r.country
    
    
  3. company_lookup
    Operation type:

    Used for finding recipient’s invoicing information. Possible error return values:

    • ERROR: TOO MANY RESULTS – if result set contains more than 200 hits
    • ERROR: SEARCH STRING BLANK OR TOO SHORT (MIN 3 CHARS)
    SOAP action:
    /v1.1/api/company_lookup
    Input:
    api-company_lookup (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    • search_string string #Search string can be company name, BID (organisation number), VAT code or e-invoice address (EDI, OVT, EAN, GLN…)
    • country_code string #Limit hits to specific country. If left blank, returns hits from all countries
    • limit int #Maximum number of results to return, default 20 and maximum 200
    • disable_vies boolean #Disable external directory lookup fallback when no results from Maventa Network. If set to false or left blank, Maventa will do queries on external services if no match is found in Maventa Finder, this might slow down query.
    Output:
    api-company_lookupResponse (soap:body, use = encoded)

    return CompanyLookupOutDArray – array of CompanyLookupOutD

    • status string
    • edis StringArray – array of string
    • name string
    • state string
    • post_code string
    • post_office string
    • maventa_id string
    • bid string
    • address1 string
    • country string
    • address2 string
    • receive_invoices boolean #Can only be true for Maventa network users (e.g. maventa_id field is not blank), for all others this is always false and does not necessarily mean they cannot receive e-invoices
    • receive_orders boolean #Only applies for Maventa network users
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    search_struct = Hash.new
    search_struct[:search_string] = "FI1234567"
    search_struct[:disable_vies] = true
    search_struct[:limit] = 20
    
    results = server.company_lookup(api_keys, search_struct)
    
    if results[0].status == "OK"
      results.each do |result|
        puts result.name, result.bid, result.address1, result.post_code,
        result.post_office, result.country
        result.edis.each do |edi_code|
          puts edi_code
        end
      end
    end
    
    
  4. company_lookup_with_operator
    Operation type:

    Used for finding recipient’s invoicing information. Differs from company_lookup only by returning also operator_code inside ‘edis’ value. Possible error return values are:

    • ERROR: TOO MANY RESULTS – if result set contains more than 200 hits
    • ERROR: SEARCH STRING BLANK OR TOO SHORT (MIN 3 CHARS)
    SOAP action:
    /v1.1/api/company_lookup_with_operator
    Input:
    api-company_lookup_with_operator (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    • search_string string #Search string can be company name, BID (organisation number), VAT code or e-invoice address (EDI, OVT, EAN, GLN…)
    • country_code string #Limit hits to specific country. If left blank, returns hits from all countries
    • limit int #Maximum number of results to return, default 20 and maximum 200
    • disable_vies boolean #Disable external directory lookup fallback when no results from Maventa Network. If set to false or left blank, Maventa will do queries on external services if no match is found in Maventa Finder, this might slow down query.
    Output:
    api-company_lookup_with_operatorResponse (soap:body, use = encoded)

    return CompanyLookupOutExtendedArray – array of CompanyLookupOutExtended

    • status string
    • edis ElectronicInvoiceAddressArray – array of ElectronicInvoiceAddress # ElectronicInvoiceAddress content is two strings, ‘eia’ with the electronic invoice address and ‘operator_code’
    • name string
    • state string
    • post_code string
    • post_office string
    • maventa_id string
    • bid string
    • address1 string
    • country string
    • address2 string
    • receive_invoices boolean #Can only be true for Maventa network users (e.g. maventa_id field is not blank), for all others this is always false and does not necessarily mean they cannot receive e-invoices
    • receive_orders boolean #Only applies for Maventa network users
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    search_struct = Hash.new
    search_struct[:search_string] = "FI1234567"
    search_struct[:disable_vies] = true
    search_struct[:limit] = 20
    
    results = server.company_lookup_with_operator(api_keys, search_struct)
    
    if results[0].status == "OK"
      results.each do |result|
        puts result.name, result.bid, result.address1, result.post_code,
        result.post_office, result.country
        result.edis.each do |edi_code|
          puts "#{edi_code.eia}@#{edi_code.operator_code}"
        end
      end
    end
    
    
  5. company_settings_show
    Operation type:
    Used to view current company settings.
    SOAP action:
    /v1.1/api/company_settings_show
    Input:
    api-company_settings_show (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    Output:
    api-company_settings_showResponse (soap:body, use = encoded)

    return CompanySettingsParamsD

    • status string #Status for outbound struct
    • website string #Website of company, displayed on invoice (depending on sending format)
    • print_and_send int #Print&Send enabled
    • print_and_send_request int #Print&Send enabled request (1=yes,0=no)
    • print_and_send_verified boolean #Print&Send verified?
    • print_and_send_letter_class integer #Print&Send mail class (1 = Priority, 0 = Economy)
    • print_and_send_own_pdf boolean #Use own PDF images in Print&Send
    • email_remind_freq int #Frequency of email reminder’s for open invoices in days (e.g. 2)
    • email string #Company email
    • invoice_email string #Company invoice email (inbound invoice notifications)
    • errors_to_user boolean #Send invoice relay errors to users or just error email?
    • error_emails string #List of comma separated error emails to notify of invoice relay errors
    • reports int #E-mail reports activated (0 = no, 1 = weekly, 2 = monthly, 3 = daily)
    • reports_emails string #List of comma separated email addresses to send reports to
    • name string #Name of company
    • bid string #Business ID, VAT, organization number etc.
    • country string #Country of company
    • stop_duplicates boolean #Prevent (re)sending invoices with the same number
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    result = server.company_settings_show(api_keys)
    
    if result.status == "OK"
      puts result.print_and_send, result.invoice_email
    end
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    response_code, result = client.service.company_settings_show(api_keys)
    
    if response_code == 200:
      if result.status == "OK":
        print result.print_and_send, result.invoice_email
    
    
  6. company_settings_update
    Operation type:

    Used for updating company settings.Possible return values are:

    • 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
    SOAP action:
    /v1.1/api/company_settings_update
    Input:
    api-company_settings_update (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string

    company_setting_params CompanySettingsParamsD

    • status string #Status for outbound struct
    • website string #Website of company, displayed on invoice (depending on sending format)
    • print_and_send_request int #Print&Send enabled request (1=yes,0=no)
    • print_and_send_letter_class integer #Print&Send mail class (1 = Priority, 0 = Economy)
    • print_and_send_own_pdf boolean #Use own PDF images in Print&Send
    • email_remind_freq int #Frequency of email reminder’s for open invoices in days (e.g. 2)
    • email string #Company email
    • invoice_email string #Company invoice email (inbound invoice notifications)
    • errors_to_user boolean #Send invoice relay errors to users or just error email?
    • error_emails string #List of comma separated error emails to notify of invoice relay errors
    • reports int #E-mail reports activated (0 = no, 1 = weekly, 2 = monthly, 3 = daily)
    • reports_emails string #List of comma separated email addresses to send reports to
    • name string #Name of company
    • bid string #Business ID, VAT, organization number etc.
    • country string #Country of company
    • stop_duplicates boolean #Prevent (re)sending invoices with the same number
    Output:
    api-company_settings_updateResponse (soap:body, use = encoded)
    return string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    settings = Hash.new
    settings[:website]                = "http://company.com"
    settings[:print_and_send_request]   = 1
    settings[:print_and_send_letter_class]  = 1
    settings[:stop_duplicates]        = true
    
    puts server.company_settings_update(api_keys, settings)
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    settings = client.factory.create("CompanySettingsParams")
    settings.website           = "http://company.com"
    settings.print_and_send_request = 1
    settings.ipost_own_pdf = False
    
    print client.service.company_settings_update(api_keys, settings)
    
    
  7. configure_company
    Operation type:

    Used for updating company settings.Possible return values are:

    • ERROR: NO RIGHTS TO CHANGE SETTINGS Only admin user can change settings
    • ERROR: COULD NOT SAVE SETTINGS Could not save settings for unknown reason
    • ERROR: BILLING EMAIL ADDRESS INVALID Email address is not valid
    • ERROR: BILLING INFORMATION INCOMPLETE Invoicing postal address is incomplete; address, postcode or postoffice is missing
    • OK Settings saved successfully
    SOAP action:
    /v1.1/api/configure_company
    Input:
    api-configure_company (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string

    settings SettingValueArray

    • website string #Website of company, displayed on invoice (depending on sending format)
    • print_and_send_request int #Print&Send enabled request (1=yes,0=no)
    • print_and_send_letter_class integer #Print&Send mail class (1 = Priority, 0 = Economy)
    • print_and_send_own_pdf boolean #Use own PDF images in Print&Send
    • print_and_send_color boolean #Print with colors in Print&Send
    • print_attachments_disabled boolean #Disable printing of attachments (true = disabled, false = enabled) Note! This setting applies only for outside FI companies!
    • email_remind_freq int #Frequency of email reminder’s for open invoices in days (e.g. 2)
    • email string #Company email
    • invoice_email string #Company invoice email (inbound invoice notifications)
    • errors_to_user int #Send invoice relay errors to users or just error email? (1=yes,0=no)
    • error_emails string #List of comma separated error emails to notify of invoice relay errors
    • reports int #E-mail reports activated (0 = no, 1 = weekly, 2 = monthly, 3 = daily)
    • reports_emails string #List of comma separated email addresses to send reports to
    • name string #Name of company
    • bid string #Business ID, VAT, organization number etc.
    • country string #Country of company
    • stop_duplicates boolean #Prevent (re)sending invoices with the same number
    • notify_incoming boolean #Enable/disable email notification of incoming invoice. Will be sent to invoice email if defined, else company email
    • disable_email boolean #Enable/disable sending of invoices by email notification. If this is set to true, invoices will only go out as e-invoices or by print. If the only available route for an invoice is email, the invoice will go to error state
    • notifications_disabled int #Enable/disable all e-mail notifications to the company email address, (1=disable, 0=enable)
    • internal_receive_via_peppol boolean #Enable/disable internal receive via Peppol. When enabled, all invoices received from companies inside the home network will be converted to EHF/ PEPPOL BIS, routed through the PEPPOL network and validated towards PEPPOL validation rules. If the invoice fails PEPPOL validation, sender will receive an error message and the invoice will not be delivered.
    • send_email_attachments int #With this option we add the invoice image (as PDF) and other attachments on your invoices which get sent by email (total size max 5 megabytes, if larger, recipient is asked to download the attachments from our service using a link provided). Note! You will not get an acknowledgement of receival when sending attachments like for normal email invoices. Also note that when sending attachments the recipient’s email box might get full and then emails are not delivered.
    • send_invoice_email int #With this option you can decide how the email invoice is sent out. 0 = Do not send invoice via email. 1 = send all invoice e-mails with attachments (max size 5MB). 2 = Send all invoice e-mail with invoice objections. 3 = Send all invoice e-mails with a link to download PDF. Note! This setting will override send_email_attachments and disable_email settings
    • receive_finvoice2 int #Enable/disable receiving finvoice 2.x. With this option you can make both the API and UI return Finvoice documents with version 2.0 and higher. When off, it will return version 1.3 or earlier.
    • invoice_receiving int #Enable/disable invoice receiving, (1=enabled, 0=disabled).
    • invoicing_eia string #invoicing EIA (Billing information: The delivery method priority is following 1 = einvoice, 2 = email, 3 = print, if all below values are given. If company prefers invoicing via normal post, invoicing_eia, invoicing_operator and invoicing_email should be left blank).
    • invoicing_operator string #invoicing operator.
    • invoicing_email string #invoicing email address.
    • invoicing_street_address1 string #invoicing postal address.
    • invoicing_street_address2 string #invoicing additional postal address.
    • invoicing_post_code string #invoicing post code.
    • invoicing_post_office string #invoicing post office.
    • billing_company_id string #Company to be set as a billing company.
    • message_from_sender string #Only for Norway. Write a message to the invoice receivers that is visible in the recipients e-mail. Note! If your ERP supports their own message to receiver, the message in the ERP will overwrite this message.
    • b2c_fallback string #Only for B2C NO, can be print or email
    • b2c_reminder boolean #Enable/disable B2C NO reminders
    • contact_person string #Contact person, email and phone are shown in the email message when invoice is sent by email
    • contact_email string #Contact person, email and phone are shown in the email message when invoice is sent by email
    • contact_phone string #Contact person, email and phone are shown in the email message when invoice is sent by email
    • scan_notification_interval string #Supplier Activation e-mail interval (Use one of the following to activate the service: ”monthly”, ”weekly”, ”daily”, or to disable the service use something else for example ”disabled”)
    • scan_notification_email string #E-mail address for Supplier Activation e-mail delivery
    Output:
    api-configure_companyResponse (soap:body, use = encoded)
    return string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    settings = [
        {:key => "notify_incoming", :value => "true"},
        {:key => "stop_duplicates", :value => "true"},
        {:key => "name", :value => "MyNewName"},
        {:key => "email", :value => "newemail@company.no"},
        {:key => "invoice_email", :value => "newinvoiceemail@company.no"},
        {:key => "email_remind_freq", :value => "5"},
        {:key => "errors_to_user", :value => "1"},
        {:key => "reports", :value => "2"},
        {:key => "error_emails", :value => "firsterroremail@company.no,seconderroremail@company.no"},
        {:key => "reports_emails", :value => "firstreportemail@company.no,secondreportemail@company.no"},
        {:key => "website", :value => "www.maventa.no"},
        {:key => "print_and_send_request", :value => "1"},
        {:key => "print_and_send_letter_class", :value => "2"},
        {:key => "print_and_send_own_pdf", :value => "true"},
      {:key => "disable_email", :value => "false"}
    ]
    puts server.configure_company(api_keys, settings)
    
    
  8. show_company_configuration
    Operation type:
    Shows current company configuration and available key/value pairs.
    SOAP action:
    /v1.1/api/show_company_configuration
    Input:
    api-show_company_configuration (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    Output:
    api-show_company_configurationResponse (soap:body, use = encoded)

    return SettingValuesOutArray – array of SettingValuesOut

    • status string
    • settings SettingValueArray – array of SettingValue (string key, string value)

    settings SettingValueArray

    • website string #Website of the company
    • print_and_send_request int #Print&Send request sent (1=yes,0=no)
    • print_and_send_letter_class integer #Print&Send mail class (1 = Priority, 0 = Economy)
    • print_and_send_own_pdf boolean #Use own PDF images in Print&Send (true/false)
    • print_and_send_color boolean #Print with colors in Print&Send (true/false)
    • print_attachments_disabled boolean #Shows if printing of attachments is disabled or enabled (Note! Only for outside FI companies)
    • email_remind_freq int #Frequency of email reminder’s for open invoices in days (e.g. 2)
    • email string #Company email
    • invoice_email string #Company invoice email (inbound invoice notifications)
    • errors_to_user int #Send invoice relay errors to users or just error email? (1=yes,0=no)
    • error_emails string #E-mail address for invoice errors
    • reports int #E-mail reports activated (0 = no, 1 = weekly, 2 = monthly, 3 = daily)
    • reports_emails string #E-mail for send reports
    • name string #Name of the company
    • bid string #Business ID, VAT, organization number etc.
    • country string #Country of the company
    • stop_duplicates boolean #Prevent (re)sending invoices with the same number (true/false)
    • notify_incoming boolean #E-mail notification of incoming invoice (true/false)
    • disable_email boolean #Sending of invoices by email notification. (true/false)
    • notifications_disabled int #Enable/disable all e-mail notifications to the company email address, (1=disable, 0=enable)
    • internal_receive_via_peppol boolean #Internal receiving via Peppol (true/false)
    • send_email_attachments int #Send the invoice image as attachment (true/false)
    • send_invoice_email int #Shows which email invoice sending method is in use. 0 = Do not send invoice via email. 1 = send all invoice e-mails with attachments (max size 5MB). 2 = Send all invoice e-mail with invoice objections. 3 = Send all invoice e-mails with a link to download PDF. Note! This setting will override send_email_attachments and disable_email settings
    • receive_finvoice2 int #Receiving finvoice 2.x (1=yes,0=no)
    • invoice_receiving int #Invoice receiving status, (1=enabled, 0=disabled)
    • invoicing_eia string #invoicing EIA
    • invoicing_operator string #invoicing operator.
    • invoicing_email string #invoicing email address.
    • invoicing_street_address1 string #invoicing postal address.
    • invoicing_street_address2 string #invoicing additional postal address.
    • invoicing_post_code string #invoicing post code.
    • invoicing_post_office string #invoicing post office.
    • billing_company_id string #Billing company id that handles the invoicing of the company
    • print_and_send_enabled string #Print&Send enabled (true/false)
    • vat_number string #Is the Norwegian company VAT registered, returns the VAT number
    • default_receive_vendor_api_key string #Default vendor API key for receiving
    • default_send_vendor_api_key string #Default vendor API key for sending
    • peppol_id string #Peppol ID for the company
    • bank_send string #Is the bank network connection open or not (true/false)
    • marketing_on_invoice string #Electronic invoicing instruction page/marketing page enabled (true/false)
    • message_from_sender string #Message from sender that is visible in the e-mail invoices
    • scan_return_email string #Email address for returned scan material if scan account exists (active or disabled)
    • scan_return_postal string #Postal address for returned scan material if scan account exists (active or disabled)
    • b2c_fallback string #Shows B2C NO fallback route . (print/email)
    • b2c_reminder boolean #Shows if B2C NO reminders are enabled or disabled. (true/false)
    • contact_person string #Shows contact person that is shown in the email message when invoice is sent by email
    • contact_email string #Shows contact email that is shown in the email message when invoice is sent by email
    • contact_phone string #Shows contact phone that is shown in the email message when invoice is sent by email
    • scan_notification_interval string #Supplier Activation e-mail interval (Service is enabled if one of the following is returned: ”monthly”, ”weekly”, ”daily” or disabled if ”disabled”
    • scan_notification_email string #E-mail address for Supplier Activation e-mail delivery
Example code:

Example in Ruby

require 'soap/wsdlDriver'

server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver

api_keys = Hash.new
api_keys[:user_api_key] = "" # User API key
api_keys[:company_uuid] = "" # UUID of current company

result = server.show_company_configuration(api_keys)
if result['status'] == "OK"
  result['settings'].each do |x|
    puts "#{x['key']}: #{x['value']}"
  end
else
  puts result['status']
end

  • company_show
    Operation type:
    Used for showing current company information.
    SOAP action:
    /v1.1/api/company_show
    Input:
    api-company_show (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    Output:
    api-company_showResponse (soap:body, use = encoded)

    return CompanyParamsOut

    • email string
    • status string
    • name string
    • maventa_id string
    • bid string
    • id string
    • country string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    result = server.company_show(api_keys)
    
    if result.status == "OK"
      puts result.id, result.name, result.bid, result.email, result.country
    end
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    result = client.service.company_show(api_keys)
    
    if result.status == "OK":
      print result.id, result.name, result.bid, result.email, result.country
    
    
    
  • hello_world
    Operation type:
    Used for testing Maventa API-connection.
    SOAP action:
    /v1.1/api/hello_world
    Input:
    api-hello_world (soap:body, use = encoded)
    Output:
    api-hello_worldResponse (soap:body, use = encoded)
    return string
    Example code:

    Example in Ruby

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

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    print client.service.hello_world()
    
    
  • inbound_invoice_show
    Operation type:

    Used for getting information about a specific inbound invoice.Arguments

    1. api_keys
    2. id string (invoice id)
    3. include_files boolean (download invoice image and attachments)
    4. xmlformat string (nil, finvoice, finvoice2, oio, teapps, ebis, ubl, liinos, svefaktura, sedi, ehf, vismaxml, e2b, woodx, facturae, bgc, ubl, peppolbis20, siubl11)
    SOAP action:
    /v1.1/api/inbound_invoice_show
    Input:
    api-inbound_invoice_show (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    id string
    include_files boolean
    xmlformat string
    Output:
    api-inbound_invoice_showResponse (soap:body, use = encoded)

    return InboundInvoiceParamsOutC

    • status string #Status
    • id string #Invoice db-id
    • state int #Invoice state
    • currency string #Currency abbrevation
    • invoice_nr string #Invoice number
    • order_nr string #Order number
    • sum string #Total sum without tax
    • sum_tax string #Total sum with tax
    • delivery_date string #Delivery date, YYYYMMDD
    • delivery_type string #Delivery type (e.g. mail)
    • reference_nr string #Invoice reference number
    • date string #Invoicing date, YYYYMMDD
    • date_due string #Invoice due date, YYYYMMDD
    • customer_reference string #Reference for customer (“Viitteenne”)
    • company_reference string #Reference for company (“Viitteemme”)
    • company_comment string #Comment for email invoice
    • notes string #Additional information for invoice
    • lang string #Language code for invoice (e.g. ‘FI’)
    • customer_nr string #Customer number
    • customer_name string #Recipient name
    • customer_email string #Recipient email
    • customer_bid string #Recipient BID/VAT/org number
    • customer_contact_p string #Recipient contact person’s name
    • customer_address1 string #Recipient street address
    • customer_address2 string #Recipient additional address
    • customer_post_code string #Recipient postal code
    • customer_post_office string #Recipient postal office
    • customer_state string #Recipient address state
    • customer_country string #Recipient country code
    • customer_ovt string #Recipient e-invoice address (EDI/OVT/GLN/EAN…)
    • company_name string #Sender name
    • company_bid string #Sender BID/VAT/org number
    • company_address1 string #Sender street address
    • company_address2 string #Sender additional address
    • company_post_code string #Sender post code
    • company_post_office string #Sender post office
    • company_city string #Sender registered city
    • company_state string #Sender address state
    • company_country string #Sender country code
    • company_phone string #Sender phone number
    • company_gsm string #Sender GSM number
    • company_fax string #Sender fax number
    • company_email string #Sender email
    • company_website string #Sender website
    • company_interest string #Invoice late interest rate
    • company_reminder string #Invoice reminder fee
    • company_paper_fee string #Invoice paper fee
    • user_name string #Sender contact person
    • user_email string #Sender contact email
    • user_phone string #Sender contact phone
    • invoice_delivery_address InvoiceDeliveryAddressOut #Invoice delivery address
    • invoice_seller_information InvoiceSellerInformationOut #Invoice seller information
    • work_order_nr string #Work order nr
    • payment_terms string #Payment terms
    • items ItemsOutArray – array of ItemsOut
      • subject string #Subject string
      • amount double #Amount/quantity of items
      • price string #Unit price
      • tax double # VAT tax for item, expressed as a percentage, e.g. 22.0 is 22%
      • sum string #Sum without VAT tax for item row, dot as decimal separator (e.g. ‘123.45’)
      • sum_tax string #Sum including VAT tax for item row, dot as decimal separator (e.g. ‘123.45’)
      • item_code string #Item code
      • definition string #Additional definition for item (freetext)
      • position int #Position in item list
      • unit_type string #Unit of item (e.g. ‘km’ or ‘h’)
      • discount double #Discount percentage (e.g. 12.5)
    • attachments FileAttachmentArray – array of FileAttachment
      • attachment_type string
      • filename string
      • file base64
    • accounts InvoiceAccountParamsOutArray – array of InvoiceAccountParamsOut
      • status string
      • account string
      • iban string
      • bank string
      • swift string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    result = server.inbound_invoice_show(api_keys, "1c555458-fa83-402b-a1f6-4d22071020a8", true, "teapps")
    if result.status == "OK"
      puts "Invoice number: " + result.invoice_nr
    
      if result.attachments
        result.attachments.each do |fa|
          File.open(fa.filename, 'wb') do |f|
            f.push(fa.file)
          end
        end
      end
    end
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    import base64
    
    result = client.service.inbound_invoice_show(api_keys, "1c555458-fa83-402b-a1f6-4d22071020a8", true, "teapps")
    
    if result.status == "OK":
        print "Invoice number: " + result.invoice_nr
    
        if result.attachments:
            for fa in result.attachments:
                open(fa.filename, 'w').write(base64.decodestring(fa.file))
    
    

    Example in C#

    //WSDL at https://testing.maventa.com/apis/v1.1/wsdl needs to be added as 
    //web reference for the example to work
    
    using System;
    using System.IO;
    using System.Collections.Generic;
    using System.Drawing;
    using System.Windows.Forms;
    using MaventaAPI;
    
    namespace MaventaDemo
    {
      public partial class MainForm : Form
      {
        public MainForm()
        {
          InitializeComponent();
          MaventaService m_server = new MaventaService();
    
          ApiKeys apiKeys = new ApiKeys();
          apiKeys.user_api_key = ""; //User API key
          apiKeys.company_uuid = ""; //UUID of current company
    
          //Get invoice data and save attachments
          InboundInvoiceParamsOutC inbound_invoice = new InboundInvoiceParamsOutC();
          inbound_invoice = m_server.inbound_invoice_show(apiKeys,
                                                          "1f7e5f62-93f2-4a62-a3bb-fc81d3570133",
                                                          true, "finvoice");
    
          if (inbound_invoice.attachments.Length > 0)
          {
            for (int j = 0; j > inbound_invoice.attachments.Length; j++)
            {
              FileStream fstream = new FileStream ("C:\\" +
                                                   inbound_invoice.attachments[j].filename,
                                                   FileMode.Append,
                                                   FileAccess.Write);
    
              BinaryWriter bwriter = new BinaryWriter(fstream);
              bwriter.Write(inbound_invoice.attachments[j].file);
              fstream.Close();
              bwriter.Close();
            }
          }
          MessageBox.Show(String.Format("Invoice number {0} downloaded",
                                              inbound_invoice.invoice_nr));
    
        }
      }
    }
    
    
  • invoice_accept
    Operation type:

    Used for accepting incoming invoice. This means that the invoice and the contents seems to be legit according to an agreement. The acceptance sends a notification to the invoice sender so they know you have received the invoice. Note! Only inside Maventa network.”Status” can be one of the following:

    • 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
    SOAP action:
    /v1.1/api/invoice_accept
    Input:
    api-invoice_accept (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    id string
    Output:
    api-invoice_acceptResponse (soap:body, use = encoded)
    return string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    puts server.invoice_accept(api_keys, "00521759-4570-467c-98dd-c496b22de0bc")
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    print client.service.invoice_accept(api_keys, "00521759-4570-467c-98dd-c496b22de0bc")
    
    
  • invoice_confirm
    Operation type:

    Used for marking an outbound invoice as paid, meaning you have received payment and want to archive the invoice.”Status” can be one of the following:

    • 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
    SOAP action:
    /v1.1/api/invoice_confirm
    Input:
    api-invoice_confirm (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    id string
    payment_date string
    Output:
    api-invoice_confirmResponse (soap:body, use = encoded)
    return string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    puts server.invoice_confirm(api_keys, "3b24eff1-50d2-4e67-b16c-8b711e87df15", "20090917")
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    print client.service.invoice_confirm(api_keys, "3b24eff1-50d2-4e67-b16c-8b711e87df15", "20090917")
    
    
  • invoice_create
    Operation type:

    Used for creating new invoices. Note! If you want to create a credit note, please provide all the sums as negative, because there is no separate parameter for the invoice type. ”Status” 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
    • 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
    SOAP action:
    /v1.1/api/invoice_create
    Input:
    api-invoice_create (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string

    invoice_params InvoiceParamsIn

    • items ItemsInArray – array of ItemsIn
      • sum string
      • subject string
      • discount double
      • price string
      • amount double
      • position int
      • definition string
      • item_code string
      • tax double -> Expressed as a percentage, e.g. 22.0 is 22%
      • sum_tax string
      • unit_type string
    • attachments FileAttachmentArray – array of FileAttachment
      • attachment_type string
      • filename string
      • file base64
    • bank_accounts BankAccountParamsInArray – array of BankAccountParamsIn
      • account string
      • default boolean
      • iban string
      • swift string
      • bank string
    • disabled_routes RouteDisable
      • email boolean
      • paper boolean
      • relay boolean
    • customer CustomerParamsIn
      • customer_type string
      • email string
      • lang string # Allowed values are FI, SE, EN, NO, DK, NL
      • name string
      • state string
      • post_code string
      • phone string
      • post_office string
      • customer_nr int
      • ovt string # Operator code can be added after ovt and @ sign, e.g. 003712345678@003721291126
      • bid string
      • address1 string
      • gsm string
      • country string
      • address2 string
      • contact_p string
    • company_postal PostalAddressParamsIn
      • default boolean
      • company_name string
      • lang string
      • state string
      • post_code string
      • post_office string
      • phone string
      • address1 string
      • gsm string
      • address2 string
      • country string
      • city string
      • fax string
    • customer_maventa_id string #Customer maventa ID
    • currency string #Currency abbrevation
    • invoice_nr string #Invoice number
    • order_nr string #Company’s order number (seller). If also customer (buyer) order number is needed both values can be given separated with ”|” character (”company_order_nr|customer_order_number”)
    • sum string #Total sum without tax
    • sum_tax string #Total sum with tax
    • delivery_date string #Delivery date, YYYYMMDD
    • delivery_type string #Delivery type (e.g. mail)
    • reference_nr string #Invoice reference number
    • date string #Invoicing date, YYYYMMDD
    • date_due string #Invoice due date, YYYYMMDD
    • company_interest string #Company’s interest rate (e.g. 11.5)
    • company_reminder string #Company’s reminder fee in invoices currency (e.g. 5.50)
    • company_paper_fee string #Company’s paper fee, added if customer requests paper invoice (e.g. 3.25)
    • customer_reference string #Reference for customer (“Viitteenne”)
    • company_reference string #Reference for company (“Viitteemme”)
    • company_comment string #Comment for email invoice
    • notes string #Additional information for invoice
    • company_website string #Company’s website, shown on PDF invoice
    • lang string #Language code for invoice (Allowed values are FI, SE, EN, NO, DK, NL)
    • require_sign bool #Require signing before send
    • invoice_delivery_address InvoiceDeliveryAddressIn #Invoice delivery address
    • invoice_seller_information InvoiceSellerInformationIn #Invoice seller information
    • work_order_nr string #Work order nr
    • payment_terms string #Payment terms
    • data string #JSON input for extra parameters. Currently supports key ‘payment_instruction_identifier’ needed for Finnish B2C invoicing
    Output:
    api-invoice_createResponse (soap:body, use = encoded)

    return InvoiceStatus

    • status string
    • invoice_id string
    • file_statuses FileStatusArray – array of FileStatus
      • status string
      • filehash string
      • filename string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    #Set up customer information
    customer = Hash.new
    customer[:customer_nr] = "1001"
    customer[:name] = "Test Customer"
    customer[:address1] = "Post Address"
    customer[:post_code] = "00100"
    customer[:post_office] = "TEST"
    customer[:country] = "FI"
    customer[:lang] = "FI"
    customer[:contact_p] = "John Doe"
    customer[:email] = "customer@maventa.com"
    customer[:bid] = "FI1234567"
    customer[:ovt] = "00371111111"
    
    #Set up invoice items
    items_out = Array.new
    inv_item = Hash.new
    inv_item[:subject]    = "Test item"
    inv_item[:unit_type]  = "pcs"
    inv_item[:amount]     = "1"
    inv_item[:price]      = "200"
    inv_item[:discount]   = "50"
    inv_item[:definition] = ""
    inv_item[:tax]        = "22"
    inv_item[:sum]        = "100"
    inv_item[:sum_tax]    = "122"
    items_out.push(inv_item)
    
    #Set up attachments
    attachments_out = Array.new
    fa = Hash.new
    fa[:filename] = "invoice_1001.pdf"
    fa[:file] = SOAP::Attachment.new(File.new("invoice_1001.pdf"))
    fa[:attachment_type] = "INVOICE_IMAGE"
    attachments_out.push(fa)
    
    fa = Hash.new
    fa[:filename] = "attachment_1001.doc"
    fa[:file] = SOAP::Attachment.new(File.new("attachment_1001.doc"))
    fa[:attachment_type] = "ATTACHMENT"
    attachments_out.push(fa)
    
    #Set up invoice information
    invoice = Hash.new
    invoice[:invoice_nr] = 1001
    invoice[:date] = "20090915"
    invoice[:date_due] = "20090930"
    invoice[:currency] = "EUR"
    invoice[:notes] = "TEST INVOICE / DO NOT PAY"
    invoice[:sum] = "100"
    invoice[:sum_tax] = "122"
    invoice[:customer] = customer
    invoice[:items] = items_out
    invoice[:attachments] = attachments_out
    
    #JSON input for setting PaymentInstructionIdentifier needed for Finnish B2C invoicing
    #invoice[:data] = '{"payment_instruction_identifier":"PID554433"}'
    
    #Create the invoice
    result = server.invoice_create(api_keys, invoice)
    
    puts result.status
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    import base64
    
    #Set up customer information
    customer = client.factory.create("CustomerParamsInC")
    customer.customer_nr = "1001"
    customer.name = "Test Customer"
    customer.address1 = "Post Address"
    customer.post_code = "00100"
    customer.post_office = "TEST"
    customer.country = "FI"
    customer.lang = "FI"
    customer.contact_p = "John Doe"
    customer.email = "customer@maventa.com"
    customer.bid = "FI1234567"
    customer.ovt = "00371111111"
    
    #Set up invoice items
    items_out = []
    inv_item = client.factory.create("ItemsInC")
    inv_item.subject    = "Test item"
    inv_item.unit_type  = "pcs"
    inv_item.amount     = "1"
    inv_item.position   = 1
    inv_item.price      = "200"
    inv_item.discount   = "50"
    inv_item.definition = ""
    inv_item.tax        = "22"
    inv_item.sum        = "100"
    inv_item.sum_tax    = "122"
    items_out.append(inv_item)
    
    #Set up attachments
    attachments_out = []
    
    fa = client.factory.create("FileAttachment")
    fa.filename = "invoice_1001.pdf"
    fa.file = base64.encodestring(open("invoice_1001.pdf").read())
    fa.attachment_type = "INVOICE_IMAGE"
    attachments_out.append(fa)
    
    fa = client.factory.create("FileAttachment")
    fa.filename = "attachment_1001.doc"
    fa.file = open("attachment_1001.doc").read()
    fa.attachment_type = "ATTACHMENT"
    attachments_out.append(fa)
    
    #Set up invoice information
    invoice = client.factory.create("InvoiceParamsInC")
    invoice.invoice_nr = 1001
    invoice.date = "20090915"
    invoice.date_due = "20090930"
    invoice.require_sign = False
    invoice.currency = "EUR"
    invoice.notes = "TEST INVOICE / DO NOT PAY"
    invoice.sum = "100"
    invoice.sum_tax = "122"
    invoice.customer = customer
    invoice.items = items_out
    invoice.attachments = attachments_out
    invoice.bank_accounts = []
    invoice.company_postal = []
    
    routes = client.factory.create("RouteDisable")
    routes.email = False
    routes.paper = True
    routes.relay = True
    
    invoice.disabled_routes = routes
    
    #Create the invoice
    response_code, result = client.service.invoice_create(api_keys, invoice)
    
    if response_code == 200:
      print result.status
    
    

    Example in C#

    //WSDL at https://testing.maventa.com/apis/v1.1/wsdl
    //needs to be added as web reference for the example to work
    
    using System;
    using System.IO;
    using System.Collections.Generic;
    using System.Drawing;
    using System.Windows.Forms;
    using MaventaAPI;
    
    namespace MaventaDemo
    {
      public partial class MainForm : Form
      {
        public MainForm()
        {
          InitializeComponent();
          MaventaService m_server = new MaventaService();
    
          ApiKeys apiKeys = new ApiKeys();
          apiKeys.user_api_key = ""; //User API key
          apiKeys.company_uuid = ""; //UUID of current company
    
          //Create invoice
          InvoiceParamsIn invoiceOut = new InvoiceParamsIn();
          invoiceOut.invoice_nr = "1001";
          invoiceOut.reference_nr = "10016";
          invoiceOut.date = "20090918";
          invoiceOut.date_due = "20090925";
          invoiceOut.sum = "200";
          invoiceOut.sum_tax = "244";
          invoiceOut.currency = "EUR";
          invoiceOut.lang = "FI";
    
          //Customer information
          CustomerParamsIn customerOut = new CustomerParamsIn();
          customerOut.name = "Test Customer";
          customerOut.bid = "FI1234567";
                            customerOut.ovt = "0037111111";
          customerOut.email = "customer@maventa.com";
          customerOut.country = "FI";
          invoiceOut.customer = customerOut;
    
          //Invoice items
          ItemsIn[] itemArray = new ItemsIn[2];
    
          ItemsIn itemOut1 = new ItemsIn();
          itemOut1.item_code = "TST001";
          itemOut1.subject = "Test item 1";
          itemOut1.definition = "blue";
          itemOut1.amount = 1;
          itemOut1.price = "100";
          itemOut1.tax = 22;
          itemOut1.sum = "100";
          itemOut1.sum_tax = "122";
          itemOut1.position = 1;
    
          ItemsIn itemOut2 = new ItemsIn();
          itemOut2.item_code = "TST002";
          itemOut2.subject = "Test item 2";
          itemOut2.definition = "red";
          itemOut2.amount = 1;
          itemOut2.price = "100";
          itemOut2.tax = 22;
          itemOut2.sum = "100";
          itemOut2.sum_tax = "122";
          itemOut2.position = 2;
    
          itemArray[0] = itemOut1;
          itemArray[1] = itemOut2;
          invoiceOut.items = itemArray;
    
                //File attachments
          FileAttachment[] fileArray = new FileAttachment[1];
    
          FileAttachment attachmentFile1 = new FileAttachment();
          attachmentFile1.filename = "attachment1.doc";
          attachmentFile1.file = File.ReadAllBytes("C:\\attachment1.doc");
          attachmentFile1.attachment_type = "ATTACHMENT";
    
          fileArray[0] = attachmentFile1;
          invoiceOut.attachments = fileArray;
    
          //Send invoice
          InvoiceStatus invoiceResponse = new InvoiceStatus();
          invoiceResponse = m_server.invoice_create(apiKeys, invoiceOut);
          MessageBox.Show(invoiceResponse.status);
        }
      }
    }
    
    

    Example in PHP

    require 'SOAP/Client.php';
      # 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.
    
      $client = new SoapClient('https://testing.maventa.com/apis/v1.1/wsdl');
    
      $api_keys = array();
      $api_keys["vendor_api_key"] = null;
      $api_keys["user_api_key"] = null;
      $api_keys["company_uuid"] = null;
    
      # Gather needed data for invoice customer
      $customer = array();
      $customer["customer_nr"] = "1001";
      $customer["name"] = "Test Customer";
      $customer["email"] = "test.customer@maventa.com";
      $customer["bid"] = "FI12345678";
      $customer["address1"] = "Customer address";
      $customer["address2"] = "";
      $customer["post_code"] = "00100";
      $customer["post_office"] = "Helsinki";
      $customer["country"] = "FI";
      $customer["contact_p"] = "Customer Test";
      $customer["lang"] = "FI";
      $customer["customer_type"] = "COMPANY";
      $customer["state"] = null;
      $customer["phone"] = null;
      $customer["gsm"] = null;
      $customer["ovt"] = null;
    
      # Gather invoice items into array
      # NOTE! Items are an array of arrays
      $items_out = array();
    
      $inv_items = array();
      $inv_items["position"] = 1;
      $inv_items["item_code"] = "itm0001";
      $inv_items["subject"] = "Test item";
      $inv_items["unit_type"] = "pcs";
      $inv_items["amount"] = 10;
      $inv_items["price"] = "10";
      $inv_items["discount"] = 0;
      $inv_items["definition"] = "red";
      $inv_items["tax"] = 22;
      $inv_items["sum"] = "100";
      $inv_items["sum_tax"] = "122";
      $inv_items["data"] = "null";
    
        array_push($items_out, $inv_items);
      
    $bank_accounts_out = array();
    
      $bank_account = array();
      $bank_account["iban"] = "FI1234561212244";
      $bank_account["swift"] = "TSTBNKFIHH";
      $bank_account["account"] = null;
      $bank_account["bank"] = null;
      $bank_account["default"] = null;
    
        array_push($bank_accounts_out, $bank_account);
    
      $disabled_routes = array();
      $disabled_routes["paper"] = false;
      $disabled_routes["relay"] = true;
      $disabled_routes["email"] = true;
      
    $attachments_out = array();
    
      $attachment = array();
      $attachment["filename"] = "liite1.pdf";
      $attachment["attachment_type"] = "ATTACHMENT";
      $attachment["file"] = base64_encode(file_get_contents('liite1.pdf'));
    
        array_push($attachments_out, $attachment);
    
      # Gather invoice data
      $invoice = array();
      $invoice["invoice_nr"] = "1001";
      $invoice["reference_nr"] = "10012";
      $invoice["date"] = "20091028";
      $invoice["date_due"] = "20091104";
      $invoice["currency"] = "EUR";
      $invoice["sum"] = "100.00";
      $invoice["sum_tax"] = "122.00";
      $invoice["lang"] = "FI";
      $invoice["order_nr"] = null;
      $invoice["company_comment"] = null;
      $invoice["notes"] = null;
      $invoice["customer_maventa_id"] = null;
      $invoice["delivery_date"] = null;
      $invoice["delivery_type"] = null;
      $invoice["customer_reference"] = null;
      $invoice["company_reference"] = null;
      $invoice["company_paper_fee"] = null;
      $invoice["company_interest"] = null;
      $invoice["company_reminder"] = null;
      $invoice["company_website"] = null;
      $invoice["require_sign"] = null;
      $invoice["disabled_routes"] = null;
      $invoice["attachments"] = null;
      $invoice["bank_accounts"] = null;
      $invoice["company_postal"] = null;
      $invoice["work_order_nr"] = null;
      $invoice["data"] = null;
      $invoice["invoice_delivery_address"] = null;
      $invoice["invoice_seller_information"] = null;
      $invoice["payment_terms"] = null;
    
      # Assign customer and item info to invoice
      $invoice["customer"] = $customer;
      $invoice["items"] = $items_out;
      $invoice["disabled_routes"] = $disabled_routes;
      $invoice["attachments"] = $attachments_out;
      $invoice["bank_accounts"] = $bank_accounts_out;
    
      $result = $client->invoice_create($api_keys, $invoice);
      print $result->status;
    
    
  • invoice_decline
    Operation type:

    Used for declining incoming invoice in cases where they contain an error. Note! Will automatically notify sender of decline only inside Maventa network.Return value(s)

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

    Error return values include:

    • 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

    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)
    SOAP action:
    /v1.1/api/invoice_decline
    Input:
    api-invoice_decline (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    id string
    message string
    Output:
    api-invoice_declineResponse (soap:body, use = encoded)
    return string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    puts server.invoice_decline(api_keys, "00521759-4570-467c-98dd-c496b22de0bc",
                                "Message, why invoice was declined")
    
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    print client.service.invoice_decline(api_keys, "00521759-4570-467c-98dd-c496b22de0bc",
                                "Message, why invoice was declined")
    
    
  • invoice_dispute
    Operation type:

    Used for disputing an invoice. This means that you consider the invoice to be fraudulent and is not the same as just declining an invoice that has something wrong!. Maventa administrator will get notified and actions will be taken against sender if deemed necessary.Return values include:

    • 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
    SOAP action:
    /v1.1/api/invoice_dispute
    Input:
    api-invoice_dispute (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    id string
    message string #Message for sender about the dispute
    Output:
    api-invoice_disputeResponse (soap:body, use = encoded)
    return string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    puts server.invoice_dispute(api_keys, "00521759-4570-467c-98dd-c496b22de0bc",
                                "Message, why invoice is disputed")
    
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    print client.service.invoice_dispute(api_keys, "00521759-4570-467c-98dd-c496b22de0bc",
                                "Message, why invoice was declined")
    
    
  • invoice_list_between_dates
    Operation type:

    Used for getting list of outbound invoices. With timestamps its possible to recheck an intervall if there’s reason to believe something was missed or need to redownload invoices.Arguments

    1. api_keys (required)
    2. timestamp_start (string start time for search, format “YYYYMMDDHHMMSS”)
    3. timestamp_end (string end time for search, format “YYYYMMDDHHMMSS”)
    4. all integer (nil => open invoices, 1 => archived invoices, 2 => all invoices, 3 => invoices in error state)
    SOAP action:
    /v1.1/api/invoice_list_between_dates
    Input:
    api-invoice_list_between_dates (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    timestamp_start string
    timestamp_end string
    all int
    Output:
    api-invoice_list_between_datesResponse (soap:body, use = encoded)

    return InvoiceParamsOutCArray – array of InvoiceParamsOutC

    • status string #Status
    • id string #Invoice db-id
    • state int #Invoice state
    • currency string #Currency abbrevation
    • invoice_nr string #Invoice number
    • order_nr string #Order number
    • sum string #Total sum without tax
    • sum_tax string #Total sum with tax
    • delivery_date string #Delivery date, YYYYMMDD
    • delivery_type string #Delivery type (e.g. mail)
    • reference_nr string #Invoice reference number
    • date string #Invoicing date, YYYYMMDD
    • date_due string #Invoice due date, YYYYMMDD
    • company_interest string #Company’s interest rate (e.g. 11.5)
    • company_reminder string #Company’s reminder fee in invoices currency (e.g. 5.50)
    • company_paper_fee string #Company’s paper fee, added if customer requests paper invoice (e.g. 3.25)
    • customer_reference string #Reference for customer (“Viitteenne”)
    • company_reference string #Reference for company (“Viitteemme”)
    • company_comment string #Comment for email invoice
    • customer_comment string #Customer comment (from decline invoice)
    • notes string #Additional information for invoice
    • lang string #Language code for invoice (e.g. ‘FI’)
    • customer_nr string #Customer number
    • customer_name string #Name
    • customer_email string #Email
    • customer_bid string #Business ID, VAT, etc
    • customer_contact_p string #Contact person’s name
    • customer_address1 string #First line of street address
    • customer_address2 string #Second line of street address
    • customer_post_code string #Postal code
    • customer_post_office string #Postal office
    • customer_state string #State
    • customer_country string #Country (e.g. ‘FI’)
    • customer_ovt string #EDI-code (OVT)
    • work_order_nr string #Work order nr
    • payment_terms string #Payment terms
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    invoices = server.invoice_list_between_dates(api_keys, "20120501000000", "20120510000000", nil)
    
    if invoices[0].status == "OK"
    
      invoices.each do |invoice|
        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
      end
    
    end
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    response_code, invoices = client.service.invoice_list_between_dates(api_keys, "20120501000000", "20120510000000")
    
    if response_code == 200:
      if invoices.status == "OK":
    
          for invoice in invoices:
              print 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
    
    
  • invoice_list_inbound_between_dates
    Operation type:

    Used for getting list of inbound invoices. With timestamps its possible to recheck an intervall if there’s reason to believe something was missed or need to redownload invoices. Recommended that ‘id’ of downloaded invoices is saved locally to be able to check for duplicates.Arguments

    1. api_keys (required)
    2. timestamp_start (string start time for search, format “YYYYMMDDHHMMSS”)
    3. timestamp_end (string end time for search, format “YYYYMMDDHHMMSS”)
    SOAP action:
    /v1.1/api/invoice_list_inbound_between_dates
    Input:
    api-invoice_list_inbound_between_dates (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    timestamp_start string
    timestamp_end string
    Output:
    api-invoice_list_inbound_between_datesResponse (soap:body, use = encoded)

    return InboundInvoiceParamsOutCArray – array of InboundInvoiceParamsOutC

    • status string #Status
    • id string #Invoice db-id
    • state int #Invoice state
    • currency string #Currency abbrevation
    • invoice_nr string #Invoice number
    • order_nr string #Order number
    • sum string #Total sum without tax
    • sum_tax string #Total sum with tax
    • delivery_date string #Delivery date, YYYYMMDD
    • delivery_type string #Delivery type (e.g. mail)
    • reference_nr string #Invoice reference number
    • date string #Invoicing date, YYYYMMDD
    • date_due string #Invoice due date, YYYYMMDD
    • customer_reference string #Reference for customer (“Viitteenne”)
    • company_reference string #Reference for company (“Viitteemme”)
    • company_comment string #Comment for email invoice
    • notes string #Additional information for invoice
    • lang string #Language code for invoice (e.g. ‘FI’)
    • customer_nr string #Customer number
    • customer_name string #Recipient name
    • customer_email string #Recipient email
    • customer_bid string #Recipient BID/VAT/org number
    • customer_contact_p string #Recipient contact person’s name
    • customer_address1 string #Recipient street address
    • customer_address2 string #Recipient additional address
    • customer_post_code string #Recipient postal code
    • customer_post_office string #Recipient postal office
    • customer_state string #Recipient address state
    • customer_country string #Recipient country code
    • customer_ovt string #Recipient e-invoice address (EDI/OVT/GLN/EAN…)
    • company_name string #Sender name
    • company_bid string #Sender BID/VAT/org number
    • company_address1 string #Sender street address
    • company_address2 string #Sender additional address
    • company_post_code string #Sender post code
    • company_post_office string #Sender post office
    • company_city string #Sender registered city
    • company_state string #Sender address state
    • company_country string #Sender country code
    • company_phone string #Sender phone number
    • company_gsm string #Sender GSM number
    • company_fax string #Sender fax number
    • company_email string #Sender email
    • company_website string #Sender website
    • company_interest string #Invoice late interest rate
    • company_reminder string #Invoice reminder fee
    • company_paper_fee string #Invoice paper fee
    • user_name string #Sender contact person
    • user_email string #Sender contact email
    • user_phone string #Sender contact phone
    • invoice_delivery_address InvoiceDeliveryAddressOut #Invoice delivery address
    • invoice_seller_information InvoiceSellerInformationOut #Invoice seller information
    • work_order_nr string #Work order nr
    • payment_terms string #Payment terms
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    invoices = server.invoice_list_inbound_between_dates(api_keys, "20090916000000", "20120916000000")
    
    if invoices[0].status == "OK"
    
      invoices.each do |invoice|
        puts "ID: #{invoice.id}, Nr: #{invoice.invoice_nr}, Date: #{invoice.date}"
      end
    
    end
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    response_code, invoices = client.service.invoice_list_inbound_between_dates(api_keys, "20090916000000", "20120916000000")
    
    if response_code == 200:
      if invoices[0].status == "OK":
          for invoice in invoices:
              print "ID: %(id)s, Nr: %(invoice_nr)s, Date: %(date)s" % dict(id=invoice.id, invoice_nr=invoice.invoice_nr, date=invoice.date)
    
    
  • invoice_put_file
    Operation type:
    Used for creating new invoices from existing XML invoice files or ZIP files with XML files and attachments.
    SOAP action:
    /v1.1/api/invoice_put_file
    Input:
    api-invoice_put_file (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string

    file_in FileAttachment

    • attachment_type string
    • filename string
    • file base64
    Output:
    api-invoice_put_fileResponse (soap:body, use = encoded)

    return FileStatusArray – array of FileStatus

    • status string
    • filehash string
    • filename string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    file_out = Hash.new
    file_out[:file] = SOAP::Attachment.new(File.new("invoice.xml")).to_s
    file_out[:filename] = "invoice.xml"
    
    results = server.invoice_put_file(api_keys, file_out)
    results.each do |result|
      puts result.status
    end
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    import base64
    file_out = client.factory.create("FileAttachment")
    file_out.file = base64.encodestring(open("testfile.xml").read())
    file_out.filename = "invoice.xml"
    
    response_code, result = client.service.invoice_put_file(api_keys, file_out)
    
    if response_code == 200:
      for r in result:
          print r.status
    

    Example in C#

    //WSDL at https://testing.maventa.com/apis/v1.1/wsdl needs to be added as web
    //reference for the example to work
    
    using System;
    using System.IO;
    using System.Collections.Generic;
    using System.Drawing;
    using System.Windows.Forms;
    using MaventaAPI;
    
    namespace MaventaDemo
    {
      public partial class MainForm : Form
      {
        public MainForm()
        {
          MaventaService m_server = new MaventaService();
          ApiKeys apiKeyParams = new ApiKeys();
          apiKeyParams.user_api_key = "";
          apiKeyParams.company_uuid = "";
    
          FileAttachment fileOut = new FileAttachment();
    
                            fileOut.filename = "1001.xml";
                            fileOut.file = File.ReadAllBytes("1001.xml");
    
          FileStatus[] fStatus = m_server.invoice_put_file(apiKeyParams, fileOut);;
          MessageBox.Show(fStatus[0].filename + " " + fStatus[0].status);
        }
      }
    }
    
  • invoice_put_invoice
    Operation type:
    Used for creating new invoices from existing XML invoice files or ZIP files with XML files and attachments.

    “Status” can be one of the following:

    • OK: INVOICE CREATED SUCCESSFULLY
    • ERROR: UNSUPPORTED XML FORMAT
    • ERROR: FILE OR FILENAME BLANK
    • ERROR: FILENAME CONTAINS INVALID CHARACTERS
    • ERROR: FILENAME INSIDE ZIP CONTAINS INVALID CHARACTERS OR IS INVALID TYPE
    • ERROR: INVALID ZIP FILE
    • ERROR: COULD NOT SAVE FILES TO DISK
    • ERROR: FILENAME CONTAINS INVALID CHARACTERS OR IS INVALID TYPE
    • ERROR: FILE IS EMPTY
    • ERROR: NO XML FILE OR MORE THAN ONE FOUND
    • ERROR: UNKNOWN ERROR
    SOAP action:
    /v1.1/api/invoice_put_invoice
    Input:
    api-invoice_put_invoice (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string

    file_in FileAttachment

    • attachment_type string #Not needed on input
    • filename string #Allowed characters [A-z0-9_.] (no spaces or other special characters allowed)
    • file base64 #File contant itself (XML or ZIP)
    xmlformat string #Currently supports “vismaxml”, “svefaktura”, “sedi”, “e2b”, “ehf”, “peppolbis20”, “siubl11”, “vismaubl”
    Output:
    api-invoice_put_invoiceResponse (soap:body, use = encoded)

    return InvoiceStatus

    • status string #Status string, includes OK or ERROR
    • invoice_id string #36 character UUID of new invoice if successfully created
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    file_out = Hash.new
    file_out[:file] = SOAP::Attachment.new(File.new("invoice.xml")).to_s
    file_out[:filename] = "invoice.xml"
    
    result = server.invoice_put_invoice(api_keys, file_out, "vismaxml")
    puts "#{result.status} #{result.invoice_id}"
    
    

    Example in C#

    //WSDL at https://testing.maventa.com/apis/v1.1/wsdl needs to be added as web
    //reference for the example to work
    
    using System;
    using System.IO;
    using System.Collections.Generic;
    using System.Drawing;
    using System.Windows.Forms;
    using MaventaAPI;
    
    namespace MaventaDemo
    {
      public partial class MainForm : Form
      {
        public MainForm()
        {
          MaventaService m_server = new MaventaService();
          ApiKeys apiKeyParams = new ApiKeys();
          apiKeyParams.user_api_key = "";
          apiKeyParams.company_uuid = "";
    
          FileAttachment fileOut = new FileAttachment();
    
          fileOut.filename = "1001.xml";
          fileOut.file = File.ReadAllBytes("1001.xml");
    
          FileStatus[] fStatus = m_server.invoice_put_invoice(apiKeyParams, fileOut, "svefaktura");
          MessageBox.Show(fStatus[0].filename + " " + fStatus[0].status);
        }
      }
    }
    
    
  • invoice_put_invoice_with_metadata
    Operation type:
    Used for creating new invoices from existing XML invoice files or ZIP files with XML files and attachments. Additional information which XML cannot represent can be given in metadata (currently routing info and disabled routes functionality)

    “Status” can be one of the following:

    • OK: INVOICE CREATED SUCCESSFULLY
    • ERROR: UNSUPPORTED XML FORMAT
    • ERROR: FILE OR FILENAME BLANK
    • ERROR: FILENAME CONTAINS INVALID CHARACTERS
    • ERROR: FILENAME INSIDE ZIP CONTAINS INVALID CHARACTERS OR IS INVALID TYPE
    • ERROR: INVALID ZIP FILE
    • ERROR: COULD NOT SAVE FILES TO DISK
    • ERROR: FILENAME CONTAINS INVALID CHARACTERS OR IS INVALID TYPE
    • ERROR: FILE IS EMPTY
    • ERROR: NO XML FILE OR MORE THAN ONE FOUND
    • ERROR: UNKNOWN ERROR
    SOAP action:
    /v1.1/api/invoice_put_invoice_with_metadata
    Input:
    api-invoice_put_invoice_with_metadata (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string

    file_in FileAttachment

    • attachment_type string #Not needed on input
    • filename string #Allowed characters [A-z0-9_.] (no spaces or other special characters allowed)
    • file base64 #File contant itself (XML or ZIP)
    xmlformat string #Currently supports “vismaxml”, “svefaktura”, “sedi”, “e2b”, “ehf”, “peppolbis20”, “siubl11”, “vismaubl”
    metadata string #JSON struct, example: {“version”: “1.1”, “routing” :{“receiver_eia”: “00371111111”, “receiver_operator_id”: “003721291126”}, “disabled_routes_out” :{“paper”: “true”, “email”: “false”, “relay”: “true”}}
    Output:
    api-invoice_put_invoice_with_metadataResponse (soap:body, use = encoded)

    return InvoiceStatus

    • status string #Status string, includes OK or ERROR
    • invoice_id string #36 character UUID of new invoice if successfully created
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    file_out = Hash.new
    file_out[:file] = SOAP::Attachment.new(File.new("invoice.xml")).to_s
    file_out[:filename] = "invoice.xml"
    
    metadata = "{\"version\": \"1.1\", \"routing\" :{\"receiver_eia\": \"003122312555\", \"receiver_operator_id\": \"003721291126\"}}"
    
    result = server.invoice_put_invoice_with_metadata(api_keys, file_out, "vismaxml", metadata)
    puts "#{result.status} #{result.invoice_id}"
    
    

    Example in C#

    //WSDL at https://testing.maventa.com/apis/v1.1/wsdl needs to be added as web
    //reference for the example to work
    
    using System;
    using System.IO;
    using System.Collections.Generic;
    using System.Drawing;
    using System.Windows.Forms;
    using MaventaAPI;
    
    namespace MaventaDemo
    {
      public partial class MainForm : Form
      {
        public MainForm()
        {
          MaventaService m_server = new MaventaService();
          ApiKeys apiKeyParams = new ApiKeys();
          apiKeyParams.user_api_key = "";
          apiKeyParams.company_uuid = "";
    
          FileAttachment fileOut = new FileAttachment();
    
          fileOut.filename = "1001.xml";
          fileOut.file = File.ReadAllBytes("1001.xml");
    
        string metaData = "{\"version\": \"1.1\", \"routing\": {\"receiver_eia\": \"720031223125\", \"receiver_operator_id\": \"003721291126\"}}";
    
          FileStatus[] fStatus = m_server.invoice_put_invoice(apiKeyParams, fileOut, "svefaktura", metaData);
          MessageBox.Show(fStatus[0].filename + " " + fStatus[0].status);
        }
      }
    }
    
    
  • invoice_show
    Operation type:

    Used for getting information about a specific outbound invoice.Arguments

    1. api_keys (required)
    2. id string (invoice id)
    3. include_files boolean (download invoice image and attachments)
    4. xmlformat string (nil, finvoice, finvoice2, oio, teapps, ebis, ubl, liinos, svefaktura, sedi, ehf, vismaxml, e2b, woodx, facturae, bgc or ubl)
    SOAP action:
    /v1.1/api/invoice_show
    Input:
    api-invoice_show (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    id string
    include_files boolean
    xmlformat string
    Output:
    api-invoice_showResponse (soap:body, use = encoded)

    return InvoiceParamsOutD

    • status string #Status
    • id string #Invoice db-id
    • state int #Invoice state
    • currency string #Currency abbrevation
    • invoice_nr string #Invoice number
    • order_nr string #Order number
    • sum string #Total sum without tax
    • sum_tax string #Total sum with tax
    • delivery_date string #Delivery date, YYYYMMDD
    • delivery_type string #Delivery type for invoiced product (e.g. truck, mail…)
    • reference_nr string #Invoice payment reference number
    • date string #Invoicing date, YYYYMMDD
    • date_due string #Invoice due date, YYYYMMDD
    • company_interest string #Company’s interest rate (e.g. 11.5)
    • company_reminder string #Company’s reminder fee in invoices currency (e.g. 5.50)
    • company_paper_fee string #Company’s paper fee, added if customer requests paper invoice (e.g. 3.25)
    • customer_reference string #Reference for customer (“Viitteenne”)
    • company_reference string #Reference for company (“Viitteemme”)
    • company_comment string #Comment for email invoice
    • customer_comment string #Recipient comment (from decline invoice)
    • notes string #Additional freetext information for invoice
    • lang string #Language code for invoice (e.g. ‘FI’)
    • customer_nr string #Customer number
    • customer_name string #Name of recipient
    • customer_email string #Email of recipient. If left blank, no email notification can/will be sent
    • customer_bid string #Business ID, VAT, organization number etc
    • customer_contact_p string #Contact person’s name
    • customer_address1 string #First line of street address
    • customer_address2 string #Second line of street address
    • customer_post_code string #Postal code
    • customer_post_office string #Postal office
    • customer_state string #State
    • customer_country string #Country (e.g. ‘FI’)
    • customer_ovt string #EDI-code (OVT), e-invoice address
    • work_order_nr string #Work order nr
    • payment_terms string #Payment terms
    • items ItemsOutArray – array of ItemsOut
      • subject string #Subject string
      • amount double #Amount/quantity of items
      • price string #Unit price
      • tax double # VAT tax for item, expressed as a percentage, e.g. 22.0 is 22%
      • sum string #Sum without VAT tax for item row, dot as decimal separator (e.g. ‘123.45’)
      • sum_tax string #Sum including VAT tax for item row, dot as decimal separator (e.g. ‘123.45’)
      • item_code string #Item code
      • definition string #Additional definition for item (freetext)
      • position int #Position in item list
      • unit_type string #Unit of item (e.g. ‘km’ or ‘h’)
      • discount double #Discount percentage (e.g. 12.5)
    • attachments FileAttachmentArray – array of FileAttachment
      • attachment_type string
      • filename string
      • file base64
    • accounts InvoiceAccountParamsOutArray – array of InvoiceAccountParamsOut
      • status string
      • account string
      • iban string
      • bank string
      • swift string
    • actions InvoiceActionParamsOutArray – array of InvoiceActionParamsOut
      • timestamp string
      • action string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    result = server.invoice_show(api_keys, "1c555458-fa83-402b-a1f6-4d22071020a8", true, "teapps")
    if result.status == "OK"
      puts "Invoice number: " + result.invoice_nr
    
      if result.attachments
        result.attachments.each do |fa|
          File.open(fa.filename, 'wb') do |f|
            f<<(fa.file)
          end
        end
      end
    end
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    import base64
    
    response_code, result = client.service.invoice_show(api_keys, "1c555458-fa83-402b-a1f6-4d22071020a8", True, "ubl")
    
    if response_code == 200:
      if result.status == "OK":
        print "Invoice number: " + result.invoice_nr
        if result.attachments:
            for attachment in result.attachments:
                open(fa.filename, 'w').write(base64.decodestring(fa.file))
    
    
  • invoice_state_list
    Operation type:
    Used for getting list of states for given set of invoices and can be used to update state of multiple invoices at once.
    SOAP action:
    /v1.1/api/invoice_state_list
    Input:
    api-invoice_state_list (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    invoices StringArray – array of string
    Output:
    api-invoice_state_listResponse (soap:body, use = encoded)

    return InvoiceStateArray – array of InvoiceState

    • status string
    • state int
    • invoice_id string

    “State” can be one of the following:

    • 0 = PENDING – Awaiting delivery (scheduled transmission)
    • 1 = SENT – Invoice sent
    • 2 = DECLINED – Rejected/declined by the recipient (Only e-mail and internal Maventa)
    • 3 = ACCEPTED – approved/accepted by the recipient (Only e-mail and internal Maventa)
    • 6 = PAID – Invoice marked as paid by sender (Internal Maventa only)
    • 7 = VIEWED – Invoice link opened by the recipient
    • 92 = DISPUTED – Dispueted by the recipient (Only internal Maventa)
    • 99 = ERROR – Send error occurred

    “Status” can be one of the following:

    • “OK” or
    • “ERROR: NO INVOICES FOUND”
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    invoices = Array.new
    invoices.push("00521759-4570-467c-98dd-c496b22de0ba")
    invoices.push("049b161d-4d15-45a9-95f6-f669d26acf51")
    invoices.push("128dc817-90ae-4fa5-a0af-8e24e7650a72")
    invoices.push("1c555458-fa83-402b-a1f6-4d22071020a8")
    invoices.push("505459bf-8507-42ee-b0da-470f2407c96f")
    invoices.push("5ad8cec7-ef53-4161-b9e1-da1921b29f43")
    
    result = server.invoice_state_list(api_keys, invoices)
    if result[0].status == "OK"
      result.each do |i|
        puts "#{i.invoice_id}: #{i.state}"
      end
    end
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    invoices = []
    invoices.append("00521759-4570-467c-98dd-c496b22de0ba")
    invoices.append("049b161d-4d15-45a9-95f6-f669d26acf51")
    invoices.append("128dc817-90ae-4fa5-a0af-8e24e7650a72")
    invoices.append("1c555458-fa83-402b-a1f6-4d22071020a8")
    
    response_code, result = client.service.invoice_state_list(api_keys, invoices)
    
    if response_code == 200:
      if result[0].status == "OK":
          for i in result:
              print "%(invoice_id): %(state)s" % dict(invoice_id=i.invoice_id, state=i.state)
    
    
  • partner_trx_list
    Operation type:

    DEPRICATED!

    Used for getting a list of all transactions from given software between given dates (defined by software API key).Arguments

  • postal_address_create
    Operation type:

    Used for adding a postal address for the company.Possible return values are:

    • 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
    SOAP action:
    /v1.1/api/postal_address_create
    Input:
    api-postal_address_create (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string

    postal_address_params PostalAddressParamsIn

    • default boolean
    • company_name string
    • lang string
    • state string
    • post_code string
    • post_office string
    • phone string
    • address1 string
    • gsm string
    • address2 string
    • country string
    • city string
    • fax string
    Output:
    api-postal_address_createResponse (soap:body, use = encoded)
    return string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    postal_address = Hash.new
    postal_address[:address1]    = "Company address"
    postal_address[:address2]    = ""
    postal_address[:post_code]   = "00100"
    postal_address[:post_office] = "Helsinki"
    postal_address[:city]        = "Helsinki"
    postal_address[:state]       = ""
    postal_address[:country]     = "FI"
    
    puts server.postal_address_create(api_keys, postal_address)
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    postal_address = client.factory.create("PostalAddressParamsIn")
    postal_address.address1    = "Company address"
    postal_address.address2    = ""
    postal_address.post_code   = "00100"
    postal_address.post_office = "Helsinki"
    postal_address.city        = "Helsinki"
    postal_address.state       = ""
    postal_address.country     = "FI"
    
    print client.service.postal_address_create(api_keys, postal_address)
    
    
  • postal_address_delete
    Operation type:

    Used for deleting postal address.Possible return values are:

    • 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
    SOAP action:
    /v1.1/api/postal_address_delete
    Input:
    api-postal_address_delete (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    id string
    Output:
    api-postal_address_deleteResponse (soap:body, use = encoded)
    return string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    puts server.postal_address_delete(api_keys, "bc645d0c-64ed-4ad2-a8eb-bfc2af00ed46")
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    print client.service.postal_address_delete(api_keys, "bc645d0c-64ed-4ad2-a8eb-bfc2af00ed46")
    
    
  • postal_address_list
    Operation type:
    Used for listing all the company’s postal addresses.
    SOAP action:
    /v1.1/api/postal_address_list
    Input:
    api-postal_address_list (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    Output:
    api-postal_address_listResponse (soap:body, use = encoded)

    return PostalAddressParamsOutArray – array of PostalAddressParamsOut

    • status string
    • default boolean
    • lang string
    • state string
    • post_code string
    • phone string
    • post_office string
    • address1 string
    • gsm string
    • city string
    • country string
    • id string
    • address2 string
    • fax string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    results = server.postal_address_list(api_keys)
    
    if results[0].status == "OK"
      results.each do |result|
        puts result.id, result.address1, result.address2, result.post_code,
        result.post_office, result.city, result.state, result.country
    
      end
    end
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    response_code, res = client.service.postal_address_list(api_keys)
    
    if res.status == "OK":
        for r in res:
            print r.id, r.address1, r.address2, r.post_code, r.post_office, r.city,\
            r.state, r.country
    
    
    
  • postal_address_show
    Operation type:
    Used displaying information for a specific postal address.
    SOAP action:
    /v1.1/api/postal_address_show
    Input:
    api-postal_address_show (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    id string
    Output:
    api-postal_address_showResponse (soap:body, use = encoded)

    return PostalAddressParamsOut

    • status string
    • default boolean
    • lang string
    • state string
    • post_code string
    • phone string
    • post_office string
    • address1 string
    • gsm string
    • city string
    • country string
    • id string
    • address2 string
    • fax string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    result = server.postal_address_show(api_keys, "bc645d0c-64ed-4ad2-a8eb-bfc2af00ed46")
    
    if result.status == "OK"
      puts result.id, result.address1, result.address2, result.post_code,
      result.post_office, result.city, result.state, result.country
    
    end
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    response_code, res = client.service.postal_address_show(api_keys, "bc645d0c-64ed-4ad2-a8eb-bfc2af00ed46")
    
    if res.status == "OK":
        print res.id, res.address1, res.address2, res.post_code, res.post_office,\
        res.city, res.state, res.country
    
    
    
  • postal_address_update
    Operation type:

    Used for updating an existing postal address.Possible return values are:

    • 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
    SOAP action:
    /v1.1/api/postal_address_update
    Input:
    api-postal_address_update (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    id string

    postal_address_params PostalAddressParamsIn

    • default boolean
    • company_name string
    • lang string
    • state string
    • post_code string
    • post_office string
    • phone string
    • address1 string
    • gsm string
    • address2 string
    • country string
    • city string
    • fax string
    Output:
    api-postal_address_updateResponse (soap:body, use = encoded)
    return string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    postal_address = Hash.new
    postal_address[:address1]    = "Company address updated"
    postal_address[:address2]    = ""
    postal_address[:post_code]   = "00100"
    postal_address[:post_office] = "Helsinki"
    postal_address[:city]        = "Helsinki"
    postal_address[:state]       = ""
    postal_address[:country]     = "FI"
    
    puts server.postal_address_update(api_keys, "bc645d0c-64ed-4ad2-a8eb-bfc2af00ed46", postal_address)
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    postal_address = client.factory.create("PostalAddressParamsIn")
    postal_address.address1    = "Company address updated"
    postal_address.address2    = ""
    postal_address.post_code   = "00100"
    postal_address.post_office = "Helsinki"
    postal_address.city        = "Helsinki"
    postal_address.state       = ""
    postal_address.country     = "FI"
    
    print client.service.postal_address_update(api_keys, "bc645d0c-64ed-4ad2-a8eb-bfc2af00ed46", postal_address)
    
    
  • register_with_password
    Operation type:

    Method register_with_password can be used to register new companies trough the API with predefined password (if given). 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.This method returns a RegistrationParamsOutD struct which includes the new user’s API key, the company’s UUID and e-invoice address for receiving. 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. Note! If given user (e-mail) exists, API key will not be returned for security reasons. The user will then get access to the newly created company with the same user account. In this case the password will not be updated. Note! Password minimum length 8 characters

    SOAP action:
    /v1.1/api/register_with_password
    Input:
    api-register_with_password (soap:body, use = encoded)

    registration_params RegistrationParamsIn

    • vendor_api_key string #Identifies partner/ERP, mandatory
    • license_agreement boolean #Registering company must accept Maventa user agreement, mandatory
    • company_name string #Company name, mandatory
    • company_bid string #Company VAT/Business ID/Organization number (VAT preferred), mandatory
    • company_email string #Contact email address for company, mandatory
    • no_vat boolean #If company_bid is not a VAT-number, this is set to true to skip VAT-check
    • receive_invoices boolean #Select if company wants to receive e-invoices on their account
    • #User information
    • user_first_name string #First name, mandatory
    • user_last_name string #Last name, mandatory
    • user_email string #Email is used as login to portal and needs to be unique, mandatory
    • user_phone string #Depending on invoice format, phone number might be visible on invoices
    • email_activation boolean #Possibility to skip email activation by link (partner has verified email)
    • #Company postal address
    • address1 string #Street address, mandatory
    • address2 string #Additional address
    • post_code string #Postal number/code, mandatory
    • post_office string #Post office, mandatory
    • city string #Registered city, mandatory
    • state string #State of address
    • country string #Country code for company, mandatory
    • bank_accounts BankAccountParamsInArray – array of BankAccountParamsIn #Bank accounts are not required for registration and needed only if invoicing format does not include bank account details
      • account string
      • default boolean
      • iban string
      • swift string
      • bank string
    user_password string #if not given, random password will be generated
    Output:
    api-registerResponse (soap:body, use = encoded)

    return RegistrationParamsOutD

    • status string
    • company_uuid string
    • user_api_key string
    • company_maventa_id string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    registration_params = Hash.new
    
    #vendor api key needs to be set and valid for register request to work
    registration_params[:vendor_api_key] = "bccd8e6e-fc64-427a-b1b2-3c3ab578e370"
    
    #license agreement needs to be agreed, vendor makes sure user can read the
    #agreement
    registration_params[:license_agreement] = true
    
    #company name and bid/vat
    registration_params[:company_name] = "api test"
    registration_params[:company_bid] = "fi12345671"
    
    #company has vat code or no
    registration_params[:no_vat] = true
    
    #Receiving invoices on/off
    registration_params[:receive_invoices] = true
    
    #Require activation of email address
    registration_params[:email_activation] = false
    
    #user information, activation email with password is sent to this email address
    registration_params[:user_first_name] = "api"
    registration_params[:user_last_name] = "test"
    registration_params[:user_email] = "apitest@maventa.com"
    registration_params[:user_phone] = "040 123 4566"
    
    #company address information
    registration_params[:address1] = "test street 1"
    registration_params[:address2] = "section c"
    registration_params[:post_code] = "00100"
    registration_params[:post_office] = "helsinki"
    registration_params[:city] = "helsinki"
    registration_params[:state] = nil
    registration_params[:country] = "fi"
    
    #bank account information, not mandatory since account information can be given
    #in the invoice_create request when using the new api
    bank_account_params = array.new
    
    ba1 = hash.new
    ba1[:bank] = "testbank 1"
    ba1[:iban] = "f1111 1221121"
    ba1[:swift] = "tstbnkfi"
    ba1[:account] = "12222-42211"
    ba1[:default] = true
    
    ba2 = hash.new
    ba2[:bank] = "testbank 2"
    ba2[:iban] = "f222 2221222"
    ba2[:swift] = "tstbnkfi"
    ba2[:account] = "222122-42221"
    
    bank_account_params.push(ba1)
    bank_account_params.push(ba2)
    
    registration_params[:bank_accounts] = bank_account_params
    
    result = server.register_with_password(registration_params, user_password)
    
    if result.status == "OK"
      puts "user api key: #{result.user_api_key}"
      puts "company uuid: #{result.company_uuid}"
      puts "company e-invoice address: #{result.e_invoice_address}"
    end
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    #vendor api key needs to be set and valid for register request to work
    registration_params = client.factory.create("RegistrationParamsIn")
    registration_params.vendor_api_key = ""
    
    #license agreement needs to be agreed, vendor makes sure user can read the
    #agreement
    registration_params.license_agreement = True
    
    #company name and bid/vat
    registration_params.company_name = "api test"
    registration_params.company_bid = "fi12345671"
    
    #company has vat code or no
    registration_params.no_vat = True
    
    #user information, activation email with password is sent to this email address
    registration_params.user_first_name = "api"
    registration_params.user_last_name = "test"
    registration_params.user_email = "apitest@maventa.com"
    registration_params.user_phone = "040 123 4566"
    
    #company address information
    registration_params.address1 = "test street 1"
    registration_params.address2 = "section c"
    registration_params.post_code = "00100"
    registration_params.post_office = "helsinki"
    registration_params.city = "helsinki"
    registration_params.state = None
    registration_params.country = "fi"
    
    #bank account information, not mandatory since account information can be given
    #in the invoice_create request when using the new api
    ba1 = client.factory.create("BankAccountParamsIn")
    ba1.bank = "testbank 1"
    ba1.iban = "f1111 1221121"
    ba1.swift = "tstbnkfi"
    ba1.account = "12222-42211"
    ba1.default = True
    
    ba1 = client.factory.create("BankAccountParamsIn")
    ba2.bank = "testbank 2"
    ba2.iban = "f222 2221222"
    ba2.swift = "tstbnkfi"
    ba2.account = "222122-42221"
    ba2.default = False
    
    registration_params.bank_accounts = [ba1, ba2]
    
    response_code, result = client.service.register_with_password(registration_params, user_password)
    
    if response_code == 200:
      if result.status == "OK":
        print "user api key: " + result.user_api_key
        print "company uuid: " + result.company_uuid
        print "company e-invoice address:: " + result.e_invoice_address
    
    
  • server_time
    Operation type:
    Used for getting current server time for timestamping purposes.
    This method returns a string with the current server time (format “YYYYMMDDHHMMSS”).
    SOAP action:
    /v1.1/api/server_time
    Input:
    api-server_time (soap:body, use = encoded)
    Output:
    api-server_timeResponse (soap:body, use = encoded)
    return string
    Example code:

    Example in Ruby

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

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    print client.service.server_time()
    
    
  • user_create
    Operation type:

    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.Returns string which contains the new user’s API key or an ERROR message.

    Return values include:

    • 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
    SOAP action:
    /v1.1/api/user_create
    Input:
    api-user_create (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string

    user_params UserParamsIn

    • email string #Email address, needs to be unique
    • user_role string #Role can be ADMIN or USER. ADMIN has access to company settings etc.
    • first_name string #First name for user, mandatory
    • last_name string #Last name of user, mandatory
    • phone string #Phone number
    • notifications_disabled boolean #If set to false, user will not receive e-mail notifications for their invoices e.g. when receiver accepts invoice etc. (only applies inside Maventa network)
    Output:
    api-user_createResponse (soap:body, use = encoded)
    return string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    user = Hash.new
    user[:first_name]            = 'Test'
    user[:last_name]             = 'Person2'
    user[:email]                 = 'test.person2@company'
    user[:phone]                 = '123-555-12345'
    user[:user_role]             = 'USER' # Can be also ADMIN
    
    puts server.user_create(api_keys, user)
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    user = client.factory.create("UserParamsIn")
    user.first_name            = 'Test'
    user.last_name             = 'Person2'
    user.email                 = 'test.person2@company'
    user.phone                 = '123-555-12345'
    user.user_role             = 'USER' # Can be also ADMIN
    
    print client.service.user_create(api_keys, user)
    
    print client.service.server_time()
    
    
  • user_create_e
    Operation type:

    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.Returns string which contains the new user’s API key or an ERROR message.

    Return values include:

    • 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
    SOAP action:
    /v1.1/api/user_create_e
    Input:
    api-user_create_e (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string

    user_params UserParamsIn

    • email string #Email address, needs to be unique
    • user_role string #Role can be ADMIN or USER. ADMIN has access to company settings etc.
    • first_name string #First name for user, mandatory
    • last_name string #Last name of user, mandatory
    • phone string #Phone number
    • notifications_disabled boolean #If set to false, user will not receive e-mail notifications for their invoices e.g. when receiver accepts invoice etc. (only applies inside Maventa network)
    • emails_disabled boolean #If set to false, user will not receive any e-mail notifications e.g. invoice send errors and such.
    Output:
    api-user_create_eResponse (soap:body, use = encoded)
    return string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    user = Hash.new
    user[:first_name]            = 'Test'
    user[:last_name]             = 'Person2'
    user[:email]                 = 'test.person2@company'
    user[:phone]                 = '123-555-12345'
    user[:user_role]             = 'USER' # Can be also ADMIN
    
    puts server.user_create_e(api_keys, user)
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    user = client.factory.create("UserParamsIn")
    user.first_name            = 'Test'
    user.last_name             = 'Person2'
    user.email                 = 'test.person2@company'
    user.phone                 = '123-555-12345'
    user.user_role             = 'USER' # Can be also ADMIN
    
    print client.service.user_create_e(api_keys, user)
    
    
  • user_delete
    Operation type:

    Used for deleting user from your company account. You cannot delete your own account.Return values include:

    • 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
    SOAP action:
    /v1.1/api/user_delete
    Input:
    api-user_delete (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    id string
    Output:
    api-user_deleteResponse (soap:body, use = encoded)
    return string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    puts server.user_delete(api_keys, "10f1626d-ceb6-414e-9120-bebd9d78524f")
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    print client.service.user_delete(api_keys, "10f1626d-ceb6-414e-9120-bebd9d78524f")
    
    
    
  • user_list
    Operation type:
    Used for listing your company’s users.
    SOAP action:
    /v1.1/api/user_list
    Input:
    api-user_list (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    Output:
    api-user_listResponse (soap:body, use = encoded)

    return UserParamsOutArray – array of UserParamsOut

    • status string
    • email string
    • user_role string
    • first_name string
    • last_name string
    • phone string
    • id string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    results = server.user_list(api_keys)
    
    if results[0].status == "OK"
      results.each do |result|
        puts result.first_name, result.last_name, result.email, result.user_role
      end
    end
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    response_code, result = client.service.user_list(api_keys)
    
    if result[0].status == "OK":
        for r in result:
            print r.first_name, r.last_name, r.email, r.user_role
    
    
  • user_show
    Operation type:
    Used for showing information about a specific user.
    SOAP action:
    /v1.1/api/user_show
    Input:
    api-user_show (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    id string
    Output:
    api-user_showResponse (soap:body, use = encoded)

    return UserParamsOut

    • status string
    • email string
    • user_role string
    • first_name string
    • last_name string
    • phone string
    • id string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    result = server.user_show(api_keys, "123456-123123")
    
    if result.status == "OK"
      puts result.first_name, result.last_name, result.email, result.user_role
    end
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    response_code, res = client.service.user_show(api_keys, "123456-123123")
    
    if response_code == 200:
      if res[0].status == "OK":
          print res.first_name, res.last_name, res.email, res.user_role
    
    
  • user_update
    Operation type:

    Used for updating users details on your company account. You cannot update a user’s email address trough the API.Return values include:

    • 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
    SOAP action:
    /v1.1/api/user_update
    Input:
    api-user_update (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    id string

    user_params UserParamsIn

    • email string
    • user_role string
    • first_name string
    • last_name string
    • phone string
    • notifications_disabled boolean #If set to true, user will not receive e-mail notifications for their invoices e.g. when receiver accepts invoice etc. (only applies inside Maventa network)
    Output:
    api-user_updateResponse (soap:body, use = encoded)
    return string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    user = Hash.new
    user[:first_name]            = 'Test'
    user[:last_name]             = 'Person2'
    user[:phone]                 = '123-555-12345'
    
    puts server.user_update(api_keys, "10f1626d-ceb6-414e-9120-bebd9d78524f", user)
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    user = client.factory.create("UserParamsIn")
    user.first_name            = 'Test'
    user.last_name             = 'Person2'
    user.phone                 = '123-555-12345'
    
    print client.service.user_update(api_keys, "10f1626d-ceb6-414e-9120-bebd9d78524f", user)
    

     

  • user_update_e
    Operation type:

    Used for updating users details on your company account. You cannot update a user’s email address trough the API.Return values include:

    • 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
    SOAP action:
    /v1.1/api/user_update_e
    Input:
    api-user_update_e (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    id string

    user_params UserParamsIn

    • email string
    • user_role string
    • first_name string
    • last_name string
    • phone string
    • notifications_disabled boolean #If set to true, user will not receive e-mail notifications for their invoices e.g. when receiver accepts invoice etc. (only applies inside Maventa network)
    • emails_disabled boolean #If set to true, user will not receive any e-mail notifications e.g. invoice send errors and such
    Output:
    api-user_update_eResponse (soap:body, use = encoded)
    return string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    user = Hash.new
    user[:first_name]            = 'Test'
    user[:last_name]             = 'Person2'
    user[:phone]                 = '123-555-12345'
    user[:emails_disabled]              = 'true'
    
    puts server.user_update_e(api_keys, "10f1626d-ceb6-414e-9120-bebd9d78524f", user)
    
    

    Example in Python

    import suds
    from suds.client import Client
    from suds.xsd.doctor import ImportDoctor, Import
    import logging
    import logging.handlers
    
    # Add the log message handler to the logger
    handler = logging.handlers.RotatingFileHandler("suds.log", maxBytes=1531072, backupCount=5)
    
    suds_logger = logging.getLogger("suds.client")
    suds_logger.setLevel(logging.DEBUG)
    suds_logger.addHandler(handler)
    
    # Fix issue with wsdl https://fedorahosted.org/suds/ticket/220
    imp = Import("http://schemas.xmlsoap.org/soap/encoding/")
    imp.filter.add("https://testing.maventa.com/")
    d = ImportDoctor(imp)
    
    client = Client("https://testing.maventa.com/apis/v1.1/wsdl", doctor = d, faults=False)
    
    api_keys = client.factory.create("ApiKeys")
    api_keys.vendor_api_key = ""
    api_keys.user_api_key = ""
    api_keys.company_uuid = ""
    
    user = client.factory.create("UserParamsIn")
    user.first_name            = 'Test'
    user.last_name             = 'Person2'
    user.phone                 = '123-555-12345'
    
    print client.service.user_update_e(api_keys, "10f1626d-ceb6-414e-9120-bebd9d78524f", user)
    

     

  • update_logo
    Operation type:

    Used for uploading company logo to Maventa for PDF template output when PDF template is not generated in ERP. Most image formats are supported but not PDF. JPEG or PNG is prefered.Return values include:

    • OK
    • ERROR: COULD NOT UPDATE LOGO File format not supported
    SOAP action:
    /v1.1/api/update_logo
    Input:
    api-update_logo (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string

    company_logo_params CompanyLogoParams

    • logo base64 #Company logofile
    • logo_w int #Logo placement options
    • logo_x int member :logo_h, :int
    Output:
    api-update_logoResponse (soap:body, use = encoded)
    return string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    company_logo_params = Hash.new
    company_logo_params[:logo] = SOAP::Attachment.new(File.new("logo.png").to_s
    company_logo_params[:logo_x] = 5
    
    puts server.update_logo(api_keys, company_logo_params)
    
    
    
  • remove_logo
    Operation type:

    Removes uploaded logo from serverReturn values include:

    • OK
    • ERROR: COULD NOT SAVE SETTINGS Logo could not be removed
    SOAP action:
    /v1.1/api/remove_logo
    Input:
    api-remove_logo (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    Output:
    api-remove_logoResponse (soap:body, use = encoded)
    return string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    puts server.remove_logo(api_keys)
    
    
    
  • list_operators
    Operation type:

    Lists currently supported roaming operators and their operator codesReturn values include:

    • Array of OperatorInfo
    SOAP action:
    /v1.1/api/list_operators
    Input:
    api-list_operators (soap:body, use = encoded)
    Output:
    api-list_operatorsResponse (soap:body, use = encoded)
    • operator_id string #Operator code
    • name string #Operator name
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    result = server.list_operators
    result.each do |op|
      puts "#{op.name}: #{op.operator_id}"
    end
    
    
    
  • get_invoice_id
    Operation type:

    Find invoice unique ID for given invoice number. Only works for unique hits per companyReturn values include:

    • ERROR: NO INVOICE NUMBER GIVEN
    • ERROR: NO INVOICE FOUND
    • ERROR: MULTIPLE INVOICES FOUND WITH NUMBER #{invoice_number}
    • INVOICE ID (36 character UUID)
    SOAP action:
    /v1.1/api/get_invoice_id
    Input:
    api-get_invoice_id (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    invoice_number string
    Output:
    api-get_invoice_idResponse (soap:body, use = encoded)
    return string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    result = server.get_invoice_id(api_keys, "1234")
    if result =~ /ERROR/
      puts result
    else
      puts "Invoice ID is: #result"
    end
    
    
  • get_invoice_image_as_format
    Operation type:
    Returns given invoice’s invoice image in specified format (normally PDF). Currently only supports TIFF
    SOAP action:
    /v1.1/api/get_invoice_image_as_format
    Input:
    api-get_invoice_image_as_format (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    • invoice_id string #Invoice UUID
    • image_format string #Format, currently only TIFF
    Output:
    api-get_invoice_image_as_formatResponse (soap:body, use = encoded)
    return Array of FileAttachment
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    result = server.get_invoice_image_as_format(api_keys, "1276f4d5-4eff-4f4d-bd23-cab71bd226a6", "TIFF")
    if result
      fa = result.first
      puts "Saving attachment #{fa.filename}"
      File.open("#{fa.filename}", 'wb') { |f| f << fa.file }
    else
    puts "Error"
    end
    
    
    
  • list_vendor_actions
    Operation type:
    List all actions for given vendor API key after given timestamp. This is used to batch query all partner’s user companies’ actions in one request. The output lists new actions since given timestamp per company and that information can then be used to for example download all new incoming invoices.
    SOAP action:
    /v1.1/api/list_vendor_actions
    Input:
    api-list_vendor_actions (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    • timestamp string #format “YYYYMMDDHHMMSS”)
    Output:
    api-list_vendor_actionsResponse (soap:body, use = encoded)

    return Array of VendorActionOutput

    • status string
    • vendor_actions Array of VendorAction
      • company_id string #36 character UUID of company
      • incoming_invoices Array of string #Array of ids for new incoming invoices
      • invoice_errors Array of string #Array of ids for invoices with new errors
      • incoming_orders Array of string #Array of ids for new incoming orders
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    res = server.list_vendor_actions(api_keys, "20120501152042")
    if res.status == "OK"
      res.vendor_actions.each do |va|
        puts "COMPANY: #{va.company_id}"
        puts "  INCOMING INVOICES: #{va.incoming_invoices.join(',')}"
        puts "  ERRORS: #{va.invoice_errors.join(',')}"
        api_keys[:user_api_key] = "12307dc7-a0f4-4b1a-957e-22a2039a044b"
        api_keys[:company_uuid] = "1239198d-437b-4ee1-9262-bb1ca565f7b6"
        va.invoice_errors.each do |error|
          puts "    #{error}: #{server.invoice_show(api_keys, error, false, nil).error_message}"
        end
      end
    else
      puts res.status
    end
    
    
    
  • list_company_actions
    Operation type:
    List all actions for given company after given timestamp. This is used to query all company’s new actions in one request. The output lists new actions since given timestamp and that information can then be used to for example download all new incoming invoices.
    SOAP action:
    /v1.1/api/list_company_actions
    Input:
    api-list_company_actions (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    • timestamp string #format “YYYYMMDDHHMMSS”)
    Output:
    api-list_company_actionsResponse (soap:body, use = encoded)

    return Array of CompanyActionOutput

    • status string
    • company_id string #36 character UUID of company
    • incoming_invoices Array of string #Array of ids for new incoming invoices
    • invoice_errors Array of string #Array of ids for invoices with new errors
    • incoming_orders Array of string #Array of ids for new incoming orders
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    res = server.list_company_actions(api_keys, "20120501152042")
    if res.status == "OK"
      puts "INCOMING INVOICES: #{res.incoming_invoices.join(',')}"
      puts "ERRORS: #{res.invoice_errors.join(',')}"
      res.invoice_errors.each do |error|
        puts "    #{error}: #{server.invoice_show(api_keys, error, false, nil).error_message}"
      end
    else
      puts res.status
    end
    
    
  • enable_operator
    Operation type:
    Enables operator connections that require it done separately. Currently needed for PEPPOL receiving.
    SOAP action:
    /v1.1/api/enable_operator
    Input:
    api-enable_operator (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string

    operator_struct OperatorStruct

    • operator_id string #Operator name/codeFor PEPPOL, values are:
      • PEPPOL – enables receiving of both invoices and credit notes
      • PEPPOL_INVOICE – enables receiving invoices
      • PEPPOL_CREDIT_NOTE – enables receiving of credit notes

      Note! Updating will overwrite existing information so if company has previously only had PEPPOL_INVOICE enabled and wants to also receive credit notes, set operator_id to PEPPOL to allow both.

       

    • enabled boolean #Enable or disable. When set to false, will remove both invoice and credit note receiving
    • sender_id string #Sender ID if needed (not needed for PEPPOL)
    • recipient_id string #Recipient ID if needed (not needed for PEPPOL)
    Output:
    api-enable_operatorResponse (soap:body, use = encoded)
    • status string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    operator = Hash.new
    operator[:operator_id] = "PEPPOL"
    operator[:enabled] = true
    
    puts server.enable_operator(api_keys, operator)
    
    
  • link_vendor_api_key
    Operation type:
    Link company account to a vendor_api_key like company was registered using API with that vendor_api_key.
    SOAP action:
    /v1.1/api/link_vendor_api_key
    Input:
    api-link_vendor_api_key (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    Output:
    api-link_vendor_api_keyResponse (soap:body, use = encoded)
    return
  • string “OK” or “ERROR: ….”
  • Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    puts server.link_vendor_api_key(api_keys)
    
    
  • unlink_vendor_api_key
    Operation type:
    Unlinks company from vendor_api_key if company stops using ERP
    SOAP action:
    /v1.1/api/unlink_vendor_api_key
    Input:
    api-unlink_vendor_api_key (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    Output:
    api-unlink_vendor_api_keyResponse (soap:body, use = encoded)
    return
  • string “OK” or “ERROR: ….”
  • Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    puts server.unlink_vendor_api_key(api_keys)
    
    
  • list_vendor_inbound_invoices
    Operation type:
    Allows vendor to list inbound invoices of companies linked to their vendor_api_key
    SOAP action:
    /v1.1/api/list_vendor_inbound_invoices
    Input:
    api-list_vendor_inbound_invoices (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    Output:
    api-list_vendor_inbound_invoicesResponse (soap:body, use = encoded)
    return
  • InboundInvoiceList

    • status string #Status
    • items InboundInvoiceListItemArray #Array of InboundInvoiceListItem
      • invoice_id string #Unique ID of invoice, to be used in method inbound_invoice_show
      • recipient_id string #company_uuid of recipient company
      • timestamp string #Timestamp when invoice was received on account, is what is checked against with the list methods timestamps
  • Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    result = server.list_vendor_inbound_invoices(api_keys, "20120501152042", "20120502152042")
    if result.status == "OK"
      result.items.each do |item|
        puts "Incoming invoice #{item.invoice_id} for recipient #{item.recipient_id} with timestamp #{item.timestamp}"
      end
    else
      puts result.status
    end
    
    
  • scan_account_order
    Operation type:
    Open a new scan account for your company or for updating already existing one when called again. If first time ordering is successful, returns the scan address where suppliers send their invoices (paper or email). Note! It is very important to give suppliers the full returned scanning address. Also note that you cannot open a scan account if your account has receiving e-invoices turned off. When called again for already existing scan account, will return OK: RETURN ADDRESS UPDATED
  • Note! Important information about the scanning service:
  • Note! User accepts the pricing including scan minimum fee when opening the account
  • Possible return values for ‘status’ parameter are

    • ERROR: SCAN ACCOUNT EXISTS (Company already has a scan account, you can have only one)
    • ERROR: SCAN ACCOUNT CURRENTLY AVAILABLE FOR FINNISH, NORWEGIAN, SWEDISH, DANISH AND DUTCH COMPANIES ONLY
    • ERROR: RETURN ADDRESS EMPTY OR INVALID
    • ERROR: RECEIVING INVOICES NOT ENABLED ON ACCOUNT
    • ERROR: REGISTRATION FAILED (Unexpected error, contact support)
    • OK (Scan account opened, return value includes address information of the new scan account)
    • OK: RETURN ADDRESS UPDATED
    SOAP action:
    /v1.1/api/scan_account_order
    Input:
    api-scan_account_order (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
  • return_address ScanAddress #Your company’s postal address. Given to scan provider so they can return mail which is not proper invoices that have been sent to scanning address (like contracts etc.)
    • name string
    • address1 string #either address1 or address2 mandatory
    • address2 string
    • post_code string #mandatory
    • post_office string #mandatory
    • state string
    • country string #mandatory
    • email string #for sending notifications in error situations, mandatory
  • Output:
    api-scan_account_orderResponseResponse (soap:body, use = encoded)
    return
  • ScanAccountParamsOut

    • status string #Status
    • address ScanAddress #Company’s scanning address (i.e the address suppliers should use when sending invoices)
      • name string
      • address1 string
      • address2 string
      • post_code string
      • post_office string
      • state string
      • country string
      • email string #for sending PDFs per email for interpretation
  • Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    return_address = Hash.new
    return_address[:name] = "Test"
    return_address[:address1] = "TestStreet 1"
    return_address[:address2] = "B2"
    return_address[:post_code] = "010101"
    return_address[:post_office] = "TEST"
    return_address[:country] = "FI"
    return_address[:email] = "myreturn@company.loc"
    
    result = server.scan_account_order(api_keys, return_address)
    puts result.status
    
    
  • scan_account_show
    Operation type:
    Show company’s scanning address (i.e the address suppliers should use when sending invoices). Note! It is very important to give suppliers the full returned scanning address.
    SOAP action:
    /v1.1/api/scan_account_show
    Input:
    api-scan_account_show (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
  • Output:
    api-scan_account_showResponseResponse (soap:body, use = encoded)
    return
  • ScanAddress

    • status string #Status
      • name string
      • address1 string
      • address2 string
      • post_code string
      • post_office string
      • state string
      • country string
      • email string #for sending PDFs per email for interpretation
  • Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    result = server.scan_account_show(api_keys)
    if result.status == "OK"
      puts result.address.name
      puts result.address.email
      puts result.address.address1
      puts result.address.address2
      puts result.address.post_code
      puts result.address.post_office
      puts result.address.country
    else
      puts result.status
    end
    
    
  • scan_account_disable
    Operation type:
    Close scan account.
    SOAP action:
    /v1.1/api/scan_account_disable
    Input:
    api-scan_account_disable (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
  • Possible return values for ‘status’ parameter are

    • ERROR: Scan account not found
    • ERROR: Multiple scan accounts found, please contact support
    • ERROR: Unexpected error, contact customer support
    • OK (Scan account closed)
  • Output:
    api-scan_account_disableResponseResponse (soap:body, use = encoded)
    return
  • Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    result = server.scan_account_disable(api_keys)
    puts result
    
    
  • invoice_put_finvoice
    Operation type:
    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.
    SOAP action:
    /v1.1/api/invoice_put_finvoice
    Input:
    api-invoice_put_finvoice (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string

    finvoice_in FinvoiceTrx

    • files ActionWebService..Base64Array – array of base64
    • filenames StringArray – array of string
    Output:
    api-invoice_put_finvoiceResponse (soap:body, use = encoded)

    return InvoiceStatus

    • status string
    • invoice_id string
    • file_statuses FileStatusArray – array of FileStatus
      • status string
      • filehash string
      • filename string
    Example code:

    Example in Ruby

    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:vendor_api_key] = "" # Partner software API key
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    files_out = Hash.new
    files_out[:files] = []
    files_out[:filenames] = []
    
    files_out[:files].push(SOAP::Attachment.new(File.new("finvoice.xml")))
    files_out[:filenames].push("finvoice.xml")
    files_out[:files].push(SOAP::Attachment.new(File.new("finvoice.pdf")))
    files_out[:filenames].push("finvoice.pdf")
    
    result = server.invoice_put_finvoice(api_keys, files_out)
    puts result.status
    

    Example in C#

    //WSDL at https://testing.maventa.com/apis/v1.1/wsdl needs to be added as web
    //reference for the example to work
    
    using System;
    using System.IO;
    using System.Collections.Generic;
    using System.Drawing;
    using System.Windows.Forms;
    using MaventaAPI;
    
    namespace MaventaDemo
    {
      public partial class MainForm : Form
      {
        public MainForm()
        {
          MaventaService m_server = new MaventaService();
          ApiKeys apiKeyParams = new ApiKeys();
          apiKeyParams.user_api_key = "";
          apiKeyParams.company_uuid = "";
    
          FinvoiceTrx finvoiceOut = new FinvoiceTrx();
    
          //Finvoice method requires that PDF image has the same name as the Finvoice XML file
          string[] filenameArray = new string[2];
          filenameArray[0] = "finvoice.xml";
          filenameArray[1] = "finvoice.pdf";
    
          byte[][] fileArray = new byte[2][];
          fileArray[0] = File.ReadAllBytes("finvoice.xml");
          fileArray[1] = File.ReadAllBytes("finvoice.pdf");
    
          finvoiceOut.filenames = filenameArray;
          finvoiceOut.files = fileArray;
    
          InvoiceStatus result = new InvoiceStatus();
          result = m_server.invoice_put_finvoice(apiKeyParams, finvoiceOut);
          MessageBox.Show(result.status);
        }
      }
    }
    
  • b2c_issuer_agreement_order
    Operation type:

    For opening Norwegian B2C agreement for a company. Input is name and email address of a person with rights to accept such an agreement on behalf of the company. That email address will receive the agreement by email as PDF and a link to accept the agreement with (Note! Does not require login).

    Possible return values are:

    • “ERROR: NO RIGHTS” (Only admin user can order the agreement)
    • “ERROR: signer_name or signer_email missing or invalid”
    • “ERROR: Unexpected error”
    • “OK: Email sent to #{signer_email}”
    SOAP action:
    /v1.1/api/b2c_issuer_agreement_order
    Input:
    api-b2c_issuer_agreement_order (soap:body, use = encoded)
    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string

    signer_name string
    signer_email string

    Output:
    api-b2c_issuer_agreement_orderResponse (soap:body, use = encoded)
    return string
    Example code:

    Example in Ruby

    
    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:user_api_key] = ""
    api_keys[:company_uuid] = ""
    
    puts server.b2c_issuer_agreement_order(api_keys, "John Doe", "john@company.doe")
    
  • b2c_issuer_agreement_order_with_ocr
    Operation type:

    For opening Norwegian B2C agreement together with agreement capture (requires OCR agreement). Input is name and email address of a person with rights to accept such an agreement on behalf of the company, OCR account number, OCR kid length, OCR reference position. That email address will receive the agreement by email as PDF and a link to accept the agreement with (Note! Does not require login).

    Possible return values are:

    • “ERROR: NO RIGHTS” (Only admin user can order the agreement)
    • “ERROR: signer_name or signer_email missing or invalid”
    • “ERROR: ocr_account_number is invalid”
    • “ERROR: ocr_kid_length is invalid”
    • “ERROR: ocr_reference_position syntax is invalid”
    • “ERROR: Unexpected error”
    • “OK: Email sent to #{signer_email}”
    SOAP action:
    /v1.1/api/b2c_issuer_agreement_order_with_ocr
    Input:
    api-b2c_issuer_agreement_order_with_ocr (soap:body, use = encoded)
    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string

    signer_name string
    signer_email string
    ocr_account_number string #has to be 11 digits
    ocr_kid_length string #is number larger than 0, has nothing to do with oce_account_number
    ocr_reference_position string #reference position can not be line 2-1 or 1-1

    Output:
    api-b2c_issuer_agreement_order_with_ocrResponse (soap:body, use = encoded)
    return string
    Example code:

    Example in Ruby

    
    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:user_api_key] = ""
    api_keys[:company_uuid] = ""
    
    puts server.b2c_issuer_agreement_order_with_ocr(api_keys, "John Doe", "john@company.doe", "32234756777", "10000", "1-3")
    
  • get_consumer_link
    Operation type:

    For preparing consumer agreement without actually sending invoices. Can be used to mass-prepare consumer registry for a coming invoice batch. Consumer will get either SMS or email depending on what information is given (SMS preferred if both) with a link to Nets’ service where they can login using BankID and accept the agreement.

    Possible return values are:

    • “ERROR: B2C agreement is not opened”
    • “ERROR: customer_nr missing”
    • “ERROR: Invalid reference_nr, only numbers allowed”
    • “ERROR: Invalid reference_nr, check digit mismatch”
    • “ERROR: Invalid phone number”
    • “ERROR: Unexpected error”
    • “PENDING” (means that agreement is waiting for acceptance from consumer)
    • “OK” (means that agreement is already in place)

    For OK status there can be an additional ‘message’ attribute with these values

    • “Link already exists for given reference”
    • “Consumer has accept all flag, agreement created”

    For PENDING status there can be an additional ‘message’ attribute with these values

    • “Sent agreement to consumer for acceptance”
    SOAP action:
    /v1.1/api/get_consumer_link
    Input:
    api-get_consumer_link (soap:body, use = encoded)
    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    consumer_info ConsumerInfoIn

    • name string
    • phone string # International format, e.g. +4712341234
    • email string
    • country string
    • reference_nr string # Efakturaref, can be left blank, in that case one will be generated based on the customer_nr
    • customer_nr string # Mandatory and unique for company
    Output:
    api-get_consumer_linkResponse (soap:body, use = encoded)
    return ConsumerLinkResponse

    • status string
    • message string
    • reference_nr string
    Example code:

    Example in Ruby

    
    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:user_api_key] = ""
    api_keys[:company_uuid] = ""
    
    consumer_info = Hash.new
    consumer_info[:name]         = "Test Consumer 1"
    consumer_info[:phone]        = "+4755512345"
    consumer_info[:email]        = "test.consumer@mail.tst"
    consumer_info[:country]      = "NO"
    consumer_info[:reference_nr] = ""
    consumer_info[:customer_nr]  = "20141113014"
    
    result = server.get_consumer_link(api_keys, consumer_info)
    puts "#{result.status}: #{result.message}"
    
  • consumer_agreement_status
    Operation type:

    Checking status of an existing consumer agreement.

    Possible return values are:

    • “ERROR: CONSUMER NOT FOUND”
    • “ERROR: Unexpected error”
    • “OK: #{status}” # where status is one of REQUEST_SENT, NEW, ACCEPTED, ACTIVE, DELETED, REJECTED, ERROR. Status of ACTIVE means the consumer is ready to receive invoices.
    SOAP action:
    /v1.1/api/consumer_agreement_status
    Input:
    api-consumer_agreement_status (soap:body, use = encoded)
    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    reference_nr string
    Output:
    api-consumer_agreement_statusResponse (soap:body, use = encoded)
    return string
    Example code:

    Example in Ruby

    
    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:user_api_key] = ""
    api_keys[:company_uuid] = ""
    
    puts server.consumer_agreement_status(api_keys, "20141113014")
    
  • consumer_agreements_query
    Operation type:

    Checking status of existing agremeents by query

    Possible return values are:

    • ERROR: Unexpected error
    • ERROR: Timestamp format error
    • ERROR: No agreements found
    • ERROR: Unexpected error
    • OK
    SOAP action:
    /v1.1/api/consumer_agreements_query
    Input:
    api-consumer_agreements_query (soap:body, use = encoded)
    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    query ConsumerAgreementQuery

    • name string
    • phone string
    • email string
    • state string # One of: REQUEST_SENT, NEW, ACCEPTED, ACTIVE, DELETED, REJECTED, ERROR
    • reference_nr string
    • customer_nr string
    • timestamp string # Example 20150401152042
    Output:
    api-consumer_agreements_queryResponse (soap:body, use = encoded)
    return ConsumerAgreementQueryResponse

    • status string
    • agreements array of ConsumerInfoOut
      • state string # One of: REQUEST_SENT, NEW, ACCEPTED, ACTIVE, DELETED, REJECTED, ERROR
      • name string
      • phone string
      • email string
      • reference_nr string
      • customer_nr string
    Example code:

    Example in Ruby

    
    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:user_api_key] = ""
    api_keys[:company_uuid] = ""
    
    query = Hash.new
    query[:name] = "Test Consumer 1"
    
    result = server.consumer_agreements_query(api_keys, query)
    if result.status == "OK"
     result.agreements.each do |agreement|
      puts agreement.reference_nr
      puts agreement.customer_nr
     end
    else
     puts result.status
    end
    
  • vendor_consumer_agreements_query
    Operation type:

    Checking status of existing agremeents by query for all companies under given vendor_api_key

    Possible return values are:

    • ERROR: Unexpected error
    • ERROR: No rights to vendor API key
    • ERROR: Timestamp format error
    • OK
    SOAP action:
    /v1.1/api/vendor_consumer_agreements_query
    Input:
    api-vendor_consumer_agreements_query (soap:body, use = encoded)
    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    query ConsumerAgreementQuery

    • name string
    • phone string
    • email string
    • state string # One of: REQUEST_SENT, NEW, ACCEPTED, ACTIVE, DELETED, REJECTED, ERROR
    • reference_nr string
    • customer_nr string
    • timestamp string # Example 20150401152042
    Output:
    api-vendor_consumer_agreements_queryResponse (soap:body, use = encoded)
    return VendorConsumerAgreementQueryResponse

    • status string
    • results array of VendorConsumerAgreementQueryResult
      • company_id string
      • agreements array of ConsumerInfoOut
        • state string # One of: REQUEST_SENT, NEW, ACCEPTED, ACTIVE, DELETED, REJECTED, ERROR
        • name string
        • phone string
        • email string
        • reference_nr string
        • customer_nr string
    Example code:

    Example in Ruby

    
    require 'soap/wsdlDriver'
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    api_keys = Hash.new
    api_keys[:user_api_key]   = ""
    api_keys[:company_uuid]   = ""
    api_keys[:vendor_api_key] = ""
    query = Hash.new
    query[:name] = "Test Consumer 1"
    result = server.vendor_consumer_agreements_query(api_keys, query)
    if result.status == "OK"
     result.results.each do |company|
       puts "Handling company: #{company.company_id}"
       company.agreements.each do |agreement|
        puts agreement.reference_nr
        puts agreement.customer_nr
       end
    else
     puts result.status
    end
    
  • token_login
    Operation type:

    Returns a URL to access the web UI without needing to login. Currently supports service parameter: FI_BANK_NETWORK_OPEN for opening Finnish bank network and COMPANY_SETTINGS for accessing setting page for given company

    Possible return values for the FI_BANK_NETWORK_OPEN are:

    • “ERROR: No rights to sign bank agreements – User API key is for normal user”
    • “ERROR: Only available for Finnish companies – Company uuid is for none Finnish company “
    • “ERROR: Bank agreement already active – Company has already bank network connection “
    • “ERROR: Bank agreement already pending – Company has already order the bank network opening “
    • “https://….. – successfull request, URL can be accessed “
    SOAP action:
    /v1.1/api/token_login
    Input:
    api-token_login (soap:body, use = encoded)
    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    service string
    Output:
    api-token_login (soap:body, use = encoded)
    return string
    Example code:

    Example in Ruby

    
    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:user_api_key] = ""
    api_keys[:company_uuid] = ""
    
    puts server.token_login(api_keys, "FI_BANK_NETWORK_OPEN")
    
    # Output:
    # https://testing.maventa.com/token_login/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2FwaV9rZXkiOiJlZGQwY2IzMi04YzE....
    
  • invoice_show_original_xml
    Operation type:
    Used for getting the original xml file for a specified received (inbound) or sent (outbound) invoice.
    SOAP action:
    /v1.1/api/invoice_show_original_xml
    Input:
    api-invoice_show_original_xml (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string

    id string

    Output:
    api-invoice_show_original_xmlResponse (soap:body, use = encoded)

    return FileOut

    • status string
    • format string
    • file base64
    Example code:

    Example in Ruby

     
    require 'soap/wsdlDriver'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    begin
     api_keys = Hash.new
     api_keys[:vendor_api_key] = "" # Partner software API key
     api_keys[:user_api_key] = "" # User API key
     api_keys[:company_uuid] = "" # UUID of current company
    
     result = server.invoice_show_original_xml(api_keys, "1c555458-fa83-402b-a1f6-4d22071020a8")
     if result.status == "OK" 
      puts result.format
      puts "Saving file to inbound.xml"
      File.open("inbound.xml","w"){ |f| f << result.file }
     end
    
    rescue
     puts$!.message
    end
    
  • sent_invoices_status
    Operation type:

    Used querying the status and possible error message of the sent invoices.

    Possible sent_by values are:

    • Sent inside home network
    • Sent by email
    • Sent by print
    • Sent by print PRIORITY
    • Sent by print EU
    • Sent by print WORLD
    • Sent e-invoice
    • Sent to bank network
    • Sent by N/A

    Possible state values are:

    • PENDING
    • SENT
    • DECLINED
    • ACCEPTED
    • PAID
    • VIEWED
    • DISPUTED
    • ERROR
    SOAP action:
    /v1.1/api/sent_invoices_status
    Input:
    api-sent_invoices_status (soap:body, use = encoded)

    api_keys ApiKeys

    • company_uuid string
    • user_api_key string
    • vendor_api_key string
    invoices StringArray – array of string
    Output:
    api-sent_invoices_statusResponse (soap:body, use = encoded)

    return InvoiceStateArray – array of InvoiceState

    • invoice_id string
    • state string
    • sent_by string
    • error_message string
    Example code:

    Example in Ruby

    
    require 'soap/wsdlDriver'
    require 'soap/rpc/driver'
    require 'soap/attachment'
    
    server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/v1.1/wsdl").create_rpc_driver
    
    api_keys = Hash.new
    api_keys[:user_api_key] = "" # User API key
    api_keys[:company_uuid] = "" # UUID of current company
    
    response = server.sent_invoices_status(api_keys, ["2a444e5r-4d8c-4858-9179-296b30c0dc39","4444f870d-fb34-43e4-b3c6-c83a96f12bc5"])
    
    if response.status == "OK"
     response.invoices.each do |invoice|
     puts "#{invoice.invoice_id}: #{invoice.state}, #{invoice.sent_by}, #{invoice.error_message}"
    end
    else
     puts response.status
    end