PHP PHP iSDK XML-RPC Python Back to Top

Introduction

One of the hidden gems in the Keap suite of software is the API. The Keap API enables third-party applications to communicate with Keap and process, update, and destroy data for a wide variety of uses. You can do things like manage contacts, place orders, send messages, and most other things available for use in the Keap software.

Making XML-RPC Requests

The Keap API uses XML implemented as encoded XML-RPC as its communication method for both sending and receiving requests.

All requests made to the Infusionsoft XML-RPC API will be an HTTP POST to https://api.infusionsoft.com/crm/xmlrpc/v1

You can authenticate your request either with a Personal Access Token/Service Account Key (if a first-party developer) or an OAuth2 Bearer Token (if a third-party integration).

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.



Helper Libraries

Keap officially supports the PHP library we created in-house. In addition, there are a number of third party helper libraries created by members of the community that may be useful to you. Many of these libraries are open source, so we encourage you to get into contact with their creators if you find bugs or have ideas for feature requests.

See Available Helper Libraries

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.



Additional Languages

Additionally, we have created a number of sample files that implement the Keap API in many languages, including ASP, .Net, Java, Perl, PHP, Python, and Ruby. You can try those out for yourself by downloading all samples on Github (zip, 2.5mb) If you're interested in implementing the API in a custom application, or a language not shown above, we have created documentation to help you create the raw XML calls, and understand the XML replies. In this way Keap API is language agnostic and can tie in with whatever language you'd like to use.

See Available Code Samples

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.



Authentication

The Keap API uses a fairly standard implementation of OAuth 2.0 in order to provide authentication to all API endpoints. In the past, the Infusionsoft API has relied on a simple token based system; while those tokens will remain active until some date in the future for the XML-RPC API, any new implementations and all requests to the REST API will be required to use OAuth 2.0. Rather than re-explain OAuth again, it is more useful to provide a series of documents that have already been created and demonstrate the OAuth protocol, how to implement it in your code, how to troubleshoot, and how to ease development. Before that, though, it is important to have the authorization destinations and necessary details.

Request Permission

The first step in the OAuth flow is to redirect the user to Keap in order to authorize your application for access. The URL you generate here is where you first send your user in order for them to log in and continue the OAuth flow.

Redirect users to https://signin.infusionsoft.com/app/oauth/authorize along with the required parameters in order to start the OAuth exchange.


Form Parameters

client_id:
string (required)

Application client ID. Found in the developer portal

redirect_uri:
string (required)

This is the callback URL that Infusionsoft will redirect the users back to after authorization (must be HTTPS). The redirect_uri must be a registered URL in your application. We will not redirect users to any other URLs, so it is important this be properly setup before any authentication attempts.

response_type:
string (required)

The desired grant type, as per the OAuth 2.0 spec. The only current valid value is response_type=code Defaults to code

scope:
string

The scopes required by your application. The only current valid value is scope=full Defaults to full

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Once the user has logged into their Keap account and authorized your application, they will be redirected back to your application at your specified redirect_uri with a code URL parameter that is used to request an access token.


GET https://signin.infusionsoft.com/app/oauth/authorize
Begins the OAuth flow by asking the user to choose an Infusionsoft account to authenticate with.

curl https://signin.infusionsoft.com/app/oauth/authorize

require("../../src/isdk.php");

$app = new iSDK();
$app->setClientId('CLIENTID');
$app->setSecret('CLIENTSECRET');

echo "<p>Click the link below to allow my application to access your Infusionsoft application.</p>";
echo '<a href="'.$app->getAuthorizationURL().'">Authorize My Application</a>';

$url = $infusionsoft->getAuthorizationUrl();
echo '<a href="' . $url . '">Click here to authorize</a>';

Request an Access Token

Using the code URL parameter returned from the authorization callback, your application can request an access token and refresh token from Keap.

Requesting an access token requires you to POST to https://api.infusionsoft.com/token


Form Parameters

client_id:
string (required)

Your application's client ID. Found in the developer portal

client_secret:
string (required)

Your application's client secret. Found in the developer portal

code:
string (required)

The code returned when the user was redirected back to your application

grant_type:
string (required)

The desired grant type, as per the OAuth 2.0 spec. The only current valid value is grant_type=authorization_code Defaults to authorization_code

redirect_uri:
string (required)

The redirect URL from the original authorization request

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

The access_token is the token you will use to authenticate requests to the Keap API, and it expires after the time in the expires_in field (in seconds). In order to get a new valid access token after one has expired, you must use the refresh_token to request a new access token.


curl https://api.infusionsoft.com/token -X POST -d card=token_id

{
    "token_type": "bearer",
    "access_token": "axxxxx",
    "expires_in": 3600,
    "refresh_token": "rxxxxx",
    "scope":"full|example.infusionsoft.com"
}

require("../../src/isdk.php");

$app = new iSDK();

if(isset($_GET['code'])){
    $app->setClientId('CLIENTID');
    $app->setSecret('CLIENTSECRET');
    $app->authorize($_GET['code']);

    $app->refreshAccessToken();
}

$infusionsoft->requestAccessToken($_GET['code']);

Refresh an Access Token

After your access token expires, you'll use the refresh token that was provided when your access token was initially granted to request a new access token.

Note: Once a Refresh Token is used to receive a new Access Token, you will be returned a new Refresh Token as well, which will need to be persisted in order to request the next access token.

Refreshing an access token requires you to POST to https://api.infusionsoft.com/token


Form Parameters

grant_type:
string (required)

The desired grant type, as per the OAuth 2.0 spec. The only current valid value is refresh_token Defaults to refresh_token

refresh_token:
string (required)

The refresh token provided when the most recent access_token was granted

Header: Authorization:
string (required)

The word "Basic" concatenated with a base64 encoded string of your client_id, a colon, and your client_secret passed via the Authorization header.

Example pseudo code: 'Basic ' + base64_encode(CLIENT_ID + ':' + CLIENT_SECRET)

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Provides a new access_token that you will use to authenticate subsequent requests to the Infusionsoft API. Like the originally granted token, this expires after the amount of time in the expires_in field (in seconds). You must use the newly provided refresh_token to request a subsequent new access token.

Make sure to also store the new refresh token every time you request and store a new access token.


POST /token
$infusionsoft->refreshAccessToken();

$infusionsoft = new InfusionsoftInfusionsoft(array(
    'clientId' => 'CLIENT_ID',
    'clientSecret' => 'CLIENT_SECRET',
    'redirectUri' => 'REDIRECT_URL',
));

// retrieve the existing token object from storage
$infusionsoft->setToken($yourStoredToken);

$infusionsoft->refreshAccessToken();

POST /token
$infusionsoft->refreshAccessToken();

$infusionsoft = new InfusionsoftInfusionsoft(array(
    'clientId' => 'CLIENTID',
    'clientSecret' => 'CLIENTSECRET',
    'redirectUri' => 'https://example.com/callback',
));

// retrieve the existing token object from storage
$infusionsoft->setToken($yourStoredToken);

return $infusionsoft->refreshAccessToken();

Affiliate

The Affiliate Service is used to pull commission data and activities for affiliates. With this service, you have access to Clawbacks, Commissions, Payouts, Running Totals, and the Activity Summary. The methods in the Affiliate Service mirror the reports produced inside Infusionsoft. To manage affiliate information (ie Name, Phone, etc.) you will need to use the DataService.

Retrieve Clawbacks

Retrieves all clawed back commissions for a particular affiliate. Claw backs typically occur when an order has been refunded to the customer.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

affiliateId:
integer (required)

The Id number for the affiliate record you would like the claw backs for

filterStartDate:
dateTime (required)

The starting date for the date range which you would like affiliate claw backs for

filterEndDate:
dateTime (required)

The ending date for the date range which you would like the affiliate claw backs for

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




APIAffiliateService.affClawbacks

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>APIAffiliateService.affClawbacks</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>affiliateId</int></value>
    </param>
    <param>
      <value><dateTime.iso8601>startDate</dateTime.iso8601></value>
    </param>
    <param>
      <value><dateTime.iso8601>endDate</dateTime.iso8601></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><array><data/></array></value>
    </param>
  </params>
</methodResponse>

$app->affClawbacks($affiliateId, $start, $finish);


$app = new iSDK();
// perform authorization tasks

$affiliateId = 123;
$start = date('YmdTH:i:s',mktime(00,00,00,09,01,2008));
$finish = date('YmdTH:i:s',mktime(00,00,00,09,30,2008));
$claws = $app->affClawbacks($affiliateId, $start, $finish);

$infusionsoft->affiliates()->affClawbacks()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->affiliates()->affClawbacks($affiliateId, $filterStartDate, $filterEndDate)

Retrieve Commissions

Retrieves all commissions for a specific affiliate within a date range.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

affiliateId:
integer (required)

The Id number for the affiliate record you would like the commissions for

filterStartDate:
dateTime (required)

The starting date for the date range which you would like affiliate commissions for

filterEndDate:
dateTime (required)

The ending date for the date range which you would like the affiliate commissions for

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




$app->affCommissions($affiliateId, $start, $finish);


$app = new iSDK();
// perform authorization tasks

$affiliateId = 123;
$start = date('YmdTH:i:s',mktime(00,00,00,09,01,2008));
$finish = date('YmdTH:i:s',mktime(00,00,00,09,30,2008));
$comms = $app->affCommissions($affiliateId, $start, $finish);

APIAffiliateService.affCommissions

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>APIAffiliateService.affCommissions</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>affiliateId</int></value>
    </param>
    <param>
      <value><dateTime.iso8601>startDate</dateTime.iso8601></value>
    </param>
    <param>
      <value><dateTime.iso8601>endDate</dateTime.iso8601></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><array><data/></array></value>
    </param>
  </params>
</methodResponse>

$infusionsoft->affiliates()->affCommissions()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->affiliates()->affCommissions($affiliateId, $filterStartDate, $filterEndDate)

Retrieve Payments

Retrieves all payments for a specific affiliate within a date range


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

affiliateId:
integer (required)

The Id number for the affiliate record you would like the claw backs for

filterStartDate:
dateTime (required)

The starting date for the date range which you would like affiliate payments for

filterEndDate:
dateTime (required)

The ending date for the date range which you would like the affiliate payments for

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




$app->affPayouts($affiliateId, $start, $finish);


$app = new iSDK();
// perform authorization tasks

$affiliateId = 123;
$start = date('YmdTH:i:s',mktime(00,00,00,09,01,2008));
$finish = date('YmdTH:i:s',mktime(00,00,00,09,30,2008));
$pays = $app->affPayouts($affiliateId, $start, $finish);

APIAffiliateService.affPayouts

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>APIAffiliateService.affPayouts</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>affiliateId</int></value>
    </param>
    <param>
      <value><dateTime.iso8601>startDate</dateTime.iso8601></value>
    </param>
    <param>
      <value><dateTime.iso8601>endDate</dateTime.iso8601></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><array><data/></array></value>
    </param>
  </params>
</methodResponse>

$infusionsoft->affiliates()->affPayouts()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->affiliates()->affPayouts($affiliateId, $filterStartDate, $filterEndDate)

Retrieve a Summary of Affiliate Statistics

Retrieves a summary of statistics for a list of affiliates.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

affiliateId:
integer (required)

An array of Affiliate Id numbers you would like stats for

filterStartDate:
dateTime (required)

The starting date for the date range which you would like affiliate stats for

filterEndDate:
dateTime (required)

The ending date for the date range which you would like the affiliate stats for

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




APIAffiliateService.affSummary

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>APIAffiliateService.affSummary</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><array>
        <data>
          <value><int>affList1</int></value>
          <value><int>affList2</int></value>
          <value><int>affList3</int></value>
        </data>
      </array></value>
    </param>
    <param>
      <value><dateTime.iso8601>startDate</dateTime.iso8601></value>
    </param>
    <param>
      <value><dateTime.iso8601>endDate</dateTime.iso8601></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <array>
          <data>
            <value>
              <struct>
                <member>
                  <name>Clawbacks</name>
                  <value><double>0.0</double></value>
                </member>
                <member>
                  <name>AmountEarned</name>
                  <value><double>0.0</double></value>
                </member>
                <member>
                  <name>Balance</name>
                  <value>
                    <double>0.0</double></value>
                </member>
                <member>
                  <name>AffiliateId</name>
                  <value><i4>2</i4></value>
                </member>
              </struct>
            </value>
            <value>
              <struct>
                <member>
                  <name>Clawbacks</name>
                  <value><double>0.0</double></value>
                </member>
                <member>
                  <name>AmountEarned</name>
                  <value><double>0.0</double></value>
                </member>
                <member>
                  <name>Balance</name>
                  <value><double>0.0</double></value>
                </member>
                <member>
                  <name>AffiliateId</name>
                  <value><i4>4</i4></value>
                </member>
              </struct>
            </value>
            <value>
              <struct>
                <member>
                  <name>Clawbacks</name>
                  <value><double>0.0</double></value>
                </member>
                <member>
                  <name>AmountEarned</name>
                  <value><double>0.0</double></value>
                </member>
                <member>
                  <name>Balance</name>
                  <value><double>0.0</double></value>
                </member>
                <member>
                  <name>AffiliateId</name>
                  <value><i4>6</i4></value>
                </member>
              </struct>
            </value>
          </data>
        </array>
      </value>
    </param>
  </params>
</methodResponse>

$app->affSummary($affiliateIds, $start, $finish);


$app = new iSDK();
// perform authorization tasks

$affiliateIds = array(123,456,789);
$start = date('YmdTH:i:s',mktime(00,00,00,09,01,2008));
$finish = date('YmdTH:i:s',mktime(00,00,00,09,30,2008));
$pays = $app->affSummary($affiliateIds, $start, $finish);

$infusionsoft->affiliates()->affSummary()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->affiliates()->affSummary($affiliateId, $filterStartDate, $filterEndDate)

Retrieve Running Totals

Retrieves the current balances for Amount Earned, Clawbacks, and Running Balance.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

affiliateIds:
array (required)

An integer array of the affiliate ID numbers that you would like balances for

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




APIAffiliateService.affRunningTotals

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>APIAffiliateService.affRunningTotals</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><array>
        <data>
          <value><int>affList1</int></value>
          <value><int>affList2</int></value>
          <value><int>affList3</int></value>
        </data>
      </array></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <array>
          <data>
            <value>
              <struct>
                <member>
                  <name>Clawbacks</name>
                  <value><double>0.0</double></value>
                </member>
                <member>
                  <name>AmountEarned</name>
                  <value><double>0.5483</double></value>
                </member>
                <member>
                  <name>Payments</name>
                  <value><double>0.0</double></value>
                </member>
                <member>
                  <name>RunningBalance</name>
                  <value><double>0.5483</double></value>
                </member>
                <member>
                  <name>AffiliateId</name>
                  <value><i4>2</i4></value>
                </member>
              </struct>
            </value>
            <value>
              <struct>
                <member>
                  <name>Clawbacks</name>
                  <value><double>0.0</double></value>
                </member>
                <member>
                  <name>AmountEarned</name>
                  <value><double>0.0</double></value>
                </member>
                <member>
                  <name>Payments</name>
                  <value><double>0.0</double></value>
                </member>
                <member>
                  <name>RunningBalance</name>
                  <value><double>=0.0</double></value>
                </member>
                <member>
                  <name>AffiliateId</name>
                  <value><i4>4</i4></value>
                </member>
              </struct>
            </value>
            <value>
              <struct>
                <member>
                  <name>Clawbacks</name>
                  <value><double>0.0</double></value>
                </member>
                <member>
                  <name>AmountEarned</name>
                  <value><double>0.0</double></value>
                </member>
                <member>
                  <name>Payments</name>
                  <value><double>0.0</double></value>
                </member>
                <member>
                  <name>RunningBalance</name>
                  <value><double>0.0</double></value>
                </member>
                <member>
                  <name>AffiliateId</name>
                  <value><i4>6</i4></value>
                </member>
              </struct>
            </value>
          </data>
        </array>
      </value>
    </param>
  </params>
