BBAPI: Cart Commands
The cart commands allow you to manage an online shopping cart using the Nigma API. All typical functions such as add/remove and update quantities can be acheived with the cart commands. Cart easily converted to an orders with the SetOrders command.
On This Page:
Available Commands
SetCarts
Save cart(s) data such as client reference, products and their quantities.
GetCarts
Get cart(s) including product and their quantities, tax, shipping and totals.
Example 1: Input
Here is an example of what would be sent to the API to create a shopping cart and add a product to the cart.
If your products contain optional items, you can add these by also passing in a productItem node (also shown below) with the respective item information. You do NOT have to pass in a productItem node if you wish for all required items to be added to the cart.
If you wish for tax and shipping to be calculated, you must also pass in a client id reference. The ID should be the clientID of an existing client with a valid shipping and/or billing address.
If you remove a required item from the cart, the entire product will be removed from the cart.
Example 1: Response
The API will return the results of your request in a similar way. All data that would be seen in a GetProducts call is shown for each product and item found within the cart.
You should store either the cartID or the clientID in a session or cookie for future look-ups.
Similarly, you can call the GetCarts command while passing in a cartID or clientID to get cart information for a specific cart or client. See the summary of nodes table below to learn how to remove existing products and/or items from the cart and to learn more interactions witht the shopping cart API.
Summary of Nodes
Here is a summary of the nodes that may be passed back and their meaning. The nodes found within the product and item is not defined here, but can be found here.
Node |
Type | Description |
|---|---|---|
cartID |
Integer | Unique ID of cart. |
| cartClientID | Integer | Unqiue ID of client that created the cart. |
| cartIP | String | Last known IP address of cart. |
| subTotal | Double | Current sub-total of all items in cart. |
| grandTotal | Double | Current grand-total of cart including all items in cart, tax and shipping. Also includes any discounts applied. |
| tax | Double | Tax to charge for cart. |
| shipping | Double | Shipping to charge for cart using the default shipping method. |
| shippingMethodID | Integer | Shipping method ID chosen. Call GetShipping to find shipping methods and their values. |
| products | XML | Product Nodes for all products found in the cart. |
