Shopify admin API, get product theme templates

BohdanNikitchuk
Shopify Partner
5 0 1

Hello,
How can I get a list of available product template options via Shopify admin APIs (Rest or Graphql)? 
In ProductInput fields (for product update/create mutation) we have a templateSuffix field to set, but I cannot find a way to get the list of all available product templates.
In Shopify admin, we have the block for it, that retrieves availableProductTemplateOptions array. I need the same but via admin API. Look at the screenshot:

BohdanNikitchuk_0-1691496716299.png

 

Replies 6 (6)

DavidT
Shopify Partner
24 1 6

Hello, did you find a solution for this?

QuickEdit - Bulk Product Edit - Quick and easy bulk editor for products and variants.
SafeShip - Address Validator - International address validation and PO box blocking at checkout for Shopify Plus merchants.
BohdanNikitchuk
Shopify Partner
5 0 1

Unfortunately, no

DavidT
Shopify Partner
24 1 6

Someone just shared a solution with me. Apparently, you get them with the Assets API: https://shopify.dev/docs/api/admin-rest/2023-07/resources/asset#get-themes-theme-id-assets

 

But I don't know if this will actually work. I guess the template prefix would be part of the key value?

QuickEdit - Bulk Product Edit - Quick and easy bulk editor for products and variants.
SafeShip - Address Validator - International address validation and PO box blocking at checkout for Shopify Plus merchants.
BohdanNikitchuk
Shopify Partner
5 0 1

Hmm, it sounds like a possible solution, must try. Thank you!

jam_chan
Shopify Partner
906 23 177

I have the same issue. The asset API can get the assets of a theme. But there is no key filter. So I don't think it can retrieve all product templates. Getting all theme assets and filter the files may work though

BYOB - Build Your Own Bundles, SPO - SEO App to research keywords & edit social link preview

samuelvandeven
Shopify Partner
2 0 0

Did you found a solution?