</methodResponse>

$app->affPayouts($affiliateIds);


$app = new iSDK();
// perform authorization tasks

$affiliateIds = array(123,456,789);
$totals = $app->affPayouts($affiliateIds);

$infusionsoft->affiliates()->affRunningTotals()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->affiliates()->affRunningTotals($affiliateIds)

Affiliate Program

The Affiliate Program Service allows access to some of features in the Referral Partner Center

Retrieve All Programs

Retrieves a list of all of the Affiliate Programs that are in the application.

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>AffiliateProgramService.getAffiliatePrograms</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <fault>
    <value>
      <struct>
        <member>
        </member>
      </struct>
    </value>
  </fault>
</methodResponse>

$app->getAffiliatePrograms();


$app = new iSDK();
// perform authorization tasks

$programs = $app->getAffiliatePrograms();

Retrieve a Program's Affiliates

Retrieves a list of all of the affiliates with their contact data for the specified program. This includes all of the custom fields defined for the contact and affiliate records that are retrieved.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

programId:
integer (required)

The Referral Partner Commission Program ID

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




AffiliateProgramService.getAffiliatesByProgram

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>AffiliateProgramService.getAffiliatesByProgram</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><string>programId</string></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>

    </param>
  </params>
</methodResponse>

$app->getAffiliatesByProgram(3);


$app = new iSDK();
// perform authorization tasks

$app->getAffiliatesByProgram(3);

$infusionsoft->affiliatePrograms()->getAffiliatesByProgram()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->affiliatePrograms()->getAffiliatesByProgram($programId)

Retrieve an Affiliate's Programs

Retrieves a list of all of the Affiliate Programs for the Affiliate specified.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

affiliateId:
integer (required)

The affiliate you want to get the programs for

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




AffiliateProgramService.getProgramsForAffiliate

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
 <methodName>AffiliateProgramService.getProgramsForAffiliate</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><i4>affiliateId</i4></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name></name>
            <value></value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

$app->getProgramsForAffiliate(2);


$app = new iSDK();
// perform authorization tasks

$programs = $app->getProgramsForAffiliate(2);

$infusionsoft->affiliatePrograms()->getProgramsForAffiliate()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->affiliatePrograms()->getProgramsForAffiliate($affiliateId)

Retrieve Program Resources

Retrieves a list of all of the resources that are associated to the Affiliate Program specified.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

programId:
integer (required)

The commission program you want resources from

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




AffiliateProgramService.getResourcesForAffiliateProgram

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>AffiliateProgramService.getResourcesForAffiliateProgram</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>programId</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
    </param>
  </params>
</methodResponse>

$app->getResourcesForAffiliateProgram($programId);


$app = new iSDK();
// perform authorization tasks

$result = $app->getResourcesForAffiliateProgram(2);

$infusionsoft->affiliatePrograms()->getResourcesForAffiliateProgram()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->affiliatePrograms()->getResourcesForAffiliateProgram($programId)

Contact

The Contact service is used to manage contacts. You can add, update and find contacts in addition to managing follow up sequences, tags and action sets.

Find Contact by Name Or Email

Searches for a contact by Name or Email Address


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

searchString:
string (required)

The name or email to search by

limit:
integer (required)

The number of records you would like returned

page:
integer (required)

The page number of results

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




ContactService.findByNameOrEmail

<methodCall>
<methodName>ContactService.findByNameOrEmail</methodName>
<params>
    <param>
      <value><string>dummyKey</string></value>
    </param>
    <param>
      <value><string>name@email.com</string></value>
    </param>    
    <param>
      <value><int>10</int></value>
    </param>
    <param>
      <value><int>0</int></value>
    </param>
  </params>
</methodCall>

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
    <params>
        <param>
            <value>
                <array>
                    <data>
                        <value>
                            <struct>
                                <member>
                                    <name>Email</name>
                                    <value>name@email.com</value>
                                </member>
                                <member>
                                    <name>FirstName</name>
                                    <value>thefirstname</value>
                                </member>
                                <member>
                                    <name>Id</name>
                                    <value>
                                        <i4>1</i4>
                                    </value>
                                </member>
                                <member>
                                    <name>LastName</name>
                                    <value>thelastname</value>
                                </member>
                            </struct>
                        </value>
                    </data>
                </array>
            </value>
        </param>
    </params>
</methodResponse>

Create a Contact

Creates a new contact record from the data passed in the associative array.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

data:
array (required)

An associative array of the data for this new contact record. The array key is the field name to store the value within

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




ContactService.add

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>ContactService.add</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><struct>
        <member><name>FirstName</name>
          <value><string>John</string></value>
        </member>
        <member><name>LastName</name>
          <value><string>Doe</string></value>
        </member>
        <member><name>Email</name>
          <value><string>there_he_go@itsjohndoe.com</string></value>
        </member>
      </struct></value>
    </param>
  </params>
  </methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><i4>contactIDNumber</i4></value>
    </param>
  </params>
</methodResponse>

$app->addCon($contactData);


$contactData = array('FirstName' => 'John',
                'LastName'  => 'Doe',
                'Email'     => 'JDoe@email.com');

$conID = $app->addCon($contactData);

$infusionsoft->contacts()->add()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->contacts()->add($data)

Create a Contact and Check for Duplicates

Adds or updates a contact record based on matching data


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

data:
array (required)

An associative array of the data for this new contact record. The array key is the field name to store the value within.

dupCheckType:
string (required)

Determines how to consider a duplicate record. Options are: 'Email', 'EmailAndName', or 'EmailAndNameAndCompany'

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




ContactService.addWithDupCheck

<?xml version="1.0"?>
<methodCall>
    <methodName>ContactService.addWithDupCheck</methodName>
        <params>
            <param>
                <value><string>privateKey</string></value>
            </param>
            <param>
                <value>
                    <struct>
                        <member>
                            <name>FirstName</name>
                            <value><string>John</string></value>
                        </member>
                        <member>
                            <name>LastName</name>
                            <value><string>Doe</string></value>
                        </member>
                        <member>
                            <name>Email</name>
                            <value><string>there_he_go@itsjohndoe.com</string></value>
                        </member>
                    </struct>
                </value>
            </param>
            <param>
                <value><string>EmailAndName</string></value>
            </param>
        </params>
</methodCall>

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
    <params>
        <param>
            <value>
                <i4>40</i4>
            </value>
        </param>
    </params>
</methodResponse>

$app->addWithDupCheck();


$app = new iSDK();
// perform authorization tasks

$app->addWithDupCheck(array('FirstName' => 'test', 'LastName' => 'test', 'Email' => 'test@test.com'), 'EmailAndName');

$infusionsoft->contacts()->addWithDupCheck()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->contacts()->addWithDupCheck($data, $dupCheckType)

Retrieve a Contact


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

contactId:
integer (required)

The Id number of the contact you would like to load data from

selectedFields:
array (required)

An array of strings where each string is the database field name of the field you would like sent back

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




ContactService.load

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
<methodName>ContactService.load</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>contactIDNumber</int></value>
    </param>
    <param>
      <value><array>
        <data>
          <value><string>Id</string></value>
          <value><string>FirstName</string></value>
          <value><string>LastName</string></value>
        </data>
      </array></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>FirstName</name>
            <value>Ron</value>
          </member>
          <member>
            <name>Id</name>
            <value><i4>18</i4></value>
          </member>
          <member>
            <name>LastName</name>
            <value>Doe</value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

$app->loadCon(123, $returnFields);


$app = new iSDK();
// perform authorization tasks

$returnFields = array('Email', 'FirstName', 'LastName', '_myCustomField');
$conDat = $app->loadCon(123, $returnFields);

$infusionsoft->contacts()->load()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->contacts()->load($contactId, $selectedFields)

Update a Contact

Updates a contact's information


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

contactId:
integer (required)

The ID of the contact you wish to update

data:
array (required)

An associate array of the data for this contact. The array keys should be the field names you wish to update.

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




ContactService.update

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
<methodName>ContactService.update</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>contactIDNumber</int></value>
    </param>
    <param>
      <value><struct>
        <member><name>fieldToUpdate1</name>
          <value><string>field1</string></value>
        </member>
        <member><name>fieldToUpdate2</name>
          <value><string>field2</string></value>
        </member>
      </struct></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><i4>contactIDNumber</i4></value>
    </param>
  </params>
</methodResponse>

$app->updateCon($ID, $contactData);


$conDat = array('Email' => 'JDoe2@email.com');
$conID = $app->updateCon(123, $conDat);

$infusionsoft->contacts()->update()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->contacts()->update($contactId, $data)

Merge Two Contacts

Merges two contacts into a single record.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

contactId:
integer (required)

The contact ID number you want to merge into

duplicateContactId:
integer (required)

The contact ID of the duplicate contact you would like to merge

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




ContactService.merge

<?xml version="1.0"?>
<methodCall>
    <methodName>ContactService.merge</methodName>
    <params>
        <param>
            <value><string>privateKey</string></value>
        </param>
        <param>
            <value><int>contactId</int></value>
        </param>
        <param>
            <value><int>duplicateContactId</int></value>
        </param>
    </params>
</methodCall>

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
    <params>
        <param>
            <value>
                <boolean>1</boolean>
            </value>
        </param>
    </params>
</methodResponse>


$app = new iSDK();
// perform authorization tasks

$carray = array(
php_xmlrpc_encode($app->key),
php_xmlrpc_encode(16),
php_xmlrpc_encode(24));

$app->methodCaller("ContactService.merge",$carray);

$infusionsoft->contacts()->merge()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->contacts()->merge($contactId, $duplicateContactId)

Search for a Contact by an Email Address

Retrieves all contacts with the given email address. This searches the Email, Email 2, and Email 3 fields


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

email:
string (required)

The email address to search with

selectedFields:
array (required)

The contact fields you would like returned

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




ContactService.findByEmail

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>ContactService.findByEmail</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><string>there_he_go@itsjohndoe.com</string></value>
    </param>
    <param>
      <value><array>
        <data>
          <value><string>Id</string></value>
          <value><string>FirstName</string></value>
          <value><string>LastName</string></value>
        </data>
      </array></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <array>
          <data>
            <value>
              <struct>
                <member>
                  <name>FirstName</name>
                  <value>John</value>
                </member>
                <member>
                  <name>Id</name>
                  <value><i4>16</i4></value>
                </member>
                <member>
                  <name>LastName</name>
                  <value>Doe</value>
                </member>
              </struct>
            </value>
            <value>
              <struct>
                <member>
                  <name>FirstName</name>
                  <value>Ron</value>
                </member>
                <member>
                  <name>Id</name>
                  <value><i4>18</i4></value>
                </member>
                <member>
                  <name>LastName</name>
                  <value>Doe</value>
                </member>
              </struct>
            </value>
          </data>
        </array>
      </value>
    </param>
  </params>
</methodResponse>

$app->findByEmail($email, $returnFields);


$app = new iSDK();
// perform authorization tasks

$email = 'test@example.com';
$returnFields = array('Id', 'FirstName', 'LastName');
$data = $app->findByEmail($email, $returnFields);

$infusionsoft->contacts()->findByEmail()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->contacts()->findByEmail($email, $selectedFields)

Add a Tag to a Contact

Adds a tag to a contact record (tags were originally called "groups").


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

contactId:
integer (required)

The ID of the contact you would like to add to a group

tagId:
integer (required)

The ID of the tag to add to the contact

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




ContactService.addToGroup

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>ContactService.addToGroup</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>contactIDNumber</int></value>
    </param>
    <param>
      <value><int>tagIDNumber</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><boolean>1</boolean></value>
    </param>
  </params>
</methodResponse>

$app->grpAssign($contactId, $tagId);


$app = new iSDK();
// perform authorization tasks

$contactId = 123;
$tagId = 456;
$result = $app->grpAssign($contactId, $tagId);

$infusionsoft->contacts()->addToGroup()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->contacts()->addToGroup($contactId, $tagId)

Remove a Tag from a Contact

Removes a tag from a contact (tags were originally called groups).


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

contactId:
integer (required)

The Id number of the contact you would like to remove the tag from

tagId:
integer (required)

The tag ID. This is found on the Setup > Tags menu

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




ContactService.removeFromGroup

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
<methodName>ContactService.removeFromGroup</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>contactIDNumber</int></value>
    </param>
    <param>
      <value><int>tagIDNumber</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><boolean>1</boolean></value>
    </param>
  </params>
</methodResponse>

$app->grpRemove($contactId, $groupId);


$app = new iSDK();
// perform authorization tasks

$contactId = 123;
$groupId = 456;
$result = $app->grpRemove($contactId, $groupId);

$infusionsoft->contacts()->removeFromGroup()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->contacts()->removeFromGroup($contactId, $tagId)

Add a Contact to a Follow-up Sequence

Adds a contact to a follow-up sequence (campaigns were the original name of follow-up sequences).


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

contactId:
integer (required)

The ID of the contact you would like to start the follow-up sequence for.

campaignId:
integer (required)

The ID of the follow-up sequence to start the contact on.

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




ContactService.addToCampaign

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>ContactService.addToCampaign</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>contactIDNumber</int></value>
    </param>
    <param>
      <value><int>campaignIDNumber</int></value>
    </param>
  </params>
</methodCall>

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
    <params>
        <param>
            <value>
                <boolean>0</boolean>
            </value>
        </param>
    </params>
</methodResponse>

$app->campAssign($contactId, $campaignId);


$app = new iSDK();
// perform authorization tasks

$contactId = 123;
$campId = 456;
$result = $app->campAssign($contactId, $campId)

$infusionsoft->contacts()->addToCampaign()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->contacts()->addToCampaign($contactId, $campaignId)

Retrieve a Contact's Next Follow-up Sequence Step

Returns the Id number of the next follow-up sequence step for the given contact


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

contactId:
integer (required)

The Id number of the contact record you would like to get the next sequence step for

followUpSequenceId:
integer (required)

The follow-up sequence Id number you would like to get the next step for the given contact

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




ContactService.getNextCampaignStep

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>ContactService.getNextCampaignStep</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>contactIDNumber</int></value>
    </param>
    <param>
      <value><int>followUpSequenceId</int></value>
    </param>
  </params>
</methodCall>

$app->getNextCampaignStep($contactIdNumber,2);


$app = new iSDK();
// perform authorization tasks

$cStep = $app->getNextCampaignStep($contactIdNumber,2);

$infusionsoft->contacts()->getNextCampaignStep()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->contacts()->getNextCampaignStep($contactId, $followUpSequenceId)

Immediately Execute a Follow-up Sequence Step for Multiple Contacts

Immediately performs the given follow-up sequence step for the given contacts.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

contactIds:
array (required)

An array of contact Id numbers you would like to reschedule the step for

sequenceStepId:
integer (required)

The ID of the particular sequence step you would like to reschedule

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




ContactService.rescheduleCampaignStep

<?xml version="1.0"?>
<methodCall>
  <methodName>ContactService.rescheduleCampaignStep</methodName>
    <params>
      <param>
        <value><string>privateKey</string></value>
      </param>
    <param>
    <value><array>
      <data>
        <value><int>22</int></value>
        <value><int>12</int></value>
        <value><int>16</int></value>
      </data>
    </array></value>
    </param>
    <param>
      <value><int>2</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <i4>
          3
        </i4>
      </value>
    </param>
  </params>
</methodResponse>

$app->rescheduleCampaignStep();


$app = new iSDK();
// perform authorization tasks

$contactIds = array(123,456,789);
$app->rescheduleCampaignStep($conIds, 23);

$infusionsoft->contacts()->rescheduleCampaignStep()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->contacts()->rescheduleCampaignStep($contactIds, $sequenceStepId)

Pause a Follow-up Sequence for a Contact

Pauses a follow-up sequence for the given contact record


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

contactId:
integer (required)

The Id number of the contact record you are pausing the sequence on

sequenceId:
integer (required)

