Shopify admin API not working in the client side

Keyurp
New Member
12 0 0


Hello all


I am using Shopify admin API in my store and this store is the development and basic plan store and the admin and Graphql API are working properly. But one of my client stores is live and I am using those API in this store but there is a CORS error. Also, I am trying to get information using Jquery AJAX.

I am gone stuck now so please help me or provide an alternative solution.

For more information please refer to the attached file.

0 Likes
L_J_K
Shopify Staff
Shopify Staff
152 15 24

Hey @Keyurp 

It's not possible to make client side requests to Shopify's Admin API, as it's a private API. 

You might wish to take a look at the Storefront API - here's a helpful post.

 

| API Support @ Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
0 Likes
Keyurp
New Member
12 0 0

Hello 

I have referred to these documents and I found the product using Javascript Buy SDK in Shopify but I did not find the metafield.

if there is any way, how can I get the metafield using the Shopify Javascript Buy SDK?

0 Likes
L_J_K
Shopify Staff
Shopify Staff
152 15 24

Hey @Keyurp 

The JS SDK would technically be out of my scope, but the fetch for Metafields does seem possible going by the schema bump here.  

You might like to check out this post here.

 

 

 

| API Support @ Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
Keyurp
New Member
12 0 0

I have checked as you provided in the previous thread but it does not work.

So let me know if there is any other flow in your attention.

0 Likes
Keyurp
New Member
12 0 0

Any update regarding the above concern?

0 Likes
L_J_K
Shopify Staff
Shopify Staff
152 15 24

Hey @Keyurp 

So, as at Version 2.2.4, Metafields would be supported by the JS SDK.

I am not sure of the exact error you are getting, but if you are whitelisting the metafields (the process to expose them is outlined here), and you are using this custom SDK query and importing this client, then you should be able to fetch them.

If still running into issues, I would throughly recommend creating an issue in the JS SDK here. Hope that helps.

 

 

| API Support @ Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!
0 Likes