Difference between revisions of "Freeside:3:Documentation:Developer/FS/API"

From Freeside
Jump to: navigation, search
(METHODS)
(METHODS)
Line 45: Line 45:
 
Returns general customer information.
 
Returns general customer information.
 
Takes a hash reference as parameter with the following keys, custnum and API secret
 
Takes a hash reference as parameter with the following keys, custnum and API secret
 
+
<br><br>
 +
'''location_info''' HASHREF<br>
 +
Returns location specific information for the customer.
 +
Takes a hash reference as parameter with the following keys, custnum and API secret
 +
<br><br>
 
'''new_customer''' HASHREF<br>
 
'''new_customer''' HASHREF<br>
 
:Creates a new customer. Takes a hash reference as parameter with the following keys:
 
:Creates a new customer. Takes a hash reference as parameter with the following keys:

Revision as of 09:51, 31 March 2014

NAME

FS::API - API for advanced back-office integration

SYNOPSIS


use strict;
use Frontier::Client;
use Data::Dumper;

my $uri = new URI 'http://localhost:8008/';

my $server = new Frontier::Client ( 'url' => $uri );

my $result = $server->call(
  'FS.API.customer_info',
    'secret'  => 'sharingiscaring',
    'custnum' => 181318,
);

#die $result->{'error'} if $result->{'error'};

print Dumper($result);

1;

DESCRIPTION

This module implements a backend API for advanced back-office integration.

In contrast to the self-service API, which authenticates an end-user and offers functionality to that end user, the backend API performs a simple shared-secret authentication and offers full, administrator functionality, enabling integration with other back-office systems.

If accessing this API remotely with XML-RPC or JSON-RPC, be careful to block the port by default, only allow access from back-office servers with the same security precations as the Freeside server, and encrypt the communication channel (for exampple, with an SSH tunnel or VPN) rather than accessing it in plaintext.

METHODS

customer_info HASHREF
Returns general customer information. Takes a hash reference as parameter with the following keys, custnum and API secret

location_info HASHREF
Returns location specific information for the customer. Takes a hash reference as parameter with the following keys, custnum and API secret

new_customer HASHREF

Creates a new customer. Takes a hash reference as parameter with the following keys:
secret
API Secret
first
first name (required)
last
last name (required)
ss
(not typically collected; mostly used for ACH transactions)
company
Company name
address1 (required)
Address line one
city (required)
City
county
County
state (required)
State
zip (required)
Zip or postal code
country
2 Digit Country Code
latitude
Latitude
longitude
Longitude
geocode
Currently used for third party tax vendor lookups
censustract
Used for determining FCC 477 reporting
censusyear
Used for determining FCC 477 reporting
daytime
Daytime phone number
night
Evening phone number
fax
Fax number
mobile
Mobile number
invoicing_list
comma-separated list of email addresses for email invoices. The special value 'POST' is used to designate postal invoicing (it may be specified alone or in addition to email addresses),
postal_invoicing
Set to 1 to enable postal invoicing
payby
CARD, DCRD, CHEK, DCHK, LECB, BILL, COMP or PREPAY
payinfo
Card number for CARD/DCRD, account_number@aba_number for CHEK/DCHK, prepaid "pin" for PREPAY, purchase order number for BILL
paycvv
Credit card CVV2 number (1.5+ or 1.4.2 with CVV schema patch)
paydate
Expiration date for CARD/DCRD
payname
Exact name on credit card for CARD/DCRD, bank name for CHEK/DCHK
referral_custnum
referring customer number
agentnum
Agent number
agent_custid
Agent specific customer number
referral_custnum
Referring customer number



insert_payment
Adds a new payment to a customers account. Takes a hash reference as parameter with the following keys:

secret
API Secret
custnum
Customer number
payby
Payment type
paid
Amount paid