Core API
...
Core API Docs
Products
Create a Product
code examples curl location 'https //app sparklayer io/api/v1/products' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "variants" \[ {} ] }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "variants" \[ {} ] }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //app sparklayer io/api/v1/products", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //app sparklayer io/api/v1/products") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump({ "variants" \[ {} ] }) response = https request(request) puts response read body import requests import json url = "https //app sparklayer io/api/v1/products" payload = json dumps({ "variants" \[ {} ] }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // successful response { "id" "pp 123", "created at" "", "updated at" "", "external id" "id001", "title" "striped jumper", "slug" "striped jumper", "variants" \[ { "product id" "pp 123", "id" "pv 234", "created at" "", "updated at" "", "external id" "idv001", "sku" "idv001", "barcode" 837493612362, "weight in grams" 0, "tax type" 0, "position" 0, "cart image url" "", "rrp" \[ { "value" 10 49, "currency code" "gbp" } ], "options" \[ { "group" "color", "value" "blue" } ], "status" "live", "settings" \[ { "customer group" "default", "pack size" 0, "reserve stock quantity" 0, "min order quantity" 0, "max order quantity" 0, "min order parent quantity" 0, "max order parent quantity" 0, "display" false, "sell" false } ], "stock management" "none" } ] }// error response