Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.

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
249 42 36

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