Index
- Overview
- API keys and endpoints
- User authentication
- Encoding
- Date formats
- Error return values
- Invoice state values
- Invoice layouts
- API versions
- Advanced
Contents
Bravo API documentation
- authenticate_token
- bank_account_create
- bank_account_delete
- bank_account_list
- bank_account_show
- bank_account_update
- company_fee_create
- company_fee_delete
- company_fee_list
- company_fee_show
- company_fee_update
- company_invoice_receiving
- company_list
- company_lookup
- company_settings_show
- company_settings_update
- company_show
- company_update
- country_list
- currency_list
- get_inbound_invoice_files
- hello_world
- inbound_invoice_show
- invoice_accept
- invoice_cancel
- invoice_confirm
- invoice_create
- invoice_decline
- invoice_dispute
- invoice_list
- invoice_list_inbound
- invoice_max_number
- invoice_put_file
- invoice_put_finvoice
- invoice_show
- invoice_state_list
- invoice_xml_test
- login
- partner_trx_list
- postal_address_create
- postal_address_delete
- postal_address_list
- postal_address_show
- postal_address_update
- register
- search
- server_time
- user_create
- user_delete
- user_list
- user_show
- user_update
Operations
- authenticate_tokenOperation type:Used for authenticating a user’s USB auth token.
This method returns a string (OK or FAIL).SOAP action:/bravo/api/authenticate_tokenInput:api-authenticate_token (soap:body, use = encoded)api_keys ApiKeys- company_uuid string
- user_api_key string
- vendor_api_key string
otp stringOutput:api-authenticate_tokenResponse (soap:body, use = encoded)return stringExample code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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.authenticate_token(api_keys, "echdheebedeeectnklekhcdivdhktederbjhegbkribd")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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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.authenticate_token(api_keys, "echdheebedeeectnklekhcdivdhktederbjhegbkribd") - bank_account_createOperation type:Used for adding bank account details to be used in invoices.
Possible return values are:
- ERROR: @errormessage Error message with validation errors for the bank account
- OK: ACCOUNT SAVED Account created successfully
SOAP action:/bravo/api/bank_account_createInput:api-bank_account_create (soap:body, use = encoded)api_keys ApiKeys- company_uuid string
- user_api_key string
- vendor_api_key string
bank_account_params BankAccountParamsIn- account string
- default boolean
- iban string
- swift string
- bank string
Output:api-bank_account_createResponse (soap:body, use = encoded)return stringExample code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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 bank_account = Hash.new bank_account[:account] = "2202" bank_account[:bank] = "TSTBANK" bank_account[:iban] = "FI0031223222" bank_account[:swift] = "TSTBANKFI" puts server.bank_account_create(api_keys, bank_account)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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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 = "" bank_account = client.factory.create("BankAccountParamsIn") bank_account.account = "2202" bank_account.bank = "TSTBANK" bank_account.iban = "FI0031223222" bank_account.swift = "TSTBANKFI" bank_account.default = False print client.service.bank_account_create(api_keys, bank_account) - bank_account_deleteOperation type:Used for deleting bank account details.
Possible return values are:
- ERROR: ACCOUNT NOT FOUND OR NO RIGHTS BankAccount with given id does not exist for current company
- ERROR: COULD NOT DELETE ACCOUNT Could not delete account
- OK: ACCOUNT DELETED Account deleted successfully
SOAP action:/bravo/api/bank_account_deleteInput:api-bank_account_delete (soap:body, use = encoded)api_keys ApiKeys- company_uuid string
- user_api_key string
- vendor_api_key string
id stringOutput:api-bank_account_deleteResponse (soap:body, use = encoded)return stringExample code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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.bank_account_delete(api_keys, "58c4f3ae-c637-4447-a2ee-4d03cbd62f6e")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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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.bank_account_delete(api_keys, "58c4f3ae-c637-4447-a2ee-4d03cbd62f6e") - bank_account_listOperation type:Used for showing information about a specific bank account.SOAP action:/bravo/api/bank_account_listInput:api-bank_account_list (soap:body, use = encoded)api_keys ApiKeys
- company_uuid string
- user_api_key string
- vendor_api_key string
Output:api-bank_account_listResponse (soap:body, use = encoded)return BankAccountParamsOutArray - array of BankAccountParamsOut- status string
- account string
- default boolean
- iban string
- swift string
- bank string
- id string
Example code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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 accounts = server.bank_account_list(api_keys)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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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 = "" accounts = client.service.bank_account_list(api_keys) - bank_account_showOperation type:Used for showing information about a specific bank account.SOAP action:/bravo/api/bank_account_showInput:api-bank_account_show (soap:body, use = encoded)api_keys ApiKeys
- company_uuid string
- user_api_key string
- vendor_api_key string
id stringOutput:api-bank_account_showResponse (soap:body, use = encoded)return BankAccountParamsOut- status string
- account string
- default boolean
- iban string
- swift string
- bank string
- id string
Example code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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 account = server.bank_account_show(api_keys, "58c4f3ae-c637-4447-a2ee-4d03cbd62f6e") if account.status == "OK" puts account.account, account.bank, account.iban, account.swift endimport 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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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, acc = client.service.bank_account_show(api_keys, "58c4f3ae-c637-4447-a2ee-4d03cbd62f6e") if acc.status == "OK": print acc.account, acc.bank, acc.iban, acc.swift - bank_account_updateOperation type:Used for updating bank account details to be used in invoices.
Possible return values are:
- ERROR: ACCOUNT NOT FOUND OR NO RIGHTS BankAccount with given id does not exist for current company
- ERROR: @errormessage Error message with validation errors for the bank account
- OK: ACCOUNT SAVED Account updated successfully
SOAP action:/bravo/api/bank_account_updateInput:api-bank_account_update (soap:body, use = encoded)api_keys ApiKeys- company_uuid string
- user_api_key string
- vendor_api_key string
id stringparam2 BankAccountParamsIn- account string
- default boolean
- iban string
- swift string
- bank string
Output:api-bank_account_updateResponse (soap:body, use = encoded)return stringExample code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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 bank_account = Hash.new bank_account[:account] = "2202" bank_account[:bank] = "TSTBANK" bank_account[:iban] = "FI0031223222" bank_account[:swift] = "TSTBANKFI" bank_account[:default] = 1 puts server.bank_account_update(api_keys, "58c4f3ae-c637-4447-a2ee-4d03cbd62f6e", bank_account)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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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 = "" bank_account = client.factory.create("BankAccountParamsIn") bank_account.account = "2202" bank_account.bank = "TSTBANK" bank_account.iban = "FI0031223222" bank_account.swift = "TSTBANKFI" bank_account.default = 1 print client.service.bank_account_update(api_keys, "58c4f3ae-c637-4447-a2ee-4d03cbd62f6e", bank_account) - company_fee_createOperation type:Used for creating company invoicing fees for different currencies.
Possible return values are:
- ERROR: INVALID CURRENCY FOR COMPANY FEE Given currency not supported
- ERROR: COMPANY ALREADY HAS FEE FOR CURRENCY @currency Company can only have one fee per currency
- ERROR: @error Exception handling
- OK: COMPANY FEE SAVED Company fee saved successfully
SOAP action:/bravo/api/company_fee_createInput:api-company_fee_create (soap:body, use = encoded)api_keys ApiKeys- company_uuid string
- user_api_key string
- vendor_api_key string
company_fee_params CompanyFeeParamsIn- paper_fee string
- currency string
- reminder_fee string
- interest double
Output:api-company_fee_createResponse (soap:body, use = encoded)return stringExample code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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 fee = Hash.new fee[:interest] = "15" fee[:currency] = "EUR" fee[:reminder_fee] = "5" fee[:paper_fee] = "7.5" puts server.company_fee_create(api_keys, fee)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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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 = "" fee = client.factory.create("CompanyFeeParamsIn") fee.interest = "15" fee.currency = "EUR" fee.reminder_fee = "5" fee.paper_fee = "7.5" print client.service.company_fee_create(api_keys, fee) - company_fee_deleteOperation type:Used for deleting a company invoicing fee for a certain currency.
Possible return values are:
- ERROR: COMPANY FEE NOT FOUND OR NO RIGHTS CompanyFee with given id does not exist for current company
- ERROR: COULD NOT DELETE COMPANY FEE Failed to delete company fee
- OK: COMPANY FEE DELETED Company fee deleted successfully
SOAP action:/bravo/api/company_fee_deleteInput:api-company_fee_delete (soap:body, use = encoded)api_keys ApiKeys- company_uuid string
- user_api_key string
- vendor_api_key string
id stringOutput:api-company_fee_deleteResponse (soap:body, use = encoded)return stringExample code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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_fee_delete(api_keys, "cc1eec9b-5423-4506-9518-f74c16500f97")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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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_fee_delete(api_keys, "cc1eec9b-5423-4506-9518-f74c16500f97") - company_fee_listOperation type:Used for listing company invoicing fees for different currencies.SOAP action:/bravo/api/company_fee_listInput:api-company_fee_list (soap:body, use = encoded)api_keys ApiKeys
- company_uuid string
- user_api_key string
- vendor_api_key string
Output:api-company_fee_listResponse (soap:body, use = encoded)return CompanyFeeParamsOutArray - array of CompanyFeeParamsOut- status string
- paper_fee string
- currency string
- reminder_fee string
- interest double
- id string
Example code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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_fee_list(api_keys) if results[0].status == "OK" results.each do |result| puts result.id, result.interest, result.currency, result.reminder_fee, result.paper_fee end endimport 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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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, results = client.service.company_fee_list(api_keys) if results[0].status == "OK": for result in results: print result.id, result.interest, result.currency, result.reminder_fee,\ result.paper_fee - company_fee_showOperation type:Used for showing details of a specific company invoicing fee.SOAP action:/bravo/api/company_fee_showInput:api-company_fee_show (soap:body, use = encoded)api_keys ApiKeys
- company_uuid string
- user_api_key string
- vendor_api_key string
id stringOutput:api-company_fee_showResponse (soap:body, use = encoded)return CompanyFeeParamsOut- status string
- paper_fee string
- currency string
- reminder_fee string
- interest double
- id string
Example code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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_fee_show(api_keys, "Fee ID") if result.status == "OK" puts result.currency, result.interest, result.reminder_fee, result.paper_fee endimport 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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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_fee_show(api_keys, "Fee ID") if result.status == "OK": print result.currency, result.interest, result.reminder_fee, result.paper_fee - company_fee_updateOperation type:Used for updating details of a company invoicing fee for a certain currency.
Possible return values are:
- ERROR: COMPANY FEE NOT FOUND OR NO RIGHTS CompanyFee with given id does not exist for current company
- ERROR: INVALID CURRENCY FOR COMPANY FEE Given currency not supported
- ERROR: COMPANY ALREADY HAS FEE FOR CURRENCY @currency Company can only have one fee per currency
- ERROR: @error Exception handling
- OK: COMPANY FEE SAVED Company fee saved successfully
SOAP action:/bravo/api/company_fee_updateInput:api-company_fee_update (soap:body, use = encoded)api_keys ApiKeys- company_uuid string
- user_api_key string
- vendor_api_key string
id stringparam2 CompanyFeeParamsIn- paper_fee string
- currency string
- reminder_fee string
- interest double
Output:api-company_fee_updateResponse (soap:body, use = encoded)return stringExample code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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 fee = Hash.new fee[:interest] = "13" fee[:currency] = "EUR" fee[:reminder_fee] = "4.50" fee[:paper_fee] = "6.5" puts server.company_fee_update(api_keys, "cc1eec9b-5423-4506-9518-f74c16500f97", fee)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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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 = "" fee = client.factory.create("CompanyFeeParamsIn") fee.interest = "13" fee.currency = "EUR" fee.reminder_fee = "4.50" fee.paper_fee = "6.5" print client.service.company_fee_update(api_keys, "cc1eec9b-5423-4506-9518-f74c16500f97", fee) - company_invoice_receivingOperation type:Enable/disable receiving of invoices.SOAP action:/bravo/api/company_invoice_receivingInput:api-company_invoice_receiving (soap:body, use = encoded)api_keys ApiKeys
- company_uuid string
- user_api_key string
- vendor_api_key string
receive booleanOutput:api-company_invoice_receivingResponse (soap:body, use = encoded)return stringExample code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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)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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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) - company_listOperation type:Used for listing all the companies user has access to.SOAP action:/bravo/api/company_listInput: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
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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 endimport 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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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 - company_lookupOperation type:Used for finding recipient’s invoicing information.SOAP action:/bravo/api/company_lookupInput:api-company_lookup (soap:body, use = encoded)api_keys ApiKeys
- company_uuid string
- user_api_key string
- vendor_api_key string
search_string stringOutput:api-company_lookupResponse (soap:body, use = encoded)return CompanyLookupOutArray - array of CompanyLookupOut- status string
- edis StringArray - array of string
- name string
- state string
- post_code string
- post_office string
- maventa_id string
- ovt string
- bid string
- address1 string
- country string
- address2 string
Example code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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_lookup(api_keys, "FI1234567") 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 endimport 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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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_lookup(api_keys, "FI1234567") if response_code == 200: if result[0].status == "OK": for r in result: print r.name, r.bid, r.address1, r.post_code,\ r.post_office, r.country for edi_code in r.edis: print edi_code - company_settings_showOperation type:Used to view current company settings.SOAP action:/bravo/api/company_settings_showInput: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 CompanySettingsParams- status string
- ipost_own_pdf boolean
- ipost int -> where 0 = disabled, 1 = Finland, 2 = EU, 3 = World (actual state)
- ipost_request int-> where 0 = disabled, 1 = Finland, 2 = EU, 3 = World (current request made by user)
- acc_man_email string -> currently not used
- website string
- email_remind_freq int
- ipost_verified boolean -> is iPost service enabled by Maventa
- ipost_type int -> applicable only in Finland, 0 = Economy, 1 = Priority
Example code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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.acc_man_email, result.website, result.ipost, result.ipost_type, result.email_remind_freq endimport 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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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.acc_man_email, result.website, result.ipost, \ result.ipost_type, result.email_remind_freq - company_settings_updateOperation 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:/bravo/api/company_settings_updateInput: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 CompanySettingsParams- status string
- ipost_own_pdf boolean -> print own PDF instead of Maventa layout, will use coverletter for address
- ipost int-> readonly value
- ipost_request int -> where 0 = disabled, 1 = Finland, 2 = EU, 3 = World
- acc_man_email string -> currently not used
- website string
- email_remind_freq int
- ipost_verified boolean -> readonly value
- ipost_type int -> applicable only in Finland, 0 = Economy, 1 = Priority
Output:api-company_settings_updateResponse (soap:body, use = encoded)return stringExample code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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[:acc_man_email] = "invoice.receiver@company.com" settings[:website] = "http://company.com" settings[:ipost_request] = "1" settings[:ipost_type] = "1" settings[:email_remind_freq] = "2" puts server.company_settings_update(api_keys, settings)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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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.acc_man_email = "invoice.receiver@company.com" settings.website = "http://company.com" settings.ipost_request = "1" settings.ipost_type = "1" settings.email_remind_freq = "2" settings.ipost_verified = False settings.ipost = 1 settings.ipost_own_pdf = False print client.service.company_settings_update(api_keys, settings) - company_showOperation type:Used for showing current company information.SOAP action:/bravo/api/company_showInput: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
- user_api_key string
- name string
- maventa_uuid string
- maventa_id string
- bid string
- id string
- country string
Example code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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 endimport 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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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 - company_updateOperation type:Used for updating company details. Changing of company name or email will require a verification of the changes. A verification link will be sent to the user requesting the change. If verification is not done, changes are reverted after 1 hour.
Return value
This method returns a string with the status. Possible return values are:
- ERROR: COUNTRY CODE INVALID Given country code does not exist or is not supported
- ERROR: @errormessage Validation errors
- ERROR: NO RIGHTS TO CHANGE SETTINGS Only admin user can change settings
- OK: COMPANY SAVED Company details updated successfully
SOAP action:/bravo/api/company_updateInput:api-company_update (soap:body, use = encoded)api_keys ApiKeys- company_uuid string
- user_api_key string
- vendor_api_key string
company_params CompanyParamsIn- email string
- name string
- bid string
- country string
Output:api-company_updateResponse (soap:body, use = encoded)return stringExample code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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_info = Hash.new company_info[:name] = 'Example company - Updated' company_info[:email] = 'updated@company.com' company_info[:country] = 'FI' puts server.company_update(api_keys, company_info)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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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 = "" company_info = client.factory.create("CompanyParamsIn") company_info.name = 'Example company - Updated' company_info.email = 'updated@company.com' company_info.country = 'FI' print client.service.company_update(api_keys, company_info) - country_listOperation type:Used for getting a list of all countries and country codes supported for invoices.SOAP action:/bravo/api/country_listInput:api-country_list (soap:body, use = encoded)api_keys ApiKeys
- company_uuid string
- user_api_key string
- vendor_api_key string
Output:api-country_listResponse (soap:body, use = encoded)return CountryParamsOutArray - array of CountryParamsOut- status string
- code string
- name string
Example code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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.country_list(api_keys) if results[0].status == "OK" results.each do |result| puts "#{result.name}: #{result.code}" end endimport 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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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.country_list(api_keys) if response_code == 200: if result[0].status == "OK": for r in result: print "%s: %s" % (r.name, r.code) - currency_listOperation type:Used for getting list of all supported currencies and currency codes for invoices.SOAP action:/bravo/api/currency_listInput:api-currency_list (soap:body, use = encoded)api_keys ApiKeys
- company_uuid string
- user_api_key string
- vendor_api_key string
Output:api-currency_listResponse (soap:body, use = encoded)return CurrencyParamsOutArray - array of CurrencyParamsOut- status string
- sign string
- name string
- abbr string
- id string
Example code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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.currency_list(api_keys) if results[0].status == "OK" results.each do |result| puts "#{result.name}: #{result.abbr}" end endimport 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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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.currency_list(api_keys) if response_code == 200: if result[0].status == "OK": for r in res: print "%s: %s" % (r.name, r.abbr) - get_inbound_invoice_filesOperation type:Used for receiving all invoices received after given time stamp as files. Can be used in “thin client” solutions where new invoices will be imported to a third party software.
Return value
Returns a InvoiceFile struct which includes a ZIP-file which includes the invoice PDF images and possible attachments. Also included is an XML representation of the invoices, if requested.
Arguments
- api_keys (required)
- timestamp (required, format “YYYYMMDDHHMMSS”)
- xmlformat string (nil, finvoice, teapps, ubl, liinos, or oio )
SOAP action:/bravo/api/get_inbound_invoice_filesInput:api-get_inbound_invoice_files (soap:body, use = encoded)api_keys ApiKeys- company_uuid string
- user_api_key string
- vendor_api_key string
timestamp stringxmlformat stringOutput:api-get_inbound_invoice_filesResponse (soap:body, use = encoded)return InvoiceFile- status string
- file base64
Example code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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_inbound_invoice_files(api_keys, "20090917000000", "ubl") if result.status == "OK" File.open("invoices.zip", 'wb') do |f| f.push(result.file) end endimport 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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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.get_inbound_invoice_files(api_keys, "20090917000000", "ubl") if result.status == "OK": open("invoices.zip", 'w').write(base64.decodestring(result.file)) - hello_worldOperation type:Used for testing Maventa API-connection.SOAP action:/bravo/api/hello_worldInput:api-hello_world (soap:body, use = encoded)Output:api-hello_worldResponse (soap:body, use = encoded)return stringExample code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/wsdl").create_rpc_driver puts server.hello_worldimport 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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/wsdl", doctor = d, faults=False) print client.service.hello_world() - inbound_invoice_showOperation type:Used for getting information about a specific inbound invoice.
Arguments
- api_keys (required)
- id string (invoice id)
- include_files boolean (download invoice image and attachments)
- xmlformat string (nil, finvoice, teapps, ubl, liinos, or oio )
SOAP action:/bravo/api/inbound_invoice_showInput:api-inbound_invoice_show (soap:body, use = encoded)api_keys ApiKeys- company_uuid string
- user_api_key string
- vendor_api_key string
id stringinclude_files booleanxmlformat stringOutput:api-inbound_invoice_showResponse (soap:body, use = encoded)return InboundInvoiceParamsOut- company_address2 string
- customer_state string
- delivery_type string
- status string
- invoice_nr string
- sum string
- company_name string
- items ItemsOutArray - array of ItemsOut
- status string
- discount double
- subject string
- sum string
- amount double
- price string
- item_code string
- definition string
- position int
- tax double -> Expressed as a percentage, e.g. 22.0 is 22%
- sum_tax string
- unit_type string
- user_name string
- customer_post_code string
- customer_name string
- lang string
- company_comment string
- company_gsm string
- 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
- currency string
- state int
- reference_nr string
- customer_post_office string
- company_post_code string
- company_paper_fee string
- company_fax string
- company_email string
- attachment string
- company_post_office string
- company_bid string
- customer_bid string
- date string
- order_nr string
- customer_email string
- company_country string
- company_interest string
- company_website string
- notes string
- customer_nr int
- company_reminder string
- company_city string
- user_phone string
- customer_address1 string
- sum_tax string
- date_due string
- customer_contact_p string
- company_state string
- customer_ovt string
- customer_reference string
- customer_country string
- user_email string
- id string
- delivery_date string
- customer_address2 string
- company_address1 string
- company_phone string
- company_reference string
Example code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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 C#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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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))//WSDL at https://testing.maventa.com/apis/bravo/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 InboundInvoiceParamsOut inbound_invoice = new InboundInvoiceParamsOut(); 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_acceptOperation 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.
"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:/bravo/api/invoice_acceptInput:api-invoice_accept (soap:body, use = encoded)api_keys ApiKeys- company_uuid string
- user_api_key string
- vendor_api_key string
id stringOutput:api-invoice_acceptResponse (soap:body, use = encoded)return stringExample code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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")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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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_cancelOperation type:Used for canceling an invoice already sent which is in state SENT. The only thing this does it set the invoice state to REJECTED so that any e-mail reminders won’t be sent for the invoice. The method cannot cancel invoices relayed to other networks or sent as paper.
Return value
This method returns a string with the result (“OK: INVOICE CANCELED” or “ERROR: @error”).
SOAP action:/bravo/api/invoice_cancelInput:api-invoice_cancel (soap:body, use = encoded)api_keys ApiKeys- company_uuid string
- user_api_key string
- vendor_api_key string
id stringOutput:api-invoice_cancelResponse (soap:body, use = encoded)return stringExample code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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_cancel(api_keys, "00521759-4570-467c-98dd-c496b22de0bc")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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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_cancel(api_keys, "00521759-4570-467c-98dd-c496b22de0bc") - invoice_confirmOperation 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:/bravo/api/invoice_confirmInput:api-invoice_confirm (soap:body, use = encoded)api_keys ApiKeys- company_uuid string
- user_api_key string
- vendor_api_key string
id stringpayment_date stringOutput:api-invoice_confirmResponse (soap:body, use = encoded)return stringExample code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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")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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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_createOperation type:Used for creating new invoices.
"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:/bravo/api/invoice_createInput:api-invoice_create (soap:body, use = encoded)api_keys ApiKeys- company_uuid string
- user_api_key string
- vendor_api_key string
invoice_params InvoiceParamsIn- sum string
- invoice_nr string
- delivery_type string
- 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
- require_sign boolean
- invoice_image string
- company_comment string
- lang string
- attachments FileAttachmentArray - array of FileAttachment
- attachment_type string
- filename string
- file base64
- reference_nr string
- currency string
- company_paper_fee string
- attachment string
- customer_maventa_id string
- order_nr string
- date string
- company_interest string
- bank_accounts BankAccountParamsInArray - array of BankAccountParamsIn
- account string
- default boolean
- iban string
- swift string
- bank string
- company_website string
- notes string
- company_reminder string
- disabled_routes RouteDisable
- email boolean
- paper boolean
- relay boolean
- customer CustomerParamsIn
- customer_type string
- email string
- lang string
- name string
- state string
- post_code string
- phone string
- post_office string
- customer_nr int
- ovt string
- bid string
- address1 string
- gsm string
- country string
- address2 string
- contact_p string
- date_due string
- sum_tax string
- customer_reference 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
- delivery_date string
- company_reference string
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
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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 #Create the invoice result = server.invoice_create(api_keys, invoice) puts result.status
Example in C#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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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("CustomerParamsIn") 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("ItemsIn") 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("InvoiceParamsIn") 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 PHP//WSDL at https://testing.maventa.com/apis/bravo/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); } } }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/bravo/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"] = nulltomer["gsm"] $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"; array_push($items_out, $inv_items); # 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; # Assign customer and item info to invoice $invoice["customer"] = $customer; $invoice["items"] = $items_out; $result = $client->invoice_create($api_keys, $invoice); print $result->status; - invoice_declineOperation type:Used for declining incoming invoice in cases where they contain an error.
Return value(s)
This method returns a string with the result (“OK” or “ERROR: @error”).
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
- api_keys (required)
- Invoice id string (required)
- Message string (why invoice is declined, will be sent to invoice sender by email)
SOAP action:/bravo/api/invoice_declineInput:api-invoice_decline (soap:body, use = encoded)api_keys ApiKeys- company_uuid string
- user_api_key string
- vendor_api_key string
id stringmessage stringOutput:api-invoice_declineResponse (soap:body, use = encoded)return stringExample code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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")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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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_disputeOperation type:Used for disputing an invoice.
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:/bravo/api/invoice_disputeInput:api-invoice_dispute (soap:body, use = encoded)api_keys ApiKeys- company_uuid string
- user_api_key string
- vendor_api_key string
id stringmessage stringOutput:api-invoice_disputeResponse (soap:body, use = encoded)return stringExample code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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")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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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_listOperation type:Used for getting list of outbound invoices.
Arguments
- api_keys (required)
- all integer (nil => open invoices, 1 => archived invoices, 2 => all invoices, 3 => invoices in error state)
SOAP action:/bravo/api/invoice_listInput:api-invoice_list (soap:body, use = encoded)api_keys ApiKeys- company_uuid string
- user_api_key string
- vendor_api_key string
all intOutput:api-invoice_listResponse (soap:body, use = encoded)return InvoiceParamsOutArray - array of InvoiceParamsOut- items ItemsOutArray - array of ItemsOut
- status string
- discount double
- subject string
- sum string
- amount double
- price string
- item_code string
- definition string
- position int
- tax double -> Expressed as a percentage, e.g. 22.0 is 22%
- sum_tax string
- unit_type string
- sum string
- invoice_nr string
- status string
- delivery_type string
- customer_state string
- company_comment string
- lang string
- customer_name string
- customer_post_code string
- attachments FileAttachmentArray - array of FileAttachment
- attachment_type string
- filename string
- file base64
- customer_post_office string
- reference_nr string
- state int
- currency string
- company_paper_fee string
- accounts InvoiceAccountParamsOutArray - array of InvoiceAccountParamsOut
- status string
- account string
- iban string
- bank string
- swift string
- customer_comment string
- attachment string
- customer_email string
- order_nr string
- date string
- company_interest string
- customer_bid string
- customer_nr int
- notes string
- company_reminder string
- customer_contact_p string
- date_due string
- sum_tax string
- customer_address1 string
- customer_country string
- customer_reference string
- customer_ovt string
- customer_address2 string
- delivery_date string
- id string
- actions InvoiceActionParamsOutArray - array of InvoiceActionParamsOut
- timestamp string
- action string
- company_reference string
Example code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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(api_keys) 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 endimport 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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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(api_keys) 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_inboundOperation type:Used for getting list of inbound invoices.
Arguments
- api_keys (required)
- timestamp string of timestamp (format “YYYYMMDDHHMMSS”, if nil, gets all unseen invoices)
SOAP action:/bravo/api/invoice_list_inboundInput:api-invoice_list_inbound (soap:body, use = encoded)api_keys ApiKeys- company_uuid string
- user_api_key string
- vendor_api_key string
timestamp stringOutput:api-invoice_list_inboundResponse (soap:body, use = encoded)return InboundInvoiceParamsOutArray - array of InboundInvoiceParamsOut- company_address2 string
- customer_state string
- delivery_type string
- status string
- invoice_nr string
- sum string
- company_name string
- items ItemsOutArray - array of ItemsOut
- status string
- discount double
- subject string
- sum string
- amount double
- price string
- item_code string
- definition string
- position int
- tax double -> Expressed as a percentage, e.g. 22.0 is 22%
- sum_tax string
- unit_type string
- user_name string
- customer_post_code string
- customer_name string
- lang string
- company_comment string
- company_gsm string
- 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
- currency string
- state int
- reference_nr string
- customer_post_office string
- company_post_code string
- company_paper_fee string
- company_fax string
- company_email string
- attachment string
- company_post_office string
- company_bid string
- customer_bid string
- date string
- order_nr string
- customer_email string
- company_country string
- company_interest string
- company_website string
- notes string
- customer_nr int
- company_reminder string
- company_city string
- user_phone string
- customer_address1 string
- sum_tax string
- date_due string
- customer_contact_p string
- company_state string
- customer_ovt string
- customer_reference string
- customer_country string
- user_email string
- id string
- delivery_date string
- customer_address2 string
- company_address1 string
- company_phone string
- company_reference string
Example code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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(api_keys, "20090916000000") if invoices[0].status == "OK" invoices.each do |invoice| puts "ID: #{invoice.id}, Nr: #{invoice.invoice_nr}, Date: #{invoice.date}" end endimport 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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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(api_keys, "20090916000000") 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_max_numberOperation type:Used for getting the largest invoice number used. Note! This might not work as expected if company uses characters in their invoice numbers.SOAP action:/bravo/api/invoice_max_numberInput:api-invoice_max_number (soap:body, use = encoded)api_keys ApiKeys
- company_uuid string
- user_api_key string
- vendor_api_key string
Output:api-invoice_max_numberResponse (soap:body, use = encoded)return stringExample code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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_max_number(api_keys)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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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_max_number(api_keys) - invoice_put_fileOperation type:Used for creating new invoices from existing XML invoice files or ZIP files with XML files and attachments.SOAP action:/bravo/api/invoice_put_fileInput: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
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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")) file_out[:filename] = "invoice.xml" results = server.invoice_put_file(api_keys, file_out) results.each do |result| puts result.status end
Example in C#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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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//WSDL at https://testing.maventa.com/apis/bravo/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_finvoiceOperation 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:/bravo/api/invoice_put_finvoiceInput: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
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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#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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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 files_out.files = [base64.encodestring(open("finvoice.xml").read()), base64.encodestring(open("finvoice.pdf").read())] files_out.filenames = ["finvoice.xml", "finvoice.pdf"] response_code, result = client.service.invoice_put_finvoice(api_keys, files_out) if response_code == 200: print result.status//WSDL at https://testing.maventa.com/apis/bravo/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); } } } - invoice_showOperation type:Used for getting information about a specific outbound invoice.
Arguments
- api_keys (required)
- id string (invoice id)
- include_files boolean (download invoice image and attachments)
- xmlformat string (nil, finvoice, teapps, ubl, liinos, or oio )
SOAP action:/bravo/api/invoice_showInput:api-invoice_show (soap:body, use = encoded)api_keys ApiKeys- company_uuid string
- user_api_key string
- vendor_api_key string
id stringinclude_files booleanxmlformat stringOutput:api-invoice_showResponse (soap:body, use = encoded)return InvoiceParamsOut- items ItemsOutArray - array of ItemsOut
- status string
- discount double
- subject string
- sum string
- amount double
- price string
- item_code string
- definition string
- position int
- tax double -> Expressed as a percentage, e.g. 22.0 is 22%
- sum_tax string
- unit_type string
- sum string
- invoice_nr string
- status string
- delivery_type string
- customer_state string
- company_comment string
- lang string
- customer_name string
- customer_post_code string
- attachments FileAttachmentArray - array of FileAttachment
- attachment_type string
- filename string
- file base64
- customer_post_office string
- reference_nr string
- state int
- currency string
- company_paper_fee string
- accounts InvoiceAccountParamsOutArray - array of InvoiceAccountParamsOut
- status string
- account string
- iban string
- bank string
- swift string
- customer_comment string
- attachment string
- customer_email string
- order_nr string
- date string
- company_interest string
- customer_bid string
- customer_nr int
- notes string
- company_reminder string
- customer_contact_p string
- date_due string
- sum_tax string
- customer_address1 string
- customer_country string
- customer_reference string
- customer_ovt string
- customer_address2 string
- delivery_date string
- id string
- actions InvoiceActionParamsOutArray - array of InvoiceActionParamsOut
- timestamp string
- action string
- company_reference string
Example code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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.push(fa.file) end end end endimport 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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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_listOperation 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:/bravo/api/invoice_state_listInput: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 stringOutput:api-invoice_state_listResponse (soap:body, use = encoded)return InvoiceStateArray - array of InvoiceState- status string
- state int
- invoice_id string
Example code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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 endimport 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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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) - invoice_xml_testOperation type:Used for testing the compatibility of an XML invoice material created with a third-party application with the Maventa XML parser.SOAP action:/bravo/api/invoice_xml_testInput:api-invoice_xml_test (soap:body, use = encoded)api_keys ApiKeys
- company_uuid string
- user_api_key string
- vendor_api_key string
xml_invoice ActionWebService..Base64Array - array of base64Output:api-invoice_xml_testResponse (soap:body, use = encoded)return XmlTestStatus- status string
- invoices XmlTestInvoiceStatusArray - array of XmlTestInvoiceStatus
- sum string
- invoice_nr string
- status string
- customer_name string
- currency string
- reference_nr string
- customer_bid string
- date string
- bank_account string
- date_due string
- sum_tax string
- customer_ovt string
- xml_format string
Example code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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 = serv.invoice_xml_test(api_keys, SOAP::Attachment.new("testfile.xml")) puts "VALIDATION RESULT: #{result.status}" puts "XML FORMAT: #{result.xml_format}" puts "INVOICE COUNT: #{result.invoices.size}" result.invoices.each do |invoice| puts "Invoice number: #{invoice.invoice_nr}" puts "Status: #{invoice.status}" puts "Customer name: #{invoice.customer_name}" puts "Total sum: #{invoice.sum_tax}" endimport 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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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 codecs response_code, result = client.service.invoice_xml_test(api_keys, codecs.open("testfile.xml", "r", "utf-8").read()) if repsonse_code == 200: print "VALIDATION RESULT: " + result.status print "XML FORMAT: " + result.xml_format print "INVOICE COUNT: " + str(len(result.invoices)) for inv in result.invoices: print "Invoice number: %s" % invoice.invoice_nr print "Status: %s" % invoice.status print "Customer name: %s" % invoice.customer_name print "Total sum: %s" % invoice.sum_tax - loginOperation type:Login with a user name and password. Returns a login status (true or false) and a message (ERROR... or API-KEY if login status is true).SOAP action:/bravo/api/loginInput:api-login (soap:body, use = encoded)email stringpassword stringOutput:api-loginResponse (soap:body, use = encoded)return LoginStatus
- status boolean
- message string
- partner_trx_listOperation type:Used for getting a list of all transactions from given software between given dates (defined by software API key).
Arguments
- api_keys (required)
- date_start string (required, start date for report, format “YYYYMMDD”)
- date_end string (required, end date for report, format “YYYYMMDD”)
- csv_file boolean (if set, returns also a CSV file with the same information)
SOAP action:/bravo/api/partner_trx_listInput:api-partner_trx_list (soap:body, use = encoded)api_keys ApiKeys- company_uuid string
- user_api_key string
- vendor_api_key string
date_start stringdate_end stringcsv_file booleanOutput:api-partner_trx_listResponse (soap:body, use = encoded)return TrxListResponse- status string
- trx_list_items TrxListItemArray - array of TrxListItem
- invoice_nr string
- customer_name string
- price_maventa string
- timestamp string
- pages int
- price_partner string
- customer_maventa_id string
- customer_bid string
- action string
- file base64
Example code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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.partner_trx_list(api_keys, "20090901", "20090917", true) if result.status == "OK" result.trx_list_items.each do |item| puts "#{item.timestamp}: #{item.customer_name} (#{item.customer_bid}) - #{item.invoice_nr}: #{item.action}" end File.open("trxlist.csv", 'wb') do |f| f.push(result.file) end endimport 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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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.partner_trx_list(api_keys, "20090901", "20090917", True) if response_code == 200: if result.status == "OK": for item in result.trx_list_items: print "%(timestamp)s: %(customer_name)s (%(bid)s - %(invoice_nr)s: %(action)s" % \ dict(timestamp = item.timestamp, item.customer_name, \ item.customer_bid, item.invoice_nr, item.action) open("trxlist.csv", "w").write(base64.decodestring(result.file)) - postal_address_createOperation 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:/bravo/api/postal_address_createInput: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 stringExample code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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)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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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_deleteOperation 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:/bravo/api/postal_address_deleteInput:api-postal_address_delete (soap:body, use = encoded)api_keys ApiKeys- company_uuid string
- user_api_key string
- vendor_api_key string
id stringOutput:api-postal_address_deleteResponse (soap:body, use = encoded)return stringExample code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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")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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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_listOperation type:Used for listing all the company’s postal addresses.SOAP action:/bravo/api/postal_address_listInput: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
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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 endimport 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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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_showOperation type:Used displaying information for a specific postal address.SOAP action:/bravo/api/postal_address_showInput:api-postal_address_show (soap:body, use = encoded)api_keys ApiKeys
- company_uuid string
- user_api_key string
- vendor_api_key string
id stringOutput: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
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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 endimport 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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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_updateOperation 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:/bravo/api/postal_address_updateInput:api-postal_address_update (soap:body, use = encoded)api_keys ApiKeys- company_uuid string
- user_api_key string
- vendor_api_key string
id stringpostal_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 stringExample code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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)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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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) - registerOperation type:Method register can be used to register new companies trough the API. This method is only for partners and requires a partner software API key. Partner must make sure the user can read and understand the Maventa license agreements.
This method returns a RegistrationParamsOut struct which includes the new user’s API key, the company’s UUID and Maventa ID. This information can then be automatically updated to the software’s settings so the users do not need to input API key information by themselves.
SOAP action:/bravo/api/registerInput:api-register (soap:body, use = encoded)registration_params RegistrationParamsIn- company_name string
- no_vat boolean
- state string
- company_email string
- user_first_name string
- post_code string
- post_office string
- company_bid string
- vendor_api_key string
- bank_accounts BankAccountParamsInArray - array of BankAccountParamsIn
- account string
- default boolean
- iban string
- swift string
- bank string
- user_last_name string
- user_phone string
- address1 string
- user_email string
- address2 string
- city string
- country string
- license_agreement boolean
Output:api-registerResponse (soap:body, use = encoded)return RegistrationParamsOut- status string
- company_uuid string
- user_api_key string
- company_maventa_id string
Example code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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 #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(registration_params) if result.status == "OK" puts "user api key: #{result.user_api_key}" puts "company uuid: #{result.company_uuid}" puts "company maventa id: #{result.company_maventa_id}" endimport 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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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(registration_params) if response_code == 200: if result.status == "OK": print "user api key: " + result.user_api_key print "company uuid: " + result.company_uuid print "company maventa id: " + result.company_maventa_id - searchOperation type:Search models, returns ID of matching objects
Arguments:
- api_keys (required)
- model_name (string BANK_ACCOUNT, POSTAL_ADDRESS, USER, or FEE)
- column_name (depends on model_name)
BANK_ACCOUNT columns- IBAN
- ACCOUNT
- SWIFT
POSTAL_ADDRESS columns- ADDRESS
- POST_CODE
- POST_OFFICE
- COUNTRY
- LANG
- LANG_COUNTRY
USER columns
FEE columns- CURRENCY
SOAP action:/bravo/api/searchInput:api-search (soap:body, use = encoded)api_keys ApiKeys- company_uuid string
- user_api_key string
- vendor_api_key string
model_name stringcolumn_name stringsearch_string stringOutput:api-searchResponse (soap:body, use = encoded)return StringArray - array of string - server_timeOperation type:Used for getting current server time for timestamping purposes.
This method returns a string with the current server time (format “YYYYMMDDHHMMSS”).SOAP action:/bravo/api/server_timeInput:api-server_time (soap:body, use = encoded)Output:api-server_timeResponse (soap:body, use = encoded)return stringExample code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/wsdl").create_rpc_driver puts server.server_timeimport 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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/wsdl", doctor = d, faults=False) print client.service.server_time() - user_createOperation 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:/bravo/api/user_createInput: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
- user_role string
- first_name string
- password_confirmation string
- last_name string
- phone string
- password string
Output:api-user_createResponse (soap:body, use = encoded)return stringExample code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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)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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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) - user_deleteOperation 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:/bravo/api/user_deleteInput:api-user_delete (soap:body, use = encoded)api_keys ApiKeys- company_uuid string
- user_api_key string
- vendor_api_key string
id stringOutput:api-user_deleteResponse (soap:body, use = encoded)return stringExample code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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")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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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_listOperation type:Used for listing your company’s users.SOAP action:/bravo/api/user_listInput: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
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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 endimport 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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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_showOperation type:Used for showing information about a specific user.SOAP action:/bravo/api/user_showInput:api-user_show (soap:body, use = encoded)api_keys ApiKeys
- company_uuid string
- user_api_key string
- vendor_api_key string
id stringOutput: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
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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 endimport 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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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_updateOperation 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:/bravo/api/user_updateInput:api-user_update (soap:body, use = encoded)api_keys ApiKeys- company_uuid string
- user_api_key string
- vendor_api_key string
id stringuser_params UserParamsIn- email string
- user_role string
- first_name string
- password_confirmation string
- last_name string
- phone string
- password string
Output:api-user_updateResponse (soap:body, use = encoded)return stringExample code:Example in Ruby
Example in Pythonrequire 'soap/wsdlDriver' server = SOAP::WSDLDriverFactory.new("https://testing.maventa.com/apis/bravo/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)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://secure.maventa.com/") d = ImportDoctor(imp) client = Client("https://testing.maventa.com/apis/bravo/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)




