Cart Boxx – Cart API Reference

THE API BASICS

System administration API.

Description: Shopping cart processes.
Default URL: https://your-site.com/api/cart
Response/return: Cart Boxx APIs will always return a standard response, most data will be put into the “cb-more” response field – Check out function verbose in the library reference.

Example Usage
$.ajax({
  url : "https://your-site.com/api/cart",
  data : { 
    req : "add",
    product_id : 1,
    qty : 8
  }
}).done(
  // DO YOUR PROCESSING HERE
);

 

THE REQUESTS

req: count

Description: Get total number of items in cart

Parameters
None
req: add

Description: Add item to cart

Parameters
[INT] $_POST[‘product_id’] – product ID.
[INT] $_POST[‘qty’] – Quantity to add
req: change

Description: Change item quantity in cart

Parameters
[INT] $_POST[‘product_id’] – Product ID
[INT] $_POST[‘qty’] – New quantity
req: remove

Description: Remove item from cart

Parameters
[INT] $_POST[‘product_id’] – Product ID
[INT] $_POST[‘qty’] – Quantity to remove. If 0 is sent, will remove all
req: nuke

Description: Remove all items from cart

Parameters
None
req: show

Description: Show items in cart (spartan, array of items without names and total)

Parameters
None
req: showall

Description: Show items in cart (elegant, array of items with names and calculated totals)

Parameters
None
req: checkout

Description: Checkout the current cart

Parameters
None

Leave a Comment

Your email address will not be published. Required fields are marked *