Merchant Account Services

Merchant Account Blog


Authorize.Net Releases New Customer Information Manager API

Recently Authorize.Net released their API for their new Customer Information Manager (CIM) feature of their payment gateway. This feature is a boon for merchants who wish to store credit card information or do recurring billing in different amounts or varied schedules.

The main features of this new service are:

  • PCI Compliance

    Remove the specter of PCI compliance from your ecommerce website by letting Authorize.Net handle the storing of sensitive information for you. Because your customers’ information reside on the Authorize.Net servers you do not have to worry about encrypting and protecting sensitive data. Not only do not have to worry about PCI compliance but your website is no longer an inviting target for hackers who want to steal this information from you.

  • Process Irregularly Priced Recurring Billing Charges

    The Authorize.Net Automated Recurring Billing System is great for businesses that charge a fixed amount each billing period. But it does not work if you have a varying amount to charge during each billing period. CIM allows your website to handle the varying billing amounts and CIM will handle the storage of the billing information and processing of the recurring transaction. Now your recurring payments can be completely automated.

  • Process Irregularly Scheduled Recurring Billing Charges

    Do you need to charge your customers on a recurring basis but the schedule is not consistent? With CIM you can store the credit card and billing information with Authorize.Net and only need to handle the actual scheduling of the payments. This allows you to automate the entire process reducing your costs and time spent processing payments.

  • Create A “One Click” Checkout

    Creating a quick and easy checkout system is an important feature of any successful ecommerce website. Allowing your customers to store their data so they do not have to enter it again the next time they make a purchase can make shopping at your online store more appealing then your competitors’. With CIM you can provide this functionality for your customers and increase customer satisfaction and loyalty.

Naturally we created our own class to access their CIM API. This API, as well as the potential functionality of this service is complex, but here are a couple of examples to get you started in using this new service.

Here’s how to create a new CIM account:


try
{
require_once("AuthnetCIM.class.php");

$cim = new AuthnetCIM();
$cim->setParameter('company', 'Fake Cpmpany');
$cim->setParameter('cardNumber', '4111111111111111');
$cim->setParameter('expirationDate', '2008-12');
$cim->setParameter('firstName', 'Joseph');
$cim->setParameter('lastName', 'Faker');
$cim->setParameter('address', '100 Main Street');
$cim->setParameter('city', 'Townville');
$cim->setParameter('state', 'NY');
$cim->setParameter('zip', '12345');
$cim->setParameter('country', 'US');
$cim->setParameter('phoneNumber', '111-111-1111');
$cim->setParameter('faxNumber', '222-222-2222');
$cim->setParameter('shipFirstName', 'Joseph');
$cim->setParameter('shipLastName', 'Faker');
$cim->setParameter('shipCompany', 'Fake Cpmpany.');
$cim->setParameter('shipAddress', '100 Main Street');
$cim->setParameter('shipCity', 'Townville');
$cim->setParameter('shipState', 'NY');
$cim->setParameter('shipZip', '12345');
$cim->setParameter('shipCountry', 'US');
$cim->setParameter('shipPhoneNumber', '333-333-3333');
$cim->setParameter('shipFaxNumber', '444-444-4444');
$cim->setParameter('description', 'Monthly Membership and stuff again' . time());
$cim->setParameter('merchantCustomerId', 'user04');

$cim->CreateCustomerProfile();
$profile_id = $cim->getProfileID();
}
catch (AuthnetCIMException $e)
{
$debug = $e->getTrace();
die(”Exception occurred: ” . $e->getMessage() . “. File: ” .
$debug[0][’file’] . ” on line ” . $debug[0][’line’]);
}

Here’s how to add a new profile to that new account:


$cim->setParameter('customerProfileId', $profile_id);
$cim->setParameter('firstName', 'Joseph');
$cim->setParameter('lastName', 'Faker');
$cim->setParameter('address', '100 Main Street');
$cim->setParameter('city', 'Townville');
$cim->setParameter('state', 'NY');
$cim->setParameter('zip', '12345');
$cim->setParameter('country', 'US');
$cim->setParameter('phoneNumber', '111-111-1111');
$cim->setParameter('faxNumber', '222-222-2222');
$cim->setParameter('cardNumber', '4111111111111111');
$cim->setParameter('expirationDate', ' 2024 -12');

$cim->createCustomerPaymentProfile();
$payment_profile_id = $cim->getPaymentProfileId();

Here’s how to add a shipping address to that account:


$cim->setParameter('customerProfileId', $profile_id);
$cim->setParameter('firstName', 'Joseph');
$cim->setParameter('lastName', 'Faker');
$cim->setParameter('address', '101 Main Street');
$cim->setParameter('city', 'Townville');
$cim->setParameter('state', 'NY');
$cim->setParameter('zip', '12345');
$cim->setParameter('country', 'US');
$cim->setParameter('phoneNumber', '111-111-1111');
$cim->setParameter('faxNumber', '222-222-2222');

$cim->createCustomerShippingAddress();
$address_id = $cim->getCustomerAddressId();

Here’s how to process a transaction with that new account:


$cim->setParameter('amount', '1.00');
$cim->setParameter('shipAmount', '1.00');
$cim->setParameter('shipName', 'UPS');
$cim->setParameter('shipDescription', 'UPS Ground');
$cim->setParameter('customerProfileId', $profile_id);
$cim->setParameter('customerPaymentProfileId', $profile_id);
$cim->setParameter('customerShippingAddressId', $address_id);
$cim->setParameter('cardCode', '123');
$cim->setLineItem('12', 'test item', 'it lets you test stuff', '1', '1.00');

$cim->createCustomerProfileTransaction();
echo 'approval code: ' . $cim->getAuthCode();

Hopefully this is enough to get you started in accessing the Authorize.Net Customer Information Manager API. You can be sure an article will follow that will go into further detail about using this feature and API.

They offer two distinct APIs for using this new service. One uses their new XML API and the other uses SOAP. You can download the XML PDFPDF or SOAP PDF of their integration guide from your control panel. You can find an example of PHP code using the SOAP API in their developer section of their website. So far there is no code for the XML API.

You can download a beta version of our Authorize.Net Customer Information Manager Class here. It is written in PHP 5 but can easily be converted to PHP 4 (but why would you want to?). This class has not been tested in a production environment yet so it may be buggy. If you find a bug please report it here so we can update it accordingly.

7 Responses to “Authorize.Net Releases New Customer Information Manager API”

  1. Jestep

    They have needed to come out with this for a while now. Makes so much more sense than their recurring billing API by itself.

  2. Dan Grossman

    Just wanted to drop a note thanking you for releasing yet another PHP class for working with Authnet’s APIs. I had to edit this one a bit as I didn’t want to use most of the fields and there were some inconsistencies between variable names in the class and the API… but as always, it’s better to have example code to start from than just developer documentation. W3Counter’s subscriptions now use CIM :)

  3. Rob Stoddard

    How do I cancel a subscription set up through ARB?

  4. Peter Young

    Just discovered your site as I am preparing to abandone x-cart and build my own shopping cart. Thanks very much for all the great information. I downloaded your authorize.net php code – thanks very much. I also downloaded this code, but I am still getting my head around CIM. If I use CIM, then I use it for everything including card transactions? Not just for storing information?

    Peter

  5. Peter Young

    Your AIM stuff was great, now I’m going to use your CIM stuff. I want to send you a bottle of wine. Email me and let me know where to send it.

  6. Peter Young

    I think I found a bug in UpdatePaymentProfile. You have the customerProfileID but not the customerPaymentProfileID in the xml construction.

    Peter

  7. Sanaa

    Jim, just wanted to say Thank You!
    Thank You! for your work with AIM, ARB and CIM.
    Authorize.net should seriously just post a link to your tutorials next to their Manuals and call it a day!

    Take Care,

    Sn.

Leave a Reply