The follow-up sequence Id number

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




ContactService.pauseCampaign

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
<methodName>ContactService.pauseCampaign</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>22</int></value>
    </param>
    <param>
      <value><int>2</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <boolean>
          1
        </boolean>
      </value>
    </param>
  </params>
</methodResponse>

$app->campPause($contactId, $seqId);


$app = new iSDK();
// perform authorization tasks

$contactId = 123;
$seqId = 456;
$result = $app->campPause($contactId, $seqId);

$infusionsoft->contacts()->pauseCampaign()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->contacts()->pauseCampaign($contactId, $sequenceId)

Resume a Follow-up Sequence for a Contact

Resumes a follow-up sequence that has been stopped/paused for a given contact.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

contactId:
integer (required)

The ID of the contact you would like to resume the campaign for

seqId:
integer (required)

The ID of the follow-up sequence to resume

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




$app->resumeCampaignForContact($contactId, $sequenceId);


$app = new iSDK();
// perform authorization tasks

$contactId = 123;
$sequenceId = 456;
$result = $app->resumeCampaignForContact($contactId, $sequenceId);

ContactService.resumeCampaignForContact

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
<methodName>ContactService.resumeCampaignForContact</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>contactIDNumber</int></value>
    </param>
    <param>
      <value><int>sequenceIDNumber</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><boolean>1</boolean></value>
    </param>
  </params>
</methodResponse>

$infusionsoft->contacts()->resumeCampaignForContact()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->contacts()->resumeCampaignForContact($contactId, $seqId)

Remove a Contact from a Follow-up Sequence

Removes a follow-up sequence from a contact record


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

contactId:
integer (required)

The Id number of the contact you want to remove the sequence from

followUpSequenceId:
integer (required)

The ID number of the campaign sequence you would like to remove the contact from

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




ContactService.removeFromCampaign

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
<methodName>ContactService.removeFromCampaign</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>contactIDNumber</int></value>
    </param>
    <param>
      <value><int>campaignIDNumber</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <boolean>
          1
        </boolean>
      </value>
    </param>
  </params>
</methodResponse>

$app->campRemove($contactId, $followUpId);


$app = new iSDK();
// perform authorization tasks

$contactId = 123;
$fusId = 456;
$result = $app->campRemove($contactId, $fusId);

$infusionsoft->contacts()->removeFromCampaign()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->contacts()->removeFromCampaign($contactId, $followUpSequenceId)

List Linked Contacts

This will list all linked contacts to the given contact id.


Attributes

privateKey:
string

Your Infusionsoft API Key

contactId:
integer

The contact id you want to list all linked contacts for

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




ContactService.listLinkedContacts

<?xml version="1.0"?>
<methodCall>
<methodName>ContactService.listLinkedContacts</methodName>
<params>
<param>
<value><string>privateKey</string></value>
</param>
<param>
<value><int>contactId</int></value>
</param>
</params>
</methodCall>

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
    <params>
        <param>
            <value>
                <array>
                    <data/>
                </array>
            </value>
        </param>
    </params>
</methodResponse>

Run an Action Set for a Contact

Runs an action sequence on a given contact record


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

contactId:
integer (required)

The ID of the contact record you want to run the action set on

actionSetId:
integer (required)

The Id number of the action set you would like to run. This is found on the Setup > Action Sets menu

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




ContactService.runActionSequence

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
<methodName>ContactService.runActionSequence</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>contactIDNumber</int></value>
    </param>
    <param>
      <value><int>1</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <array>
          <data>
            <value>
              <struct>
                <member>
                  <name>
                    Action
                  </name>
                  <value>
                    Apply/Remove Tag
                  </value>
                </member>
                <member>
                  <name>
                    Message
                  </name>
                  <value>
                    tags applied to Contact: Nurture Subscriber
                  </value>
                </member>
                <member>
                  <name>
                    IsError
                  </name>
                  <value>
                    <boolean>
                      0
                    </boolean>
                  </value>
                </member>
              </struct>
            </value>
          </data>
        </array>
      </value>
    </param>
  </params>
</methodResponse>

$app->runAS();


$app = new iSDK();
// perform authorization tasks

$contactId = 123;
$actionId = 456;
$result = $app->runAS($contactId, $actionId);

$infusionsoft->contacts()->runActionSequence()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->contacts()->runActionSequence($contactId, $actionSetId)

Data

The Data service is used to manipulate most data in Infusionsoft. It permits you to work on any available tables and has a wide range of uses. To manage affiliate information (i.e. Name, Phone, etc.) you will need to use the Data service.

Retrieve information about a user

Usable only with OAuth tokens, this retrieves information about the currently authenticated user.

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Information about the authenticated user.


DataService.getUserInfo

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DataService.getUserInfo</methodName>
  <params>
  </params>
</methodCall>

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
   <params>
      <param>
         <value>
            <struct>
               <member>
                  <name>globalUserId</name>
                  <value>123456</value>
               </member>
               <member>
                  <name>localUserId</name>
                  <value>123</value>
               </member>
               <member>
                  <name>appAlias</name>
                  <value>somealias123</value>
               </member>
               <member>
                  <name>appUrl</name>
                  <value>https://app.infusionsoft.com</value>
               </member>
               <member>
                  <name>displayName</name>
                  <value>Macho Man</value>
               </member>
               <member>
                  <name>casUsername</name>
                  <value>username</value>
               </member>
            </struct>
         </value>
      </param>
   </params>
</methodResponse>



$app->getUserInfo();


$app = new iSDK();
// perform authorization tasks

$userInfo = $app->getUserInfo();

$infusionsoft->data()->getUserInfo()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->data()->getUserInfo()

Create a Record

Creates a new record in the specified Infusionsoft data table.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

table:
string (required)

The Infusionsoft database table name

values:
struct (required)

An associative array of data you would like stored in this new row in the table

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns an integer representing the ID of the new record.


DataService.add

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DataService.add</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><string>Contact</string></value>
    </param>
    <param>
      <value><struct>
        <member><name>FirstName</name>
          <value><string>John</string></value>
        </member>
        <member><name>LastName</name>
          <value><string>Doe</string></value>
        </member>
        <member><name>Email</name>
          <value><string>jdoe@email.com</string></value>
        </member>
      </struct></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><i4>26</i4></value>
    </param>
  </params>
</methodResponse>

$app->dsAdd();


$data = array('FirstName' => 'John',
		'LastName'  => 'Doe',
		'Email'     => 'JDoe@email.com');
$app->dsAdd("Contact", $data);

$infusionsoft->data()->add()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->data()->add($table, $values)

Retrieve a Record

Loads the requested fields from a specified record.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

table:
string (required)

Infusionsoft database table name from which you want to load a record

recordID:
integer (required)

The unique Id number for the record you would like to load

fields:
array (required)

The fields you would like returned from this row in the database

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

The specified fields for the given record.


DataService.load

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DataService.load</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><string>tableName</string></value>
    </param>
    <param>
      <value><int>idNumber</int></value>
    </param>
    <param>
      <value><array>
        <data>
          <value><string>field1</string></value>
          <value><string>field2</string></value>
          <value><string>field3</string></value>
        </data>
      </array></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>field1</name>
            <value>field1Value</value>
          </member>
          <member>
            <name>field2</name>
            <value>field2Value</value>
          </member>
          <member>
            <name>field3</name>
            <value>field3Value</value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

$app->dsLoad();


$app = new iSDK();
// perform authorization tasks

$returnFields = array('Email', 'FirstName', 'LastName');
$conDat = $app->dsLoad("Contact", 123, $returnFields);

$infusionsoft->data()->load()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->data()->load($table, $recordID, $fields)

Find a Record by Matching a Specific Field

Retrieves all records in a table that match the given term on a specific field.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

table:
string (required)

The Infusionsoft database table name

limit:
integer (required)

The number of records you would like returned. The maximum possible is 1000.

page:
integer (required)

The page of results you would like returned. The first page is page 0 (loop through pages to get more than 1000 records).

fieldName:
string (required)

The name of the field to search on

fieldValue:
string (required)

The value stored in the field you would like to search on

returnFields:
array (required)

The fields you would like returned from the table you are searching on

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns one object per result found. The result will contain all fields specified in the request along with their corresponding value.


DataService.findByField

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DataService.findByField</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><string>tableName</string></value>
    </param>
    <param>
      <value><int>limit</int></value>
    </param>
    <param>
      <value><int>page</int></value>
    </param>
    <param>
      <value><string>fieldName</string></value>
    </param>
    <param>
      <value><string>fieldValue</string></value>
    </param>
    <param>
      <value><array>
        <data>
          <value><string>returnField1</string></value>
        </data>
      </array></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><array><data/></array></value>
    </param>
  </params>
</methodResponse>

$app->dsFind();


$app = new iSDK();
// perform authorization tasks

$returnFields = array('ContactId','ContactGroup');
$contacts = $app->dsFind('ContactGroupAssign',5,0,'GroupId',97,$returnFields);

$infusionsoft->data()->findByField()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->data()->findByField($table, $limit, $page, $fieldName, $fieldValue, $returnFields)

Query a Data Table

Performs a query across the given table based on the query data.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

table:
string (required)

The table to query on

limit:
integer (required)

The number of records to retrieve, a maximum of 1000

page:
integer (required)

Page of data to request (in case there are more than 1000 records).Paging starts with 0.

queryData:
struct (required)

A struct containing query data. The key is the field to search on, and the value is the data to look for. % is the wild card operator and all searches are case insensitive. Below is a list of operations you can do.

1. Greater Than ex: LastUpdated => '~>~ 2017-01-01 00:00:00'
2. Greater Than or Equal to ex: LastUpdated => '~>=~ 2017-01-01 00:00:00'
3. Less Than ex: LastUpdated => '~<~ 2017-01-01 00:00:00'
4. Less Than or Equal to ex: LastUpdated => '~<=~ 2017-01-01 00:00:00'
5. Not Equal to ex: Id => '~<>~123'
6. Is Null ex: FirstName => '~null~'
7. IN statement ex: Id => [1,2,3,4]**
*The raw xml, will need be html encoded for '>' and '<'
**IN statements only work on Id fields and are limited to 1000 ids

selectedFields:
array (required)

Fields the query should return

orderBy:
string

The field which the results should be sorted by

ascending:
boolean

Changes the order of results to ascending instead of descending Defaults to false

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns an array of objects, one per result found by the query. The object will contain all fields specified by the selected fields along with their corresponding values.


DataService.query

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DataService.query</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><string>tableName</string></value>
    </param>
    <param>
      <value><int>limit</int></value>
    </param>
    <param>
      <value><int>page</int></value>
    </param>
    <param>
      <value><struct>
        <member><name>queryField</name>
          <value><string>query</string></value>
        </member>
      </struct></value>
    </param>
    <param>
      <value><array>
        <data>
          <value><string>returnField1</string></value>
          <value><string>returnField2</string></value>
        </data>
      </array></value>
    </param>
    <param>
      <value><string>orderBy</string></value>
    </param>
    <param>
      <value><boolean>ascending</boolean></value>
    </param>
  </params>
</methodCall>


<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <array>
          <data>
            <value>
              <struct>
                <member>
                  <name>FirstName</name>
                  <value>Chuck</value>
                </member>
                <member>
                  <name>Id</name>
                  <value><i4>22</i4></value>
                </member>
              </struct>
            </value>
          </data>
        </array>
      </value>
    </param>
  </params>
</methodResponse>

$app->dsQuery();


$app = new iSDK();
// perform authorization tasks

$returnFields = array('Id','FirstName');
$query = array('FirstName' => 'justin');
$contacts = $app->dsQuery("Contact",10,0,$query,$returnFields);

$infusionsoft->data()->query()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->data()->query($table, $limit, $page, $queryData, $selectedFields, $orderBy, $ascending)

Update a Record

Updates a specific record in the specified Infusionsoft data table.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

table:
string (required)

The Infusionsoft database table name

recordID:
integer (required)

The ID of the record to update

values:
struct (required)

An associative array of data to update

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns an ID of the successfully updated record.


DataService.update

<?xml version="1.0"?>
<methodCall>
    <methodName>DataService.update</methodName>
    <params>
        <param>
            <value>
                <string>privateKey</string>
            </value>
        </param>
        <param>
            <value>
                <string>Table</string>
            </value>
        </param>
        <param>
            <value>
                <int>Id of record</int>
            </value>
        </param>
        <param>
            <value>
                <struct>
                    <member>
                        <name>FieldName</name>
                        <value>
                            <string>Value you are updating to</string>
                        </value>
                    </member>
                </struct>
            </value>
        </param>
    </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><i4>26</i4></value>
    </param>
  </params>
</methodResponse>

$app->dsUpdate();


$app = new iSDK();
// perform authorization tasks

$grp = array('GroupName'  => 'Test Group',
'GroupDescription'  => 'This tag was Created with api');
$grpID = 97;
$grpID = $app->dsUpdate("ContactGroup", $grpID, $grp);

$infusionsoft->data()->update()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->data()->update($table, $recordID, $values)

Delete a Record

Deletes the specified record in the given table from the database


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

table:
string (required)

The table you would like to delete the record from

ID:
integer (required)

The ID of the record to delete

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns a boolean true if successful; false otherwise.


DataService.delete

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DataService.delete</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><string>tableName</string></value>
    </param>
    <param>
      <value><int>idNumberToDelete</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><boolean>1</boolean></value>
    </param>
  </params>
</methodResponse>

$app->dsDelete();


$app = new iSDK();
// perform authorization tasks

$result = $app->dsDelete('Contact',123);

$infusionsoft->data()->delete()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->data()->delete($table, $ID)

Count a Data Table's Records

Performs a query across the given table based on the query data and returns the count of records.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

table:
string (required)

The table to count the records on

queryData:
struct (required)

A struct containing query data. The key is the field to search on, and the value is the data to look for. % is the wild card operator and all searches are case insensitive. If you would like to query for an empty(null) field, use ~null~ in your query parameter, such as ‘FirstName' => ‘~null~'

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns an integer count of the number of records that match the query.


DataService.count

<?xml version="1.0"?>
<methodCall>
    <methodName>DataService.count</methodName>
    <params>
        <param>
            <value>
                <string>APIKEY</string>
            </value>
        </param>
        <param>
            <value>
                <string>Contact</string>
            </value>
        </param>
        <param>
            <value>
                <struct>
                    <member>
                        <name>Email</name>
                        <value>
                            <string>test@example.com</string>
                        </value>
                    </member>
                </struct>
            </value>
        </param>
    </params>
</methodCall>

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
    <params>
        <param>
            <value>
                <i4>7</i4>
            </value>
        </param>
    </params>
</methodResponse>

$app->dsCount();


$app = new iSDK();
// perform authorization tasks

$query = array('FirstName' => 'justin');
$contacts = $app->dsCount("Contact",$query);

$infusionsoft->data()->count()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->data()->count($table, $queryData)

Create a Custom Field

Creates a new custom field


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

customFieldType:
string (required)

Where the custom field will be used inside Infusionsoft. Options include Contact, Company, Affiliate, ContactAction (used for Task/Appt/Note), Order, Subscription, or Opportunity

displayName:
string (required)

The label/name of this new custom field

dataType:
string (required)

What type of data this field will support. Text, Select (Used for Dropdown), TextArea, etc.

headerID:
integer (required)

The ID of the custom field header you want this field to appear under. Customer headers are located on custom tabs.

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns the ID of the new field


DataService.addCustomField

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DataService.addCustomField</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><string>contextOfField</string></value>
    </param>
    <param>
      <value><string>displayName</string></value>
    </param>
    <param>
      <value><string>dataType</string></value>
    </param>
    <param>
      <value><int>headerID</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><i4>4</i4></value>
    </param>
  </params>
</methodResponse>

$app->addCustomField();


$app = new iSDK();
// perform authorization tasks

$newField = $app->addCustomField('Contact','Test Field','Text',1);

