POST a product from a website

Solved
Highlighted
Excursionist
20 2 1

I want to be able to POST a product from a website. As far as I can tell, the simplest way to do this is to authenticate a Private App and then make HTTP requests as in this Shopify tutorial.

 

I'm using the Postman app to test the Shopify API endpoints. I can successfully GET products using the method from the tutorial. I used the same Admin API credentials as with my GET request for my POST request:

 

URL: 

https://{username}:{password}@{shop}.myshopify.com/admin/api/2020-01/products.json

with Header (this isn't used for the GET request):

X-Shopify-Access-Token: {access_token}

where 'access token' is the password from my Admin API.

 

A truncated version of the HTML response:

<html>
<body>
	<noscript>
		<a href="https://app.shopify.com/services...">Continue</a>
	</noscript>
	<script type="text/javascript">
		window.location = "https:\/\/app.shopify.com\/services\...";
	</script>
</body>
</html>

 

Any help will be much appreciated. Thanks.

 

 

 

0 Likes
Highlighted

Success.

Excursionist
20 2 1

UPDATE.

 

I made a successful POST request in the following format:

 

https://{site-name}.myshopify.com/admin/api/2020-01/products.json

with header 'X-Shopify-Access-Token' and value of the password from the Admin API.

0 Likes