API rate limit for rest api, variant

iozyigit
Shopify Partner
23 1 2

Hi,

I am doing some test and trying to understand Shopify.

Here I am creating a variant programmatically doing 5 calls to api. Thinking 2 calls per second, how this will be applicable in real world when developing public app or even for custom app.

Or am I doing something wrong.

  1. Getting existing variant(GET)
  2. Copy existing one and create new one(POST)
  3. GetInventoryItem for variant(GET)
  4. Add quantity to inventory(POST)
  5. Add met-afield to the variant(POST)

Thanks 

 

https://www.linkedin.com/in/ismailozyigit/
Replies 2 (2)
sillycube
Shopify Partner
693 16 100

The API limit is a leaky bucket with 40 calls and 2 calls / s replenishment, NOT 2 calls / s. 

But your pseudo-code is correct. Though it can be optimized with GraphQL.

BYOB - Build Your Own Bundles, SPO - SEO App to research keywords & edit social link preview
iozyigit
Shopify Partner
23 1 2

Thanks @sillycube ,I had to convert my calls to graphQL  just make sure it is not problematic in the future.

Even some of graphQL queries needed to be divided in to separate queries.

Querying all nested object in one graphQL call was also exceeding the limit, but was easy to fix.

https://www.linkedin.com/in/ismailozyigit/