<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://secure.freeside.biz/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Freeside%3A4%3ADocumentation%3ADeveloper%2FFS%2FAPI</id>
		<title>Freeside:4:Documentation:Developer/FS/API - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://secure.freeside.biz/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Freeside%3A4%3ADocumentation%3ADeveloper%2FFS%2FAPI"/>
		<link rel="alternate" type="text/html" href="https://secure.freeside.biz/mediawiki/index.php?title=Freeside:4:Documentation:Developer/FS/API&amp;action=history"/>
		<updated>2026-08-13T12:05:38Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.27.7</generator>

	<entry>
		<id>https://secure.freeside.biz/mediawiki/index.php?title=Freeside:4:Documentation:Developer/FS/API&amp;diff=9042&amp;oldid=prev</id>
		<title>Jeremyd: Edit via perl MediaWiki framework (1.13)</title>
		<link rel="alternate" type="text/html" href="https://secure.freeside.biz/mediawiki/index.php?title=Freeside:4:Documentation:Developer/FS/API&amp;diff=9042&amp;oldid=prev"/>
				<updated>2015-11-18T15:17:17Z</updated>
		
		<summary type="html">&lt;p&gt;Edit via perl MediaWiki framework (1.13)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==NAME==&lt;br /&gt;
FS::API - Freeside backend API&lt;br /&gt;
&lt;br /&gt;
==SYNOPSIS==&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  use FS::API;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
==DESCRIPTION==&lt;br /&gt;
This module implements a backend API for advanced back-office integration.&lt;br /&gt;
&lt;br /&gt;
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. Only access this API from a secure network from other backoffice machines. DON'T use this API to create customer portal functionality.&lt;br /&gt;
&lt;br /&gt;
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 example, with an SSH tunnel or VPN) rather than accessing it in plaintext.&lt;br /&gt;
&lt;br /&gt;
==METHODS==&lt;br /&gt;
; insert_payment OPTION =&amp;gt; VALUE, ...&lt;br /&gt;
:Adds a new payment to a customers account. Takes a list of keys and values as paramters with the following keys:&lt;br /&gt;
:; secret&lt;br /&gt;
::API Secret&lt;br /&gt;
:; custnum&lt;br /&gt;
::Customer number&lt;br /&gt;
:; payby&lt;br /&gt;
::Payment type&lt;br /&gt;
:; paid&lt;br /&gt;
::Amount paid&lt;br /&gt;
:; _date&lt;br /&gt;
::Option date for payment&lt;br /&gt;
&lt;br /&gt;
:Example:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  my $result = FS::API-&amp;gt;insert_payment(&lt;br /&gt;
    'secret'  =&amp;gt; 'sharingiscaring',&lt;br /&gt;
    'custnum' =&amp;gt; 181318,&lt;br /&gt;
    'payby'   =&amp;gt; 'CASH',&lt;br /&gt;
    'paid'    =&amp;gt; '54.32',&lt;br /&gt;
 &lt;br /&gt;
    #optional&lt;br /&gt;
    '_date'   =&amp;gt; 1397977200, #UNIX timestamp&lt;br /&gt;
  );&lt;br /&gt;
 &lt;br /&gt;
  if ( $result-&amp;gt;{'error'} ) {&lt;br /&gt;
    die $result-&amp;gt;{'error'};&lt;br /&gt;
  } else {&lt;br /&gt;
    #payment was inserted&lt;br /&gt;
    print &amp;quot;paynum &amp;quot;. $result-&amp;gt;{'paynum'};&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
; insert_credit OPTION =&amp;gt; VALUE, ...&lt;br /&gt;
:Adds a a credit to a customers account. Takes a list of keys and values as parameters with the following keys&lt;br /&gt;
:; secret&lt;br /&gt;
::API Secret&lt;br /&gt;
:; custnum&lt;br /&gt;
::customer number&lt;br /&gt;
:; amount&lt;br /&gt;
::Amount of the credit&lt;br /&gt;
:; _date&lt;br /&gt;
::The date the credit will be posted&lt;br /&gt;
&lt;br /&gt;
:Example:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  my $result = FS::API-&amp;gt;insert_credit(&lt;br /&gt;
    'secret'  =&amp;gt; 'sharingiscaring',&lt;br /&gt;
    'custnum' =&amp;gt; 181318,&lt;br /&gt;
    'amount'  =&amp;gt; '54.32',&lt;br /&gt;
 &lt;br /&gt;
    #optional&lt;br /&gt;
    '_date'   =&amp;gt; 1397977200, #UNIX timestamp&lt;br /&gt;
  );&lt;br /&gt;
 &lt;br /&gt;
  if ( $result-&amp;gt;{'error'} ) {&lt;br /&gt;
    die $result-&amp;gt;{'error'};&lt;br /&gt;
  } else {&lt;br /&gt;
    #credit was inserted&lt;br /&gt;
    print &amp;quot;crednum &amp;quot;. $result-&amp;gt;{'crednum'};&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
; insert_refund OPTION =&amp;gt; VALUE, ...&lt;br /&gt;
:Adds a a credit to a customers account. Takes a list of keys and values as parmeters with the following keys: custnum, payby, refund&lt;br /&gt;
&lt;br /&gt;
:Example:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  my $result = FS::API-&amp;gt;insert_refund(&lt;br /&gt;
    'secret'  =&amp;gt; 'sharingiscaring',&lt;br /&gt;
    'custnum' =&amp;gt; 181318,&lt;br /&gt;
    'payby'   =&amp;gt; 'CASH',&lt;br /&gt;
    'refund'  =&amp;gt; '54.32',&lt;br /&gt;
 &lt;br /&gt;
    #optional&lt;br /&gt;
    '_date'   =&amp;gt; 1397977200, #UNIX timestamp&lt;br /&gt;
  );&lt;br /&gt;
 &lt;br /&gt;
  if ( $result-&amp;gt;{'error'} ) {&lt;br /&gt;
    die $result-&amp;gt;{'error'};&lt;br /&gt;
  } else {&lt;br /&gt;
    #refund was inserted&lt;br /&gt;
    print &amp;quot;refundnum &amp;quot;. $result-&amp;gt;{'crednum'};&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
; new_customer OPTION =&amp;gt; VALUE, ...&lt;br /&gt;
:Creates a new customer. Takes a list of keys and values as parameters with the following keys:&lt;br /&gt;
:; secret&lt;br /&gt;
::API Secret&lt;br /&gt;
:; first&lt;br /&gt;
::first name (required)&lt;br /&gt;
:; last&lt;br /&gt;
::last name (required)&lt;br /&gt;
:; ss&lt;br /&gt;
::(not typically collected; mostly used for ACH transactions)&lt;br /&gt;
:; company&lt;br /&gt;
::Company name&lt;br /&gt;
:; address1 (required)&lt;br /&gt;
::Address line one&lt;br /&gt;
:; city (required)&lt;br /&gt;
::City&lt;br /&gt;
:; county&lt;br /&gt;
::County&lt;br /&gt;
:; state (required)&lt;br /&gt;
::State&lt;br /&gt;
:; zip (required)&lt;br /&gt;
::Zip or postal code&lt;br /&gt;
:; country&lt;br /&gt;
::2 Digit Country Code&lt;br /&gt;
:; latitude&lt;br /&gt;
::latitude&lt;br /&gt;
:; Longitude&lt;br /&gt;
::longitude&lt;br /&gt;
:; geocode&lt;br /&gt;
::Currently used for third party tax vendor lookups&lt;br /&gt;
:; censustract&lt;br /&gt;
::Used for determining FCC 477 reporting&lt;br /&gt;
:; censusyear&lt;br /&gt;
::Used for determining FCC 477 reporting&lt;br /&gt;
:; daytime&lt;br /&gt;
::Daytime phone number&lt;br /&gt;
:; night&lt;br /&gt;
::Evening phone number&lt;br /&gt;
:; fax&lt;br /&gt;
::Fax number&lt;br /&gt;
:; mobile&lt;br /&gt;
::Mobile number&lt;br /&gt;
:; invoicing_list&lt;br /&gt;
::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&lt;br /&gt;
:; referral_custnum&lt;br /&gt;
::Referring customer number&lt;br /&gt;
:; salesnum&lt;br /&gt;
::Sales person number&lt;br /&gt;
:; agentnum&lt;br /&gt;
::Agent number&lt;br /&gt;
:; agent_custid&lt;br /&gt;
::Agent specific customer number&lt;br /&gt;
:; referral_custnum&lt;br /&gt;
::Referring customer number&lt;br /&gt;
; update_customer&lt;br /&gt;
:Updates an existing customer. Passing an empty value clears that field, while NOT passing that key/value at all leaves it alone. Takes a list of keys and values as parameters with the following keys:&lt;br /&gt;
:; secret&lt;br /&gt;
::API Secret (required)&lt;br /&gt;
:; custnum&lt;br /&gt;
::Customer number (required)&lt;br /&gt;
:; first&lt;br /&gt;
::first name&lt;br /&gt;
:; last&lt;br /&gt;
::last name&lt;br /&gt;
:; company&lt;br /&gt;
::Company name&lt;br /&gt;
:; address1&lt;br /&gt;
::Address line one&lt;br /&gt;
:; city&lt;br /&gt;
::City&lt;br /&gt;
:; county&lt;br /&gt;
::County&lt;br /&gt;
:; state&lt;br /&gt;
::State&lt;br /&gt;
:; zip&lt;br /&gt;
::Zip or postal code&lt;br /&gt;
:; country&lt;br /&gt;
::2 Digit Country Code&lt;br /&gt;
:; daytime&lt;br /&gt;
::Daytime phone number&lt;br /&gt;
:; night&lt;br /&gt;
::Evening phone number&lt;br /&gt;
:; fax&lt;br /&gt;
::Fax number&lt;br /&gt;
:; mobile&lt;br /&gt;
::Mobile number&lt;br /&gt;
:; invoicing_list&lt;br /&gt;
::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&lt;br /&gt;
:; referral_custnum&lt;br /&gt;
::Referring customer number&lt;br /&gt;
:; salesnum&lt;br /&gt;
::Sales person number&lt;br /&gt;
:; agentnum&lt;br /&gt;
::Agent number&lt;br /&gt;
; customer_info OPTION =&amp;gt; VALUE, ...&lt;br /&gt;
:Returns general customer information. Takes a list of keys and values as parameters with the following keys: custnum, secret&lt;br /&gt;
; location_info&lt;br /&gt;
:Returns location specific information for the customer. Takes a list of keys and values as paramters with the following keys: custnum, secret&lt;br /&gt;
; bill_now OPTION =&amp;gt; VALUE, ...&lt;br /&gt;
:Bills a single customer now, in the same fashion as the &amp;quot;Bill now&amp;quot; link in the UI.&lt;br /&gt;
&lt;br /&gt;
:Returns a hash reference with a single key, 'error'. If there is an error, the value contains the error, otherwise it is empty. Takes a list of keys and values as parameters with the following keys:&lt;br /&gt;
:; secret&lt;br /&gt;
::API Secret (required)&lt;br /&gt;
:; custnum&lt;br /&gt;
::Customer number (required)&lt;/div&gt;</summary>
		<author><name>Jeremyd</name></author>	</entry>

	</feed>