API REQUEST LIMIT

Solved
timvma
Tourist
13 3 0

According to the REST API  docs , request are 2 requests/second in the standard plan,
My question is 

What would happen if 50 customer added a product to the cart simultaneously ?

Would it by queued or return error or 404 or something

Here's my code

 

 

	function addProductToCart(){
		fetch('/cart/add', {
		  method: 'POST',
		  headers: {
			'Content-Type': 'application/json'
		  },
		  body: JSON.stringify(addData)
		})
		.then(response => {
		  console.log(' product added')
		}) 
		.catch((error) => {
		  console.error('Error:', error);
		});
	}

 

 

Thanks in advance

Accepted Solution (1)

Accepted Solutions
Bunty
Shopify Partner
125 34 76

This is an accepted solution.

I assume you will put this script on the storefront, like the millions of stores some with pretty heavy transactions do.

You'll be fine as long as those customers don't share the same IP, see https://shopify.dev/api/storefront

Storefront API uses a leaky bucket algorithm to enforce its rate limit. Unlike most Shopify APIs, however, this limit is enforced on the IP address of the buyer, not the ID of the merchant’s shop.

Tech Expert at Frankie - Personalizing the Shopping experience.
Frankie - empowering merchants in 206 Countries and 31 Currencies.

View solution in original post

Replies 2 (2)
Bunty
Shopify Partner
125 34 76

This is an accepted solution.

I assume you will put this script on the storefront, like the millions of stores some with pretty heavy transactions do.

You'll be fine as long as those customers don't share the same IP, see https://shopify.dev/api/storefront

Storefront API uses a leaky bucket algorithm to enforce its rate limit. Unlike most Shopify APIs, however, this limit is enforced on the IP address of the buyer, not the ID of the merchant’s shop.

Tech Expert at Frankie - Personalizing the Shopping experience.
Frankie - empowering merchants in 206 Countries and 31 Currencies.

View solution in original post

lucas05021
Excursionist
39 0 4

Have you solved this problem now?