Learn how to make Web Services API calls

From a Browser
Posting an API call to Intacct can be accomplished from a very simple set of HTML loaded into a web browser. &lt;HTML&gt; &lt;form method="post" action="https://www.intacct.com/ia/xml/xmlgw.phtml"&gt; &lt;textarea rows="20" cols="80" name="xmlrequest"&gt;&lt;/textarea&gt;&lt;br/&gt; &lt;input type="submit"/&gt; &lt;/form&gt; &lt;/HTML&gt; The key to the browser-based call is naming a form element "xmlrequest" that contains the XML to post.

From a Trigger
You can add a custom Trigger to custom objects on selected events, with optional conditions. To invoke an Intacct Web Services API call from a trigger, choose the "HTTP Post" trigger type with the appropriate URL for the environment. In production, this URL is "https://www.intacct.com/ia/xml/xmlgw.phtml". In the preview environment, the URL is "https://partner.intacct.com/ia/xml/xmlgw.phtml". To use a trigger, you must first create a document template for the trigger to process. Look at this sample document to see how to use merge fields to create a dynamic API call from a trigger:

Create an Invoice from a Trigger

Using a Programming Language like PHP
All modern languages provide basic facilities for posting API calls over an HTTP(S) connection. The following sample PHP code demonstrates how to make arbitrary API calls: &lt;? class api_post { public static function create($xml) { $createXml = "&lt;create&gt;". $xml. "&lt;/create&gt;"; return api_post::post($createXml); }    public static function xml2_1_method($xml) { return api_post::post($xml); }    private static function post($xml) { global $sessionId; $templateHead = "&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt; &lt;request&gt;    &lt;control&gt;         &lt;senderid&gt;intacct_dev&lt;/senderid&gt;         &lt;password&gt;babbage&lt;/password&gt;         &lt;controlid&gt;foobar&lt;/controlid&gt;         &lt;uniqueid&gt;false&lt;/uniqueid&gt;         &lt;dtdversion&gt;3.0&lt;/dtdversion&gt;     &lt;/control&gt;     &lt;operation&gt;         &lt;authentication&gt;             &lt;sessionid&gt;{1%}&lt;/sessionid&gt;         &lt;/authentication&gt;         &lt;content&gt;             &lt;function controlid=\"foobar\"&gt;"; $templateFoot = "&lt;/function&gt;        &lt;/content&gt;     &lt;/operation&gt; &lt;/request&gt;"; $xml = $templateHead. $xml. $templateFoot; $xml = str_replace("{1%}", $sessionId, $xml); // post! $ch = curl_init; curl_setopt( $ch, CURLOPT_URL, "https://partner.intacct.com/ia/xml/xmlgw.phtml" ); curl_setopt( $ch, CURLOPT_HEADER, 0 ); curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1 ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $ch, CURLOPT_MUTE, 1 ); curl_setopt( $ch, CURLOPT_TIMEOUT, 300 ); //Seconds until timeout curl_setopt( $ch, CURLOPT_POST, 1 ); $body = "xmlrequest=". urlencode( $xml ); curl_setopt( $ch, CURLOPT_POSTFIELDS, $body ); $response = curl_exec( $ch ); curl_close( $ch ); return $response; } } ?&gt;