Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

problem when creating product variants with inventory quantity more than 9800

Solved

problem when creating product variants with inventory quantity more than 9800

iPutin
Tourist
8 1 0

Shopify+. I am creating product variants via api. I need to create 90 variants (no more than 100), the quantity of each variant must be 200. 

when I run my api script, variants are created with a quantity of 200, but the problem arises when the total number exceeds 9600/9800, then the rest of the variants are created with zero quantity. 

Screenshot from 2021-08-04 12-51-23.png

iPutin_0-1628070984869.png


I would be grateful if someone could tell me what this might be related to.

Accepted Solution (1)
iPutin
Tourist
8 1 0

This is an accepted solution.

my script creates 90 variants, then deletes the most recent one and adds a new variant, when a new variant is added, it was necessary to insert the quantity for a new variant. I needed to get all list of variants.

It turned out that when you retrieves a list of product variants, it returns only 50 variants by default, accordingly, I could not add quantity for the rest variants that went beyond 50.
I set the limit for the number of variants I needed, after which it worked

View solution in original post

Replies 3 (3)

GrahamS
Shopify Staff (Retired)
193 37 55

Hello @iPutin ,

Can I ask for an x-request-id for the api call you are running? We can take a look to see what might be happening here.

Best,

Graham

To learn more visit the Shopify Help Center or the Community Blog.

iPutin
Tourist
8 1 0

hello @GrahamS 

Thank you for your reply. 

Updated question is here . I'm not sure how I can get from my script x-request-id , i could get x-request-id from postman, but will it somehow related my script. If I provide you with my source code, would it be helpful to you?

I am not getting an error on the console, so it is difficult for me to analyze it



iPutin
Tourist
8 1 0

This is an accepted solution.

my script creates 90 variants, then deletes the most recent one and adds a new variant, when a new variant is added, it was necessary to insert the quantity for a new variant. I needed to get all list of variants.

It turned out that when you retrieves a list of product variants, it returns only 50 variants by default, accordingly, I could not add quantity for the rest variants that went beyond 50.
I set the limit for the number of variants I needed, after which it worked