How to create a Product with POST call from postman?

How to create a Product with POST call from postman?

queensjewelempo
Shopify Partner
1 0 0

I am using Postman for testing to create a Product but it is not working.
Shopify3.pngShopify4.png

Test
Replies 3 (3)

Liam
Community Manager
3108 340 871

You could try using the GraphQL API instead, which has a mutation for productCreate would look something like:

 

mutation {
  productCreate(input: {
    title: "Sample Product",
    vendor: "SampleVendor",
    descriptionHtml: "<b>Description</b>",
    status: DRAFT,
    productType: "DEFAULT_TYPE",
    templateSuffix: "default_template",
    productOptions: [{
      name: "Option",
      position: 1,
      values: [{name: "Value1"}, {name: "Value2"}]
    }],
    metafields: [{
      namespace: "custom",
      key: "pickers",
      value: "{\"colors\":[{\"title\":\"Color A\",\"material_handle\":\"material1\"},{\"title\":\"Color B\",\"material_handle\":\"material2\"}]}",
      type: "json"
    }]
  }) {
    product {
      id
      title
      status
    }
    userErrors {
      field
      message
    }
  }
}

 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Michael841
Shopify Partner
8 2 0

Hi,

what is the response of your request?

What I am seeing from the screenshot: The tags must be a string with comma separated tags.

 

All the best,

Michael

Kyle_liu
Shopify Partner
164 23 27

@queensjewelempo 

 

Has the specific error message been returned? Please send it out and take a look

If this is helpful, please Like and Accept the solution.
Want to modify or custom changes on store? Let me help.
- Feel free to contact me on (liushuaicc@shinetechsoftware.com)