How to Add Products to Bigcommerce Cart

BigCommerce  allows business owners to set up an online store, customize it to their liking, and then sell an unlimited number of digital, physical, or even service-based products.

For adding products to the Bigcommerce cart we can use the following endpoint.


We have to add the following query parameters to the above endpoint.

Type Parameter Description Example
string action= add or buy; buy goes directly to checkout

add will add the product to cart

int product_id= product id to add to the cart /cart.php?action=add&product_id=123
int qty= quantity to add to the cart /cart.php?action=add&product_id=123&qty=3
string sku= SKU to add to the cart (or select on product page) /cart.php?action=add&sku=xlredtshirt
string couponcode= coupon code to apply to the cart /cart.php?action=add&product_id=123&couponcode=10off100


Example URL:


After adding the parameters just call the API and this will add the product to the bigcommerece cart!


<a href=”″>Purchase Our New Product Now!</a>

Purchase Our New Product Now!

The below sample JS code that can be used in Digioh Custom Js to add the products to Bigcommerce cart .

<button id="addToCart" type="button">Add Bundle to Cart</button>

// when #addToCart is clicked...
$("button#addToCart").click(function() {

  // add product id 123
    return $.get("/cart.php?action=add&product_id=123")
  .done(function(data, status, xhr) {
    console.log('first item complete with status ' + status);
  .then(function() {
    // add product id 456
    return $.get("/cart.php?action=add&product_id=456");
  .done(function(data, status, xhr) {
    console.log('second item complete with status ' + status);
  // chain more async GET requests using .then & .done
  .fail(function(xhr, status, error) {
    console.log('oh noes, error with status ' + status + ' and error: ');
    return xhr.done();
  .always(function() {
    // go to cart
    return window.location = "/cart.php";


Reference URL: