shopify API for creating a product

Highlighted
Shopify Partner
7 0 0

I have developed a public app in shopify. And I am using shopify API to generate a product, but I am receiving CROS error. How can i resolve it?  How to set Access-Control-Allow-Origin in server side?

ss1.png

This is the screenshot of encountered error in my console.

0 Likes
Highlighted
Shopify Partner
63 13 17

Hi, I'd say you can checkout https://community.shopify.com/c/Shopify-APIs-SDKs/Problem-Querying-REST-API-from-React-Node/td-p/508...

 

Can you share what do you use on the backend?

Thanks for reading, don’t forget to like and subscribe!
Wrong outro - Click Like and Accept as Solution if it was helpful and help other to find the answer ?
1 Like
Highlighted
Shopify Partner
7 0 0

I am using angular on the front end and Node on the backend. Can you provide some examples in angular for shopify?

0 Likes
Highlighted
Shopify Partner
63 13 17

Hey, @wallart 

I'm really not aware about examples with angular for shopify. Assuming that you're using express, here's guide how to add CORS support -  - https://expressjs.com/en/resources/middleware/cors.html

 

Also, consider that Shopify encourage you to use their UI library - Polaris and they provide react component library for it - https://github.com/Shopify/polaris-react. There is nothing stopping you from using Angular but keep that in mind)

 

Thanks for reading, don’t forget to like and subscribe!
Wrong outro - Click Like and Accept as Solution if it was helpful and help other to find the answer ?
1 Like
Highlighted
Shopify Partner
7 0 0

Hello, i have created a public app for shopify. I am creating products in my app and the product which i am creating is personal to single user who logs into my app in shopify site. I dont want the product to be visible to all the endusers who use the shopify site, so i dont want to add it in the shopify product list, but i want to route to the checkout page(the page where it asks for entering the shipping address when "buy it now" option is clicked) directly from my app when i create product in my app(I am not using shopify create product api to create the product). Is it possible?

 

0 Likes
Highlighted
Shopify Partner
2294 117 356

@wallart wrote:

Hello, i have created a public app for shopify. I am creating products in my app and the product which i am creating is personal to single user who logs into my app in shopify site. I dont want the product to be visible to all the endusers who use the shopify site, so i dont want to add it in the shopify product list, but i want to route to the checkout page(the page where it asks for entering the shipping address when "buy it now" option is clicked) directly from my app when i create product in my app(I am not using shopify create product api to create the product). Is it possible?

 


Please disambiguate the problem. So your app creates products for display to a merchants-customers IF they(the customer) is logged into YOUR app.

 

Don't publish the product in the online-store channel, then pass the variant to the checkout?

 

Otherwise just make the product ,publish, checkout, unpublish, or delete it after fulfillment .

 

 

Problem Solved? ✔️Accept and ? Like the solution so you can help others.
Buy me a coffee ☕ paypal.me/paulnewton or donate to eff.org
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
1 Like