$infusionsoft->data()->addCustomField()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->data()->addCustomField($customFieldType, $displayName, $dataType, $headerID)

Update a Custom Field

Updates the value of a custom field. Every field can have it's display name and group id changed, but only certain data types will allow you to actually change values (dropdown, listbox, radio, etc).

Note: Drilldown fields are not supported with this method.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

customFieldId:
integer (required)

ID number of the custom field you would like to update

values:
struct (required)

The values for the given custom field

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns a boolean true if successfully updated.


DataService.updateCustomField

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DataService.updateCustomField</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>customFieldId</int></value>
    </param>
    <param>
      <value><struct>
        <member><name>contextOfField</name>
          <value><string>fieldValue</string></value>
        </member>
      </struct></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <fault>
    <value>
      <struct>
        <member>
          <name>faultCode</name>
          <value><i4>4</i4></value>
        </member>
        <member>
          <name>faultString</name>
          <value>[DatabaseError]Error creating custom field</value>
        </member>
      </struct>
    </value>
  </fault>
</methodResponse>

$app->addCustomField();


$app = new iSDK();
// perform authorization tasks

$meta = $app->addCustomField('Contact','API TEST','Text',1);
$values = array('Label' => 'API_TEST_UPDATE');
$status = $app->updateCustomField($meta,$values);

$infusionsoft->data()->updateCustomField()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->data()->updateCustomField($customFieldId, $values)

Retrieve an Appointment's iCalendar File

Retrieves the iCalendar file for the specified appointment


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

appointmentId:
integer (required)

The ID of the appointment to retrieve an iCalendar file for

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




DataService.getAppointmentICal

<?xml version="1.0"?>
<methodCall>
   <methodName>DataService.getAppointmentICal</methodName>
      <params>
         <param>
            <value><string>privateKey</string></value>
         </param>
         <param>
            <value><int>appointmentId</int></value>
         </param>
       </params>
</methodCall>

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
    <params>
        <param>
            <value>BEGIN:VCALENDAR PRODID:-//Infusionsoft//iCal4j 1.0//EN VERSION:2.0 CALSCALE:GREGORIAN BEGIN:VEVENT DTSTAMP:20120430T235728Z DTSTART:20120430T181500Z DTEND:20120430T184500Z SUMMARY:blah UID:20120430T235728Z-vuurr24@fe80:0:0:0:d6be:d9ff:feaa:f495%3 DESCRIPTION: ORGANIZER;ROLE=REQ-PARTICIPANT;CN=Chris Conrey:mailto:chris@vuurr.com END:VEVENT END:VCALENDAR</value>
        </param>
    </params>
</methodResponse>

$app->methodCaller();


$app = new iSDK();
// perform authorization tasks

$carray = array(
php_xmlrpc_encode($app->key),
php_xmlrpc_encode(2));

$app->methodCaller("DataService.getAppointmentICal",$carray);

$infusionsoft->data()->getAppointmentICal()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->data()->getAppointmentICal($appointmentId)

Retrieve Application Setting

Retrieves the value of a given setting in the current application. In order to find the module and option names, view the HTML field name within the Infusionsoft settings. You will see something such as name="Contact_WebModule0optiontypes". The portion before the underscore is the module name. "Contact" in this example. The portion after the 0 is the setting name, "optiontypes" in this example.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

module:
string (required)

The application module this setting belongs to

setting:
string (required)

The database name of the setting to retrieve

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




DataService.getAppSetting

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DataService.getAppSetting</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><string>moduleName</string></value>
    </param>
    <param>
      <value><string>settingName</string></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>Prospect,Customer,Partner,Personal Contact,Vendor</value>
    </param>
  </params>
</methodResponse>

$app->dsGetSetting();


$app = new iSDK();
// perform authorization tasks

$result = $app->dsGetSetting('Contact', 'optiontypes');

$infusionsoft->data()->getAppSetting()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->data()->getAppSetting($module, $setting)

Discount

The Discount service is used to manage products. You can add, update and find products in addition to managing follow up sequences, tags and action sets.

Create an Order Discount


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

name:
string (required)

Description for commission

applyDiscountToCommission:
integer (required)

Boolean of whether to apply the discount to the commission

percentOrAmt:
integer (required)

A value of 1 is for percentage, whereas a value of 0 is for an amount

payType:
string (required)

Value of either "Gross" or "Net" determines how to apply the discount

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




DiscountService.addOrderTotalDiscount

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DiscountService.addOrderTotalDiscount</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><string>name</string></value>
    </param>
    <param>
      <value><string>description</string></value>
    </param>
    <param>
      <value><int>applyDiscountToCommission</int></value>
    </param>
    <param>
      <value><int>PercentOrAmt</int></value>
    </param>
    <param>
      <value><double>amt</double></value>
    </param>
    <param>
      <value><string>payType</string></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <i4>
          3
        </i4>
      </value>
    </param>
  </params>
</methodResponse>

$app->addOrderTotalDiscount();


$app = new iSDK();
// perform authorization tasks

$app->addOrderTotalDiscount("test", "test description", 0, 1, 5.00, "Gross");


$infusionsoft->discounts()->addOrderTotalDiscount()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->discounts()->addOrderTotalDiscount($name, $applyDiscountToCommission, $percentOrAmt, $payType)

Retrieve an Order's Total Discount


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

ID:
integer (required)

The ID of the discount to retrieve

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




DiscountService.getOrderTotalDiscount

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DiscountService.getOrderTotalDiscount</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>id</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>
              amount
            </name>
            <value>
              5.0
            </value>
          </member>
          <member>
            <name>
              description
            </name>
            <value>
              test
            </value>
          </member>
          <member>
            <name>
              name
            </name>
            <value>
              discount
            </value>
          </member>
          <member>
            <name>
              pctOrAmt
            </name>
            <value>
              3
            </value>
          </member>
          <member>
            <name>
              payType
            </name>
            <value>
              Gross
            </value>
          </member>
          <member>
            <name>
              applyDiscountToCommission
            </name>
            <value>
              1
            </value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

$app->getOrderTotalDiscount();


$app = new iSDK();
// perform authorization tasks

$app->getOrderTotalDiscount(1);


$infusionsoft->discounts()->getOrderTotalDiscount()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->discounts()->getOrderTotalDiscount($ID)

Create a Free Trial on a Subscription


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

name:
string (required)

The name of the free trial

description:
string (required)

The description for free trial

freeTrialDays:
integer (required)

The number of days free trial last

hidePrice:
integer (required)

The option to show or hide price

subscriptionPlanID:
integer (required)

The ID of the subscription to add the free trial to

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns a boolean "true" if successful


DiscountService.addFreeTrial

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DiscountService.addFreeTrial</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><string>name</string></value>
    </param>
    <param>
      <value><string>description</string></value>
    </param>
    <param>
      <value><int>freeTrialDays</int></value>
    </param>
    <param>
      <value><int>hidePrice</int></value>
    </param>
    <param>
      <value><int>subscriptionPlanId</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><i4>1</i4></value>
    </param>
  </params>
</methodResponse>

$app->addFreeTrial();


$app = new iSDK();
// perform authorization tasks

$app->addFreeTrial("test", "test description", 5, 0, 1);

$infusionsoft->discounts()->addFreeTrial()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->discounts()->addFreeTrial($name, $description, $freeTrialDays, $hidePrice, $subscriptionPlanID)

Retrieve a Subscription's Free Trial


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

trialId:
integer (required)

ID of the free trial to retrieve

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




DiscountService.getFreeTrial

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DiscountService.getFreeTrial</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>trialId</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>freeTrialDays</name>
            <value>9</value>
          </member>
          <member>
            <name>subscriptionPlanId</name>
            <value>5</value>
          </member>
          <member>
            <name>description</name>
            <value>test free trial</value>
          </member>
          <member>
            <name>name</name>
            <value>free</value>
          </member>
          <member>
            <name>hidePrice</name>
            <value>1</value>
          </member>
          <member>
            <name>applyDiscountToCommission</name>
            <value>1</value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

$app->getFreeTrial();


$app = new iSDK();
// perform authorization tasks

$app->getFreeTrial(1);

$infusionsoft->discounts()->getFreeTrial()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->discounts()->getFreeTrial($trialId)

Create a Shipping Discount


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

name:
string (required)

Name of the discount

description:
string (required)

Description of the shipping discount

applyDiscountToCommission:
integer (required)

Integer value of 1 for true and 0 for false

percentOrAmt:
integer (required)

Integer value of 1 for percent and 0 for amount

amt:
double (required)

Amount of the discount

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




DiscountService.addShippingTotalDiscount

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DiscountService.addShippingTotalDiscount</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><string>name</string></value>
    </param>
    <param>
      <value><string>description</string></value>
    </param>
    <param>
      <value><int>applyDiscountToCommission</int></value>
    </param>
    <param>
      <value><int>percentOrAmt</int></value>
    </param>
    <param>
      <value><double>amt</double></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <i4>
          9
        </i4>
      </value>
    </param>
  </params>
</methodResponse>

$app->addShippingTotalDiscount();


$app->addShippingTotalDiscount("test", "test description", 0, 2, 18.00);

$infusionsoft->discounts()->addShippingTotalDiscount()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->discounts()->addShippingTotalDiscount($name, $description, $applyDiscountToCommission, $percentOrAmt, $amt)

Retrieve a Shipping Discount


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

shippingDiscountID:
integer (required)

ID of the shipping discount to retrieve

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




DiscountService.getShippingTotalDiscount

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DiscountService.getShippingTotalDiscount</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>id</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>
              amount
            </name>
            <value>
              1.0
            </value>
          </member>
          <member>
            <name>
              description
            </name>
            <value>
              Test
            </value>
          </member>
          <member>
            <name>
              name
            </name>
            <value>
              shipping discount
            </value>
          </member>
          <member>
            <name>
              pctOrAmt
            </name>
            <value>
              5
            </value>
          </member>
          <member>
            <name>
              applyDiscountToCommission
            </name>
            <value>
              1
            </value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

$app->getShippingTotalDiscount();


$app->getShippingTotalDiscount(6);

$infusionsoft->discounts()->getShippingTotalDiscount()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->discounts()->getShippingTotalDiscount($shippingDiscountID)

Create a Product Discount


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

name:
string (required)

The name of the discount

description:
string (required)

A description of the discount

applyDiscountToCommission:
integer (required)

Boolean whether to apply the discount to any commission on the product

productID:
integer (required)

The ID of the product to assign the discount to

percentOrAmt:
integer (required)

Integer defining whether to handle the discount as a percent (1) or flat amount (0)

amt:
double (required)

An integer amount of the discount

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




DiscountService.addProductTotalDiscount

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DiscountService.addProductTotalDiscount</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><string>name</string></value>
    </param>
    <param>
      <value><string>description</string></value>
    </param>
    <param>
      <value><int>applyDiscountToCommission</int></value>
    </param>
    <param>
      <value><int>productId</int></value>
    </param>
    <param>
      <value><int>percentOrAmt</int></value>
    </param>
    <param>
      <value><double>amt</double></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <i4>
          7
        </i4>
      </value>
    </param>
  </params>
</methodResponse>

$app->addProductTotalDiscount();


$app = new iSDK();
// perform authorization tasks

$app->addProductTotalDiscount("test discount", "discount for a product", 0, 3, 3, 5);


$infusionsoft->discounts()->addProductTotalDiscount()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->discounts()->addProductTotalDiscount($name, $description, $applyDiscountToCommission, $productID, $percentOrAmt, $amt)

Retrieve a Product Total Discount


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

productDiscountID:
string (required)

ID of the product discount

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




DiscountService.getProductTotalDiscount

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DiscountService.getProductTotalDiscount</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>id</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>
              description
            </name>
            <value>
              test
            </value>
          </member>
          <member>
            <name>
              name
            </name>
            <value>
              prod discount total
            </value>
          </member>
          <member>
            <name>
              applyDiscountToCommission
            </name>
            <value>
              1
            </value>
          </member>
          <member>
            <name>
              productId
            </name>
            <value>
              3
            </value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

$app->getProductTotalDiscount();


$app->getProductTotalDiscount(1);


$infusionsoft->discounts()->getProductTotalDiscount()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->discounts()->getProductTotalDiscount($productDiscountID)

Create a Category Discount


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

name:
string (required)

The category discount name

description:
string (required)

The description of the category discount

applyDiscountToCommission:
integer (required)

Boolean integer to determine whether or not a discount is applied to commission

amt:
integer (required)

The amount of the discount

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




DiscountService.addCategoryDiscount

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DiscountService.addCategoryDiscount</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><string>name</string></value>
    </param>
    <param>
      <value><string>description</string></value>
    </param>
    <param>
      <value><int>applyDiscountToCommission</int></value>
    </param>
    <param>
      <value><double>amt</double></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <i4>
          5
        </i4>
      </value>
    </param>
  </params>
</methodResponse>

$app->addCategoryDiscount();


$app = new iSDK();
// perform authorization tasks

$app->addCategoryDiscount("test", "test description", 0, 5.00);


$infusionsoft->discounts()->addCategoryDiscount()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->discounts()->addCategoryDiscount($name, $description, $applyDiscountToCommission, $amt)

Retrieve a Category Discount

Returns the options and values of the specified category discount ID.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

ID:
integer (required)

The ID of the category discount to retrieve

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




DiscountService.getCategoryDiscount

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DiscountService.getCategoryDiscount</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>id</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>
              description
            </name>
            <value>
              test
            </value>
          </member>
          <member>
            <name>
              name
            </name>
            <value>
              cat discount
            </value>
          </member>
          <member>
            <name>
              applyDiscountToCommission
            </name>
            <value>
              1
            </value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

$app->getCategoryDiscount();



$app = new iSDK();
// perform authorization tasks

$app->getCategoryDiscount(1);


$infusionsoft->discounts()->getCategoryDiscount()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->discounts()->getCategoryDiscount($ID)

Retrieve a Category Discount's Category Assignments

Retrieves the options and values of the category assignment for category discount passed.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

ID:
integer (required)

ID of the category discount

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




DiscountService.getCategoryAssignmentsForCategoryDiscount

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DiscountService.getCategoryAssignmentsForCategoryDiscount</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>id</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <array>
          <data>
            <value>
              <struct>
                <member>
                  <name>
                    id
                  </name>
                  <value>
                    1
                  </value>
                </member>
                <member>
                  <name>
                    specialItemId
                  </name>
                  <value>
                    5
                  </value>
                </member>
                <member>
                  <name>
                    productCategoryId
                  </name>
                  <value>
                    3
                  </value>
                </member>
              </struct>
            </value>
          </data>
        </array>
      </value>
    </param>
  </params>
</methodResponse>

$app->getCategoryAssignmentsForCategoryDiscount();


$app->getCategoryAssignmentsForCategoryDiscount(1);


$infusionsoft->discounts()->getCategoryAssignmentsForCategoryDiscount()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->discounts()->getCategoryAssignmentsForCategoryDiscount($ID)

Assign a Product to a Category Discount


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

ID:
integer (required)

The ID of the category discount

productID:
integer (required)

The ID of the product to assign the discount to

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




DiscountService.addCategoryAssignmentToCategoryDiscount

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DiscountService.addCategoryAssignmentToCategoryDiscount</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>id</int></value>
    </param>
    <param>
      <value><int>productId</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <i4>
          1
        </i4>
      </value>
    </param>
  </params>
</methodResponse>

$app->addCategoryAssignmentToCategoryDiscount();


$app = new iSDK();
// perform authorization tasks

$app->addCategoryAssignmentToCategoryDiscount(1, 2);


$infusionsoft->discounts()->addCategoryAssignmentToCategoryDiscount()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->discounts()->addCategoryAssignmentToCategoryDiscount($ID, $productID)

Email

The Email service allows you to email your contacts as well as attaching emails sent elsewhere (this lets you send email from multiple services and still see all communications inside of Infusionsoft).

Opt-in an Email Address

Opts-in an email address. This method only works the first time an email address opts-in.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

