New Shopify Certification now available: Liquid Storefronts for Theme Developers

I can't not save property "handle " with the Create Product API

iamivan
Shopify Partner
2 0 0

I found I cant not save "handle" with API (https://shopify.dev/api/admin-rest/2022-04/resources/product#post-products), why

 

for example:

{"product":{"bodyHtml":"<p style=\"margin:0\"><span style=\"font-family:none\">1</span></p>","handle":"thisisHandle","images"...

 

 

Replies 2 (2)
awwdam
Shopify Staff
Shopify Staff
249 42 35

Hey @iamivan 

If you are using the REST Admin API to create a product resource, the expected functionality would be that the Product.handle field is automatically generated from the title value (string) - Product API doc here. In testing with one of the example requests, the response body included a generated handle as expected per the documentation.

Hope that helps clarify - Cheers!

awwdam | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

iamivan
Shopify Partner
2 0 0

why handle can be set in excel upload but not allowed in API? sounds strange, usually these 2 share the same logic