3 # xmlrpc-agent_new_customer.pl username password
9 my( $username, $password ) = ( @ARGV );
11 my $uri = new URI 'http://localhost/selfservice/xmlrpc.cgi';
13 my $server = new Frontier::Client ( 'url' => $uri );
20 my $login_result = $server->call('FS.SelfService.XMLRPC.agent_login',
22 'username' => $username,
23 'password' => $username,
27 die $login_result->{'error'} if $login_result->{'error'};
29 my $session_id = $login_result->{'session_id'};
30 warn "logged in w/session_id $session_id\n";
37 my $result = $server->call('FS.SelfService.XMLRPC.new_customer',
39 'session_id' => $session_id,
43 'address1' => '1234 Soybean Ln.',
48 'invoicing_list' => 'tofu@example.com',
51 'payinfo' => '4111111111111111',
53 'paydate' => '11/2012',
57 '_password' => 's33kret',
61 die $result->{'error'} if $result->{'error'};
63 my $custnum = $result->{'custnum'};
64 warn "added new customer w/custnum $custnum\n";
71 my $logout_result = $server->call('FS.SelfService.XMLRPC.agent_logout',
73 'session_id' => $session_id,
77 die $logout_result->{'error'} if $logout_result->{'error'};