email:
string (required)

The email address to opt-in

optInReason:
string (required)

Why/how this email was opted-in

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns a boolean true upon successful opt-in.


APIEmailService.optIn

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
<methodName>APIEmailService.optIn</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><string>email</string></value>
    </param>
    <param>
      <value><string>reason</string></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><boolean>0</boolean></value>
    </param>
  </params>
</methodResponse>

$app->optIn();


$app = new iSDK();
// perform authorization tasks

$app->optIn($subscriberEmail,"Home page newsletter subscriber");

$infusionsoft->emails()->optIn()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->emails()->optIn($email, $optInReason)

Opt-out an Email Address

Opts-out an email address. Once an address is opt-out, the API cannot opt it back in.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

email:
string (required)

The email address to opt-out

optOutReason:
string (required)

Reason the address is being opt-out

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




APIEmailService.optOut

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
<methodName>APIEmailService.optOut</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><string>email</string></value>
    </param>
    <param>
      <value><string>reason</string></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><boolean>0</boolean></value>
    </param>
  </params>
</methodResponse>

$app->optOut();


$app = new iSDK();
// perform authorization tasks

$app->optOut($subscriberEmail,"Opted out from our website");

$infusionsoft->emails()->optOut()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->emails()->optOut($email, $optOutReason)

Retrieve an Email's Opt-in Status


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

email:
string (required)

The email address you wish to retrieve the status of

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns an integer value of 0 for opt out/non-marketable/soft bounce/hard bounce, 1 for single opt-in, or 2 for double opt-in.


APIEmailService.getOptStatus

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>APIEmailService.getOptStatus</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><string>email</string></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><i4>0</i4></value>
    </param>
  </params>
</methodResponse>

$app->optStatus();


$app = new iSDK();
// perform authorization tasks

$app->optStatus('test@example.com');

$infusionsoft->emails()->getOptStatus()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->emails()->getOptStatus($email)

Create an Email Template

Creates a new email template that can be used when sending emails.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

templateName:
string (required)

The name of the template. This will be displayed within the Infusionsoft template library.

categories:
string (required)

The category to assign this template to

fromAddress:
string (required)

The email address the email should be sent as

toAddress:
string (required)

The email address this template sends to. In most circumstances, you'll want to set this to "~Contact.Email~" so that the template delivers to the specified contact upon sending.

ccAddress:
string (required)

Any email addresses to CC when an email from this template is sent

bccAddress:
string (required)

Any email addresses to BCC when an email from this template is sent

subject:
string (required)

The subject line of the email template

textBody:
string (required)

The content you would like sent in the body of the plain text version of this email template

htmlBody:
string (required)

The content you would like sent in the body of the HTML version of this email template

contentType:
string (required)

One of three options - HTML, Text, or Multipart

mergeContext:
string (required)

One of four options - Contact, Opportunity, Invoice, or CreditCard

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns an ID of the created template.


APIEmailService.addEmailTemplate

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>APIEmailService.addEmailTemplate</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><string>title</string></value>
    </param>
    <param>
      <value><string>categories</string></value>
    </param>
    <param>
      <value><string>fromAddress</string></value>
    </param>
    <param>
      <value><string>toAddress</string></value>
    </param>
    <param>
      <value><string>ccAddresses</string></value>
    </param>
    <param>
      <value><string>bccAddresses</string></value>
    </param>
    <param>
      <value><string>subject</string></value>
    </param>
    <param>
      <value><string>textBody</string></value>
    </param>
    <param>
      <value><string>htmlBody</string></value>
    </param>
    <param>
      <value><string>contentType</string></value>
    </param>
    <param>
      <value><string>mergeContext</string></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><i4>3378</i4></value>
    </param>
  </params>
</methodResponse>

$app->addEmailTemplate();


$app = new iSDK();
// perform authorization tasks

$title = "template API test";
$category = "API Category";
$fromAddress = "from@infusionsoft.com";
$toAddress = "~Contact.Email~";
$ccAddress = "";
$bccAddresses = "";
$subject = "My Fancy Subject Line";
$textBody = "This is the text email body";
$htmlBody = "This is the HTML email body"
$contentType = "HTML";
$mergeContext = "Contact";
$tmpId = $app->addEmailTemplate($title, $category, $fromAddress, $toAddress, $ccAddress, $bccAddresses, $subject, $textBody, $htmlBody, $contentType, $mergeContext);

$infusionsoft->emails()->addEmailTemplate()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->emails()->addEmailTemplate($templateName, $categories, $fromAddress, $toAddress, $ccAddress, $bccAddress, $subject, $textBody, $htmlBody, $contentType, $mergeContext)

Retrieve an Email Template


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

templateId:
string (required)

The ID number for the template you wish to retrieve details about

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




APIEmailService.getEmailTemplate

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>APIEmailService.getEmailTemplate</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>templateId</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>pieceTitle</name>
            <value>template API Test</value>
          </member>
          <member>
            <name>categories</name>
            <value>API Category</value>
          </member>
          <member>
            <name>fromAddress</name>
            <value>from@infusionsoft.com</value>
          </member>
          <member>
            <name>toAddress</name>
            <value>~Contact.Email~</value>
          </member>
          <member>
            <name>ccAddress</name>
            <value/>
          </member>
          <member>
            <name>bccAddress</name>
            <value/>
          </member>
          <member>
            <name>subject</name>
            <value>My Fancy Subject Line</value>
          </member>
          <member>
            <name>textBody</name>
            <value>This is the text email body</value>
          </member>
          <member>
            <name>htmlBody</name>
            <value>This is html body</value>
          </member>
          <member>
            <name>contentType</name>
            <value>HTML</value>
          </member>
          <member>
            <name>mergeContext</name>
            <value>Contact</value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

$app->getEmailTemplate();


$app = new iSDK();
// perform authorization tasks

$app->getEmailTemplate(42);

$infusionsoft->emails()->getEmailTemplate()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->emails()->getEmailTemplate($templateId)

Update an Email Template

Updates an email template that can be used when sending emails.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

templateId:
string (required)

The ID number for the template you wish to update

templateName:
string (required)

The name of the template. This will be displayed within the Infusionsoft template library.

categories:
string (required)

The category to assign this template to

fromAddress:
string (required)

The email address the email should be sent as

toAddress:
string (required)

The email address this template sends to. In most circumstances, you'll want to set this to "~Contact.Email~" so that the template delivers to the specified contact upon sending.

ccAddress:
string (required)

Any email addresses to CC when an email from this template is sent

bccAddress:
string (required)

Any email addresses to BCC when an email from this template is sent

subject:
string (required)

The subject line of the email template

textBody:
string (required)

The content you would like sent in the body of the plain text version of this email template

htmlBody:
string (required)

The content you would like sent in the body of the HTML version of this email template

contentType:
string (required)

One of three options - HTML, Text, or Multipart

mergeContext:
string (required)

One of four options - Contact, Opportunity, Invoice, or CreditCard

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns an ID of the updated template.


APIEmailService.updateEmailTemplate

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>APIEmailService.updateEmailTemplate</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><string>templateId</string></value>
    </param>
    <param>
      <value><string>templateName</string></value>
    </param>
    <param>
      <value><string>categories</string></value>
    </param>
    <param>
      <value><string>fromAddress</string></value>
    </param>
    <param>
      <value><string>toAddress</string></value>
    </param>
    <param>
      <value><string>ccAddresses</string></value>
    </param>
    <param>
      <value><string>bccAddresses</string></value>
    </param>
    <param>
      <value><string>subject</string></value>
    </param>
    <param>
      <value><string>textBody</string></value>
    </param>
    <param>
      <value><string>htmlBody</string></value>
    </param>
    <param>
      <value><string>contentType</string></value>
    </param>
    <param>
      <value><string>mergeContext</string></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><i4>3378</i4></value>
    </param>
  </params>
</methodResponse>

$app->updateEmailTemplate();


$app = new iSDK();
// perform authorization tasks

$template = 1;
$title = "template API test";
$category = "API Category";
$fromAddress = "from@infusionsoft.com";
$toAddress = "~Contact.Email~";
$ccAddress = "";
$bccAddresses = "";
$subject = "My Fancy Subject Line";
$textBody = "This is the text email body";
$htmlBody = "HTML"
$contentType = "Contact";
$mergeContext = "";
$tmpId = $app->addEmailTemplate($template, $title, $category, $fromAddress, $toAddress, $ccAddress, $bccAddresses, $subject, $textBody, $htmlBody, $contentType, $mergeContext);

$infusionsoft->emails()->updateEmailTemplate()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->emails()->updateEmailTemplate($templateId, $templateName, $categories, $fromAddress, $toAddress, $ccAddress, $bccAddress, $subject, $textBody, $htmlBody, $contentType, $mergeContext)

Send an Email from a Template


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

contactList:
array (required)

An integer array of Contact Id numbers you would like to send this email to

templateID:
string (required)

The ID of the template to send

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




APIEmailService.sendEmail

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>APIEmailService.sendEmail</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><array>
      <data>
        <value><int>12</int></value>
        <value><int>16</int></value>
        <value><int>22</int></value>
      </data>
      </array></value>
    </param>
  <param>
    <value><int>3380</int></value>
  </param>
</params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <boolean>
          1
        </boolean>
      </value>
    </param>
  </params>
</methodResponse>

$app->sendTemplate();


$app = new iSDK();
// perform authorization tasks

$app->sendTemplate(array(12,16,22), 3380);

$infusionsoft->emails()->sendEmail()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->emails()->sendEmail($contactList, $templateID)

Send an Email

Send an email to a list of contacts, as well as records the email in each contacts' email history.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

contactList:
array (required)

An array of Contact IDs to send this email to

fromAddress:
string (required)

The address the email will be sent from

toAddress:
string (required)

The address this email will be sent to. This typically should be the merge field "~Contact.Email~"

ccAddresses:
string (required)

A comma-separated string of email addresses to CC

bccAddresses:
string (required)

A comma-separated string of email addresses to BCC

contentType:
string (required)

HTML, Text, or Multipart (case sensitive)

subject:
string (required)

The subject line of the email

htmlBody:
string (required)

The HTML body of the email

textBody:
string (required)

The plain text body of the email

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns boolean true if the email has been successfully sent.


APIEmailService.sendEmail

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
<methodName>APIEmailService.sendEmail</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><array>
        <data>
          <value><int>contactList1</int></value>
          <value><int>contactList2</int></value>
          <value><int>contactList3</int></value>
        </data>
      </array></value>
    </param>
    <param>
      <value><string>fromAddress</string></value>
    </param>
    <param>
      <value><string>toAddress</string></value>
    </param>
    <param>
      <value><string>ccAddresses</string></value>
    </param>
    <param>
      <value><string>bccAddresses</string></value>
    </param>
    <param>
      <value><string>contentType</string></value>
    </param>
    <param>
      <value><string>subject</string></value>
    </param>
    <param>
      <value><string>htmlBody</string></value>
    </param>
    <param>
      <value><string>textBody</string></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><boolean>1</boolean></value>
    </param>
  </params>
</methodResponse>

$app->sendEmail();


$app = new iSDK();
// perform authorization tasks

$clist = array(123,456,789); 
$status = $app->sendEmail($clist,"Test@test.com","~Contact.Email~", "","","Text","Test Subject","","This is the body");

$infusionsoft->emails()->sendEmail()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->emails()->sendEmail($contactList, $fromAddress, $toAddress, $ccAddresses, $bccAddresses, $contentType, $subject, $htmlBody, $textBody)

Retrieve Available Merge Fields

This retrieves all possible merge fields in the provided context - Contact, Opportunity, Invoice, or CreditCard.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

mergeContext:
string (required)

Contact, Opportunity, Invoice, or CreditCard

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns an array of the available merge fields.

Manually Log a Sent Email

This will create an item in the email history for a contact. This does not actually send the email, it only places an item into the email history. Using the API to instruct Infusionsoft to send an email will handle this automatically.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

contactId:
integer (required)

The ID of the contact to add this email history to

fromName:
string (required)

The name of the email sender

fromAddress:
string (required)

The address the email was sent from

toAddress:
string (required)

The address the email was sent to

ccAddresses:
string (required)

The addresses the email was CC'd to

bccAddresses:
string (required)

The addresses the email was BCC'd to

contentType:
string (required)

The content type of the email (Text, HTML, or Multipart)

subject:
string (required)

The subject line of the email

htmlBody:
string (required)

The HTML body of the email

textBody:
string (required)

The plain text body of the email

header:
string (required)

The email header information

receivedDate:
string (required)

The date this email was received. This value determines where the email displays in comparison to other sent messages.

sentDate:
string (required)

The date the email was sent

emailSentType:
integer (required)

A boolean integer value of 1 is used for marking the email as sent inside the contact history and 0 is used for marking the email as received

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns a boolean true upon success.


APIEmailService.attachEmail

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>APIEmailService.attachEmail</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>contactId</int></value>
    </param>
    <param>
      <value><string>fromName</string></value>
    </param>
    <param>
      <value><string>fromAddress</string></value>
    </param>
    <param>
      <value><string>toAddress</string></value>
    </param>
    <param>
      <value><string>ccAddress</string></value>
    </param>
    <param>
      <value><string>bccAddress</string></value>
    </param>
    <param>
      <value><string>contentType</string></value>
    </param>
    <param>
      <value><string>subject</string></value>
    </param>
    <param>
      <value><string>htmlBody</string></value>
    </param>
    <param>
      <value><string>textBody</string></value>
    </param>
    <param>
      <value><string>header</string></value>
    </param>
    <param>
      <value><string>receivedDate</string></value>
    </param>
    <param>
      <value><string>sentDate</string></value>
    </param>
    <param>
      <value><int>emailSentType(Set To 1)</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><boolean>1</boolean></value>
    </param>
  </params>
</methodResponse>

$app->attachEmail();


$app = new iSDK();
// perform authorization tasks

$contactId = 123;
$fromName = "John Doe";
$fromAddress = "JDoe@test.com";
$toAddress = "Tester@test.com";
$ccAddress = "cc@test.com";
$bccAddress = "bcc$test.com";
$contentType = "TEXT";
$subject = "test subject";
$htmlBody = "html here";
$textBody = "Test Body Can Be Anything";
$header = "Email header";
$receiveDate = "";
$sentDate = "";
$emailSentType = 1;
$status = $app->attachEmail($contactId, $fromName, $fromAddress, $toAddress, $ccAddress, $bccAddress, $contentType, $subject, $htmlBody, $textBody, $header, $receiveDate, $sentDate, $emailSentType);

$infusionsoft->emails()->attachEmail()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->emails()->attachEmail($contactId, $fromName, $fromAddress, $toAddress, $ccAddresses, $bccAddresses, $contentType, $subject, $htmlBody, $textBody, $header, $receivedDate, $sentDate, $emailSentType)

File

The FileService methods allow you to create and modify files inside of Infusionsoft.

Upload a File

Uploads a file to Infusionsoft. The optional contactID parameter is used to place the file in a specific contact's filebox.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

contactID:
integer

ID of the Contact to associate the file with

fileName:
string (required)

The name of the file to be uploaded

base64EncodedData:
string (required)

A base64 encoded string of the file data

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




FileService.uploadFile

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>FileService.uploadFile</methodName>
    <params>
      <param>
        <value><string>privateKey</string></value>
      </param>
      <param>
        <value><int>contactID</int></value>
      </param>
      <param>
        <value><string>fileName</string></value>
      </param>
      <param>
        <value><string>RGVycE15RGVycA==.......base64EncodedFile</string></value>
      </param>
    </params>
  </methodCall>

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
  <params>
    <param>
      <value><i4>482</i4></value>
    </param>
  </params>
</methodResponse>

$app->uploadFile();


$app = new iSDK();
// perform authorization tasks

$fileName = 'Test';
$base64Enc = 'RGVycE15RGVycA==.......base64EncodedFile';
$cid = 10;
$app->uploadFile($fileName, $base64Enc, $cid);

