yyyuchen
yyyuchen

Reputation: 209

Shopify API: Create hidden product variant

Is it possible to create an unpublished/hidden product variant through the Shopify API? I know it's possible to create a hidden product by specifying product['published'] = false in the POST request, but I just want to create a hidden variant that can be added to a cart.

What I'm attempting to do is create a "sale" item that's only available to a single user with a specific cart. I can create the product variant through node.js, and I can use AJAX to actually add the product to the cart on the client side, but I'll never have access to the shop's dashboard so I can't mask product variants through collections, linked options, et cetera.

Any help is greatly appreciated!

Upvotes: 5

Views: 3366

Answers (1)

Edward Ocampo-Gooding
Edward Ocampo-Gooding

Reputation: 2872

It’s not possible to hide a particular variant at the API level, but you can do it via Liquid or client-side code.

Take a look at how http://apps.shopify.com/quantity-breaks implements this and you should have a better idea.

Upvotes: 3

Related Questions