Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

Query With Shopify Product API

Solved

Query With Shopify Product API

sbdev
Shopify Partner
49 0 10

Hello,

I am using Shopify Product REST API and passing product title in the query parameter.

Before certain days I was passing "t" as a product name I was getting all the products starting with t letter. But now the API is only responding when I enter the entire product name.
Maybe Shopify updated their API or what I do not aware of. Can anyone know how to achieve this functionality?

I need all products in response which starting from the letter which is entered or provided to the API.

Below mentioned are the details of this REST API.

 

GET request on "api/2020-07/products.json" URL with the "title" parameter.

I have also tried with 2020-04 and 2020-01 API versions but nothing worked.

If anyone can help to suggest ways to do this then it will be highly suggested.

 

Thank you for hearing me.

 

Accepted Solutions (2)

olivert
Explorer
51 12 19

This is an accepted solution.

Hi Mate, 

They canned this functionality in API version 2019-07
Only way you can get partial title matching is with GraphQL. 

you could also use an older version of the API in your URL. but you'll need to upgrade eventually!

patch notes below:

https://help.shopify.com/en/api/versioning/release-notes/2019-07

View solution in original post

olivert
Explorer
51 12 19

This is an accepted solution.

Have a go at changing your API version to an older one.

2019-04

This is an unsupported version of the API

 

You would be better off changing your logic to maybe search by the entire title or using another field like barcode or SKU to identify an item

Long term switching to GraphQL would be the safer option as shopify prefer it. But I understand that's a complete rework of your code.

View solution in original post

Replies 4 (4)

olivert
Explorer
51 12 19

This is an accepted solution.

Hi Mate, 

They canned this functionality in API version 2019-07
Only way you can get partial title matching is with GraphQL. 

you could also use an older version of the API in your URL. but you'll need to upgrade eventually!

patch notes below:

https://help.shopify.com/en/api/versioning/release-notes/2019-07

sbdev
Shopify Partner
49 0 10

Hello, @olivert,

 

Thanks for your response. Is there any other way to tackle this situation using REST API or we have to compulsory use GRAPHQL API?
Transforming of the API may take a certain time and our app is in production and users are lacking this feature. Can anyone is having some suggestions/information?

Thanks again.

olivert
Explorer
51 12 19

This is an accepted solution.

Have a go at changing your API version to an older one.

2019-04

This is an unsupported version of the API

 

You would be better off changing your logic to maybe search by the entire title or using another field like barcode or SKU to identify an item

Long term switching to GraphQL would be the safer option as shopify prefer it. But I understand that's a complete rework of your code.

sbdev
Shopify Partner
49 0 10

Thanks @olivert. I highly appreciate your help mate.