$infusionsoft->files()->uploadFile()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->files()->uploadFile($contactID, $fileName, $base64EncodedData)

Retrieve a File

Retrieves the file data for the specified file ID.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

fileID:
integer (required)

The ID of the file to return

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




FileService.getFile

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>FileService.getFile</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>fileUID</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>fileData</value>
    </param>
  </params>
</methodResponse>

$app->getFile();


$fileId = 64;
$myUrl = $app->getFile($fileId);

$infusionsoft->files()->getFile()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->files()->getFile($fileID)

Retrieve a File Download URL


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

fileID:
string (required)

The ID of the file url to be returned

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




FileService.getDownloadUrl

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>FileService.getDownloadUrl</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>fileUID</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        https://example.com/123xyz
      </value>
    </param>
  </params>
</methodResponse>

$app->getDownloadUrl();


$app = new iSDK();
// perform authorization tasks

$fileId = 64;
$myUrl = $app->getDownloadUrl($fileId);

$infusionsoft->files()->getDownloadUrl()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->files()->getDownloadUrl($fileID)

Replace a File

Replaces a file's data.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

fileId:
integer (required)

The Id of the file to be uploaded

base64EncodedData:
string (required)

A base64 encoded string of the file data

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




FileService.replaceFile

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>FileService.replaceFile</methodName>
    <params>
      <param>
        <value><string>privateKey</string></value>
      </param>
      <param>
        <value><int>fileId</int></value>
      </param>
      <param>
        <value><string>RGVycE15RGVycA==.......base64EncodedFile</string></value>
      </param>
    </params>
  </methodCall>

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
  <params>
    <param>
      <value><i4>482</i4></value>
    </param>
  </params>
</methodResponse>

$app->replaceFile();


$app = new iSDK();
// perform authorization tasks

$fileName = 'Test';
$base64Enc = 'RGVycE15RGVycA==.......base64EncodedFile';
$app->replaceFile($fileName, $base64Enc, $cid);

$infusionsoft->files()->replaceFile()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->files()->replaceFile($fileId, $base64EncodedData)

Rename a File


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

fileID:
string (required)

ID of the file to be renamed

fileName:
string (required)

New file name

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




FileService.renameFile

<?xml version="1.0"?>
<methodCall>
<methodName>FileService.renameFile</methodName>
<params>
<param>
<value><string>privateKey</string></value>
</param>
<param>
<value><int>fileUID</int></value>
</param>
<param>
<value><string>fileName</string></value>
</param>
</params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <boolean>
          1
        </boolean>
      </value>
    </param>
  </params>
</methodResponse>




$infusionsoft->files()->renameFile()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->files()->renameFile($fileID, $fileName)

Funnel

The Funnel Service is used to add contacts to marketing sequences.

Achieve a Goal


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

integration:
string (required)

The integration name of the goal

callName:
string (required)

The call name of the goal

contactID:
integer (required)

ID of the applicable contact

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns the result of a goal being achieved.


FunnelService.achieveGoal

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>FunnelService.achieveGoal</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><string>Integration</string></value>
    </param>
    <param>
      <value><string>CallName</string></value>
    </param>
    <param>
      <value><int>contactId</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <array>
          <data>
            <value>
              <struct>
                 <member>
                     <name>success</name>
                     <value><boolean>1</boolean></value>
                  </member>
                  <member>
                     <name>msg</name>
                     <value></value>
                  </member>
                  <member>
                     <name>funnelId</name>
                     <value><i4>175</i4></value>
                  </member>
                  <member>
                      <name>goalId</name>
                      <value><i4>3</i4></value>
                  </member>
                  <member>
                      <name>flowStart</name>
                      <value><array><data>
                           <value>
                             <struct>
                               <member>
                                 <name>success</name>
                                 <value><boolean>1</boolean></value>
                               </member>
                               <member>
                                 <name>msg</name>
                                 <value></value>
                               </member>
                               <member>
                                 <name>flowId</name>
                                 <value><i4>10</i4></value>
                               </member>
                             </struct>
                           </value>
                         </data>
                       </array>
                     </value>
                   </member>
           -        <member>
                     <name>flowStop</name>
                     <value>
                     <array>
                       <data>
                         <value>
                           <struct>
                             <member>
                               <name>success</name>
                               <value><boolean>0</boolean></value>
                             </member>
                             <member>
                               <name>msg</name>
                               <value>No Sequences were configured to be stopped by this Goal.</value>
                             </member>
                             <member>
                               <name>flowId</name>
                               <value><i4>0</i4></value>
                              </member>
                           </struct>
                         </value>
                       </data>
                     </array>
                   </value>
                 </member>
               </struct>
             </value>
           </data>
         </array>
       </value>
     </param>
   </params>
 </methodResponse>

$app->achieveGoal();


$app = new iSDK();
// perform authorization tasks

$Integration = 'test';
$callName = 'goal';
$cid = 123;

$app->achieveGoal($Integration, $callName, $cid);

$infusionsoft->funnels()->achieveGoal()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->funnels()->achieveGoal($integration, $callName, $contactID)

Invoice

The Invoice Service allows you to manage Infusionsoft eCommerce transactions.

Create an Invoice

Creates a blank invoice with no line items that has not yet been paid.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

contactID:
integer (required)

The ID of the contact to be invoiced (0 is not a valid contact id)

name:
string (required)

The name of the invoice, also used as the link within the Infusionsoft order interface

orderDate:
dateTime (required)

Date and time of the invoice

leadAffiliateID:
integer (required)

ID of the lead affiliate

saleAffiliateID:
integer (required)

ID of the sale affiliate

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns an ID representing the newly created invoice.


InvoiceService.createBlankOrder

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>InvoiceService.createBlankOrder</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>22</int></value>
    </param>
    <param>
      <value><string>hello world</string></value>
    </param>
    <param>
      <value><dateTime.iso8601>20080908T00:00:00</dateTime.iso8601></value>
    </param>
    <param>
      <value><int>2</int></value>
    </param>
    <param>
      <value><int>2</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><i4>8</i4></value>
    </param>
  </params>
</methodResponse>

$app->blankOrder();


$app = new iSDK();
// perform authorization tasks

$date = $app->infuDate("8-9-2015");
$invoiceId = $app->blankOrder(123,"Some Cart Order", $date, 0, 187);

$infusionsoft->invoices()->createBlankOrder()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->invoices()->createBlankOrder($contactID, $name, $orderDate, $leadAffiliateID, $saleAffiliateID)

Pay an Invoice

Charges the specified card the amount currently due on the invoice.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

invoiceID:
integer (required)

The ID of the invoice to pay

notes:
string (required)

A note about the payment

creditCardID:
integer (required)

The ID of the credit card to charge

merchantAccountID:
integer (required)

The ID of the merchant account to use to process the payment

bypassComissions:
boolean (required)

Whether this payment should count towards affiliate commissions Defaults to false

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns a struct containing payment details.

  • Successful: a boolean value as to whether the charge was successful
  • Code: The approval code: APPROVED, DECLINED, ERROR, SKIPPED (there was no balance to charge)
  • RefNum: If charge was successful, this is the reference number passed back by the merchant account
  • Message: Error message for the transaction, if applicable


InvoiceService.chargeInvoice

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>InvoiceService.chargeInvoice</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>invoiceId</int></value>
    </param>
    <param>
      <value><string>notes</string></value>
    </param>
    <param>
      <value><int>creditCardId</int></value>
    </param>
    <param>
      <value><int>merchId</int></value>
    </param>
    <param>
      <value><boolean>bypassComm</boolean></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>
              Successful
            </name>
            <value>
              <boolean>
                0
              </boolean>
            </value>
          </member>
          <member>
            <name>
              Message
            </name>
            <value>
              (TESTMODE)
            </value>
          </member>
          <member>
            <name>
              RefNum
            </name>
            <value>
              0
            </value>
          </member>
          <member>
            <name>
              Code
            </name>
            <value>
              ERROR
            </value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

$app->chargeInvoice();


$app = new iSDK();
// perform authorization tasks

$result = $app->chargeInvoice(16,"API Upsell Payment",2,1,false);

$infusionsoft->invoices()->chargeInvoice()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->invoices()->chargeInvoice($invoiceID, $notes, $creditCardID, $merchantAccountID, $bypassComissions)

Retrieve Invoice Payments


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

invoiceID:
integer (required)

ID of the invoice to retrieve payments for

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




InvoiceService.getPayments

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>InvoiceService.getPayments</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>paymentId</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <array>
          <data>
            <value>
              <struct>
                <member>
                  <name>Id</name>
                  <value><i4>2</i4></value>
                </member>
                <member>
                  <name>PayDate</name>
                  <value><dateTime.iso8601>20120314T00:00:00</dateTime.iso8601></value>
                </member>
                <member>
                  <name>UserId</name>
                  <value><i4>14</i4></value>
                </member>
                <member>
                  <name>PayAmt</name>
                  <value><double>5.0</double></value>
                </member>
                <member>
                  <name>PayType</name>
                  <value>Credit Card (Manual)</value>
                </member>
                <member>
                  <name>ContactId</name>
                  <value><i4>22</i4></value>
                </member>
                <member>
                  <name>PayNote</name>
                  <value/>
                </member>
                <member>
                  <name>InvoiceId</name>
                  <value><i4>6</i4></value>
                </member>
                <member>
                  <name>RefundId</name>
                  <value><i4>0</i4></value>
                </member>
                <member>
                  <name>ChargeId</name>
                  <value><i4>0</i4></value>
                </member>
                <member>
                  <name>Synced</name>
                  <value><i4>0</i4></value>
                </member>
              </struct>
            </value>
          </data>
        </array>
      </value>
    </param>
  </params>
</methodResponse>

$app->getPayments();


$app = new iSDK();
// perform authorization tasks

$invoiceId = '1';
$result = $app->getPayments($invoiceId);

$infusionsoft->invoices()->getPayments()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->invoices()->getPayments($invoiceID)

Retrieve Invoice Amount Due

Retrieves the outstanding amount of an invoice


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

invoiceID:
integer (required)

ID of the invoice to retrieve the amount due on

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




InvoiceService.calculateAmountOwed

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>InvoiceService.calculateAmountOwed</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>invoiceId</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><double>41.14</double></value>
    </param>
  </params>
</methodResponse>

$app->amtOwed();


$app = new iSDK();
// perform authorization tasks

$invoiceID = 1;
$app->amtOwed($invoiceID);

$infusionsoft->invoices()->calculateAmountOwed()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->invoices()->calculateAmountOwed($invoiceID)

Add an Item to an Order by Invoice

Adds a line item to an Order.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

invoiceId:
integer (required)

The Id of the Invoice for the Order this line item is to be added to

productId:
integer (required)

The Id of the product to add to the Order. For a non-product, set the value to 0.

type:
integer (required)

The order item type as defined below

Type ID Description
1 Shipping
2 Tax
3 Service & Misc
4 Product
5 Upsell Product
6 Finance Charge
7 Special
8 Program
9 Subscription Plan
10 Special: Free Trial Days
11 Special: Order Total
12 Special: Product
13 Special: Category
14 Special: Shipping

price:
double (required)

The price of the Order Item

quantity:
integer (required)

The quantity of Order Items to be added

description:
string (required)

A description of the Item

notes:
string (required)

Notes about the Item

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns "true" upon success.


InvoiceService.addOrderItem

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>InvoiceService.addOrderItem</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>invoiceId</int></value>
    </param>
    <param>
      <value><int>productId</int></value>
    </param>
    <param>
      <value><int>type</int></value>
    </param>
    <param>
      <value><double>price</double></value>
    </param>
    <param>
      <value><int>quantity</int></value>
    </param>
    <param>
      <value><string>description</string></value>
    </param>
    <param>
      <value><string>notes</string></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><boolean>1</boolean></value>
    </param>
  </params>
</methodResponse>

$app->addOrderItem();


$app = new iSDK();
// perform authorization tasks

$result = $app->addOrderItem($invoiceId, 17, 6, 23.07, 2, "Turbo Booster", "Jay's Awesome Turbo Booster");

$infusionsoft->invoices()->addOrderItem()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->invoices()->addOrderItem($invoiceId, $productId, $type, $price, $quantity, $description, $notes)

Add a Payment to an Invoice

Adds a payment to an invoice without actually processing a charge through a merchant. This is useful if you accept cash/check, or handle payments outside of Infusionsoft.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

invoiceID:
integer (required)

ID of the invoice to add the payment to

amount:
double (required)

Amount of payment to add to the invoice

date:
dateTime (required)

Date the payment is made

paymentType:
string (required)

What payment type. Example: Credit Card or PayPal

description:
string (required)

Description of the payment

bypassCommissions:
boolean (required)

Whether this payment should count towards affiliate commissions.

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns true on success.


InvoiceService.addManualPayment

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>InvoiceService.addManualPayment</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>invoiceId</int></value>
    </param>
    <param>
      <value><double>amt</double></value>
    </param>
    <param>
      <value><dateTime.iso8601>paymentDate</dateTime.iso8601></value>
    </param>
    <param>
      <value><string>paymentType</string></value>
    </param>
    <param>
      <value><string>paymentDescription</string></value>
    </param>
    <param>
      <value><boolean>bypassCommissions</boolean></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><boolean>1</boolean></value>
    </param>
  </params>
</methodResponse>

$app->manualPmt();


$app = new iSDK();
// perform authorization tasks

$currentDate = date("d-m-Y");
$pDate = $app->infuDate($currentDate);
$result = $app->manualPmt(123,9.95,$pDate,'Credit Card','$9.95 paid by Credit Card',false);

$infusionsoft->invoices()->addManualPayment()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->invoices()->addManualPayment($invoiceID, $amount, $date, $paymentType, $description, $bypassCommissions)

Add a Commission to an Invoice

Adds a commission to an existing invoice


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

invoiceID:
integer (required)

ID of the invoice to add the commission to

affiliateID:
integer (required)

ID of the affiliate to send the commission to

productID:
integer (required)

ID of the product the commission is for

percent:
integer (required)

The percentage paid for the product being sold

amount:
double (required)

The amount of the commission

payoutType:
integer (required)

An ID defining how the commission should be earned. A value of "4" will pay the commission up front, and a value of "5" will pay the commission after the customer payment is received.

description:
string (required)

Description of the commission

date:
dateTime (required)

Date the commission was generated

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns true upon success


InvoiceService.addOrderCommissionOverride

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>InvoiceService.addOrderCommissionOverride</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>invoiceId</int></value>
    </param>
    <param>
      <value><int>affiliateId</int></value>
    </param>
    <param>
      <value><int>productId</int></value>
    </param>
    <param>
      <value><int>commissionPercentage</int></value>
    </param>
    <param>
      <value><double>amountPaid</double></value>
    </param>
    <param>
      <value><int>payoutType</int></value>
    </param>
    <param>
      <value><string>desc</string></value>
    </param>
    <param>
      <value><dateTime.iso8601>date</dateTime.iso8601></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><boolean>1</boolean></value>
    </param>
  </params>
</methodResponse>

$app->commOverride();


$app = new iSDK();
// perform authorization tasks

$cDate = $app->infuDate("01-12-2007");

$app->commOverride(43,1,3,15,5.06,5,"No Description",$cDate);

$infusionsoft->invoices()->addOrderCommissionOverride()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->invoices()->addOrderCommissionOverride($invoiceID, $affiliateID, $productID, $percent, $amount, $payoutType, $description, $date)

Calculate Invoice Tax

Calculates tax based on the line items of the invoice, and adds the amount to the invoice.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

invoiceID:
integer (required)

ID of the invoice to calculate tax on

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns true upon success


InvoiceService.recalculateTax

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>InvoiceService.recalculateTax</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>invoiceId</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><boolean>1</boolean></value>
    </param>
  </params>
</methodResponse>

$app->recalculateTax();


$app = new iSDK();
// perform authorization tasks

$invoiceId = "1";
$ret = $app->recalculateTax($invoiceId);

