Register

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

Return value

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

Arguments

  1. RegistrationParamsIn (required)

Example code in Ruby

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

Also available in: HTML TXT