Using API to create product and SKU

The documentation on Webflow APIs is sketchy. I am using the API to create a product and SKU from user input. The documentation on “Create Product & SKUs”
http://developers.webflow.com/?Javascript#create-product-&-sku
Much of the curl is self explanatory. There are a few items that I do not find references for in the documentation.
common to all curl commands is the header

–header ‘Authorization: Bearer {access_token}’ \

Where it is clear there is a reference to the Webflow_APIKEY. This is a string inside curly braces and should be a ‘name : value’ pair. But WHAT is the name? ‘access-token’? ‘webflow_apikey’? Or maybe I have this all wrong?

NEXT confusing thing in the curl:

 "ec-product-type": "ff42fee0113744f693a764e3431a9cc2",

where is that found? In Webflow Ecommerce “product type” is one of four “types” not a long text string code.

NEXT confusing thing in the curl

    "updated-by": "Person_5d8fcb6d94dd1853060fb3b3",

where does “Person_…” come from? Is that required? Developer optional? Is there any part of that string that is required?

    "default-sku": "5e8518536e147040726cc416",
    "_cid": "5dd44c493543b37d5449b3a5",
    "_id": "5e8518516e147040726cc415"

Where and how are these values generated or are they simply placeholders? Webflow will insert these values dynamically?

“_cid” is…?
“_id” is…?
Documentation on these curl commands is lacking as far as I can see, Certainly be helpful if there was something close by on the web page.

Here is my read only link but don’t think it’s relevant…
https://preview.webflow.com/preview/davids-cool-project-9b22c7?utm_medium=preview_link&utm_source=designer&utm_content=davids-cool-project-9b22c7&preview=454984bc0992fefc4eb788f0bcda7382&pageId=62ccac298cf05d7228d39259&itemId=62ccac298cf05d47dbd39260&workflow=preview


Here is my site Read-Only: LINK
(how to share your site Read-Only link)

1 Like

product type sets it to advanced with that type

created by gets generated and will cause an error if added.
default sku will set all variants to this sku.
here is my working data

product:_id and sku:product should match

  "product": {
    "fields":{
     "shippable": true,
     "_archived": false,
     "_draft": false,
     "name": "Cloak Of Invisibility",
     "ec-product-type": "ff42fee0113744f693a764e3431a9cc2",
     "sku-properties": [
       {
         "id": "a37a7991f7ca1be0d349a805a2bddb5b",
         "name": "Color",
         "enum": [
           {
             "id": "12345",
             "name": "Obsidian Black",
             "slug": "obsidian-black"
           },
           {
             "id": "c92a465a1298c95fd1cd7f4c1c96c2ba",
             "name": "Smoke Grey",
             "slug": "smoke-grey"
           },
           {
             "id": "ef9511c0b56cc11ff47c5669f65030b4",
             "name": "Forest Green",
             "slug": "forest-green"
           }
         ]
       }
     ],
     "description": "A cloak that renders the wearer invisible to the eye.",
     "slug": "cloak-of-invisibility-1",
     "published-on": null,
     "published-by": null,
     "_cid": "5dd44c493543b37d5449b3a5",
     "_id": "5e8518516e147040726cc415"
   }},
  "sku": {
      "fields":{
    "price": {
      "unit": "USD",
      "value": 120000
    },
    "_archived": false,
    "_draft": false,
    "sku-values": {},
    "width": 56,
    "length": 0.3,
    "height": 72,
    "weight": 24,
    "name": "Cloak Of Invisibility Color: Obsidian Black",
    "main-image": {
      "fileId": "5e85161dabd9ea4072cf1414",
      "url": "https://d1otoma47x30pg.cloudfront.net/5d93ba5e38c6b0160ab711d6/5e85161dabd9ea4072cf1414_5e8512181ae993035b15f315_external-content.duckduckgo.com.jpeg",
      "alt": null
    },
    "more-images": [
      {
        "fileId": "5e85161dabd9ea4072cf1414",
        "url": "https://d1otoma47x30pg.cloudfront.net/5d93ba5e38c6b0160ab711d6/5e85161dabd9ea4072cf1414_5e8512181ae993035b15f315_external-content.duckduckgo.com.jpeg",
        "alt": null
      },
      {
        "fileId": "5e85161dabd9ea4072cf1414",
        "url": "https://d1otoma47x30pg.cloudfront.net/5d93ba5e38c6b0160ab711d6/5e85161dabd9ea4072cf1414_5e8512181ae993035b15f315_external-content.duckduckgo.com.jpeg",
        "alt": null
      }
    ],
    "download-files": [
      {
        "id": "5ebb1676c3244c2c6ae18814",
        "name": "The modern web design process - Webflow Ebook.pdf",
        "url": "https://dropbox.com/files/modern-web-design-process.pdf"
      }
    ],
    "slug": "cloak-of-invisibility-color-obsidian-black-7",
    "product": "5e8518516e147040726cc415",
    "published-on": null,
    "published-by": null,
    "_cid": "5dd44c493543b37d5449b383",
    "_id": "5e8518536e147040726cc416"    
  }}
}

I still cannot figure out how to add a variant sku after i add a product so ive made a post in the forum as well