$infusionsoft->invoices()->recalculateTax()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->invoices()->recalculateTax($invoiceID)

Delete an Invoice

Deletes an invoice. Also deletes the order within the Job table tied to the invoice.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

invoiceID:
string (required)

ID of the invoice to delete

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns true upon successful deletion.


InvoiceService.deleteInvoice

<?xml version="1.0"?>
<methodCall>
  <methodName>InvoiceService.deleteInvoice</methodName>
    <params>
      <param>
         <value><string>privateKey</string></value>
      </param>
      <param>
         <value><int>invoiceID</int></value>
      </param>
    </params>
</methodCall>

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
    <params>
        <param>
            <value>
                <boolean>1</boolean>
            </value>
        </param>
    </params>
</methodResponse>

$app->deleteInvoice();


$invoiceId = 1;
$result = $app->deleteInvoice($invoiceId);

$infusionsoft->invoices()->deleteInvoice()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->invoices()->deleteInvoice($invoiceID)

Create a Contact Subscription

Creates a subscription for a contact. Subscriptions are billed automatically by Infusionsoft within six hours of creation. If you want to bill immediately you will need to then call the InvoiceService.createInvoiceForRecurring and InvoiceService.chargeInvoice methods.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

contactID:
integer (required)

ID of the contact the subscription will be attached to

Allow Duplicate:
boolean (required)

Allows a duplicate subscription or not

subscriptionID:
integer (required)

ID of the subscription to attach to the Contact

quantity:
integer (required)

Quantity of the subscription to add to the contact

price:
double (required)

Price to charge for the subscription

taxable:
boolean (required)

Whether or not to charge tax on the subscription

merchantAccountID:
integer (required)

ID of the merchant account to use to charge the subscription

creditCardID:
integer (required)

ID of the card to charge the subscription to

affiliateID:
integer (required)

ID of the sale affiliate. Set to "0" if there is no affiliate on the order.

trialPeriod:
integer (required)

Number of days the subscription will trial

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns the ID of the newly created subscription.


InvoiceService.addRecurringOrder

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>InvoiceService.addRecurringOrder</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>contactId</int></value>
    </param>
    <param>
      <value><boolean>allowDup</boolean></value>
    </param>
    <param>
      <value><int>SubscriptionPlanId</int></value>
    </param>
    <param>
      <value><int>qty</int></value>
    </param>
    <param>
      <value><double>price</double></value>
    </param>
    <param>
      <value><boolean>allowTax</boolean></value>
    </param>
    <param>
      <value><int>merchantId</int></value>
    </param>
    <param>
      <value><int>creditCardId</int></value>
    </param>
    <param>
      <value><int>affiliateId</int></value>
    </param>
    <param>
      <value><int>trialPeriod</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><i4>6</i4></value>
    </param>
  </params>
</methodResponse>

$app->addRecurringAdv();


$app = new iSDK();
// perform authorization tasks

$subscriptionId = $app->addRecurringAdv($cid,false,23,2,2.95,true,1,$ccId,$affId,0);

$infusionsoft->invoices()->addRecurringOrder()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->invoices()->addRecurringOrder($contactID, $Allow Duplicate, $subscriptionID, $quantity, $price, $taxable, $merchantAccountID, $creditCardID, $affiliateID, $trialPeriod)

Create a Subscription Invoice

Creates an invoice for all charges due on a subscription. If the subscription has multiple billing cycles due, it will create a single invoice with charges for all charges due.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

subscriptionID:
integer (required)

ID of the subscription to create an invoice for

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns the ID of the newly created invoice. Returns 0 if no invoices were generated.


InvoiceService.createInvoiceForRecurring

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>InvoiceService.createInvoiceForRecurring</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>subscriptionID</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><i4>10</i4></value>
    </param>
  </params>
</methodResponse>

$app->recurringInvoice();


$app = new iSDK();
// perform authorization tasks

$invoiceID = $app->recurringInvoice($recurringOrderId);

$infusionsoft->invoices()->createInvoiceForRecurring()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->invoices()->createInvoiceForRecurring($subscriptionID)

Update Subscription Billing Date

Changes the next date a subscription is paid


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

subscriptionID:
integer (required)

ID of the subscription to update

nextBillDate:
date (required)

New billing date

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




InvoiceService.updateJobRecurringNextBillDate

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
 <methodName>InvoiceService.updateJobRecurringNextBillDate</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>recurringOrderId</int></value>
    </param>
    <param>
      <value><dateTime.iso8601>nextBillDate</dateTime.iso8601></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><boolean>1</boolean></value>
    </param>
  </params>
</methodResponse>

$app->updateSubscriptionNextBillDate();


$app = new iSDK();
// perform authorization tasks

$currentDate = date("d-m-Y");
$nDate = $app->infuDate($currentDate);

$result = $app->updateSubscriptionNextBillDate($recurringOrderId,$nDate);

$infusionsoft->invoices()->updateJobRecurringNextBillDate()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->invoices()->updateJobRecurringNextBillDate($subscriptionID, $nextBillDate)

Delete a Subscription

Deletes the specified subscription, as well as all invoices tied to the subscription.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

subscriptionID:
string (required)

ID of the subscription to delete

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns true upon success.


InvoiceService.deleteSubscription

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
 <methodName>InvoiceService.deleteSubscription</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>subscriptionId</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><boolean>1</boolean></value>
    </param>
  </params>
</methodResponse>

$app->deleteSubscription();


$app = new iSDK();
// perform authorization tasks

$result = $app->deleteSubscription($recurringOrderId);


$infusionsoft->invoices()->deleteSubscription()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->invoices()->deleteSubscription($subscriptionID)

Validate a New Credit Card


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

cardType:
string (required)

Credit card type (Visa, American Express, etc)

contactID:
integer (required)

ID of the contact to own the credit card

cardNumber:
string (required)

The card account number

expirationMonth:
string (required)

Two digit card expiration month

expirationYear:
string (required)

Four digit card expiration year

securityCode:
string (required)

Card security code

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




InvoiceService.validateCreditCard

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
 <methodName>InvoiceService.validateCreditCard</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><struct>
        <member><name>CardType</name>
          <value><string>Visa</string></value>
        </member>
        <member><name>ContactId</name>
          <value><int>123</int></value>
        </member>
        <member><name>CardNumber</name>
          <value><string>4111111111111111</string></value>
        </member>
        <member><name>ExpirationMonth</name>
          <value><string>12</string></value>
        </member>
        <member><name>ExpirationYear</name>
          <value><string>2009</string></value>
        </member>
        <member><name>CVV2</name>
          <value><string>123</string></value>
        </member>
      </struct></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>Message</name>
            <value>Card has expired</value>
          </member>
          <member>
            <name>Valid</name>
            <value>false</value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

$app->validateCard();


$app = new iSDK();
// perform authorization tasks

$card = array('CardType' => 'Visa',
              'ContactId' => 123,
              'CardNumber' => "4111111111111111",
              'ExpirationMonth' => '12',
              'ExpirationYear' => '2009',
              'CVV2' => '123');
$result = $app->validateCard($card);

$infusionsoft->invoices()->validateCreditCard()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->invoices()->validateCreditCard($cardType, $contactID, $cardNumber, $expirationMonth, $expirationYear, $securityCode)

Validate an Existing Credit Card


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

cardID:
integer (required)

ID of the credit card to validate

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




InvoiceService.validateCreditCard

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
 <methodName>InvoiceService.validateCreditCard</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><string>cardID</string></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>Message</name>
            <value>Card has expired</value>
          </member>
          <member>
            <name>Valid</name>
            <value>false</value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

$app->validateCard();


$app = new iSDK();
// perform authorization tasks

$result = $app->validateCard(156);

$infusionsoft->invoices()->validateCreditCard()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->invoices()->validateCreditCard($cardID)

Retrieve Credit Card

Retrieves a credit card for the specified contact


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

contactID:
integer (required)

Contact ID to retrieve the credit card for

lastFour:
string (required)

Last 4 digits of the card to retrieve

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns the credit card ID on success; 0 upon failure.


InvoiceService.locateExistingCard

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
 <methodName>InvoiceService.locateExistingCard</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>contactId</int></value>
    </param>
    <param>
      <value><string>last4</string></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><i4>0</i4></value>
    </param>
  </params>
</methodResponse>

$app->locateCard();


$app = new iSDK();
// perform authorization tasks

$contactId = "1";
$result = $app->locateCard($contactId,"1234");

$infusionsoft->invoices()->locateExistingCard()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->invoices()->locateExistingCard($contactID, $lastFour)

Retrieve Available Payment Options

Retrieves all payment types available within the requested Infusionsoft account

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




InvoiceService.getAllPaymentOptions

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>  <methodName>InvoiceService.getAllPaymentOptions</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
  </params>
</methodCall>


<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>Credit Card (Manual)</name>
            <value>Credit Card (Manual)</value>
          </member>
          <member>
            <name>Check</name>
            <value>Check</value>
          </member>
          <member>
            <name>Cash</name>
            <value>Cash</value>
          </member>
          <member>
            <name>Money Order</name>
            <value>Money Order</value>
          </member>
          <member>
            <name>Adjustment</name>
            <value>Adjustment</value>
          </member>
          <member>
            <name>Credit Card</name>
            <value>Credit Card</value>
          </member>
          <member>
            <name>Credit</name>
            <value>Credit</value>
          </member>
          <member>
            <name>Refund</name>
            <value>Refund</value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

$app->getAllPaymentOptions();


$app = new iSDK();
// perform authorization tasks

$result = $app->getAllPaymentOptions();

$infusionsoft->invoices()->getAllPaymentOptions()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->invoices()->getAllPaymentOptions()

Create a Custom Recurring Payment

Creates a custom recurring payment for an invoice.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

invoiceID:
integer (required)

ID of the invoice to apply the payment plan to

autoCharge:
boolean (required)

Whether or not the payment plan should automatically charge or not

creditCardID:
integer (required)

ID of the card to charge

merchantAccountID:
integer (required)

ID of the merchant account used to process the payment

daysUntilRetry:
integer (required)

Number of days to wait before re-attempting a failed payment

maxRetry:
integer (required)

Maximum number of attempts to retry a failed payment

initialPaymentAmount:
double (required)

Amount of the first charge on the payment plan

initialPaymentDate:
dateTime (required)

Date the first charge should occur

planStartDate:
dateTime (required)

Date the second, and subsequent, charge should occur. Note this does not include the first payment.

numberOfPayments:
integer (required)

The number of payments in the plan, not including the first payment

daysBetweenPayments:
integer (required)

Number of days between payments, starting with the second payment

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns true on successful creation


InvoiceService.addPaymentPlan

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>InvoiceService.addPaymentPlan</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>invoiceId</int></value>
    </param>
    <param>
      <value><boolean>autoCharge</boolean></value>
    </param>
    <param>
      <value><int>creditCardId</int></value>
    </param>
    <param>
      <value><int>merchantAccountId</int></value>
    </param>
    <param>
      <value><int>daysRetry</int></value>
    </param>
    <param>
      <value><int>maxRetry</int></value>
    </param>
    <param>
      <value><double>initialPmt</double></value>
    </param>
    <param>
      <value><dateTime.iso8601>initialPmtDate</dateTime.iso8601></value>
    </param>
    <param>
      <value><dateTime.iso8601>planStartDate</dateTime.iso8601></value>
    </param>
    <param>
      <value><int>numPmts</int></value>
    </param>
    <param>
      <value><int>daysBetweenPmts</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <boolean>1</boolean></value>
    </param>
  </params>
</methodResponse>

$app->payPlan();


$app = new iSDK();
// perform authorization tasks

$invoiceDate = $app->infuDate("10-11-2008");
$startDate = $app->infuDate("10-25-2008");
$result = $app->payPlan(43,true,12,1,2,3,25.50,$invoiceDate,$startDate,5,30);

$infusionsoft->invoices()->addPaymentPlan()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->invoices()->addPaymentPlan($invoiceID, $autoCharge, $creditCardID, $merchantAccountID, $daysUntilRetry, $maxRetry, $initialPaymentAmount, $initialPaymentDate, $planStartDate, $numberOfPayments, $daysBetweenPayments)

Order

The Order Service is used to create and charge an order.

Create an Order


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

contactID:
integer (required)

ID of the order's Contact (0 is not a valid contact id)

cardID:
integer (required)

ID of the credit card to charge. To skip charging a card, set to "0"

planID:
integer

ID of the payment plan to use when creating the order. If not specified, the default plan is used.

productIDs:
array (required)

A list of integers representing the products to be added to the order. This cannot be empty if a subscription is not specified.

subscriptionIDs:
array (required)

A list of integers representing the subscription(s) to be added to the order. This cannot be empty if a productID is not specified.

processSpecials:
boolean (required)

Whether or not the order should consider discounts that would normally be applied if this order was being placed through the shopping cart.

promoCodes:
array (required)

Promo codes to add to the cart; only used if processing of specials is turned on

leadAffiliateID:
integer (required)

ID of the lead affiliate

saleAffiliateID:
integer (required)

ID of the sale affiliate

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns the result of order placement along with IDs of the order and invoice that were created and the status of a credit card charge (if applicable).


OrderService.placeOrder

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>OrderService.placeOrder</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>contactId</int></value>
    </param>
    <param>
      <value><int>creditCardId</int></value>
    </param>
    <param>
      <value><int>payPlanId</int></value>
    </param>
    <param>
      <value><array>
        <data>
          <value><int>productIds</int></value>
        </data>
      </array></value>
    </param>
    <param>
      <value><array>
        <data>
          <value><int>subscriptionPlanIds</int></value>
        </data>
      </array></value>
    </param>
    <param>
      <value><boolean>processSpecials</boolean></value>
    </param>
    <param>
      <value><array>
        <data>
          <value><string>promoCodes</string></value>
        </data>
      </array></value>
    </param>
    <param>
      <value><int>0</int></value>
    </param>
    <param>
      <value><int>0</int></value>
    </param>
  </params>
</methodCall>

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
    <params>
        <param>
            <value>
                <struct>
                    <member>
                        <name>Successful</name>
                        <value>false</value>
                    </member>
                    <member>
                        <name>Message</name>
                        <value>DECLINE - Response code(200)</value>
                    </member>
                    <member>
                        <name>RefNum</name>
                        <value>2879922578</value>
                    </member>
                    <member>
                        <name>OrderId</name>
                        <value>2935</value>
                    </member>
                    <member>
                        <name>InvoiceId</name>
                        <value>2937</value>
                    </member>
                    <member>
                        <name>Code</name>
                        <value>None</value>
                    </member>
                </struct>
            </value>
        </param>
    </params>
</methodResponse>


$app = new iSDK();
// perform authorization tasks

$carray = array(
	$app->key,
	$contactId,  
	$creditCardId, 
	$payPlanId, 
	array($productId1, $productId2), 
	array($subscriptionPlanId1, $subscriptionPlanId2), 
	$processSpecials,
	array($promoCode1, $promoCode2)) // array of strings
);

$app->placeOrder($carray);

$infusionsoft->orders()->placeOrder()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->orders()->placeOrder($contactID, $cardID, $planID, $productIDs, $subscriptionIDs, $processSpecials, $promoCodes, $leadAffiliateID, $saleAffiliateID)

Product

The Product Service is used to manage products stored in Infusionsoft. You can add, update and find products in addition to managing follow up sequences, tags and action sets.

Retrieve Available Product Inventory


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

productID:
integer (required)

The ID of the product to retrieve inventory levels for

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns the available inventory for the requested product as an integer.


ProductService.getInventory

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>ProductService.getInventory</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>productId</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><i4>0</i4></value>
    </param>
  </params>
</methodResponse>

$app->getInventory();


$app = new iSDK();
// perform authorization tasks

$app->getInventory(1);

$infusionsoft->products()->getInventory()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->products()->getInventory($productID)

Increment Available Product Inventory

Increments the specified product's inventory by one unit.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

