shopify.post

Sends a POST request to the specified  Shopify API endpoint.

This action is used to create resources like orders, products, customers in Shopify.

Parameters

url: string API endpoint to call
data: object Data to be sent to the API endpoint

Returns

Promise that is resolved with the created resource.

Examples

Create a new product
module.exports = async function(payload, actions, context) {
	const result = await actions.shopify.post(
		"/admin/api/2023-07/products.json",
		{
			product: {
				title: "Burton Custom Freestyle 151",
				body_html: "Good snowboard!",
				vendor: "Burton",
				product_type: "Snowboard",
				tags: "Barnes & Noble, John's Fav, Big Air"
			}
		}
	);

	console.log('Created product: ', result);
}