Create a product (programmatically using frontend API) which will have a custom image in Checkout

Solved
den232
Explorer
49 0 12

My store will be selling custom jewelry, individual to each customer.  This design process will generate a unique image of the piece.  I would like the Checkout generated to use this unique image (unique to each customer, each sale).   

I know I can create a new product using the admin API, but would really rather use the frontend API.

Is it possible to create a product or attach a custom image to one) specific to the customer not using the admin API, as this code would be in my public front-end and ... well, you know, that is the very reason there is a separate admin API. 

Any hope?  Thanks, jb

0 Likes
michaeltheodore
Explorer
59 6 8

This is an accepted solution.

Well the admin api seems to be the only Shopify api with which you can create products.

0 Likes
sjz
New Member
1 0 0

Did you find an actual solution to this? If you ended up using the admin API, how do you manage all of the new products you are creating? Seems like the strategy of creating new products for each checkout might not scale well.

0 Likes
michaeltheodore
Explorer
59 6 8

One solution could be using the Storefront API and Apollo to pull product data and show it in the cart along with the generated image which you can do somewhere in your code. The image will probably not appear in the Shopify checkout though.

0 Likes
den232
Explorer
49 0 12

Hi sjz and Michael Theodore. 

I generate my own cart outside of Shopify, so I can put my custom image in there without breaking a sweat. 

The admin API does the trick for the checkout, creating the endless stream of products I need.  It's the only way I found to have an image for the checkout, which is the thing I need.  

Scaling is not really a problem for me, as Shopify needs the product to exist in order to show an image even in the customer's order email, which might be viewed well in the future.  I figure that if the number of products overwhelms me, I can zap old ones en masse once a year.

 

Cheers jb

0 Likes