productID:
integer (required)

ID of the product to increment inventory on

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns a boolean true on success.


ProductService.incrementInventory

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
 <methodName>ProductService.incrementInventory</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>productId</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><boolean>1</boolean></value>
    </param>
  </params>
</methodResponse>

$app->incrementInventory();


$app = new iSDK();
// perform authorization tasks

$app->incrementInventory(1);

$infusionsoft->products()->incrementInventory()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->products()->incrementInventory($productID)

Decrement Available Product Inventory

Decrements the specified product's inventory by one unit.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

productID:
string (required)

ID of the product to decrement inventory on

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




ProductService.decrementInventory

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
 <methodName>ProductService.decrementInventory</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>productId</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><boolean>1</boolean></value>
    </param>
  </params>
</methodResponse>

$app->decrementInventory();


$app = new iSDK();
// perform authorization tasks

$app->decrementInventory(1);

$infusionsoft->products()->decrementInventory()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->products()->decrementInventory($productID)

Increase a Product's Available Inventory

Increases the available inventory for the specified product.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

productID:
integer (required)

ID of the product to modify inventory of

quantity:
integer (required)

The amount to increase the product's inventory by

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




ProductService.increaseInventory

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>ProductService.increaseInventory</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>productId</int></value>
    </param>
    <param>
      <value><int>quantity</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><boolean>1</boolean></value>
    </param>
  </params>
</methodResponse>

$app->increaseInventory();


$app = new iSDK();
// perform authorization tasks

$app->increaseInventory(1, 3);

$infusionsoft->products()->increaseInventory()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->products()->increaseInventory($productID, $quantity)

Decrease a Product's Available Inventory

Decreases the available inventory for the specified product.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

productID:
integer (required)

ID of the product to modify inventory of

quantity:
integer (required)

The amount to decrease the product's inventory by

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




ProductService.decreaseInventory

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>ProductService.decreaseInventory</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>productId</int></value>
    </param>
    <param>
      <value><int>quantity</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><boolean>1</boolean></value>
    </param>
  </params>
</methodResponse>

$app->decreaseInventory();


$app = new iSDK();
// perform authorization tasks

$app->decreaseInventory(1, 3);

$infusionsoft->products()->decreaseInventory()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->products()->decreaseInventory($productID, $quantity)

Deactivate a Credit Card


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

cardID:
integer (required)

ID of the credit card to deactivate

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns boolean true if the card is successfully deactivated.


ProductService.deactivateCreditCard

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>ProductService.deactivateCreditCard</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>creditCardId</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><boolean>1</boolean></value>
    </param>
  </params>
</methodResponse>

$app->deactivateCreditCard();


$app = new iSDK();
// perform authorization tasks

$app->deactivateCreditCard(1);

$infusionsoft->products()->deactivateCreditCard()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->products()->deactivateCreditCard($cardID)

Retrieve a Report's Available Fields


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

savedSearchID:
integer (required)

ID of the saved search to retrieve columns for

userID:
integer (required)

ID of the user that created the saved search

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns an array of the fields available on a saved search/report.


SearchService.getAllReportColumns

<?xml version="1.0"?>
<methodCall>
  <methodName>SearchService.getAllReportColumns</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>savedSearchId</int></value>
    </param>
    <param>
      <value><int>userId</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>Id</name>
            <value>Id</value>
          </member>
          <member>
            <name>FilterId</name>
            <value>Filter Id</value>
          </member>
          <member>
            <name>ContactId</name>
            <value>Contact Id</value>
          </member>
          <member>
            <name>ContactName</name>
            <value>Name</value>
          </member>
          <member>
            <name>ContactName.firstName</name>
            <value>First Name</value>
          </member>
          <member>
            <name>ContactName.lastName</name>
            <value>Last Name</value>
          </member>
		  ...
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

$app->getAvailableFields();


$app = new iSDK();
// perform authorization tasks

$savedSearchId = 3;
$userId = 1;
$results = $app->getAvailableFields($savedSearchId, $userId);

$infusionsoft->search()->getAllReportColumns()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->search()->getAllReportColumns($savedSearchID, $userID)

Retrieve Available Quick Searches


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

userID:
integer (required)

ID of the requesting user

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns a struct of the requesting user's available quick searches.


SearchService.getAvailableQuickSearches

<?xml version="1.0"?>
<methodCall>
  <methodName>SearchService.getAvailableQuickSearches</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>14</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>FindPerson</name>
            <value>Person</value>
          </member>
          <member>
            <name>FindCompany</name>
            <value>Company</value>
          </member>
          <member>
            <name>FindTask</name>
            <value>Task/Appt/Note</value>
          </member>
          <member>
            <name>FindOrder</name>
            <value>Order</value>
          </member>
          <member>
            <name>FindSubscription</name>
            <value>Subscription</value>
          </member>
          <member>
            <name>FindOpportunity</name>
            <value>Opportunity</value>
          </member>
          <member>
            <name>FindAffiliate</name>
            <value>Affiliate</value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

$app->getQuickSearches();


$app = new iSDK();
// perform authorization tasks

$userId = 6;
$result = $app->getQuickSearches($userId);

$infusionsoft->search()->getAvailableQuickSearches()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->search()->getAvailableQuickSearches($userID)

Retrieve a Quick Search Report

Returns a quick search, equivalent to using the search box in the Infusionsoft application.


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

searchType:
integer (required)

The type of search you are running. FindPerson, FindOrder, FindOpportunity, FindCompany, FindTask, FindSubscription, or FindAffiliate

userID:
integer (required)

ID of the user running the search. Results are returned based upon the specified user's permissions.

searchData:
string (required)

Search query

page:
integer (required)

A zero-indexed page of results to return

limit:
integer (required)

Number of results to return; maximum of 1000

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns a struct of report results.


SearchService.quickSearch

<?xml version="1.0"?>
<methodCall>
  <methodName>SearchService.quickSearch</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><string>quickSearchType</string></value>
    </param>
    <param>
      <value><int>userId</int></value>
    </param>
    <param>
      <value><string>searchData</string></value>
    </param>
    <param>
      <value><int>page</int></value>
    </param>
    <param>
      <value><int>limit</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><array><data/></array></value>
    </param>
  </params>
</methodResponse>

$app->quickSearch();


$app = new iSDK();
// perform authorization tasks

$userId = 1;
$searchData = 'in';
$results = $app->quickSearch('FindPerson', $userId, $searchData, 0, 1000);

$infusionsoft->search()->quickSearch()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->search()->quickSearch($searchType, $userID, $searchData, $page, $limit)

Shipping

The Shipping Service is used to retrieve available shipping options.

Retrieve Available Shipping Options

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




ShippingService.getAllShippingOptions

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>ShippingService.getAllShippingOptions</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value><array><data/></array></value>
    </param>
  </params>
</methodResponse>

$app->getAllConfiguredShippingOptions();


$app = new iSDK();
// perform authorization tasks

$app->getAllConfiguredShippingOptions();

$infusionsoft->shipping()->getAllShippingOptions()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->shipping()->getAllShippingOptions()

Retrieve Weight-Based Shipping Options


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

optionID:
integer (required)

ID of the shipping option

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns the options and values of the requested weight based shipping option.


ShippingService.getWeightBasedShippingOption

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>ShippingService.getWeightBasedShippingOption</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>optionId</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>id</name>
            <value>11</value>
          </member>
          <member>
            <name>description</name>
            <value/>
          </member>
          <member>
            <name>name</name>
            <value>Ship by Weight</value>
          </member>
          <member>
            <name>orderBased</name>
            <value>true</value>
          </member>
          <member>
            <name>international</name>
            <value>false</value>
          </member>
          <member>
            <name>active</name>
            <value>true</value>
          </member>
          <member>
            <name>type</name>
            <value>Weight</value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

$app->getWeightBasedShippingOption();


$app = new iSDK();
// perform authorization tasks

$app->getWeightBasedShippingOption(1);

$infusionsoft->shipping()->getWeightBasedShippingOption()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->shipping()->getWeightBasedShippingOption($optionID)

Retrieve Flat Rate Shipping Options


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

optionID:
string (required)

ID of the shipping option to retrieve

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




ShippingService.getFlatRateShippingOption

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>ShippingService.getFlatRateShippingOption</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>optionId</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>id</name>
            <value>1</value>
          </member>
          <member>
            <name>price</name>
            <value>0.0</value>
          </member>
          <member>
            <name>description</name>
            <value>test</value>
          </member>
          <member>
            <name>orderBased</name>
            <value>false</value>
          </member>
          <member>
            <name>name</name>
            <value>Flat Rate Per Order</value>
          </member>
          <member>
            <name>international</name>
            <value>false</value>
          </member>
          <member>
            <name>active</name>
            <value>true</value>
          </member>
          <member>
            <name>type</name>
            <value>Flat</value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

$app->getFlatRateShippingOption();


$app = new iSDK();
// perform authorization tasks

$app->getFlatRateShippingOption(1);

$infusionsoft->shipping()->getFlatRateShippingOption()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->shipping()->getFlatRateShippingOption($optionID)

Retrieve Product Shipping Options


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

optionID:
integer (required)

ID of the requested shipping option

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns an array of shipping options and values for the requested product shipping option.


ShippingService.getProductBasedShippingOption

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>ShippingService.getProductBasedShippingOption</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>optionId</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>id</name>
            <value>3</value>
          </member>
          <member>
            <name>description</name>
            <value/>
          </member>
          <member>
            <name>name</name>
            <value>Specific Price Per Product</value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

$app->getProductBasedShippingOption();


$app = new iSDK();
// perform authorization tasks

$app->getProductBasedShippingOption(1);

$infusionsoft->shipping()->getProductBasedShippingOption()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->shipping()->getProductBasedShippingOption($optionID)

Retrieve Order Shipping Options


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

optionID:
integer (required)

ID of the shipping option

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns an array of options and values for order shipping option.


ShippingService.getOrderTotalShippingOption

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>ShippingService.getOrderTotalShippingOption</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>optionId</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <array>
          <data/>
        </array>
      </value>
    </param>
  </params>
</methodResponse>

$app->getOrderTotalShippingOption();


$app = new iSDK();
// perform authorization tasks

$app->getOrderTotalShippingOption(1);

$infusionsoft->shipping()->getOrderTotalShippingOption()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->shipping()->getOrderTotalShippingOption($optionID)

Retrieve Order Quantity Shipping Options


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

optionID:
integer (required)

ID of the shipping option

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns the options and values of the order quantity shipping option provided.


ShippingService.getOrderQuantityShippingOption

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>ShippingService.getOrderQuantityShippingOption</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>optionId</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>id</name>
            <value>7</value>
          </member>
          <member>
            <name>baseShippingPrice</name>
            <value>1.0</value>
          </member>
          <member>
            <name>pricePerItem</name>
            <value>1.0</value>
          </member>
          <member>
            <name>description</name>
            <value/>
          </member>
          <member>
            <name>orderBased</name>
            <value>false</value>
          </member>
          <member>
            <name>name</name>
            <value>test quan</value>
          </member>
          <member>
            <name>international</name>
            <value>false</value>
          </member>
          <member>
            <name>active</name>
            <value>true</value>
          </member>
          <member>
            <name>type</name>
            <value>Quantity</value>
          </member>
          <member>
            <name>minimumShippingPrice</name>
            <value>1.0</value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

$app->getOrderQuantityShippingOption();


$app->getOrderQuantityShippingOption(1);

$app = new iSDK();
// perform authorization tasks

$infusionsoft->shipping()->getOrderQuantityShippingOption()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->shipping()->getOrderQuantityShippingOption($optionID)

Retrieve Order Shipping Ranges


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

optionID:
integer (required)

ID of the requested shipping option

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns the available values for order shipping ranges based on the requested shipping option.


ShippingService.getOrderTotalShippingRanges

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>ShippingService.getOrderTotalShippingRanges</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int>optionId</int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <array>
          <data/>
        </array>
      </value>
    </param>
  </params>
</methodResponse>

$app->getOrderTotalShippingRanges();


$app = new iSDK();
// perform authorization tasks

$app->getOrderTotalShippingRanges(1);

$infusionsoft->shipping()->getOrderTotalShippingRanges()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->shipping()->getOrderTotalShippingRanges($optionID)

Retrieve UPS Shipping Option


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

optionID:
integer (required)

The ID of the requested option

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns the options and values of the requested UPS shipping option.


ShippingService.getUpsShippingOption

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>ShippingService.getUpsShippingOption</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
    <param>
      <value><int> optionId </int></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>deliveryType</name>
            <value>01,03,07</value>
          </member>
          <member>
            <name>orderBased</name>
            <value>false</value>
          </member>
          <member>
            <name>international</name>
            <value>false</value>
          </member>
          <member>
            <name>accessLicenseNumber</name>
            <value>niewonfidso</value>
          </member>
          <member>
            <name>type</name>
            <value>UPS</value>
          </member>
          <member>
            <name>pickupType</name>
            <value>01</value>
          </member>
          <member>
            <name>id</name>
            <value>13</value>
          </member>
          <member>
            <name>accountNumber</name>
            <value>39208234</value>
          </member>
          <member>
            <name>accessPassword</name>
            <value>ronald11</value>
          </member>
          <member>
            <name>destinationType</name>
            <value>0</value>
          </member>
          <member>
            <name>description</name>
            <value/>
          </member>
          <member>
            <name>packagingType</name>
            <value>01</value>
          </member>
          <member>
            <name>name</name>
            <value>UPS</value>
          </member>
          <member>
            <name>active</name>
            <value>true</value>
          </member>
          <member>
            <name>accessUserId</name>
            <value>ron</value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

$app->getUpsShippingOption();


$app = new iSDK();
// perform authorization tasks

$app->getUpsShippingOption(1);

$infusionsoft->shipping()->getUpsShippingOption()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->shipping()->getUpsShippingOption($optionID)

Webform

The Webform Service is used to retrieve available web forms created within Keap.

Retrieve a Form's HTML


Form Parameters

privateKey:
string (required)

Your Infusionsoft API key

formID:
integer (required)

ID of the webform to retrieve

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns the HTML for the requested webform


WebFormService.getHTML

<?xml version="1.0"?>
<methodCall>
    <methodName>WebFormService.getHTML</methodName>
    <params>
        <param>
            <value><string>c94a1f2b395a9ab97d4263b37f7b0923</string></value>
        </param>
        <param>
            <value><int>6</int></value>
        </param>
    </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <html style="height:100%; margin:0;
		...
	</value>
    </param>
  </params>
</methodResponse>

$app->getWebFormHtml();


$app = new iSDK();
// perform authorization tasks

$formId = 6;
$form = $app->getWebFormHtml($formId);

$infusionsoft->webForms()->getHTML()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->webForms()->getHTML($formID)

Retrieve Webform IDs

Authorization Change

First, request access by using your Client ID. We'll use our redirect URL, then bring you back here to show how to get a token.


Now, exchange the code for an access token and refresh token.




Returns

Returns all of the available webform name and ID pairs


WebFormService.getMap

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>WebFormService.getMap</methodName>
  <params>
    <param>
      <value><string>privateKey</string></value>
    </param>
  </params>
</methodCall>

<?xml version='1.0' encoding='UTF-8'?>
<methodResponse>
  <params>
    <param>
      <value>
        <struct>
          <member>
            <name>
              6
            </name>
            <value>
              test
            </value>
          </member>
        </struct>
      </value>
    </param>
  </params>
</methodResponse>

$app->getWebFormMap();


$app = new iSDK();
// perform authorization tasks

$map = $app->getWebFormMap();

$infusionsoft->webForms()->getMap()


$infusionsoft = new \Infusionsoft\Infusionsoft(array(
    'clientId' => CLIENT_ID,
    'clientSecret' => CLIENT_SECRET,
    'redirectUri' => REDIRECT_URL,
));

$infusionsoft->refreshAccessToken();

$infusionsoft->webForms()->getMap()