fix A/R report
[freeside.git] / bin / xmlrpc-new_customer
1 #!/usr/bin/perl
2
3 use strict;
4 use Frontier::Client;
5 use Data::Dumper;
6
7 my( $username, $password ) = ( @ARGV );
8
9 my $uri = new URI 'http://localhost:8008/';
10
11 my $server = new Frontier::Client ( 'url' => $uri );
12
13 my $result = $server->call('FS.API.new_customer',
14     #API shared secret
15     'secret'         => 'sharingiscaring',
16
17     #customer informaiton
18     'agentnum'         => 1,
19     'refnum'           => 1, #advertising source
20     'agent_custid'     => '', #'323',
21     'referral_custnum' => 1,
22
23     'first'            => 'Tofu',
24     'last'             => 'Beast',
25     'company'          => 'Bank of Soymerica',
26
27     #address
28     'address1'         => '1234 Soybean Ln.',
29     'city'             => 'Tofutown',
30     'county'           => '',
31     'state'            => 'CA',
32     'zip'              => '54321',
33     'country'          => 'US',
34     'latitude'         => '',
35     'longitude'        => '',
36     'geocode'          => '',
37     'censustract'      => '',
38     'censusyear'       => '',
39
40     #phones
41     'daytime'          => '555 444 3211',
42     'night'            => '',
43     'fax'              => '',
44     'mobile'           => '123 466 3332',
45
46     #invoicing info
47     'invoicing_list'   => 'tofu@example.com', #comma-separated email addresses
48     'postal_invoicing' => 1,
49
50     #billing information
51     'payby'            => 'CARD', # DCRD, CHEK, DCHK, BILL, etc.
52     'payinfo'          => '4111111111111111',#card number / acctno@routing / PO#
53     'paydate'          => '11/2019', #card expiration
54     'paycvv'           => '123',     #card CVV/security code
55     'payname'          => 'Thomas Beast', #"Exact name on card" if different
56 );
57
58 die $result->{'error'} if $result->{'error'};
59
60 my $custnum = $result->{'custnum'};
61 warn "added new customer w/custnum $custnum\n";
62
63 1;