Sends a PUT request to the specified Shopify API endpoint.
This action is used to (partially) update an existing resource like an order, product, or customer 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 updated resource.
Examples
module.exports = async function(payload, actions, context) {
const productId = '7121319002195';
const result = await actions.shopify.put(
`/admin/api/2024-01/products/${productId}.json`,
{
"product": {
title: 'Modified title',
body_html: 'Modified description'
}
}
);
console.log('Updated product: ', result);
}