shopify.get

Sends a GET request to the specified Shopify API endpoint.

This action is used to get one or more resources like orders, products, customers from Shopify.

Parameters

url: string API endpoint to call

Returns

Promise that is resolved with the requested resource(s).

Examples

The first hook example gets all products:

Get all products
module.exports = async function(payload, actions, context) {
	const data = await actions.shopify.get(
  	"/admin/api/2023-07/products.json"
  );

	console.log('Products: ', data);
}

The second hook example gets a specific product:

Get a specific products
module.exports = async function(payload, actions, context) {
	const productId = '7121319002195';

	const result = await actions.shopify.get(
		`/admin/api/2023-07/products/${productId}.json`
	);

	console.log('Product: ', result);
}