New To Shopify Admin API -- Where is the price field?

cmuench
New Member
5 0 0

I am looking to integrate my application with Shopify. I want to add a product to the backend. I don't see a price field for a product in the docs. I DO see a price for variations but this is a regular NON-variant product. Do all products require a variation?

0 Likes
Greg_Kujawa
Shopify Partner
963 80 203

Looking at the REST API docs (https://shopify.dev/docs/admin-api/rest/reference/products/product#create-2020-10) it appears as if your POST request would just pass along a single variant. This would presumably be the default variant with defined pricing and whatnot.

For example...

POST /admin/api/2020-10/products.json
{
  "product": {
    "title": "Burton Custom Freestyle 151",
    "body_html": "<strong>Good snowboard!</strong>",
    "vendor": "Burton",
    "product_type": "Snowboard",
    "variants": [
      {
        "option1": "First",
        "price": "10.00",
        "sku": "123"
      }
    ]
  }
}
0 Likes
cmuench
New Member
5 0 0

Ok so if a product has just 1 variant it uses that? Just seems a little odd to design it that way

0 Likes
Greg_Kujawa
Shopify Partner
963 80 203

According to the docs this appears to be the case. It's only a small subset of attributes you need to add to the POST request really. Especially if you don't need to define SKU, options, etc. Then it's just literally...

"variants": [
      {        
        "price": "10.00"
       }      
    ]
0 Likes