Shopify - Update Product
@sergio
code:
data:privatelast updated:4 years ago
today
Build integrations remarkably fast!
You're viewing a public workflow template.
Sign up to customize, add steps, modify code and more.
Join 1,000,000+ developers using the Pipedream platform
steps.
trigger
HTTP API
Deploy to generate unique URL
This workflow runs on Pipedream's servers and is triggered by HTTP / Webhook requests.
steps.
shopify_update_product
Updates a product by id
auth
(auths.shopify)
params
Title

The name of the product.

 
string ·params.title
Product id

ID of the customer to retrieve.

 
string ·params.product_id
Optional
code
async (params, auths) => {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
}
30
const Shopify = require('shopify-api-node');

const shopify = new Shopify({
    shopName: auths.shopify.shop_id,
    accessToken: auths.shopify.oauth_access_token 
});

const product_details = {
    body_html: params.body_html,
    handle: params.handle,
    images: typeof params.images == 'undefined' ? params.images : JSON.parse(params.images),
    options: typeof params.options == 'undefined' ? params.options : JSON.parse(params.options),
    product_type : params.product_type,
    published_at : params.published_at,
    published_scope: params.published_scope,
    tags: params.tags,
    template_suffix: params.template_suffix,
    title: params.title,
    variants: typeof params.variants == 'undefined' ? params.variants : JSON.parse(params.variants),
    vendor: params.vendor,
}

try{
  this.resp = await shopify.product.update(params.product_id,product_details);
}catch(err){
  this.err;
}