Is it possible to use Shopify AJAX Cart API from another domain?

New Member
2 0 0

Description of a situation:

We have 2 sites: and is a Shopify site, is an independent site on Zend framework. 

On we have product details page, cart and checkout. On we have various products lists (catalog, recommendations, etc). Currently our customers can add product to cart only from product details page that is located on Shopify based site. But we want to add ability of adding products to cart also from products lists that is located on that is not Shopify site.

We are using AJAX Cart API for this. And it works for, but not for because of CORS restrictions.


1. I tried to solve this using AWS API Gateway as proxy and I was succeed, but I still have issue with cookies. I created a proxy server and it works as expected except one point - browser don't send cookie secure_customer_sig, because it was set for So, our proxy must be located on domain only, but it's impossible.

2. I also know about Shopify Buy Button, but it seems to be very excess because a great amount of Javascript code that we must add for every product variant (we have a lot of products with many variants on every page).

3. My last idea how to reach this was add a page on that will execute Javascript code that requests /cart/add.js and when user selects variant and clicks "add to cart" on, add hidden iframe on the page that will open created page on

Seems that the last solution should work, but I want to ask you - may be we have more simple option to reach this? May be with private app or we can allow CORS for our domain somehow...

New Member
2 0 0

I tried to implement options 2 and 3.

2. Shopify buy button creates it's own cart on that is independent from cart on But we want to have a single cart that will work for both sites: and

3. iframe doesn't work because shopify has header x-frame-options: deny for all it's pages.

After testing last options seems that this is impossible. Do we have any other options?