News‎ > ‎

Kangaroo Commerce Server API's: Brief Overview

posted Oct 31, 2011, 2:34 PM by Matt Furnari   [ updated Oct 31, 2011, 2:35 PM ]
Developers rejoice! Kangaroo Commerce Server has a number of different APIs built to make life easier. We believe that open and unfettered access to Kangaroo Commerce Server as an e-Commerce platform is key to long term growth. I am going to introduce the different APIs and give a brief overview of each.

JavaScript API:

The easiest, quickest, and most platform independent way of interacting with Kangaroo Commerce Server is by using the JavaScript API. The JavaScript API enables the developer to perform a plethora of actions without leaving the page:
  • Make calls to place an item in a basket, add payment or shipping information, or perform a checkout
  • Retrieve pieces of HTML dynamically
  • Retrieve JSON representations of Products, Users, Baskets, Orders and more.
  • Validate customer entered data.
The JavaScript API provides calling conventions:
  1. Synchronous - Make a call to Kangaroo Commerce Server and wait for the result
  2. Asychronous - Make a call to Kangaroo Commerce Server and continue. If the method call returns data it is sent to a call back function.
Here is an example of a JavaScript call to add an item to the current user’s basket asynchronously and display an alert when the call is complete:

var ProductID = 100;
var VariantID = null
var Quantity = 1
Baskets.AddProductToCart(ProductID, VariantID, Quantity, 
                                function() {alert(“Done!”) });

A second example that synchronously retrieves a product and displays the name:

    var ProductID = 100;
    var oProduct = Products.Get(ProductID);
    alert("Successfully retrieved product: " 
            + oProduct.Name + " - " + oProduct.Code);

Pretty easy.

C# API:

Kangaroo Commerce Server also provides direct access to the C# API for developers who want to build .NET code extensions. Two primary assemblies define all the functionality for interacting with Kangaroo Commerce Server:

RooTrax.eCommerce - Used by the customer site to add, remove, update items in a basket, register users, make product comments, and other customer actions.

RooTrax.eCommerce.Admin - Used to administer the site. Create categories, products, and departments, list orders, approve and delete comments and ratings.

XML Web Service API:

Kangaroo Commerce Server also provides a web service API for remote access to the system. The XML Web Service API provides a Messaging pattern interface onto the Kangaroo Commerce Server. This makes it the perfect location to integrate 3rd party applications. Order Fulfillment, Accouting and CRM Applications, and other Kangaroo Software products use this API to keep track of new orders and customers and to add new customers and products to the web site.
Comments